Skip to content

Commit

Permalink
after merge changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Varixo committed May 2, 2024
1 parent 92628c9 commit ff5c366
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 7 additions & 4 deletions packages/qwik/src/core/render/jsx/utils.public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ export const SSRStreamBlock: FunctionComponent<{ children?: JSXOutput }> = (prop

/** @public */
export type SSRStreamProps = {
children:
| AsyncGenerator<JSXChildren, void, any>
| ((stream: StreamWriter) => Promise<void>)
| (() => AsyncGenerator<JSXChildren, void, any>);
children: SSRStreamChildren;
};

/** @public */
export type SSRStreamChildren =
| AsyncGenerator<JSXChildren, void, any>
| ((stream: StreamWriter) => Promise<void>)
| (() => AsyncGenerator<JSXChildren, void, any>);

/** @public */
export const SSRStream: FunctionComponent<SSRStreamProps> = (props, key) =>
jsx(RenderOnce, { children: jsx(InternalSSRStream, props) }, key);
Expand Down
5 changes: 2 additions & 3 deletions packages/qwik/src/core/v2/ssr/ssr-render-jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { qrlToString, type SerializationContext } from '../shared/shared-seriali
import { DEBUG_TYPE, VirtualType, type fixMeAny } from '../shared/types';
import { applyInlineComponent, applyQwikComponentBody } from './ssr-render-component';
import type { SSRContainer, SsrAttrs } from './ssr-types';
import { SSRComment, SSRStream, type SSRStreamProps } from '../../render/jsx/utils.public';
import { SSRComment, SSRStream, type SSRStreamChildren } from '../../render/jsx/utils.public';
import { isAsyncGenerator } from '../../util/async-generator';

class SetScopedStyle {
Expand Down Expand Up @@ -238,8 +238,7 @@ function processJSXNode(
ssr.commentNode((jsx.props.data as string) || '');
} else if (type === SSRStream) {
ssr.commentNode(FLUSH_COMMENT);
const props = jsx.props as SSRStreamProps;
const generator = props.children;
const generator = jsx.children as SSRStreamChildren;
let value: AsyncGenerator | Promise<void>;
if (isFunction(generator)) {
value = generator({
Expand Down

0 comments on commit ff5c366

Please sign in to comment.