@lynx-js/react 0.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +250 -0
- package/LICENSE +202 -0
- package/README.md +20 -0
- package/components/lib/Page.d.ts +3 -0
- package/components/lib/Page.js +56 -0
- package/components/lib/Page.js.map +1 -0
- package/components/lib/index.d.ts +1 -0
- package/components/lib/index.js +5 -0
- package/components/lib/index.js.map +1 -0
- package/components/src/Page.ts +75 -0
- package/components/src/index.ts +5 -0
- package/package.json +162 -0
- package/refresh/.gitignore +1 -0
- package/refresh/.npmignore +3 -0
- package/refresh/.turbo/turbo-build.log +8 -0
- package/refresh/dist/index.js +311 -0
- package/refresh/package.json +21 -0
- package/refresh/src/index.ts +6 -0
- package/refresh/src/prefresh.d.ts +11 -0
- package/refresh/tsconfig.json +4 -0
- package/refresh/turbo.json +15 -0
- package/runtime/jsx-dev-runtime/index.d.ts +5 -0
- package/runtime/jsx-dev-runtime/index.js +4 -0
- package/runtime/jsx-runtime/index.d.ts +4 -0
- package/runtime/jsx-runtime/index.js +4 -0
- package/runtime/lazy/import.d.ts +1 -0
- package/runtime/lazy/import.js +55 -0
- package/runtime/lazy/internal.js +39 -0
- package/runtime/lazy/jsx-dev-runtime.js +12 -0
- package/runtime/lazy/jsx-runtime.js +12 -0
- package/runtime/lazy/legacy-react-runtime.js +20 -0
- package/runtime/lazy/react-lepus.js +9 -0
- package/runtime/lazy/react.js +46 -0
- package/runtime/lazy/target.js +11 -0
- package/runtime/lepus/index.d.ts +4 -0
- package/runtime/lepus/index.js +43 -0
- package/runtime/lepus/jsx-dev-runtime/index.js +4 -0
- package/runtime/lepus/jsx-runtime/index.js +66 -0
- package/runtime/lib/backgroundSnapshot.d.ts +23 -0
- package/runtime/lib/backgroundSnapshot.js +348 -0
- package/runtime/lib/backgroundSnapshot.js.map +1 -0
- package/runtime/lib/compat/componentIs.d.ts +4 -0
- package/runtime/lib/compat/componentIs.js +20 -0
- package/runtime/lib/compat/componentIs.js.map +1 -0
- package/runtime/lib/compat/initData.d.ts +43 -0
- package/runtime/lib/compat/initData.js +93 -0
- package/runtime/lib/compat/initData.js.map +1 -0
- package/runtime/lib/compat/lynxComponent.d.ts +5 -0
- package/runtime/lib/compat/lynxComponent.js +71 -0
- package/runtime/lib/compat/lynxComponent.js.map +1 -0
- package/runtime/lib/debug/debug.d.ts +2 -0
- package/runtime/lib/debug/debug.js +9 -0
- package/runtime/lib/debug/debug.js.map +1 -0
- package/runtime/lib/debug/printSnapshot.d.ts +3 -0
- package/runtime/lib/debug/printSnapshot.js +21 -0
- package/runtime/lib/debug/printSnapshot.js.map +1 -0
- package/runtime/lib/debug/profile.d.ts +1 -0
- package/runtime/lib/debug/profile.js +51 -0
- package/runtime/lib/debug/profile.js.map +1 -0
- package/runtime/lib/document.d.ts +4 -0
- package/runtime/lib/document.js +49 -0
- package/runtime/lib/document.js.map +1 -0
- package/runtime/lib/gesture/processGesture.d.ts +4 -0
- package/runtime/lib/gesture/processGesture.js +48 -0
- package/runtime/lib/gesture/processGesture.js.map +1 -0
- package/runtime/lib/gesture/processGestureBagkround.d.ts +2 -0
- package/runtime/lib/gesture/processGestureBagkround.js +16 -0
- package/runtime/lib/gesture/processGestureBagkround.js.map +1 -0
- package/runtime/lib/gesture/types.d.ts +34 -0
- package/runtime/lib/gesture/types.js +13 -0
- package/runtime/lib/gesture/types.js.map +1 -0
- package/runtime/lib/hooks/react.d.ts +26 -0
- package/runtime/lib/hooks/react.js +35 -0
- package/runtime/lib/hooks/react.js.map +1 -0
- package/runtime/lib/hooks/useLynxGlobalEventListener.d.ts +29 -0
- package/runtime/lib/hooks/useLynxGlobalEventListener.js +53 -0
- package/runtime/lib/hooks/useLynxGlobalEventListener.js.map +1 -0
- package/runtime/lib/hydrate.d.ts +18 -0
- package/runtime/lib/hydrate.js +271 -0
- package/runtime/lib/hydrate.js.map +1 -0
- package/runtime/lib/index.d.ts +9 -0
- package/runtime/lib/index.js +46 -0
- package/runtime/lib/index.js.map +1 -0
- package/runtime/lib/internal.d.ts +26 -0
- package/runtime/lib/internal.js +41 -0
- package/runtime/lib/internal.js.map +1 -0
- package/runtime/lib/legacy-react-runtime/index.d.ts +7 -0
- package/runtime/lib/legacy-react-runtime/index.js +34 -0
- package/runtime/lib/legacy-react-runtime/index.js.map +1 -0
- package/runtime/lib/lifecycle/delayUnmount.d.ts +8 -0
- package/runtime/lib/lifecycle/delayUnmount.js +68 -0
- package/runtime/lib/lifecycle/delayUnmount.js.map +1 -0
- package/runtime/lib/lifecycle/destroy.d.ts +2 -0
- package/runtime/lib/lifecycle/destroy.js +21 -0
- package/runtime/lib/lifecycle/destroy.js.map +1 -0
- package/runtime/lib/lifecycle/pass.d.ts +3 -0
- package/runtime/lib/lifecycle/pass.js +12 -0
- package/runtime/lib/lifecycle/pass.js.map +1 -0
- package/runtime/lib/lifecycle/patchUpdate.d.ts +23 -0
- package/runtime/lib/lifecycle/patchUpdate.js +179 -0
- package/runtime/lib/lifecycle/patchUpdate.js.map +1 -0
- package/runtime/lib/lifecycle/reload.d.ts +3 -0
- package/runtime/lib/lifecycle/reload.js +63 -0
- package/runtime/lib/lifecycle/reload.js.map +1 -0
- package/runtime/lib/lifecycle/render.d.ts +2 -0
- package/runtime/lib/lifecycle/render.js +44 -0
- package/runtime/lib/lifecycle/render.js.map +1 -0
- package/runtime/lib/lifecycleConstant.d.ts +12 -0
- package/runtime/lib/lifecycleConstant.js +17 -0
- package/runtime/lib/lifecycleConstant.js.map +1 -0
- package/runtime/lib/list.d.ts +40 -0
- package/runtime/lib/list.js +305 -0
- package/runtime/lib/list.js.map +1 -0
- package/runtime/lib/lynx/calledByNative.d.ts +2 -0
- package/runtime/lib/lynx/calledByNative.js +113 -0
- package/runtime/lib/lynx/calledByNative.js.map +1 -0
- package/runtime/lib/lynx/component.d.ts +1 -0
- package/runtime/lib/lynx/component.js +69 -0
- package/runtime/lib/lynx/component.js.map +1 -0
- package/runtime/lib/lynx/dynamic-js.d.ts +2 -0
- package/runtime/lib/lynx/dynamic-js.js +31 -0
- package/runtime/lib/lynx/dynamic-js.js.map +1 -0
- package/runtime/lib/lynx/env.d.ts +1 -0
- package/runtime/lib/lynx/env.js +92 -0
- package/runtime/lib/lynx/env.js.map +1 -0
- package/runtime/lib/lynx/injectLepusMethods.d.ts +2 -0
- package/runtime/lib/lynx/injectLepusMethods.js +50 -0
- package/runtime/lib/lynx/injectLepusMethods.js.map +1 -0
- package/runtime/lib/lynx/lazy-bundle.d.ts +9 -0
- package/runtime/lib/lynx/lazy-bundle.js +119 -0
- package/runtime/lib/lynx/lazy-bundle.js.map +1 -0
- package/runtime/lib/lynx/performance.d.ts +29 -0
- package/runtime/lib/lynx/performance.js +100 -0
- package/runtime/lib/lynx/performance.js.map +1 -0
- package/runtime/lib/lynx/tt.d.ts +4 -0
- package/runtime/lib/lynx/tt.js +193 -0
- package/runtime/lib/lynx/tt.js.map +1 -0
- package/runtime/lib/lynx-api.d.ts +311 -0
- package/runtime/lib/lynx-api.js +116 -0
- package/runtime/lib/lynx-api.js.map +1 -0
- package/runtime/lib/lynx.d.ts +2 -0
- package/runtime/lib/lynx.js +91 -0
- package/runtime/lib/lynx.js.map +1 -0
- package/runtime/lib/opcodes.d.ts +2 -0
- package/runtime/lib/opcodes.js +59 -0
- package/runtime/lib/opcodes.js.map +1 -0
- package/runtime/lib/renderToOpcodes/constants.d.ts +17 -0
- package/runtime/lib/renderToOpcodes/constants.js +23 -0
- package/runtime/lib/renderToOpcodes/constants.js.map +1 -0
- package/runtime/lib/renderToOpcodes/index.d.ts +13 -0
- package/runtime/lib/renderToOpcodes/index.js +227 -0
- package/runtime/lib/renderToOpcodes/index.js.map +1 -0
- package/runtime/lib/root.d.ts +7 -0
- package/runtime/lib/root.js +17 -0
- package/runtime/lib/root.js.map +1 -0
- package/runtime/lib/snapshot/event.d.ts +3 -0
- package/runtime/lib/snapshot/event.js +24 -0
- package/runtime/lib/snapshot/event.js.map +1 -0
- package/runtime/lib/snapshot/gesture.d.ts +2 -0
- package/runtime/lib/snapshot/gesture.js +18 -0
- package/runtime/lib/snapshot/gesture.js.map +1 -0
- package/runtime/lib/snapshot/platformInfo.d.ts +4 -0
- package/runtime/lib/snapshot/platformInfo.js +35 -0
- package/runtime/lib/snapshot/platformInfo.js.map +1 -0
- package/runtime/lib/snapshot/ref.d.ts +10 -0
- package/runtime/lib/snapshot/ref.js +119 -0
- package/runtime/lib/snapshot/ref.js.map +1 -0
- package/runtime/lib/snapshot/spread.d.ts +5 -0
- package/runtime/lib/snapshot/spread.js +289 -0
- package/runtime/lib/snapshot/spread.js.map +1 -0
- package/runtime/lib/snapshot/workletEvent.d.ts +3 -0
- package/runtime/lib/snapshot/workletEvent.js +22 -0
- package/runtime/lib/snapshot/workletEvent.js.map +1 -0
- package/runtime/lib/snapshot/workletRef.d.ts +5 -0
- package/runtime/lib/snapshot/workletRef.js +52 -0
- package/runtime/lib/snapshot/workletRef.js.map +1 -0
- package/runtime/lib/snapshot.d.ts +81 -0
- package/runtime/lib/snapshot.js +477 -0
- package/runtime/lib/snapshot.js.map +1 -0
- package/runtime/lib/snapshotPatch.d.ts +14 -0
- package/runtime/lib/snapshotPatch.js +31 -0
- package/runtime/lib/snapshotPatch.js.map +1 -0
- package/runtime/lib/snapshotPatchApply.d.ts +2 -0
- package/runtime/lib/snapshotPatchApply.js +110 -0
- package/runtime/lib/snapshotPatchApply.js.map +1 -0
- package/runtime/lib/utils.d.ts +4 -0
- package/runtime/lib/utils.js +32 -0
- package/runtime/lib/utils.js.map +1 -0
- package/runtime/lib/worklet/ctx.d.ts +1 -0
- package/runtime/lib/worklet/ctx.js +17 -0
- package/runtime/lib/worklet/ctx.js.map +1 -0
- package/runtime/lib/worklet/execMap.d.ts +1 -0
- package/runtime/lib/worklet/execMap.js +42 -0
- package/runtime/lib/worklet/execMap.js.map +1 -0
- package/runtime/lib/worklet/functionality.d.ts +1 -0
- package/runtime/lib/worklet/functionality.js +11 -0
- package/runtime/lib/worklet/functionality.js.map +1 -0
- package/runtime/lib/worklet/hmr.d.ts +1 -0
- package/runtime/lib/worklet/hmr.js +21 -0
- package/runtime/lib/worklet/hmr.js.map +1 -0
- package/runtime/lib/worklet/indexMap.d.ts +8 -0
- package/runtime/lib/worklet/indexMap.js +17 -0
- package/runtime/lib/worklet/indexMap.js.map +1 -0
- package/runtime/lib/worklet/jsImpl.d.ts +11 -0
- package/runtime/lib/worklet/jsImpl.js +68 -0
- package/runtime/lib/worklet/jsImpl.js.map +1 -0
- package/runtime/lib/worklet/runWorklet.d.ts +14 -0
- package/runtime/lib/worklet/runWorklet.js +82 -0
- package/runtime/lib/worklet/runWorklet.js.map +1 -0
- package/runtime/lib/worklet/workletRef.d.ts +131 -0
- package/runtime/lib/worklet/workletRef.js +96 -0
- package/runtime/lib/worklet/workletRef.js.map +1 -0
- package/runtime/lib/worklet/workletRefPool.d.ts +2 -0
- package/runtime/lib/worklet/workletRefPool.js +22 -0
- package/runtime/lib/worklet/workletRefPool.js.map +1 -0
- package/runtime/src/backgroundSnapshot.ts +452 -0
- package/runtime/src/compat/componentIs.ts +30 -0
- package/runtime/src/compat/initData.ts +140 -0
- package/runtime/src/compat/lynxComponent.ts +80 -0
- package/runtime/src/debug/debug.ts +9 -0
- package/runtime/src/debug/printSnapshot.ts +28 -0
- package/runtime/src/debug/profile.ts +54 -0
- package/runtime/src/document.ts +53 -0
- package/runtime/src/gesture/processGesture.ts +77 -0
- package/runtime/src/gesture/processGestureBagkround.ts +15 -0
- package/runtime/src/gesture/types.ts +39 -0
- package/runtime/src/hooks/react.ts +62 -0
- package/runtime/src/hooks/useLynxGlobalEventListener.ts +59 -0
- package/runtime/src/hydrate.ts +364 -0
- package/runtime/src/index.ts +89 -0
- package/runtime/src/internal.ts +60 -0
- package/runtime/src/legacy-react-runtime/index.ts +40 -0
- package/runtime/src/lifecycle/delayUnmount.ts +77 -0
- package/runtime/src/lifecycle/destroy.ts +26 -0
- package/runtime/src/lifecycle/pass.ts +14 -0
- package/runtime/src/lifecycle/patchUpdate.ts +240 -0
- package/runtime/src/lifecycle/reload.ts +79 -0
- package/runtime/src/lifecycle/render.ts +46 -0
- package/runtime/src/lifecycleConstant.ts +16 -0
- package/runtime/src/list.ts +375 -0
- package/runtime/src/lynx/calledByNative.ts +132 -0
- package/runtime/src/lynx/component.ts +116 -0
- package/runtime/src/lynx/dynamic-js.ts +33 -0
- package/runtime/src/lynx/env.ts +110 -0
- package/runtime/src/lynx/injectLepusMethods.ts +53 -0
- package/runtime/src/lynx/lazy-bundle.ts +126 -0
- package/runtime/src/lynx/performance.ts +117 -0
- package/runtime/src/lynx/tt.ts +212 -0
- package/runtime/src/lynx-api.ts +374 -0
- package/runtime/src/lynx.ts +105 -0
- package/runtime/src/opcodes.ts +64 -0
- package/runtime/src/renderToOpcodes/constants.ts +24 -0
- package/runtime/src/renderToOpcodes/index.ts +301 -0
- package/runtime/src/root.ts +19 -0
- package/runtime/src/snapshot/event.ts +33 -0
- package/runtime/src/snapshot/gesture.ts +25 -0
- package/runtime/src/snapshot/platformInfo.ts +48 -0
- package/runtime/src/snapshot/ref.ts +151 -0
- package/runtime/src/snapshot/spread.ts +287 -0
- package/runtime/src/snapshot/workletEvent.ts +33 -0
- package/runtime/src/snapshot/workletRef.ts +63 -0
- package/runtime/src/snapshot.ts +576 -0
- package/runtime/src/snapshotPatch.ts +56 -0
- package/runtime/src/snapshotPatchApply.ts +117 -0
- package/runtime/src/utils.ts +35 -0
- package/runtime/src/worklet/ctx.ts +22 -0
- package/runtime/src/worklet/execMap.ts +50 -0
- package/runtime/src/worklet/functionality.ts +12 -0
- package/runtime/src/worklet/hmr.ts +26 -0
- package/runtime/src/worklet/indexMap.ts +20 -0
- package/runtime/src/worklet/jsImpl.ts +86 -0
- package/runtime/src/worklet/runWorklet.ts +88 -0
- package/runtime/src/worklet/workletRef.ts +229 -0
- package/runtime/src/worklet/workletRefPool.ts +25 -0
- package/transform/cjs/main.cjs +6 -0
- package/transform/cjs/main.d.cts +3 -0
- package/transform/cjs/package.json +3 -0
- package/transform/dist/wasm.cjs +8478 -0
- package/transform/index.d.ts +187 -0
- package/transform/main.js +15 -0
- package/types/react.d.ts +147 -0
- package/types/react.docs.d.ts +74 -0
- package/worklet-runtime/dist/dev.js +414 -0
- package/worklet-runtime/dist/dev.js.map +8 -0
- package/worklet-runtime/dist/main.js +414 -0
- package/worklet-runtime/dist/main.js.map +8 -0
- package/worklet-runtime/lib/api/element.d.ts +14 -0
- package/worklet-runtime/lib/api/element.js +71 -0
- package/worklet-runtime/lib/api/element.js.map +1 -0
- package/worklet-runtime/lib/api/lepusQuerySelector.d.ts +3 -0
- package/worklet-runtime/lib/api/lepusQuerySelector.js +23 -0
- package/worklet-runtime/lib/api/lepusQuerySelector.js.map +1 -0
- package/worklet-runtime/lib/api/lynxApi.d.ts +2 -0
- package/worklet-runtime/lib/api/lynxApi.js +35 -0
- package/worklet-runtime/lib/api/lynxApi.js.map +1 -0
- package/worklet-runtime/lib/bindings/bindings.d.ts +14 -0
- package/worklet-runtime/lib/bindings/bindings.js +61 -0
- package/worklet-runtime/lib/bindings/bindings.js.map +1 -0
- package/worklet-runtime/lib/bindings/events.d.ts +7 -0
- package/worklet-runtime/lib/bindings/events.js +9 -0
- package/worklet-runtime/lib/bindings/events.js.map +1 -0
- package/worklet-runtime/lib/bindings/index.d.ts +4 -0
- package/worklet-runtime/lib/bindings/index.js +7 -0
- package/worklet-runtime/lib/bindings/index.js.map +1 -0
- package/worklet-runtime/lib/bindings/loadRuntime.d.ts +8 -0
- package/worklet-runtime/lib/bindings/loadRuntime.js +25 -0
- package/worklet-runtime/lib/bindings/loadRuntime.js.map +1 -0
- package/worklet-runtime/lib/bindings/types.d.ts +35 -0
- package/worklet-runtime/lib/bindings/types.js +2 -0
- package/worklet-runtime/lib/bindings/types.js.map +1 -0
- package/worklet-runtime/lib/delayWorkletEvent.d.ts +11 -0
- package/worklet-runtime/lib/delayWorkletEvent.js +49 -0
- package/worklet-runtime/lib/delayWorkletEvent.js.map +1 -0
- package/worklet-runtime/lib/global.d.ts +15 -0
- package/worklet-runtime/lib/global.js +2 -0
- package/worklet-runtime/lib/global.js.map +1 -0
- package/worklet-runtime/lib/index.d.ts +1 -0
- package/worklet-runtime/lib/index.js +12 -0
- package/worklet-runtime/lib/index.js.map +1 -0
- package/worklet-runtime/lib/jsFunctionLifecycle.d.ts +18 -0
- package/worklet-runtime/lib/jsFunctionLifecycle.js +55 -0
- package/worklet-runtime/lib/jsFunctionLifecycle.js.map +1 -0
- package/worklet-runtime/lib/listeners.d.ts +2 -0
- package/worklet-runtime/lib/listeners.js +17 -0
- package/worklet-runtime/lib/listeners.js.map +1 -0
- package/worklet-runtime/lib/utils/profile.d.ts +1 -0
- package/worklet-runtime/lib/utils/profile.js +20 -0
- package/worklet-runtime/lib/utils/profile.js.map +1 -0
- package/worklet-runtime/lib/utils/version.d.ts +1 -0
- package/worklet-runtime/lib/utils/version.js +10 -0
- package/worklet-runtime/lib/utils/version.js.map +1 -0
- package/worklet-runtime/lib/workletRef.d.ts +12 -0
- package/worklet-runtime/lib/workletRef.js +50 -0
- package/worklet-runtime/lib/workletRef.js.map +1 -0
- package/worklet-runtime/lib/workletRuntime.d.ts +2 -0
- package/worklet-runtime/lib/workletRuntime.js +128 -0
- package/worklet-runtime/lib/workletRuntime.js.map +1 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
import { render } from 'preact';
|
|
5
|
+
import { createContext, createElement } from 'preact/compat';
|
|
6
|
+
import { useState } from 'preact/hooks';
|
|
7
|
+
import type { Consumer, FC, ReactNode } from 'react';
|
|
8
|
+
|
|
9
|
+
import { factory, withInitDataInState } from './compat/initData.js';
|
|
10
|
+
import { LifecycleConstant } from './lifecycleConstant.js';
|
|
11
|
+
import { flushDelayedLifecycleEvents } from './lynx/tt.js';
|
|
12
|
+
import { useLynxGlobalEventListener } from './hooks/useLynxGlobalEventListener.js';
|
|
13
|
+
import { __root } from './root.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The default root exported by `@lynx-js/react` for you to render a JSX
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export interface Root {
|
|
20
|
+
/**
|
|
21
|
+
* Use this API to pass in your JSX to render
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { root } from "@lynx-js/react"
|
|
27
|
+
*
|
|
28
|
+
* function App() {
|
|
29
|
+
* // Your app
|
|
30
|
+
* return <view>...</view>
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
* root.render(<App/>);
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
*
|
|
38
|
+
* ```tsx
|
|
39
|
+
* import { root } from "@lynx-js/react"
|
|
40
|
+
*
|
|
41
|
+
* function App() {
|
|
42
|
+
* // Your app
|
|
43
|
+
* return <view>...</view>
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* if (__LEPUS__) {
|
|
47
|
+
* root.render(
|
|
48
|
+
* <DataProvider data={DEFAULT_DATA}>
|
|
49
|
+
* <App/>
|
|
50
|
+
* </DataProvider>
|
|
51
|
+
* );
|
|
52
|
+
* } else if (__JS__) {
|
|
53
|
+
* fetchData().then((data) => {
|
|
54
|
+
* root.render(
|
|
55
|
+
* <DataProvider data={data}>
|
|
56
|
+
* <App/>
|
|
57
|
+
* </DataProvider>
|
|
58
|
+
* ); // You can render later after your data is ready
|
|
59
|
+
* })
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
render: (jsx: ReactNode) => void;
|
|
66
|
+
/**
|
|
67
|
+
* {@inheritDoc Lynx.registerDataProcessors}
|
|
68
|
+
* @deprecated use {@link Lynx.registerDataProcessors | lynx.registerDataProcessors} instead
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
registerDataProcessors: (dataProcessorDefinition: DataProcessorDefinition) => void;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The default and only root of ReactLynx for you to render JSX
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* import { root } from "@lynx-js/react"
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
|
+
export const root: Root = {
|
|
84
|
+
render: (jsx: ReactNode): void => {
|
|
85
|
+
if (__LEPUS__) {
|
|
86
|
+
__root.__jsx = jsx;
|
|
87
|
+
} else {
|
|
88
|
+
__root.__jsx = jsx;
|
|
89
|
+
render(jsx, __root as any);
|
|
90
|
+
if (__FIRST_SCREEN_SYNC_TIMING__ === 'immediately') {
|
|
91
|
+
} else {
|
|
92
|
+
lynx.getNativeApp().callLepusMethod(LifecycleConstant.jsReady, {});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
flushDelayedLifecycleEvents();
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
registerDataProcessors: (dataProcessorDefinition: DataProcessorDefinition): void => {
|
|
99
|
+
lynx.registerDataProcessors(dataProcessorDefinition);
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const _InitData = /* @__PURE__ */ factory<InitData>(
|
|
104
|
+
{
|
|
105
|
+
createContext,
|
|
106
|
+
useState,
|
|
107
|
+
createElement,
|
|
108
|
+
useLynxGlobalEventListener,
|
|
109
|
+
} as any,
|
|
110
|
+
'__initData',
|
|
111
|
+
'onDataChanged',
|
|
112
|
+
);
|
|
113
|
+
/**
|
|
114
|
+
* The {@link https://react.dev/reference/react/createContext#provider | Provider} Component that provide `initData`,
|
|
115
|
+
* you must wrap your JSX inside it
|
|
116
|
+
* @group Components
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
*
|
|
120
|
+
* ```ts
|
|
121
|
+
* import { root } from "@lynx-js/react"
|
|
122
|
+
*
|
|
123
|
+
* function App() {
|
|
124
|
+
* return (
|
|
125
|
+
* <InitDataConsumer children={(initData) => <view>...</view>}/>
|
|
126
|
+
* )
|
|
127
|
+
* }
|
|
128
|
+
*
|
|
129
|
+
* root.render(
|
|
130
|
+
* <InitDataProvider>
|
|
131
|
+
* <App/>
|
|
132
|
+
* </InitDataProvider>
|
|
133
|
+
* );
|
|
134
|
+
*
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
export const InitDataProvider: FC<{ children?: ReactNode | undefined }> = /* @__PURE__ */ _InitData.Provider();
|
|
140
|
+
/**
|
|
141
|
+
* The {@link https://react.dev/reference/react/createContext#consumer | Consumer} Component that provide `initData`.
|
|
142
|
+
* This should be used with {@link InitDataProvider}
|
|
143
|
+
* @group Components
|
|
144
|
+
* @public
|
|
145
|
+
*/
|
|
146
|
+
export const InitDataConsumer: Consumer<InitData> = /* @__PURE__ */ _InitData.Consumer();
|
|
147
|
+
/**
|
|
148
|
+
* A React Hooks for you to get `initData`.
|
|
149
|
+
* If `initData` is changed, a re-render will be triggered automatically.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
*
|
|
153
|
+
* ```ts
|
|
154
|
+
* function App() {
|
|
155
|
+
* const initData = useInitData();
|
|
156
|
+
*
|
|
157
|
+
* initData.someProperty // use it
|
|
158
|
+
* }
|
|
159
|
+
* ```
|
|
160
|
+
*
|
|
161
|
+
* @public
|
|
162
|
+
*/
|
|
163
|
+
export const useInitData: () => InitData = /* @__PURE__ */ _InitData.use();
|
|
164
|
+
/**
|
|
165
|
+
* A React Hooks for you to get notified when `initData` changed.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```ts
|
|
169
|
+
* function App() {
|
|
170
|
+
* useInitDataChanged((data) => {
|
|
171
|
+
* data.someProperty // can use it
|
|
172
|
+
* })
|
|
173
|
+
* }
|
|
174
|
+
* ```
|
|
175
|
+
* @public
|
|
176
|
+
*/
|
|
177
|
+
export const useInitDataChanged: (callback: (data: InitData) => void) => void = /* @__PURE__ */ _InitData.useChanged();
|
|
178
|
+
|
|
179
|
+
// const {
|
|
180
|
+
// Provider: GlobalPropsProvider,
|
|
181
|
+
// Consumer: GlobalPropsConsumer,
|
|
182
|
+
// // InitDataContext,
|
|
183
|
+
// use: useGlobalProps,
|
|
184
|
+
// useChanged: useGlobalPropsChanged,
|
|
185
|
+
// } = /* @__PURE__ */ factory(
|
|
186
|
+
// {
|
|
187
|
+
// createContext,
|
|
188
|
+
// useState,
|
|
189
|
+
// useEffect,
|
|
190
|
+
// createElement,
|
|
191
|
+
// } as any,
|
|
192
|
+
// "__globalProps",
|
|
193
|
+
// "onGlobalPropsChanged"
|
|
194
|
+
// );
|
|
195
|
+
|
|
196
|
+
// export { GlobalPropsProvider, GlobalPropsConsumer, useGlobalProps, useGlobalPropsChanged };
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* The interface you can extends so that the `defaultDataProcessor` parameter can be customized
|
|
200
|
+
*
|
|
201
|
+
* Should be used with `lynx.registerDataProcessors`. See more examples at {@link Lynx.registerDataProcessors}.
|
|
202
|
+
*
|
|
203
|
+
* @public
|
|
204
|
+
*/
|
|
205
|
+
export interface InitDataRaw {}
|
|
206
|
+
/**
|
|
207
|
+
* The interface you can extends so that the `defaultDataProcessor` returning value can be customized
|
|
208
|
+
*
|
|
209
|
+
* Should be used with `lynx.registerDataProcessors`. See more examples at {@link Lynx.registerDataProcessors}.
|
|
210
|
+
*
|
|
211
|
+
* @public
|
|
212
|
+
*/
|
|
213
|
+
export interface InitData {}
|
|
214
|
+
|
|
215
|
+
export { withInitDataInState };
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Definition of DataProcessor(s)
|
|
219
|
+
* @public
|
|
220
|
+
*/
|
|
221
|
+
export interface DataProcessorDefinition {
|
|
222
|
+
/**
|
|
223
|
+
* You can custom input and output type of `defaultDataProcessor` by extends {@link InitDataRaw} and {@link InitData}
|
|
224
|
+
*
|
|
225
|
+
* Should be used with `lynx.registerDataProcessors`. See more examples at {@link Lynx.registerDataProcessors}.
|
|
226
|
+
*
|
|
227
|
+
* @param rawInitData - initData passed from native code
|
|
228
|
+
* @returns
|
|
229
|
+
* @public
|
|
230
|
+
*/
|
|
231
|
+
defaultDataProcessor?: (rawInitData: InitDataRaw) => InitData;
|
|
232
|
+
/**
|
|
233
|
+
* Should be used with `lynx.registerDataProcessors`. See more examples at {@link Lynx.registerDataProcessors}.
|
|
234
|
+
*
|
|
235
|
+
* @public
|
|
236
|
+
*/
|
|
237
|
+
dataProcessors?: Record<string, Function>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* APIs under `lynx` global variable that added by ReactLynx.
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
*
|
|
245
|
+
* ```ts
|
|
246
|
+
* lynx.registerDataProcessors(...);
|
|
247
|
+
* lynx.querySelector(...);
|
|
248
|
+
* lynx.querySelectorAll(...);
|
|
249
|
+
* ```
|
|
250
|
+
*
|
|
251
|
+
* @public
|
|
252
|
+
*/
|
|
253
|
+
export interface Lynx {
|
|
254
|
+
/**
|
|
255
|
+
* An alias of `lynx.getJSModule("GlobalEventEmitter").trigger(eventName, params)` only in Lepus
|
|
256
|
+
*
|
|
257
|
+
* @public
|
|
258
|
+
*/
|
|
259
|
+
triggerGlobalEventFromLepus: (eventName: string, params: any) => void;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Register DataProcessors. You MUST call this before `root.render()`.
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
*
|
|
266
|
+
* You MUST call `lynx.registerDataProcessors` before calling `root.render()`.
|
|
267
|
+
*
|
|
268
|
+
* ```ts
|
|
269
|
+
* import { root } from "@lynx-js/react"
|
|
270
|
+
*
|
|
271
|
+
* // You MUST call this before `root.render()`
|
|
272
|
+
* lynx.registerDataProcessors({
|
|
273
|
+
* defaultDataProcessor: () => {...} // default DataProcessor
|
|
274
|
+
* dataProcessors: {
|
|
275
|
+
* getScreenMetricsOverride: () => {...} // named DataProcessor
|
|
276
|
+
* }
|
|
277
|
+
* })
|
|
278
|
+
*
|
|
279
|
+
* root.render(<App/>);
|
|
280
|
+
* ```
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
*
|
|
284
|
+
* If you have a class component with `static defaultDataProcessor`
|
|
285
|
+
* or `static dataProcessors`, you can use it to register DataProcessors.
|
|
286
|
+
*
|
|
287
|
+
* ```ts
|
|
288
|
+
* import { root, Component } from "@lynx-js/react"
|
|
289
|
+
*
|
|
290
|
+
* class App extends Component {
|
|
291
|
+
* static defaultDataProcessor() {
|
|
292
|
+
* ...
|
|
293
|
+
* }
|
|
294
|
+
*
|
|
295
|
+
* static dataProcessors = {
|
|
296
|
+
* getScreenMetricsOverride() {
|
|
297
|
+
* ...
|
|
298
|
+
* }
|
|
299
|
+
* }
|
|
300
|
+
* }
|
|
301
|
+
*
|
|
302
|
+
* lynx.registerDataProcessors(App); // You can pass `App` because it has the required shape
|
|
303
|
+
* root.render(<App/>);
|
|
304
|
+
* ```
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
*
|
|
308
|
+
* For developers who want fully typed `defaultDataProcessor`,
|
|
309
|
+
* they can achieve it by extends interface `InitDataRaw` and `InitData`.
|
|
310
|
+
*
|
|
311
|
+
* ```ts
|
|
312
|
+
* import { root } from "@lynx-js/react"
|
|
313
|
+
*
|
|
314
|
+
* interface ExistingInterface {
|
|
315
|
+
* somePropertyFromExistingInterface: number
|
|
316
|
+
* }
|
|
317
|
+
*
|
|
318
|
+
* declare module '@lynx-js/react' {
|
|
319
|
+
* interface InitDataRaw extends ExistingInterface {
|
|
320
|
+
* someAnotherCustomProperty: string
|
|
321
|
+
* }
|
|
322
|
+
* }
|
|
323
|
+
*
|
|
324
|
+
* lynx.registerDataProcessors({
|
|
325
|
+
* defaultDataProcessor: (initDataRaw) => {
|
|
326
|
+
* initDataRaw.somePropertyFromExistingInterface // will be typed
|
|
327
|
+
* }
|
|
328
|
+
* })
|
|
329
|
+
*
|
|
330
|
+
* ```
|
|
331
|
+
*
|
|
332
|
+
* @example
|
|
333
|
+
*
|
|
334
|
+
* For developers who want fully typed `defaultDataProcessor`,
|
|
335
|
+
* they can achieve it by extends interface `InitDataRaw` and `InitData`.
|
|
336
|
+
*
|
|
337
|
+
* ```ts
|
|
338
|
+
* import { root, useInitData } from "@lynx-js/react"
|
|
339
|
+
*
|
|
340
|
+
* interface AnotherExistingInterface {
|
|
341
|
+
* someAnotherPropertyFromExistingInterface: number
|
|
342
|
+
* }
|
|
343
|
+
*
|
|
344
|
+
* declare module '@lynx-js/react' {
|
|
345
|
+
* interface InitData extends AnotherExistingInterface {
|
|
346
|
+
* someCustomProperty: string
|
|
347
|
+
* }
|
|
348
|
+
* }
|
|
349
|
+
*
|
|
350
|
+
* root.registerDataProcessors({
|
|
351
|
+
* defaultDataProcessor: () => {
|
|
352
|
+
* return {
|
|
353
|
+
* someCustomProperty: 'value', // will be typed
|
|
354
|
+
* someAnotherPropertyFromExistingInterface: 1, // will be typed
|
|
355
|
+
* }
|
|
356
|
+
* }
|
|
357
|
+
* })
|
|
358
|
+
*
|
|
359
|
+
* function App() {
|
|
360
|
+
* const initData = useInitData();
|
|
361
|
+
*
|
|
362
|
+
* initData.someCustomProperty // will be typed
|
|
363
|
+
* initData.someAnotherPropertyFromExistingInterface // will be typed
|
|
364
|
+
* }
|
|
365
|
+
*
|
|
366
|
+
* ```
|
|
367
|
+
* @public
|
|
368
|
+
*/
|
|
369
|
+
registerDataProcessors: (dataProcessorDefinition: DataProcessorDefinition) => void;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export { runOnBackground, runOnMainThread } from './worklet/runWorklet.js';
|
|
373
|
+
export { MainThreadRef, useMainThreadRef } from './worklet/workletRef.js';
|
|
374
|
+
export { useLynxGlobalEventListener } from './hooks/useLynxGlobalEventListener.js';
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
import { options } from 'preact';
|
|
5
|
+
import type { VNode } from 'preact';
|
|
6
|
+
// to make sure preact's hooks to register earlier than ours
|
|
7
|
+
import './hooks/react.js';
|
|
8
|
+
|
|
9
|
+
import { initProfileHook } from './debug/profile.js';
|
|
10
|
+
import { document, setupBackgroundDocument } from './document.js';
|
|
11
|
+
import { initDelayUnmount } from './lifecycle/delayUnmount.js';
|
|
12
|
+
import { injectUpdatePatch, replaceCommitHook, replaceRequestAnimationFrame } from './lifecycle/patchUpdate.js';
|
|
13
|
+
import { injectCalledByNative } from './lynx/calledByNative.js';
|
|
14
|
+
import { setupLynxEnv } from './lynx/env.js';
|
|
15
|
+
import { injectLepusMethods } from './lynx/injectLepusMethods.js';
|
|
16
|
+
import { initTimingAPI } from './lynx/performance.js';
|
|
17
|
+
import { injectTt } from './lynx/tt.js';
|
|
18
|
+
import { COMPONENT, DIFF, DIFFED, FORCE } from './renderToOpcodes/constants.js';
|
|
19
|
+
|
|
20
|
+
// @ts-expect-error Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature
|
|
21
|
+
if (__LEPUS__ && typeof globalThis.processEvalResult === 'undefined') {
|
|
22
|
+
// @ts-expect-error Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature
|
|
23
|
+
globalThis.processEvalResult = <T>(result: (schema: string) => T, schema: string) => {
|
|
24
|
+
return result(schema);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function runWithForce(cb: () => void): void {
|
|
29
|
+
// save vnode and its `_component` in WeakMap
|
|
30
|
+
const m = new WeakMap<VNode, any>();
|
|
31
|
+
|
|
32
|
+
const oldDiff = options[DIFF];
|
|
33
|
+
|
|
34
|
+
options[DIFF] = (vnode: VNode) => {
|
|
35
|
+
if (oldDiff) {
|
|
36
|
+
oldDiff(vnode);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// when `options[DIFF]` is called, a newVnode is passed in
|
|
40
|
+
// so its `vnode[COMPONENT]` should be null,
|
|
41
|
+
// but it will be set later
|
|
42
|
+
Object.defineProperty(vnode, COMPONENT, {
|
|
43
|
+
configurable: true,
|
|
44
|
+
set(c) {
|
|
45
|
+
m.set(vnode, c);
|
|
46
|
+
if (c) {
|
|
47
|
+
c[FORCE] = true;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
get() {
|
|
51
|
+
return m.get(vnode);
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const oldDiffed = options[DIFFED];
|
|
57
|
+
|
|
58
|
+
options[DIFFED] = (vnode: VNode) => {
|
|
59
|
+
if (oldDiffed) {
|
|
60
|
+
oldDiffed(vnode);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// delete is a reverse operation of previous `Object.defineProperty`
|
|
64
|
+
delete vnode[COMPONENT];
|
|
65
|
+
// restore
|
|
66
|
+
vnode[COMPONENT] = m.get(vnode);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
cb();
|
|
71
|
+
} finally {
|
|
72
|
+
options[DIFF] = oldDiff as (vnode: VNode) => void;
|
|
73
|
+
options[DIFFED] = oldDiffed as (vnode: VNode) => void;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (__LEPUS__) {
|
|
78
|
+
injectCalledByNative();
|
|
79
|
+
injectUpdatePatch();
|
|
80
|
+
if (__DEV__) {
|
|
81
|
+
injectLepusMethods();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// TODO: replace this with __PROFILE__
|
|
86
|
+
if (__PROFILE__) {
|
|
87
|
+
// We are profiling both main-thread and background.
|
|
88
|
+
initProfileHook();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (__JS__) {
|
|
92
|
+
options.document = document;
|
|
93
|
+
setupBackgroundDocument();
|
|
94
|
+
injectTt();
|
|
95
|
+
|
|
96
|
+
if (process.env['NODE_ENV'] === 'test') {}
|
|
97
|
+
else {
|
|
98
|
+
replaceCommitHook();
|
|
99
|
+
replaceRequestAnimationFrame();
|
|
100
|
+
initTimingAPI();
|
|
101
|
+
initDelayUnmount();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
setupLynxEnv();
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
import { CHILDREN } from './renderToOpcodes/constants.js';
|
|
5
|
+
import { SnapshotInstance } from './snapshot.js';
|
|
6
|
+
|
|
7
|
+
const enum Opcode {
|
|
8
|
+
Begin = 0,
|
|
9
|
+
End,
|
|
10
|
+
Attr,
|
|
11
|
+
Text,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function renderOpcodesInto(opcodes: any[], into: SnapshotInstance): void {
|
|
15
|
+
let top: SnapshotInstance = into;
|
|
16
|
+
const stack: SnapshotInstance[] = [into];
|
|
17
|
+
for (let i = 0; i < opcodes.length;) {
|
|
18
|
+
const opcode = opcodes[i];
|
|
19
|
+
switch (opcode) {
|
|
20
|
+
case Opcode.Begin: {
|
|
21
|
+
const p = top;
|
|
22
|
+
top = opcodes[i + 1];
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
if (top.__parent) {
|
|
25
|
+
// already inserted
|
|
26
|
+
top = new SnapshotInstance(top.type);
|
|
27
|
+
}
|
|
28
|
+
p.insertBefore(top);
|
|
29
|
+
stack.push(top);
|
|
30
|
+
|
|
31
|
+
i += 2;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
case Opcode.End: {
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
top[CHILDREN] = undefined;
|
|
37
|
+
|
|
38
|
+
stack.pop();
|
|
39
|
+
const p = stack[stack.length - 1];
|
|
40
|
+
top = p!;
|
|
41
|
+
|
|
42
|
+
i += 1;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
case Opcode.Attr: {
|
|
46
|
+
const key = opcodes[i + 1];
|
|
47
|
+
const value = opcodes[i + 2];
|
|
48
|
+
top.setAttribute(key, value);
|
|
49
|
+
|
|
50
|
+
i += 3;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case Opcode.Text: {
|
|
54
|
+
const text = opcodes[i + 1];
|
|
55
|
+
const s = new SnapshotInstance(null as unknown as string);
|
|
56
|
+
s.setAttribute(0, text);
|
|
57
|
+
top.insertBefore(s);
|
|
58
|
+
|
|
59
|
+
i += 2;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
export const DIFF = '__b';
|
|
5
|
+
export const RENDER = '__r';
|
|
6
|
+
export const DIFFED = 'diffed';
|
|
7
|
+
export const COMMIT = '__c';
|
|
8
|
+
export const SKIP_EFFECTS = '__s';
|
|
9
|
+
export const CATCH_ERROR = '__e';
|
|
10
|
+
|
|
11
|
+
// VNode properties
|
|
12
|
+
export const COMPONENT = '__c';
|
|
13
|
+
export const CHILDREN = '__k';
|
|
14
|
+
export const PARENT = '__';
|
|
15
|
+
export const MASK = '__m';
|
|
16
|
+
|
|
17
|
+
// Component properties
|
|
18
|
+
export const VNODE = '__v';
|
|
19
|
+
export const DIRTY = '__d';
|
|
20
|
+
export const FORCE = '__e';
|
|
21
|
+
export const NEXT_STATE = '__s';
|
|
22
|
+
export const CHILD_DID_SUSPEND = '__c';
|
|
23
|
+
export const RENDER_CALLBACKS = '__h';
|
|
24
|
+
export const HOOK = '__h';
|