@lynx-js/react 0.117.0 → 0.118.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 +24 -0
- package/package.json +14 -14
- package/refresh/.turbo/turbo-build.log +1 -1
- package/runtime/lazy/internal.js +8 -0
- package/runtime/lepus/jsx-runtime/index.js +17 -17
- package/runtime/lib/debug/printSnapshot.d.ts +3 -3
- package/runtime/lib/debug/printSnapshot.js +2 -2
- package/runtime/lib/debug/printSnapshot.js.map +1 -1
- package/runtime/lib/debug/profile.js +1 -2
- package/runtime/lib/debug/profile.js.map +1 -1
- package/runtime/lib/document.d.ts +2 -2
- package/runtime/lib/document.js +2 -2
- package/runtime/lib/document.js.map +1 -1
- package/runtime/lib/gesture/types.d.ts +13 -12
- package/runtime/lib/gesture/types.js +11 -12
- package/runtime/lib/gesture/types.js.map +1 -1
- package/runtime/lib/hooks/react.d.ts +2 -1
- package/runtime/lib/hooks/react.js +13 -7
- package/runtime/lib/hooks/react.js.map +1 -1
- package/runtime/lib/internal.d.ts +5 -3
- package/runtime/lib/internal.js +5 -3
- package/runtime/lib/internal.js.map +1 -1
- package/runtime/lib/lifecycle/constant.d.ts +19 -0
- package/runtime/lib/lifecycle/constant.js +17 -0
- package/runtime/lib/lifecycle/constant.js.map +1 -0
- package/runtime/lib/lifecycle/event/delayLifecycleEvents.d.ts +1 -1
- package/runtime/lib/lifecycle/event/jsReady.js +1 -1
- package/runtime/lib/lifecycle/event/jsReady.js.map +1 -1
- package/runtime/lib/lifecycle/isRendering.js +6 -8
- package/runtime/lib/lifecycle/isRendering.js.map +1 -1
- package/runtime/lib/lifecycle/patch/commit.d.ts +1 -1
- package/runtime/lib/lifecycle/patch/commit.js +10 -10
- package/runtime/lib/lifecycle/patch/commit.js.map +1 -1
- package/runtime/lib/lifecycle/patch/error.js +2 -1
- package/runtime/lib/lifecycle/patch/error.js.map +1 -1
- package/runtime/lib/lifecycle/patch/globalState.d.ts +8 -0
- package/runtime/lib/lifecycle/patch/globalState.js +14 -0
- package/runtime/lib/lifecycle/patch/globalState.js.map +1 -0
- package/runtime/lib/lifecycle/patch/snapshotPatchApply.js +1 -1
- package/runtime/lib/lifecycle/patch/snapshotPatchApply.js.map +1 -1
- package/runtime/lib/lifecycle/patch/updateMainThread.js +3 -3
- package/runtime/lib/lifecycle/patch/updateMainThread.js.map +1 -1
- package/runtime/lib/lifecycle/ref/delay.js +1 -1
- package/runtime/lib/lifecycle/ref/delay.js.map +1 -1
- package/runtime/lib/lifecycle/reload.js +9 -8
- package/runtime/lib/lifecycle/reload.js.map +1 -1
- package/runtime/lib/lifecycle/render.js +3 -15
- package/runtime/lib/lifecycle/render.js.map +1 -1
- package/runtime/lib/{list.d.ts → list/list.d.ts} +1 -1
- package/runtime/lib/{list.js → list/list.js} +3 -3
- package/runtime/lib/list/list.js.map +1 -0
- package/runtime/lib/{listUpdateInfo.d.ts → list/listUpdateInfo.d.ts} +1 -1
- package/runtime/lib/{listUpdateInfo.js → list/listUpdateInfo.js} +2 -2
- package/runtime/lib/list/listUpdateInfo.js.map +1 -0
- package/runtime/lib/list/pendingListUpdates.js.map +1 -0
- package/runtime/lib/lynx/calledByNative.js +7 -6
- package/runtime/lib/lynx/calledByNative.js.map +1 -1
- package/runtime/lib/lynx/injectLepusMethods.js +1 -1
- package/runtime/lib/lynx/injectLepusMethods.js.map +1 -1
- package/runtime/lib/lynx/performance.js +6 -13
- package/runtime/lib/lynx/performance.js.map +1 -1
- package/runtime/lib/lynx/suspense.js +2 -2
- package/runtime/lib/lynx/suspense.js.map +1 -1
- package/runtime/lib/lynx/tt.js +2 -3
- package/runtime/lib/lynx/tt.js.map +1 -1
- package/runtime/lib/lynx-api.js +1 -1
- package/runtime/lib/lynx-api.js.map +1 -1
- package/runtime/lib/renderToOpcodes/constants.d.ts +2 -0
- package/runtime/lib/renderToOpcodes/constants.js +2 -0
- package/runtime/lib/renderToOpcodes/constants.js.map +1 -1
- package/runtime/lib/{hydrate.d.ts → renderToOpcodes/hydrate.d.ts} +2 -2
- package/runtime/lib/{hydrate.js → renderToOpcodes/hydrate.js} +6 -6
- package/runtime/lib/renderToOpcodes/hydrate.js.map +1 -0
- package/runtime/lib/renderToOpcodes/index.d.ts +2 -1
- package/runtime/lib/renderToOpcodes/index.js +79 -24
- package/runtime/lib/renderToOpcodes/index.js.map +1 -1
- package/runtime/lib/{opcodes.d.ts → renderToOpcodes/opcodes.d.ts} +1 -2
- package/runtime/lib/{opcodes.js → renderToOpcodes/opcodes.js} +62 -65
- package/runtime/lib/renderToOpcodes/opcodes.js.map +1 -0
- package/runtime/lib/root.d.ts +2 -2
- package/runtime/lib/root.js +2 -2
- package/runtime/lib/root.js.map +1 -1
- package/runtime/lib/{backgroundSnapshot.d.ts → snapshot/backgroundSnapshot.d.ts} +13 -2
- package/runtime/lib/{backgroundSnapshot.js → snapshot/backgroundSnapshot.js} +77 -16
- package/runtime/lib/snapshot/backgroundSnapshot.js.map +1 -0
- package/runtime/lib/snapshot/constants.d.ts +11 -0
- package/runtime/lib/snapshot/constants.js +15 -0
- package/runtime/lib/snapshot/constants.js.map +1 -0
- package/runtime/lib/snapshot/definition.d.ts +29 -0
- package/runtime/lib/snapshot/definition.js +109 -0
- package/runtime/lib/snapshot/definition.js.map +1 -0
- package/runtime/lib/snapshot/dynamicPartType.d.ts +13 -8
- package/runtime/lib/snapshot/dynamicPartType.js +12 -9
- package/runtime/lib/snapshot/dynamicPartType.js.map +1 -1
- package/runtime/lib/snapshot/event.d.ts +1 -1
- package/runtime/lib/snapshot/event.js +1 -1
- package/runtime/lib/snapshot/event.js.map +1 -1
- package/runtime/lib/snapshot/gesture.d.ts +1 -1
- package/runtime/lib/snapshot/gesture.js +0 -1
- package/runtime/lib/snapshot/gesture.js.map +1 -1
- package/runtime/lib/snapshot/index.d.ts +4 -0
- package/runtime/lib/snapshot/index.js +8 -0
- package/runtime/lib/snapshot/index.js.map +1 -0
- package/runtime/lib/snapshot/list.d.ts +1 -1
- package/runtime/lib/snapshot/list.js +2 -2
- package/runtime/lib/snapshot/list.js.map +1 -1
- package/runtime/lib/snapshot/platformInfo.d.ts +1 -1
- package/runtime/lib/snapshot/platformInfo.js +2 -3
- package/runtime/lib/snapshot/platformInfo.js.map +1 -1
- package/runtime/lib/snapshot/ref.d.ts +1 -1
- package/runtime/lib/snapshot/ref.js.map +1 -1
- package/runtime/lib/snapshot/snapshot.d.ts +58 -0
- package/runtime/lib/{snapshot.js → snapshot/snapshot.js} +24 -172
- package/runtime/lib/snapshot/snapshot.js.map +1 -0
- package/runtime/lib/snapshot/snapshotInstanceHydrationMap.js.map +1 -0
- package/runtime/lib/snapshot/spread.d.ts +2 -2
- package/runtime/lib/snapshot/spread.js +3 -3
- package/runtime/lib/snapshot/spread.js.map +1 -1
- package/runtime/lib/snapshot/types.d.ts +19 -0
- package/runtime/lib/snapshot/types.js +5 -0
- package/runtime/lib/snapshot/types.js.map +1 -0
- package/runtime/lib/snapshot/utils.d.ts +12 -0
- package/runtime/lib/snapshot/utils.js +20 -0
- package/runtime/lib/snapshot/utils.js.map +1 -0
- package/runtime/lib/snapshot/workletEvent.d.ts +1 -1
- package/runtime/lib/snapshot/workletEvent.js +1 -1
- package/runtime/lib/snapshot/workletEvent.js.map +1 -1
- package/runtime/lib/snapshot/workletRef.d.ts +1 -1
- package/runtime/lib/tsconfig.tsbuildinfo +1 -0
- package/runtime/lib/utils.d.ts +1 -0
- package/runtime/lib/utils.js +4 -1
- package/runtime/lib/utils.js.map +1 -1
- package/runtime/lib/worklet/ref/updateInitValue.js +1 -1
- package/runtime/lib/worklet/ref/updateInitValue.js.map +1 -1
- package/runtime/lib/worklet-runtime/api/animation/animation.js.map +1 -0
- package/runtime/lib/worklet-runtime/api/animation/effect.js.map +1 -0
- package/runtime/lib/worklet-runtime/api/element.js.map +1 -0
- package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/api/lepusQuerySelector.js +10 -2
- package/runtime/lib/worklet-runtime/api/lepusQuerySelector.js.map +1 -0
- package/runtime/lib/worklet-runtime/api/lynxApi.js.map +1 -0
- package/runtime/lib/worklet-runtime/bindings/bindings.js.map +1 -0
- package/runtime/lib/worklet-runtime/bindings/events.js.map +1 -0
- package/runtime/lib/worklet-runtime/bindings/index.js.map +1 -0
- package/runtime/lib/worklet-runtime/bindings/loadRuntime.js.map +1 -0
- package/runtime/lib/worklet-runtime/bindings/observers.js.map +1 -0
- package/runtime/lib/worklet-runtime/bindings/types.js.map +1 -0
- package/runtime/lib/worklet-runtime/delayRunOnBackground.js.map +1 -0
- package/runtime/lib/worklet-runtime/delayWorkletEvent.js.map +1 -0
- package/runtime/lib/worklet-runtime/eomImpl.js.map +1 -0
- package/runtime/lib/worklet-runtime/eventPropagation.js.map +1 -0
- package/runtime/lib/worklet-runtime/global.js.map +1 -0
- package/runtime/lib/worklet-runtime/hydrate.js.map +1 -0
- package/runtime/lib/worklet-runtime/index.js.map +1 -0
- package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +1 -0
- package/runtime/lib/worklet-runtime/listeners.js.map +1 -0
- package/runtime/lib/worklet-runtime/runOnMainThread.js.map +1 -0
- package/runtime/lib/worklet-runtime/utils/mainThreadFlushLoopGuard.js.map +1 -0
- package/runtime/lib/worklet-runtime/utils/profile.js.map +1 -0
- package/runtime/lib/worklet-runtime/utils/version.js.map +1 -0
- package/runtime/lib/worklet-runtime/workletRef.js.map +1 -0
- package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -0
- package/runtime/worklet-runtime/dev.js +629 -0
- package/{worklet-runtime/dist → runtime/worklet-runtime}/main.js +1 -1
- package/testing-library/dist/pure.js +1 -1
- package/testing-library/dist/vitest-global-setup.js +4 -5
- package/transform/dist/wasm.cjs +1 -1
- package/transform/index.d.ts +27 -1
- package/runtime/lib/backgroundSnapshot.js.map +0 -1
- package/runtime/lib/hydrate.js.map +0 -1
- package/runtime/lib/lifecycleConstant.d.ts +0 -17
- package/runtime/lib/lifecycleConstant.js +0 -19
- package/runtime/lib/lifecycleConstant.js.map +0 -1
- package/runtime/lib/list.js.map +0 -1
- package/runtime/lib/listUpdateInfo.js.map +0 -1
- package/runtime/lib/opcodes.js.map +0 -1
- package/runtime/lib/pendingListUpdates.js.map +0 -1
- package/runtime/lib/snapshot.d.ts +0 -104
- package/runtime/lib/snapshot.js.map +0 -1
- package/runtime/lib/snapshotInstanceHydrationMap.js.map +0 -1
- package/worklet-runtime/dist/dev.js +0 -625
- package/worklet-runtime/lib/api/animation/animation.js.map +0 -1
- package/worklet-runtime/lib/api/animation/effect.js.map +0 -1
- package/worklet-runtime/lib/api/element.js.map +0 -1
- package/worklet-runtime/lib/api/lepusQuerySelector.js.map +0 -1
- package/worklet-runtime/lib/api/lynxApi.js.map +0 -1
- package/worklet-runtime/lib/bindings/bindings.js.map +0 -1
- package/worklet-runtime/lib/bindings/events.js.map +0 -1
- package/worklet-runtime/lib/bindings/index.js.map +0 -1
- package/worklet-runtime/lib/bindings/loadRuntime.js.map +0 -1
- package/worklet-runtime/lib/bindings/observers.js.map +0 -1
- package/worklet-runtime/lib/bindings/types.js.map +0 -1
- package/worklet-runtime/lib/delayRunOnBackground.js.map +0 -1
- package/worklet-runtime/lib/delayWorkletEvent.js.map +0 -1
- package/worklet-runtime/lib/eomImpl.js.map +0 -1
- package/worklet-runtime/lib/eventPropagation.js.map +0 -1
- package/worklet-runtime/lib/global.js.map +0 -1
- package/worklet-runtime/lib/hydrate.js.map +0 -1
- package/worklet-runtime/lib/index.js.map +0 -1
- package/worklet-runtime/lib/jsFunctionLifecycle.js.map +0 -1
- package/worklet-runtime/lib/listeners.js.map +0 -1
- package/worklet-runtime/lib/runOnMainThread.js.map +0 -1
- package/worklet-runtime/lib/utils/mainThreadFlushLoopGuard.js.map +0 -1
- package/worklet-runtime/lib/utils/profile.js.map +0 -1
- package/worklet-runtime/lib/utils/version.js.map +0 -1
- package/worklet-runtime/lib/workletRef.js.map +0 -1
- package/worklet-runtime/lib/workletRuntime.js.map +0 -1
- /package/runtime/lib/{pendingListUpdates.d.ts → list/pendingListUpdates.d.ts} +0 -0
- /package/runtime/lib/{pendingListUpdates.js → list/pendingListUpdates.js} +0 -0
- /package/runtime/lib/{snapshotInstanceHydrationMap.d.ts → snapshot/snapshotInstanceHydrationMap.d.ts} +0 -0
- /package/runtime/lib/{snapshotInstanceHydrationMap.js → snapshot/snapshotInstanceHydrationMap.js} +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/api/animation/animation.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/api/animation/animation.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/api/animation/effect.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/api/animation/effect.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/api/element.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/api/element.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/api/lepusQuerySelector.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/api/lynxApi.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/api/lynxApi.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/bindings.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/bindings.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/events.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/events.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/index.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/index.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/loadRuntime.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/loadRuntime.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/observers.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/observers.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/types.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/bindings/types.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/delayRunOnBackground.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/delayRunOnBackground.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/delayWorkletEvent.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/delayWorkletEvent.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/eomImpl.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/eomImpl.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/eventPropagation.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/eventPropagation.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/global.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/global.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/hydrate.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/hydrate.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/index.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/index.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/jsFunctionLifecycle.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/jsFunctionLifecycle.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/listeners.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/listeners.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/runOnMainThread.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/runOnMainThread.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/utils/mainThreadFlushLoopGuard.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/utils/mainThreadFlushLoopGuard.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/utils/profile.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/utils/profile.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/utils/version.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/utils/version.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/workletRef.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/workletRef.js +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/workletRuntime.d.ts +0 -0
- /package/{worklet-runtime/lib → runtime/lib/worklet-runtime}/workletRuntime.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @lynx-js/react
|
|
2
2
|
|
|
3
|
+
## 0.118.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- refactor: create SnapshotInstance in renderToString directly ([#2393](https://github.com/lynx-family/lynx-stack/pull/2393))
|
|
8
|
+
|
|
9
|
+
- Add `removeCall` for shake function calls. Its initial default value matches the hooks that were previously in `removeCallParams`, and `removeCallParams` now defaults to empty. ([#2423](https://github.com/lynx-family/lynx-stack/pull/2423))
|
|
10
|
+
|
|
11
|
+
`removeCall` removes matched runtime hook calls entirely, replacing them with `undefined` in expression positions and dropping them in statement positions. `removeCallParams` keeps the existing behavior of preserving the call while stripping its arguments.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Improve `shake.removeCall` and `shake.removeCallParams` in the React transform so they also match aliased runtime imports such as `import { useEffect as myUseEffect } ...` and member calls such as `ReactLynxRuntime.useEffect(...)` from default or namespace runtime imports. ([#2437](https://github.com/lynx-family/lynx-stack/pull/2437))
|
|
16
|
+
|
|
17
|
+
- Create element without ref for suspense in main thread. ([#2426](https://github.com/lynx-family/lynx-stack/pull/2426))
|
|
18
|
+
|
|
19
|
+
- refactor: make `useEffect`, `useLayoutEffect` and `useImperativeHandle` no-op on the main thread ([#2424](https://github.com/lynx-family/lynx-stack/pull/2424))
|
|
20
|
+
|
|
21
|
+
## 0.117.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Update preact version to simplify `setProperty` implementation ([#2367](https://github.com/lynx-family/lynx-stack/pull/2367))
|
|
26
|
+
|
|
3
27
|
## 0.117.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.118.0",
|
|
4
4
|
"description": "ReactLynx is a framework for developing Lynx applications with familiar React.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -76,16 +76,16 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"./worklet-runtime": {
|
|
79
|
-
"types": "./worklet-runtime/
|
|
80
|
-
"default": "./worklet-runtime/
|
|
79
|
+
"types": "./runtime/lib/worklet-runtime/index.d.ts",
|
|
80
|
+
"default": "./runtime/worklet-runtime/main.js"
|
|
81
81
|
},
|
|
82
82
|
"./worklet-dev-runtime": {
|
|
83
|
-
"types": "./worklet-runtime/
|
|
84
|
-
"default": "./worklet-runtime/
|
|
83
|
+
"types": "./runtime/lib/worklet-runtime/index.d.ts",
|
|
84
|
+
"default": "./runtime/worklet-runtime/dev.js"
|
|
85
85
|
},
|
|
86
86
|
"./worklet-runtime/bindings": {
|
|
87
|
-
"types": "./worklet-runtime/
|
|
88
|
-
"default": "./worklet-runtime/
|
|
87
|
+
"types": "./runtime/lib/worklet-runtime/bindings/index.d.ts",
|
|
88
|
+
"default": "./runtime/lib/worklet-runtime/bindings/index.js"
|
|
89
89
|
},
|
|
90
90
|
"./legacy-react-runtime": {
|
|
91
91
|
"types": "./runtime/lib/legacy-react-runtime/index.d.ts",
|
|
@@ -143,13 +143,13 @@
|
|
|
143
143
|
"./components/lib/index.d.ts"
|
|
144
144
|
],
|
|
145
145
|
"worklet-runtime": [
|
|
146
|
-
"./worklet-runtime/
|
|
146
|
+
"./runtime/lib/worklet-runtime/index.d.ts"
|
|
147
147
|
],
|
|
148
148
|
"worklet-dev-runtime": [
|
|
149
|
-
"./worklet-runtime/
|
|
149
|
+
"./runtime/lib/worklet-runtime/index.d.ts"
|
|
150
150
|
],
|
|
151
151
|
"worklet-runtime/bindings": [
|
|
152
|
-
"./worklet-runtime/
|
|
152
|
+
"./runtime/lib/worklet-runtime/bindings/index.d.ts"
|
|
153
153
|
],
|
|
154
154
|
"legacy-react-runtime": [
|
|
155
155
|
"./runtime/lib/legacy-react-runtime/index.d.ts"
|
|
@@ -163,7 +163,6 @@
|
|
|
163
163
|
"transform",
|
|
164
164
|
"types",
|
|
165
165
|
"docs",
|
|
166
|
-
"worklet-runtime",
|
|
167
166
|
"testing-library",
|
|
168
167
|
"CHANGELOG.md",
|
|
169
168
|
"internal.js",
|
|
@@ -171,11 +170,11 @@
|
|
|
171
170
|
"README.zh.md"
|
|
172
171
|
],
|
|
173
172
|
"dependencies": {
|
|
174
|
-
"preact": "npm:@lynx-js/internal-preact@10.28.4-
|
|
173
|
+
"preact": "npm:@lynx-js/internal-preact@10.28.4-4842985"
|
|
175
174
|
},
|
|
176
175
|
"devDependencies": {
|
|
177
176
|
"@lynx-js/types": "3.7.0",
|
|
178
|
-
"@microsoft/api-extractor": "7.
|
|
177
|
+
"@microsoft/api-extractor": "7.58.2",
|
|
179
178
|
"@types/react": "^18.3.28"
|
|
180
179
|
},
|
|
181
180
|
"peerDependencies": {
|
|
@@ -188,6 +187,7 @@
|
|
|
188
187
|
}
|
|
189
188
|
},
|
|
190
189
|
"scripts": {
|
|
191
|
-
"api-extractor": "api-extractor run --verbose"
|
|
190
|
+
"api-extractor": "api-extractor run --verbose",
|
|
191
|
+
"build": "rslib build"
|
|
192
192
|
}
|
|
193
193
|
}
|
package/runtime/lazy/internal.js
CHANGED
|
@@ -6,7 +6,15 @@ import { sExportsReactInternal, target } from './target.js';
|
|
|
6
6
|
|
|
7
7
|
export const {
|
|
8
8
|
BackgroundSnapshotInstance,
|
|
9
|
+
CHILDREN,
|
|
10
|
+
COMPONENT,
|
|
9
11
|
Component,
|
|
12
|
+
DIFF,
|
|
13
|
+
DIRTY,
|
|
14
|
+
DOM,
|
|
15
|
+
FLAGS,
|
|
16
|
+
INDEX,
|
|
17
|
+
PARENT,
|
|
10
18
|
__ComponentIsPolyfill,
|
|
11
19
|
__DynamicPartChildren,
|
|
12
20
|
__DynamicPartChildren_0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
|
-
import { SnapshotInstance } from '@lynx-js/react/internal';
|
|
4
|
+
import { CHILDREN, COMPONENT, DIFF, DIRTY, DOM, FLAGS, INDEX, PARENT, SnapshotInstance } from '@lynx-js/react/internal';
|
|
5
5
|
|
|
6
6
|
function createVNode(type, props, _key) {
|
|
7
7
|
if (typeof type === 'string') {
|
|
@@ -9,15 +9,15 @@ function createVNode(type, props, _key) {
|
|
|
9
9
|
|
|
10
10
|
r.props = props;
|
|
11
11
|
|
|
12
|
-
r
|
|
13
|
-
r
|
|
14
|
-
r
|
|
15
|
-
r
|
|
16
|
-
r
|
|
17
|
-
r
|
|
12
|
+
r[CHILDREN] = null;
|
|
13
|
+
r[PARENT] = null;
|
|
14
|
+
r[DIFF] = 0;
|
|
15
|
+
r[DOM] = null;
|
|
16
|
+
r[DIRTY] = undefined;
|
|
17
|
+
r[COMPONENT] = null;
|
|
18
18
|
// r.__v = --vnodeId;
|
|
19
|
-
r
|
|
20
|
-
r
|
|
19
|
+
r[INDEX] = -1;
|
|
20
|
+
r[FLAGS] = 0;
|
|
21
21
|
|
|
22
22
|
return r;
|
|
23
23
|
} else if (typeof type === 'function') {
|
|
@@ -48,16 +48,16 @@ function createVNode(type, props, _key) {
|
|
|
48
48
|
type,
|
|
49
49
|
props: normalizedProps,
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
[CHILDREN]: null,
|
|
52
|
+
[PARENT]: null,
|
|
53
|
+
[DIFF]: 0,
|
|
54
|
+
[DOM]: null,
|
|
55
|
+
[DIRTY]: void 0,
|
|
56
|
+
[COMPONENT]: null,
|
|
57
57
|
constructor: void 0,
|
|
58
58
|
// __v: --vnodeId,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
[INDEX]: -1,
|
|
60
|
+
[FLAGS]: 0,
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BackgroundSnapshotInstance } from '../backgroundSnapshot.js';
|
|
2
|
-
import { SnapshotInstance } from '../snapshot.js';
|
|
3
|
-
import type { SerializedSnapshotInstance } from '../snapshot.js';
|
|
1
|
+
import { BackgroundSnapshotInstance } from '../snapshot/backgroundSnapshot.js';
|
|
2
|
+
import { SnapshotInstance } from '../snapshot/snapshot.js';
|
|
3
|
+
import type { SerializedSnapshotInstance } from '../snapshot/types.js';
|
|
4
4
|
export declare function printSnapshotInstance(instance: BackgroundSnapshotInstance | SnapshotInstance, log?: (...data: any[]) => void): void;
|
|
5
5
|
export declare function printSerializedSnapshotInstance(instance: SerializedSnapshotInstance, log?: (...data: any[]) => void): void;
|
|
6
6
|
export declare function printSnapshotInstanceToString(instance: SnapshotInstance | BackgroundSnapshotInstance | SerializedSnapshotInstance): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
|
-
import { BackgroundSnapshotInstance } from '../backgroundSnapshot.js';
|
|
5
|
-
import { SnapshotInstance } from '../snapshot.js';
|
|
6
4
|
import { logDebug } from './debug.js';
|
|
5
|
+
import { BackgroundSnapshotInstance } from '../snapshot/backgroundSnapshot.js';
|
|
6
|
+
import { SnapshotInstance } from '../snapshot/snapshot.js';
|
|
7
7
|
export function printSnapshotInstance(instance, log) {
|
|
8
8
|
const impl = (instance, level) => {
|
|
9
9
|
let msg = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printSnapshot.js","sourceRoot":"","sources":["../../src/debug/printSnapshot.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"printSnapshot.js","sourceRoot":"","sources":["../../src/debug/printSnapshot.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,MAAM,UAAU,qBAAqB,CACnC,QAAuD,EACvD,GAA8B;IAE9B,MAAM,IAAI,GAAG,CACX,QAAuD,EACvD,KAAa,EACb,EAAE;QACF,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAA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C,QAAoF;IAEpF,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,QAAQ,YAAY,gBAAgB,IAAI,QAAQ,YAAY,0BAA0B,EAAE,CAAC;QAC3F,qBAAqB,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5D,CAAC;SAAM,CAAC;QACN,+BAA+B,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
|
-
|
|
4
|
+
import { noop } from '../utils.js';
|
|
5
5
|
export const isProfiling = /* @__PURE__ */ Boolean(lynx.performance?.isProfileRecording?.());
|
|
6
|
-
const noop = () => { };
|
|
7
6
|
const noopFlowId = () => 0;
|
|
8
7
|
export const profileStart = /* @__PURE__ */ ((() => {
|
|
9
8
|
let p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/debug/profile.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/debug/profile.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,WAAW,GAAY,eAAe,CAAC,OAAO,CACzD,IAAI,CAAC,WAAW,EAAE,kBAAkB,EAAE,EAAE,CACzC,CAAC;AAEF,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,EAAE;IACjD,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,CAAC,YAAY,KAAK,UAAU,EAAE,CAAC;QACpE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC,EAAE,CAAyC,CAAC;AAE9C,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,EAAE;IAC/C,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC,CAAC,EAAE,CAAuC,CAAC;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,EAAE;IAClD,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,CAAC,aAAa,KAAK,UAAU,EAAE,CAAC;QACrE,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC,CAAC,EAAE,CAA0C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BackgroundSnapshotInstance } from './backgroundSnapshot.js';
|
|
2
|
-
import { SnapshotInstance } from './snapshot.js';
|
|
1
|
+
import { BackgroundSnapshotInstance } from './snapshot/backgroundSnapshot.js';
|
|
2
|
+
import { SnapshotInstance } from './snapshot/snapshot.js';
|
|
3
3
|
/**
|
|
4
4
|
* This module implements an Interface Adapter Pattern to integrate Preact's
|
|
5
5
|
* rendering system with Lynx's custom Snapshot-based virtual DOM.
|
package/runtime/lib/document.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
|
-
import { BackgroundSnapshotInstance } from './backgroundSnapshot.js';
|
|
5
|
-
import { SnapshotInstance } from './snapshot.js';
|
|
4
|
+
import { BackgroundSnapshotInstance } from './snapshot/backgroundSnapshot.js';
|
|
5
|
+
import { SnapshotInstance } from './snapshot/snapshot.js';
|
|
6
6
|
const document = {};
|
|
7
7
|
/**
|
|
8
8
|
* Sets up the document interface for the background thread.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"","sources":["../src/document.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../src/document.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAyB1D,MAAM,QAAQ,GAA4B,EAA6B,CAAC;AAExE;;;GAGG;AACH,SAAS,uBAAuB;IAC9B,QAAQ,CAAC,aAAa,GAAG,UAAS,IAAY;QAC5C,OAAO,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC,CAAC;IACF,QAAQ,CAAC,eAAe,GAAG,UAAS,GAAW,EAAE,IAAY;QAC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a,EAAE,CAAC"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import type { Worklet } from '@lynx-js/react/worklet-runtime/bindings';
|
|
2
|
-
export declare
|
|
3
|
-
COMPOSED
|
|
4
|
-
PAN
|
|
5
|
-
FLING
|
|
6
|
-
DEFAULT
|
|
7
|
-
TAP
|
|
8
|
-
LONGPRESS
|
|
9
|
-
ROTATION
|
|
10
|
-
PINCH
|
|
11
|
-
NATIVE
|
|
12
|
-
}
|
|
2
|
+
export declare const GestureTypeInner: {
|
|
3
|
+
readonly COMPOSED: -1;
|
|
4
|
+
readonly PAN: 0;
|
|
5
|
+
readonly FLING: 1;
|
|
6
|
+
readonly DEFAULT: 2;
|
|
7
|
+
readonly TAP: 3;
|
|
8
|
+
readonly LONGPRESS: 4;
|
|
9
|
+
readonly ROTATION: 5;
|
|
10
|
+
readonly PINCH: 6;
|
|
11
|
+
readonly NATIVE: 7;
|
|
12
|
+
};
|
|
13
|
+
export type GestureTypeInner = (typeof GestureTypeInner)[keyof typeof GestureTypeInner];
|
|
13
14
|
export interface GestureKind {
|
|
14
15
|
type: GestureTypeInner;
|
|
15
16
|
__isSerialized?: boolean;
|
|
16
17
|
__isGesture?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export interface ComposedGesture extends GestureKind {
|
|
19
|
-
type: GestureTypeInner
|
|
20
|
+
type: (typeof GestureTypeInner)['COMPOSED'];
|
|
20
21
|
gestures: GestureKind[];
|
|
21
22
|
}
|
|
22
23
|
export interface BaseGesture extends GestureKind {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})(GestureTypeInner || (GestureTypeInner = {}));
|
|
1
|
+
export const GestureTypeInner = {
|
|
2
|
+
COMPOSED: -1,
|
|
3
|
+
PAN: 0,
|
|
4
|
+
FLING: 1,
|
|
5
|
+
DEFAULT: 2,
|
|
6
|
+
TAP: 3,
|
|
7
|
+
LONGPRESS: 4,
|
|
8
|
+
ROTATION: 5,
|
|
9
|
+
PINCH: 6,
|
|
10
|
+
NATIVE: 7,
|
|
11
|
+
};
|
|
13
12
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/gesture/types.ts"],"names":[],"mappings":"AAKA,MAAM,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/gesture/types.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,CAAC,CAAC;IACZ,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC;IACV,GAAG,EAAE,CAAC;IACN,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC;IACX,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;CACD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useContext, useDebugValue, useErrorBoundary, useId,
|
|
1
|
+
import { useCallback, useContext, useDebugValue, useErrorBoundary, useId, useMemo, useState as usePreactState, useImperativeHandle as usePreactUseImperativeHandle, useReducer, useRef } from 'preact/hooks';
|
|
2
2
|
import type { DependencyList, EffectCallback } from 'react';
|
|
3
3
|
declare const useState: typeof usePreactState;
|
|
4
4
|
/**
|
|
@@ -24,4 +24,5 @@ declare const useEffect: (effect: EffectCallback, deps?: DependencyList) => void
|
|
|
24
24
|
* @deprecated `useLayoutEffect` in the background thread cannot offer the precise timing for reading layout information and synchronously re-render, which is different from React.
|
|
25
25
|
*/
|
|
26
26
|
declare const useLayoutEffect: (effect: EffectCallback, deps?: DependencyList) => void;
|
|
27
|
+
declare const useImperativeHandle: typeof usePreactUseImperativeHandle;
|
|
27
28
|
export { useState, useReducer, useRef, useImperativeHandle, useLayoutEffect, useEffect, useCallback, useMemo, useContext, useDebugValue, useErrorBoundary, useId, };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
|
-
import { useCallback, useContext, useDebugValue, useErrorBoundary, useId,
|
|
4
|
+
import { useCallback, useContext, useDebugValue, useErrorBoundary, useId, useMemo, useEffect as usePreactEffect, useState as usePreactState, useImperativeHandle as usePreactUseImperativeHandle, useReducer, useRef, } from 'preact/hooks';
|
|
5
5
|
import { isProfiling, profileEnd, profileFlowId, profileStart } from '../debug/profile.js';
|
|
6
|
+
import { noop } from '../utils.js';
|
|
6
7
|
// Cache profiled wrappers by the original preact setter to preserve stable
|
|
7
8
|
// identity without introducing extra hooks in component render flow.
|
|
8
9
|
const stateSetterTraceCache = /* @__PURE__ */ isProfiling
|
|
@@ -98,9 +99,11 @@ const useState = isProfiling
|
|
|
98
99
|
*
|
|
99
100
|
* @public
|
|
100
101
|
*/
|
|
101
|
-
const useEffect =
|
|
102
|
-
?
|
|
103
|
-
|
|
102
|
+
const useEffect = __BACKGROUND__
|
|
103
|
+
? (isProfiling
|
|
104
|
+
? useEffectProfiled
|
|
105
|
+
: usePreactEffect)
|
|
106
|
+
: noop;
|
|
104
107
|
/**
|
|
105
108
|
* `useLayoutEffect` is now an alias of `useEffect`. Use `useEffect` instead.
|
|
106
109
|
*
|
|
@@ -113,9 +116,12 @@ const useEffect = isProfiling
|
|
|
113
116
|
*
|
|
114
117
|
* @deprecated `useLayoutEffect` in the background thread cannot offer the precise timing for reading layout information and synchronously re-render, which is different from React.
|
|
115
118
|
*/
|
|
116
|
-
const useLayoutEffect =
|
|
117
|
-
?
|
|
118
|
-
|
|
119
|
+
const useLayoutEffect = __BACKGROUND__
|
|
120
|
+
? (isProfiling
|
|
121
|
+
? useLayoutEffectProfiled
|
|
122
|
+
: usePreactEffect)
|
|
123
|
+
: noop;
|
|
124
|
+
const useImperativeHandle = __BACKGROUND__ ? usePreactUseImperativeHandle : noop;
|
|
119
125
|
export {
|
|
120
126
|
// preact
|
|
121
127
|
useState, useReducer, useRef, useImperativeHandle, useLayoutEffect, useEffect, useCallback, useMemo, useContext, useDebugValue, useErrorBoundary, useId, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/hooks/react.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EACL,WAAW,EACX,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/hooks/react.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EACL,WAAW,EACX,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,OAAO,EACP,SAAS,IAAI,eAAe,EAC5B,QAAQ,IAAI,cAAc,EAC1B,mBAAmB,IAAI,4BAA4B,EACnD,UAAU,EACV,MAAM,GACP,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAInC,2EAA2E;AAC3E,qEAAqE;AACrE,MAAM,qBAAqB,GAA0D,eAAe,CAAC,WAAW;IAC9G,CAAC,CAAC,IAAI,OAAO,EAAoC;IACjD,CAAC,CAAC,SAAS,CAAC;AAEd,SAAS,gBAAgB,CAAC,MAAc,EAAE,KAAyB;IACjE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;IACD,OAAO;QACL,MAAM;QACN,IAAI,EAAE;YACJ,KAAK;SACN;KAC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Ac,CAAC;AAEnB;;;;;;;;GAQG;AACH,MAAM,SAAS,GAA4D,cAAc;IACvF,CAAC,CAAC,CAAC,WAAW;QACZ,CAAC,CAAC,iBAAiB;QACnB,CAAC,CAAC,eAAe,CAAC;IACpB,CAAC,CAAC,IAAI,CAAC;AAET;;;;;;;;;;;GAWG;AACH,MAAM,eAAe,GAA4D,cAAc;IAC7F,CAAC,CAAC,CAAC,WAAW;QACZ,CAAC,CAAC,uBAAuB;QACzB,CAAC,CAAC,eAAe,CAAC;IACpB,CAAC,CAAC,IAAI,CAAC;AAET,MAAM,mBAAmB,GAAwC,cAAc,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,IAAI,CAAC;AAEtH,OAAO;AACL,SAAS;AACT,QAAQ,EACR,UAAU,EACV,MAAM,EACN,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,WAAW,EACX,OAAO,EACP,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,KAAK,GACN,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import './lynx.js';
|
|
2
|
-
import { BackgroundSnapshotInstance } from './backgroundSnapshot.js';
|
|
3
2
|
import { __root } from './root.js';
|
|
3
|
+
import { BackgroundSnapshotInstance } from './snapshot/backgroundSnapshot.js';
|
|
4
|
+
import { __page, __pageId, createSnapshot, snapshotManager } from './snapshot/definition.js';
|
|
4
5
|
import { DynamicPartType } from './snapshot/dynamicPartType.js';
|
|
5
6
|
import { snapshotCreateList } from './snapshot/list.js';
|
|
6
|
-
import { SnapshotInstance,
|
|
7
|
+
import { SnapshotInstance, snapshotCreatorMap } from './snapshot/snapshot.js';
|
|
8
|
+
export { CHILDREN, COMPONENT, DIFF, DIRTY, DOM, FLAGS, INDEX, PARENT } from './renderToOpcodes/constants.js';
|
|
7
9
|
export { __page, __pageId, __root };
|
|
8
10
|
export { BackgroundSnapshotInstance, SnapshotInstance, snapshotCreateList, createSnapshot, snapshotManager, snapshotCreatorMap, };
|
|
9
11
|
export declare const __DynamicPartSlot: DynamicPartType;
|
|
10
12
|
export declare const __DynamicPartMultiChildren: DynamicPartType;
|
|
11
13
|
export declare const __DynamicPartChildren: DynamicPartType;
|
|
12
14
|
export declare const __DynamicPartListChildren: DynamicPartType;
|
|
13
|
-
export { __DynamicPartChildren_0 } from './snapshot.js';
|
|
15
|
+
export { __DynamicPartChildren_0 } from './snapshot/dynamicPartType.js';
|
|
14
16
|
export { updateSpread } from './snapshot/spread.js';
|
|
15
17
|
export { updateEvent } from './snapshot/event.js';
|
|
16
18
|
export { updateRef, transformRef } from './snapshot/ref.js';
|
package/runtime/lib/internal.js
CHANGED
|
@@ -3,21 +3,23 @@
|
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
import { Suspense, createElement, lazy } from 'preact/compat';
|
|
5
5
|
import './lynx.js';
|
|
6
|
-
import { BackgroundSnapshotInstance } from './backgroundSnapshot.js';
|
|
7
6
|
import { factory as factory2 } from './compat/componentIs.js';
|
|
8
7
|
import { useMemo } from './hooks/react.js';
|
|
9
8
|
import { loadLazyBundle } from './lynx/lazy-bundle.js';
|
|
10
9
|
import { __root } from './root.js';
|
|
10
|
+
import { BackgroundSnapshotInstance } from './snapshot/backgroundSnapshot.js';
|
|
11
|
+
import { __page, __pageId, createSnapshot, snapshotManager } from './snapshot/definition.js';
|
|
11
12
|
import { DynamicPartType } from './snapshot/dynamicPartType.js';
|
|
12
13
|
import { snapshotCreateList } from './snapshot/list.js';
|
|
13
|
-
import { SnapshotInstance,
|
|
14
|
+
import { SnapshotInstance, snapshotCreatorMap } from './snapshot/snapshot.js';
|
|
15
|
+
export { CHILDREN, COMPONENT, DIFF, DIRTY, DOM, FLAGS, INDEX, PARENT } from './renderToOpcodes/constants.js';
|
|
14
16
|
export { __page, __pageId, __root };
|
|
15
17
|
export { BackgroundSnapshotInstance, SnapshotInstance, snapshotCreateList, createSnapshot, snapshotManager, snapshotCreatorMap, };
|
|
16
18
|
export const __DynamicPartSlot = DynamicPartType.Slot;
|
|
17
19
|
export const __DynamicPartMultiChildren = DynamicPartType.MultiChildren;
|
|
18
20
|
export const __DynamicPartChildren = DynamicPartType.Children;
|
|
19
21
|
export const __DynamicPartListChildren = DynamicPartType.ListChildren;
|
|
20
|
-
export { __DynamicPartChildren_0 } from './snapshot.js';
|
|
22
|
+
export { __DynamicPartChildren_0 } from './snapshot/dynamicPartType.js';
|
|
21
23
|
export { updateSpread } from './snapshot/spread.js';
|
|
22
24
|
export { updateEvent } from './snapshot/event.js';
|
|
23
25
|
export { updateRef, transformRef } from './snapshot/ref.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,WAAW,CAAC;AAEnB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,WAAW,CAAC;AAEnB,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,+BA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AAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAuB,eAAe,CAAC,QAAQ;AAC/E,iEAAiE;AACjE,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAS,EACjD,cAAc,CACf,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const LifecycleConstant: {
|
|
2
|
+
readonly firstScreen: "rLynxFirstScreen";
|
|
3
|
+
readonly updateFromRoot: "updateFromRoot";
|
|
4
|
+
readonly globalEventFromLepus: "globalEventFromLepus";
|
|
5
|
+
readonly jsReady: "rLynxJSReady";
|
|
6
|
+
readonly patchUpdate: "rLynxChange";
|
|
7
|
+
readonly publishEvent: "rLynxPublishEvent";
|
|
8
|
+
readonly updateMTRefInitValue: "rLynxChangeRefInitValue";
|
|
9
|
+
};
|
|
10
|
+
export type LifecycleConstant = (typeof LifecycleConstant)[keyof typeof LifecycleConstant];
|
|
11
|
+
export interface FirstScreenData {
|
|
12
|
+
root: string;
|
|
13
|
+
jsReadyEventIdSwap: Record<string | number, number>;
|
|
14
|
+
}
|
|
15
|
+
export declare const NativeUpdateDataType: {
|
|
16
|
+
readonly UPDATE: 0;
|
|
17
|
+
readonly RESET: 1;
|
|
18
|
+
};
|
|
19
|
+
export type NativeUpdateDataType = (typeof NativeUpdateDataType)[keyof typeof NativeUpdateDataType];
|
|
@@ -0,0 +1,17 @@
|
|
|
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 LifecycleConstant = {
|
|
5
|
+
firstScreen: 'rLynxFirstScreen',
|
|
6
|
+
updateFromRoot: 'updateFromRoot',
|
|
7
|
+
globalEventFromLepus: 'globalEventFromLepus',
|
|
8
|
+
jsReady: 'rLynxJSReady',
|
|
9
|
+
patchUpdate: 'rLynxChange',
|
|
10
|
+
publishEvent: 'rLynxPublishEvent',
|
|
11
|
+
updateMTRefInitValue: 'rLynxChangeRefInitValue',
|
|
12
|
+
};
|
|
13
|
+
export const NativeUpdateDataType = {
|
|
14
|
+
UPDATE: 0,
|
|
15
|
+
RESET: 1,
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../src/lifecycle/constant.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,kBAAkB;IAC/B,cAAc,EAAE,gBAAgB;IAChC,oBAAoB,EAAE,sBAAsB;IAC5C,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,mBAAmB;IACjC,oBAAoB,EAAE,yBAAyB;CACvC,CAAC;AASX,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;CACA,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LifecycleConstant } from '../../
|
|
1
|
+
import type { LifecycleConstant } from '../../lifecycle/constant.js';
|
|
2
2
|
declare const delayedLifecycleEvents: [type: LifecycleConstant, data: unknown][];
|
|
3
3
|
declare function delayLifecycleEvent(type: LifecycleConstant, data: unknown): void;
|
|
4
4
|
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
import { profileEnd, profileStart } from '../../debug/profile.js';
|
|
5
|
-
import { LifecycleConstant } from '../../
|
|
5
|
+
import { LifecycleConstant } from '../../lifecycle/constant.js';
|
|
6
6
|
import { __root } from '../../root.js';
|
|
7
7
|
let isJSReady;
|
|
8
8
|
let jsReadyEventIdSwap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsReady.js","sourceRoot":"","sources":["../../../src/lifecycle/event/jsReady.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"jsReady.js","sourceRoot":"","sources":["../../../src/lifecycle/event/jsReady.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,IAAI,SAAkB,CAAC;AACvB,IAAI,kBAAmD,CAAC;AAExD,SAAS,OAAO;IACd,SAAS,GAAG,IAAI,CAAC;IAEjB,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,WAAW,EAAE,CAAC;QACtD,YAAY,CAAC,yBAAyB,CAAC,CAAC;QACxC,YAAY,CAAC,0BAA0B,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,WAAW,EAAE,CAAC;QACtD,UAAU,EAAE,CAAC;IACf,CAAC;IACD,kBAAkB,CAAC;QACjB,iBAAiB,CAAC,WAAW,EAAE,kBAAkB;QACjD;YACE,IAAI;YACJ,kBAAkB;SACnB;KACF,CAAC,CAAC;IACH,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,WAAW,EAAE,CAAC;QACtD,UAAU,EAAE,CAAC;IACf,CAAC;IACD,kBAAkB,GAAG,EAAE,CAAC;AAC1B,CAAC;AAED,SAAS,uBAAuB;IAC9B,kBAAkB,GAAG,EAAE,CAAC;AAC1B,CAAC;AAED,SAAS,YAAY;IACnB,SAAS,GAAG,KAAK,CAAC;IAClB,kBAAkB,GAAG,EAAE,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -12,14 +12,12 @@ const setIsRendering = () => {
|
|
|
12
12
|
isRendering.value = false;
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
const onRenderHook = (old, ...args) => {
|
|
16
16
|
/* v8 ignore next */
|
|
17
|
-
old
|
|
17
|
+
if (old)
|
|
18
|
+
old(...args);
|
|
18
19
|
setIsRendering();
|
|
19
|
-
}
|
|
20
|
-
hook(options,
|
|
21
|
-
|
|
22
|
-
old?.(...args);
|
|
23
|
-
setIsRendering();
|
|
24
|
-
});
|
|
20
|
+
};
|
|
21
|
+
hook(options, RENDER_COMPONENT, onRenderHook);
|
|
22
|
+
hook(options, ROOT, onRenderHook);
|
|
25
23
|
//# sourceMappingURL=isRendering.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isRendering.js","sourceRoot":"","sources":["../../src/lifecycle/isRendering.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,Q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C;AAEF,IAAI,CAAC,OAAO,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAC9C,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { RunWorkletCtxData } from '@lynx-js/react/worklet-runtime/bindings';
|
|
2
|
+
import { globalBackgroundSnapshotInstancesToRemove } from './globalState.js';
|
|
2
3
|
import type { SnapshotPatch } from './snapshotPatch.js';
|
|
3
4
|
declare let globalFlushOptions: FlushOptions;
|
|
4
5
|
declare const globalCommitTaskMap: Map<number, () => void>;
|
|
5
|
-
declare let globalBackgroundSnapshotInstancesToRemove: number[];
|
|
6
6
|
/**
|
|
7
7
|
* A single patch operation.
|
|
8
8
|
*/
|