Skip to content

Commit 8028547

Browse files
authored
refactor: rename static children (#255)
1 parent 3852547 commit 8028547

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/core/api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,15 @@ export type RenderableProps<P, RefType = any> = P & Readonly<{
273273
// @public (undocumented)
274274
export const setPlatform: (doc: Document, plt: CorePlatform) => CorePlatform;
275275

276+
// @public (undocumented)
277+
export const SkipRerender: FunctionComponent<{}>;
278+
276279
// @public (undocumented)
277280
export const Slot: FunctionComponent<{
278281
name?: string;
279282
children?: any;
280283
}>;
281284

282-
// @public (undocumented)
283-
export const StaticChildren: FunctionComponent<{}>;
284-
285285
// @public (undocumented)
286286
export function useDocument(): Document;
287287

src/core/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export type { PromiseValue } from './render/jsx/async.public';
6666
// JSX Runtime
6767
//////////////////////////////////////////////////////////////////////////////////////////
6868
export { h } from './render/jsx/factory';
69-
export { Host, StaticChildren } from './render/jsx/host.public';
69+
export { Host, SkipRerender } from './render/jsx/host.public';
7070
export { Slot } from './render/jsx/slot.public';
7171
export { Fragment, jsx, jsxDEV, jsxs } from './render/jsx/jsx-runtime';
7272
export type {

src/core/render/cursor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { assertDefined, assertEqual } from '../assert/assert';
1010
import { NodeType } from '../util/types';
1111
import { intToStr } from '../object/store';
1212
import { EMPTY_ARRAY } from '../util/flyweight';
13-
import { StaticChildren } from './jsx/host.public';
13+
import { SkipRerender } from './jsx/host.public';
1414
import { logDebug, logError } from '../util/log';
1515

1616
type KeyToIndexMap = { [key: string]: number };
@@ -59,7 +59,7 @@ export function smartUpdateChildren(
5959
mode: ChildrenMode,
6060
isSvg: boolean
6161
) {
62-
if (ch.length === 1 && ch[0].type === StaticChildren) {
62+
if (ch.length === 1 && ch[0].type === SkipRerender) {
6363
if (elm.firstChild !== null) {
6464
return;
6565
}
@@ -239,7 +239,7 @@ export function patchVnode(
239239
return;
240240
}
241241

242-
if (tag === Host || tag === StaticChildren) {
242+
if (tag === Host || tag === SkipRerender) {
243243
return;
244244
}
245245

@@ -472,7 +472,7 @@ function createElm(ctx: RenderContext, vnode: JSXNode, isSvg: boolean): ValueOrP
472472
return then(wait, () => {
473473
let children = vnode.children;
474474
if (children.length > 0) {
475-
if (children.length === 1 && children[0].type === StaticChildren) {
475+
if (children.length === 1 && children[0].type === SkipRerender) {
476476
children = children[0].children;
477477
}
478478
const slotMap = isComponent ? getSlots(componentCtx, elm) : undefined;

src/core/render/jsx/host.public.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ export const Host: FunctionComponent<Record<string, any>> = { __brand__: 'host'
2828
/**
2929
* @public
3030
*/
31-
export const StaticChildren: FunctionComponent<{}> = { __brand__: 'skip' } as any;
31+
export const SkipRerender: FunctionComponent<{}> = { __brand__: 'skip' } as any;

src/core/render/jsx/jsx-runtime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { FunctionComponent, JSXNode } from './types/jsx-node';
22
import type { QwikJSX } from './types/jsx-qwik';
33
import { qDev } from '../../util/qdev';
4-
import { Host, StaticChildren } from './host.public';
4+
import { Host, SkipRerender } from './host.public';
55
import { EMPTY_ARRAY } from '../../util/flyweight';
66
import { logWarn } from '../../util/log';
77

@@ -47,7 +47,7 @@ export function processNode(node: any): JSXNode[] | JSXNode | undefined {
4747
return undefined;
4848
}
4949
if (isJSXNode(node)) {
50-
if (node.type === Host || node.type === StaticChildren) {
50+
if (node.type === Host || node.type === SkipRerender) {
5151
return node;
5252
} else if (typeof node.type === 'function') {
5353
return processNode(node.type({ ...node.props, children: node.children }, node.key));

0 commit comments

Comments
 (0)