Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changeset/tall-taxis-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

---
8 changes: 8 additions & 0 deletions packages/react/runtime/lazy/internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ import { sExportsReactInternal, target } from './target.js';

export const {
BackgroundSnapshotInstance,
CHILDREN,
COMPONENT,
Component,
DIFF,
DIRTY,
DOM,
FLAGS,
INDEX,
PARENT,
__ComponentIsPolyfill,
__DynamicPartChildren,
__DynamicPartChildren_0,
Expand Down
34 changes: 17 additions & 17 deletions packages/react/runtime/lepus/jsx-runtime/index.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// Copyright 2024 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import { SnapshotInstance } from '@lynx-js/react/internal';
import { CHILDREN, COMPONENT, DIFF, DIRTY, DOM, FLAGS, INDEX, PARENT, SnapshotInstance } from '@lynx-js/react/internal';

function createVNode(type, props, _key) {
if (typeof type === 'string') {
const r = new SnapshotInstance(type);

r.props = props;

r.__k = null;
r.__ = null;
r.__b = 0;
r.__e = null;
r.__d = undefined;
r.__c = null;
r[CHILDREN] = null;
r[PARENT] = null;
r[DIFF] = 0;
r[DOM] = null;
r[DIRTY] = undefined;
r[COMPONENT] = null;
// r.__v = --vnodeId;
r.__i = -1;
r.__u = 0;
r[INDEX] = -1;
r[FLAGS] = 0;

return r;
} else if (typeof type === 'function') {
Expand Down Expand Up @@ -48,16 +48,16 @@ function createVNode(type, props, _key) {
type,
props: normalizedProps,

__k: null,
__: null,
__b: 0,
__e: null,
__d: void 0,
__c: null,
[CHILDREN]: null,
[PARENT]: null,
[DIFF]: 0,
[DOM]: null,
[DIRTY]: void 0,
[COMPONENT]: null,
constructor: void 0,
// __v: --vnodeId,
__i: -1,
__u: 0,
[INDEX]: -1,
[FLAGS]: 0,
};
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/react/runtime/src/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { DynamicPartType } from './snapshot/dynamicPartType.js';
import { snapshotCreateList } from './snapshot/list.js';
import { SnapshotInstance, snapshotCreatorMap } from './snapshot/snapshot.js';

export { CHILDREN, COMPONENT, DIFF, DIRTY, DOM, FLAGS, INDEX, PARENT } from './renderToOpcodes/constants.js';

export { __page, __pageId, __root };

export {
Expand Down
2 changes: 2 additions & 0 deletions packages/react/runtime/src/renderToOpcodes/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const PARENT = '__';
export const MASK = '__m';
export const DOM = '__e';
export const ORIGINAL = '__v';
export const INDEX = '__i';
export const FLAGS = '__u';

// Component properties
export const VNODE = '__v';
Expand Down
Loading