@lynx-js/react 0.118.0 → 0.120.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 +70 -0
- package/package.json +28 -6
- package/refresh/.turbo/turbo-build.log +1 -1
- package/runtime/lazy/internal.js +3 -0
- package/runtime/lib/document.d.ts +4 -4
- package/runtime/lib/document.js +14 -12
- package/runtime/lib/document.js.map +1 -1
- package/runtime/lib/index.d.ts +3 -3
- package/runtime/lib/index.js +4 -4
- package/runtime/lib/index.js.map +1 -1
- package/runtime/lib/internal.d.ts +23 -20
- package/runtime/lib/internal.js +27 -23
- package/runtime/lib/internal.js.map +1 -1
- package/runtime/lib/lynx-api.d.ts +5 -5
- package/runtime/lib/lynx-api.js +9 -9
- package/runtime/lib/lynx-api.js.map +1 -1
- package/runtime/lib/lynx.d.ts +2 -2
- package/runtime/lib/lynx.js +17 -17
- package/runtime/lib/lynx.js.map +1 -1
- 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/{alog → snapshot/alog}/elementPAPICall.js +1 -0
- package/runtime/lib/snapshot/alog/elementPAPICall.js.map +1 -0
- package/runtime/lib/snapshot/alog/index.js.map +1 -0
- package/runtime/lib/{alog → snapshot/alog}/render.js +1 -1
- package/runtime/lib/snapshot/alog/render.js.map +1 -0
- package/runtime/lib/snapshot/compat/componentIs.js.map +1 -0
- package/runtime/lib/snapshot/compat/initData.js.map +1 -0
- package/runtime/lib/snapshot/compat/lynxComponent.js.map +1 -0
- package/runtime/lib/{debug → snapshot/debug}/component-stack.d.ts +0 -6
- package/runtime/lib/snapshot/debug/component-stack.js.map +1 -0
- package/runtime/lib/snapshot/debug/debug.js.map +1 -0
- package/runtime/lib/snapshot/debug/describeInvalidValue.js.map +1 -0
- package/runtime/lib/snapshot/debug/formatPatch.js.map +1 -0
- package/runtime/lib/snapshot/debug/printSnapshot.js.map +1 -0
- package/runtime/lib/{debug → snapshot/debug}/profile.js +1 -1
- package/runtime/lib/snapshot/debug/profile.js.map +1 -0
- package/runtime/lib/{debug → snapshot/debug}/profileHooks.js +1 -1
- package/runtime/lib/snapshot/debug/profileHooks.js.map +1 -0
- package/runtime/lib/snapshot/debug/vnodeSource.js.map +1 -0
- package/runtime/lib/snapshot/gesture/processGesture.js +172 -0
- package/runtime/lib/snapshot/gesture/processGesture.js.map +1 -0
- package/runtime/lib/snapshot/gesture/processGestureBagkround.d.ts +9 -0
- package/runtime/lib/snapshot/gesture/processGestureBagkround.js +80 -0
- package/runtime/lib/snapshot/gesture/processGestureBagkround.js.map +1 -0
- package/runtime/lib/snapshot/gesture/types.js.map +1 -0
- package/runtime/lib/snapshot/hooks/mainThread.d.ts +17 -0
- package/runtime/lib/snapshot/hooks/mainThread.js +152 -0
- package/runtime/lib/snapshot/hooks/mainThread.js.map +1 -0
- package/runtime/lib/{hooks → snapshot/hooks}/react.d.ts +1 -2
- package/runtime/lib/{hooks → snapshot/hooks}/react.js +8 -14
- package/runtime/lib/snapshot/hooks/react.js.map +1 -0
- package/runtime/lib/snapshot/hooks/useLynxGlobalEventListener.js.map +1 -0
- package/runtime/lib/snapshot/index.d.ts +1 -4
- package/runtime/lib/snapshot/index.js +2 -5
- package/runtime/lib/snapshot/index.js.map +1 -1
- package/runtime/lib/snapshot/legacy-react-runtime/index.js.map +1 -0
- package/runtime/lib/snapshot/lifecycle/constant.js.map +1 -0
- package/runtime/lib/{lifecycle → snapshot/lifecycle}/destroy.js +1 -1
- package/runtime/lib/snapshot/lifecycle/destroy.js.map +1 -0
- package/runtime/lib/snapshot/lifecycle/event/delayEvents.js.map +1 -0
- package/runtime/lib/snapshot/lifecycle/event/delayLifecycleEvents.js.map +1 -0
- package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/jsReady.js +4 -2
- package/runtime/lib/snapshot/lifecycle/event/jsReady.js.map +1 -0
- package/runtime/lib/{lifecycle → snapshot/lifecycle}/isRendering.js +1 -1
- package/runtime/lib/snapshot/lifecycle/isRendering.js.map +1 -0
- package/runtime/lib/snapshot/lifecycle/pass.js.map +1 -0
- package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/commit.js +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -0
- package/runtime/lib/snapshot/lifecycle/patch/error.js.map +1 -0
- package/runtime/lib/snapshot/lifecycle/patch/globalState.js.map +1 -0
- package/runtime/lib/snapshot/lifecycle/patch/isMainThreadHydrating.js.map +1 -0
- package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/snapshotPatch.js +10 -2
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.js.map +1 -0
- package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/snapshotPatchApply.js +2 -0
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js.map +1 -0
- package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -0
- package/runtime/lib/snapshot/lifecycle/ref/delay.js.map +1 -0
- package/runtime/lib/{lifecycle → snapshot/lifecycle}/reload.js +2 -2
- package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -0
- package/runtime/lib/{lifecycle → snapshot/lifecycle}/render.js +1 -7
- package/runtime/lib/snapshot/lifecycle/render.js.map +1 -0
- package/runtime/lib/{list → snapshot/list}/list.js +1 -1
- package/runtime/lib/snapshot/list/list.js.map +1 -0
- package/runtime/lib/snapshot/list/listUpdateInfo.js.map +1 -0
- package/runtime/lib/snapshot/list/pendingListUpdates.js.map +1 -0
- package/runtime/lib/{lynx → snapshot/lynx}/calledByNative.js +2 -2
- package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -0
- package/runtime/lib/snapshot/lynx/component.js.map +1 -0
- package/runtime/lib/snapshot/lynx/dynamic-js.js.map +1 -0
- package/runtime/lib/{lynx → snapshot/lynx}/env.js +0 -3
- package/runtime/lib/snapshot/lynx/env.js.map +1 -0
- package/runtime/lib/snapshot/lynx/injectLepusMethods.js.map +1 -0
- package/runtime/lib/snapshot/lynx/lazy-bundle.js.map +1 -0
- package/runtime/lib/{lynx → snapshot/lynx}/performance.js +1 -1
- package/runtime/lib/snapshot/lynx/performance.js.map +1 -0
- package/runtime/lib/{lynx → snapshot/lynx}/runWithForce.js +1 -1
- package/runtime/lib/snapshot/lynx/runWithForce.js.map +1 -0
- package/runtime/lib/{lynx → snapshot/lynx}/suspense.js +27 -17
- package/runtime/lib/snapshot/lynx/suspense.js.map +1 -0
- package/runtime/lib/{lynx → snapshot/lynx}/tt.js +1 -1
- package/runtime/lib/snapshot/lynx/tt.js.map +1 -0
- package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/constants.d.ts +1 -0
- package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/constants.js +1 -0
- package/runtime/lib/snapshot/renderToOpcodes/constants.js.map +1 -0
- package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/hydrate.js +21 -4
- package/runtime/lib/snapshot/renderToOpcodes/hydrate.js.map +1 -0
- package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/index.js +37 -14
- package/runtime/lib/snapshot/renderToOpcodes/index.js.map +1 -0
- package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/opcodes.js +4 -2
- package/runtime/lib/snapshot/renderToOpcodes/opcodes.js.map +1 -0
- package/runtime/lib/snapshot/{backgroundSnapshot.d.ts → snapshot/backgroundSnapshot.d.ts} +1 -0
- package/runtime/lib/snapshot/{backgroundSnapshot.js → snapshot/backgroundSnapshot.js} +82 -53
- package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -0
- package/runtime/lib/snapshot/snapshot/constants.js.map +1 -0
- package/runtime/lib/snapshot/{definition.d.ts → snapshot/definition.d.ts} +1 -0
- package/runtime/lib/snapshot/{definition.js → snapshot/definition.js} +6 -2
- package/runtime/lib/snapshot/snapshot/definition.js.map +1 -0
- package/runtime/lib/snapshot/{dynamicPartType.d.ts → snapshot/dynamicPartType.d.ts} +2 -0
- package/runtime/lib/snapshot/{dynamicPartType.js → snapshot/dynamicPartType.js} +2 -0
- package/runtime/lib/snapshot/snapshot/dynamicPartType.js.map +1 -0
- package/runtime/lib/snapshot/snapshot/event.js.map +1 -0
- package/runtime/lib/snapshot/snapshot/gesture.js.map +1 -0
- package/runtime/lib/snapshot/snapshot/index.d.ts +4 -0
- package/runtime/lib/snapshot/snapshot/index.js +8 -0
- package/runtime/lib/snapshot/snapshot/index.js.map +1 -0
- package/runtime/lib/snapshot/snapshot/list.js.map +1 -0
- package/runtime/lib/snapshot/snapshot/platformInfo.js.map +1 -0
- package/runtime/lib/snapshot/{ref.d.ts → snapshot/ref.d.ts} +1 -0
- package/runtime/lib/snapshot/{ref.js → snapshot/ref.js} +13 -1
- package/runtime/lib/snapshot/snapshot/ref.js.map +1 -0
- package/runtime/lib/snapshot/{snapshot.d.ts → snapshot/snapshot.d.ts} +1 -0
- package/runtime/lib/snapshot/{snapshot.js → snapshot/snapshot.js} +28 -8
- package/runtime/lib/snapshot/snapshot/snapshot.js.map +1 -0
- package/runtime/lib/snapshot/snapshot/snapshotInstanceHydrationMap.js.map +1 -0
- package/runtime/lib/snapshot/{spread.js → snapshot/spread.js} +4 -4
- package/runtime/lib/snapshot/snapshot/spread.js.map +1 -0
- package/runtime/lib/snapshot/{types.d.ts → snapshot/types.d.ts} +1 -0
- package/runtime/lib/snapshot/snapshot/types.js.map +1 -0
- package/runtime/lib/snapshot/snapshot/utils.js.map +1 -0
- package/runtime/lib/snapshot/snapshot/workletEvent.js.map +1 -0
- package/runtime/lib/snapshot/snapshot/workletRef.js.map +1 -0
- package/runtime/lib/snapshot/worklet/call/delayedRunOnMainThreadData.js.map +1 -0
- package/runtime/lib/snapshot/worklet/call/execMap.js.map +1 -0
- package/runtime/lib/snapshot/worklet/call/functionCall.js.map +1 -0
- package/runtime/lib/snapshot/worklet/call/runOnBackground.js.map +1 -0
- package/runtime/lib/snapshot/worklet/call/runOnMainThread.js.map +1 -0
- package/runtime/lib/snapshot/worklet/call/transformToWorklet.js.map +1 -0
- package/runtime/lib/snapshot/worklet/ctx.js.map +1 -0
- package/runtime/lib/snapshot/worklet/destroy.js.map +1 -0
- package/runtime/lib/{worklet → snapshot/worklet}/functionality.js +1 -1
- package/runtime/lib/snapshot/worklet/functionality.js.map +1 -0
- package/runtime/lib/snapshot/worklet/hmr.js.map +1 -0
- package/runtime/lib/snapshot/worklet/indexMap.js.map +1 -0
- package/runtime/lib/snapshot/worklet/ref/updateInitValue.js.map +1 -0
- package/runtime/lib/snapshot/worklet/ref/workletRef.js.map +1 -0
- package/runtime/lib/snapshot/worklet/ref/workletRefPool.js.map +1 -0
- package/runtime/lib/tsconfig.tsbuildinfo +1 -1
- package/runtime/lib/utils.js +1 -1
- package/runtime/lib/utils.js.map +1 -1
- package/testing-library/README.md +48 -9
- package/testing-library/dist/0~123.js +43 -0
- package/testing-library/dist/881.js +1 -0
- package/testing-library/dist/entry.d.ts +1 -0
- package/testing-library/dist/env/index.d.ts +2 -0
- package/testing-library/dist/env/index.js +661 -0
- package/testing-library/dist/env/rstest.d.ts +1 -0
- package/testing-library/dist/env/rstest.js +6 -0
- package/testing-library/dist/env/vitest.d.ts +3 -0
- package/testing-library/dist/env/vitest.js +8 -662
- package/testing-library/dist/fire-event.d.ts +111 -0
- package/testing-library/dist/index.d.ts +18 -6
- package/testing-library/dist/plugins/index.d.ts +2 -0
- package/testing-library/dist/plugins/index.js +282 -0
- package/testing-library/dist/plugins/vitest.d.ts +26 -0
- package/testing-library/dist/pure.js +4 -4
- package/testing-library/dist/rstest-config.d.ts +25 -0
- package/testing-library/dist/rstest-config.js +61 -0
- package/testing-library/dist/setupFiles/common/bootstrap.js +2 -0
- package/testing-library/dist/setupFiles/common/runtime-setup.js +85 -0
- package/testing-library/dist/setupFiles/inner/rstest.js +7 -0
- package/testing-library/dist/setupFiles/inner/vitest.js +11 -0
- package/testing-library/dist/setupFiles/rstest.js +21 -0
- package/testing-library/dist/setupFiles/vitest.js +20 -0
- package/testing-library/dist/vitest.config.d.ts +6 -0
- package/testing-library/dist/vitest.config.js +4 -257
- package/transform/dist/wasm.cjs +450 -389
- package/transform/index.d.ts +10 -0
- package/types/react.docs.d.ts +1 -1
- package/runtime/lib/alog/elementPAPICall.js.map +0 -1
- package/runtime/lib/alog/index.js.map +0 -1
- package/runtime/lib/alog/render.js.map +0 -1
- package/runtime/lib/compat/componentIs.js.map +0 -1
- package/runtime/lib/compat/initData.js.map +0 -1
- package/runtime/lib/compat/lynxComponent.js.map +0 -1
- package/runtime/lib/debug/component-stack.js.map +0 -1
- package/runtime/lib/debug/debug.js.map +0 -1
- package/runtime/lib/debug/describeInvalidValue.js.map +0 -1
- package/runtime/lib/debug/formatPatch.js.map +0 -1
- package/runtime/lib/debug/printSnapshot.js.map +0 -1
- package/runtime/lib/debug/profile.js.map +0 -1
- package/runtime/lib/debug/profileHooks.js.map +0 -1
- package/runtime/lib/debug/vnodeSource.js.map +0 -1
- package/runtime/lib/gesture/processGesture.js +0 -58
- package/runtime/lib/gesture/processGesture.js.map +0 -1
- package/runtime/lib/gesture/processGestureBagkround.d.ts +0 -2
- package/runtime/lib/gesture/processGestureBagkround.js +0 -19
- package/runtime/lib/gesture/processGestureBagkround.js.map +0 -1
- package/runtime/lib/gesture/types.js.map +0 -1
- package/runtime/lib/hooks/react.js.map +0 -1
- package/runtime/lib/hooks/useLynxGlobalEventListener.js.map +0 -1
- package/runtime/lib/legacy-react-runtime/index.js.map +0 -1
- package/runtime/lib/lifecycle/constant.js.map +0 -1
- package/runtime/lib/lifecycle/destroy.js.map +0 -1
- package/runtime/lib/lifecycle/event/delayEvents.js.map +0 -1
- package/runtime/lib/lifecycle/event/delayLifecycleEvents.js.map +0 -1
- package/runtime/lib/lifecycle/event/jsReady.js.map +0 -1
- package/runtime/lib/lifecycle/isRendering.js.map +0 -1
- package/runtime/lib/lifecycle/pass.js.map +0 -1
- package/runtime/lib/lifecycle/patch/commit.js.map +0 -1
- package/runtime/lib/lifecycle/patch/error.js.map +0 -1
- package/runtime/lib/lifecycle/patch/globalState.js.map +0 -1
- package/runtime/lib/lifecycle/patch/isMainThreadHydrating.js.map +0 -1
- package/runtime/lib/lifecycle/patch/snapshotPatch.js.map +0 -1
- package/runtime/lib/lifecycle/patch/snapshotPatchApply.js.map +0 -1
- package/runtime/lib/lifecycle/patch/updateMainThread.js.map +0 -1
- package/runtime/lib/lifecycle/ref/delay.js.map +0 -1
- package/runtime/lib/lifecycle/reload.js.map +0 -1
- package/runtime/lib/lifecycle/render.js.map +0 -1
- package/runtime/lib/list/list.js.map +0 -1
- package/runtime/lib/list/listUpdateInfo.js.map +0 -1
- package/runtime/lib/list/pendingListUpdates.js.map +0 -1
- package/runtime/lib/lynx/calledByNative.js.map +0 -1
- package/runtime/lib/lynx/component.js.map +0 -1
- package/runtime/lib/lynx/dynamic-js.js.map +0 -1
- package/runtime/lib/lynx/env.js.map +0 -1
- package/runtime/lib/lynx/injectLepusMethods.js.map +0 -1
- package/runtime/lib/lynx/lazy-bundle.js.map +0 -1
- package/runtime/lib/lynx/performance.js.map +0 -1
- package/runtime/lib/lynx/runWithForce.js.map +0 -1
- package/runtime/lib/lynx/suspense.js.map +0 -1
- package/runtime/lib/lynx/tt.js.map +0 -1
- package/runtime/lib/renderToOpcodes/constants.js.map +0 -1
- package/runtime/lib/renderToOpcodes/hydrate.js.map +0 -1
- package/runtime/lib/renderToOpcodes/index.js.map +0 -1
- package/runtime/lib/renderToOpcodes/opcodes.js.map +0 -1
- package/runtime/lib/snapshot/backgroundSnapshot.js.map +0 -1
- package/runtime/lib/snapshot/constants.js.map +0 -1
- package/runtime/lib/snapshot/definition.js.map +0 -1
- package/runtime/lib/snapshot/dynamicPartType.js.map +0 -1
- package/runtime/lib/snapshot/event.js.map +0 -1
- package/runtime/lib/snapshot/gesture.js.map +0 -1
- package/runtime/lib/snapshot/list.js.map +0 -1
- package/runtime/lib/snapshot/platformInfo.js.map +0 -1
- package/runtime/lib/snapshot/ref.js.map +0 -1
- package/runtime/lib/snapshot/snapshot.js.map +0 -1
- package/runtime/lib/snapshot/snapshotInstanceHydrationMap.js.map +0 -1
- package/runtime/lib/snapshot/spread.js.map +0 -1
- package/runtime/lib/snapshot/types.js.map +0 -1
- package/runtime/lib/snapshot/utils.js.map +0 -1
- package/runtime/lib/snapshot/workletEvent.js.map +0 -1
- package/runtime/lib/snapshot/workletRef.js.map +0 -1
- package/runtime/lib/worklet/call/delayedRunOnMainThreadData.js.map +0 -1
- package/runtime/lib/worklet/call/execMap.js.map +0 -1
- package/runtime/lib/worklet/call/functionCall.js.map +0 -1
- package/runtime/lib/worklet/call/runOnBackground.js.map +0 -1
- package/runtime/lib/worklet/call/runOnMainThread.js.map +0 -1
- package/runtime/lib/worklet/call/transformToWorklet.js.map +0 -1
- package/runtime/lib/worklet/ctx.js.map +0 -1
- package/runtime/lib/worklet/destroy.js.map +0 -1
- package/runtime/lib/worklet/functionality.js.map +0 -1
- package/runtime/lib/worklet/hmr.js.map +0 -1
- package/runtime/lib/worklet/indexMap.js.map +0 -1
- package/runtime/lib/worklet/ref/updateInitValue.js.map +0 -1
- package/runtime/lib/worklet/ref/workletRef.js.map +0 -1
- package/runtime/lib/worklet/ref/workletRefPool.js.map +0 -1
- package/testing-library/dist/vitest-global-setup.js +0 -134
- package/testing-library/types/vitest-config.d.ts +0 -20
- /package/runtime/lib/{alog → snapshot/alog}/elementPAPICall.d.ts +0 -0
- /package/runtime/lib/{alog → snapshot/alog}/index.d.ts +0 -0
- /package/runtime/lib/{alog → snapshot/alog}/index.js +0 -0
- /package/runtime/lib/{alog → snapshot/alog}/render.d.ts +0 -0
- /package/runtime/lib/{compat → snapshot/compat}/componentIs.d.ts +0 -0
- /package/runtime/lib/{compat → snapshot/compat}/componentIs.js +0 -0
- /package/runtime/lib/{compat → snapshot/compat}/initData.d.ts +0 -0
- /package/runtime/lib/{compat → snapshot/compat}/initData.js +0 -0
- /package/runtime/lib/{compat → snapshot/compat}/lynxComponent.d.ts +0 -0
- /package/runtime/lib/{compat → snapshot/compat}/lynxComponent.js +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/component-stack.js +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/debug.d.ts +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/debug.js +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/describeInvalidValue.d.ts +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/describeInvalidValue.js +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/formatPatch.d.ts +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/formatPatch.js +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/printSnapshot.d.ts +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/printSnapshot.js +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/profile.d.ts +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/profileHooks.d.ts +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/vnodeSource.d.ts +0 -0
- /package/runtime/lib/{debug → snapshot/debug}/vnodeSource.js +0 -0
- /package/runtime/lib/{gesture → snapshot/gesture}/processGesture.d.ts +0 -0
- /package/runtime/lib/{gesture → snapshot/gesture}/types.d.ts +0 -0
- /package/runtime/lib/{gesture → snapshot/gesture}/types.js +0 -0
- /package/runtime/lib/{hooks → snapshot/hooks}/useLynxGlobalEventListener.d.ts +0 -0
- /package/runtime/lib/{hooks → snapshot/hooks}/useLynxGlobalEventListener.js +0 -0
- /package/runtime/lib/{legacy-react-runtime → snapshot/legacy-react-runtime}/index.d.ts +0 -0
- /package/runtime/lib/{legacy-react-runtime → snapshot/legacy-react-runtime}/index.js +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/constant.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/constant.js +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/destroy.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/delayEvents.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/delayEvents.js +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/delayLifecycleEvents.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/delayLifecycleEvents.js +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/jsReady.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/isRendering.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/pass.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/pass.js +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/commit.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/error.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/error.js +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/globalState.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/globalState.js +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/isMainThreadHydrating.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/isMainThreadHydrating.js +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/snapshotPatch.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/snapshotPatchApply.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/updateMainThread.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/updateMainThread.js +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/ref/delay.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/ref/delay.js +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/reload.d.ts +0 -0
- /package/runtime/lib/{lifecycle → snapshot/lifecycle}/render.d.ts +0 -0
- /package/runtime/lib/{list → snapshot/list}/list.d.ts +0 -0
- /package/runtime/lib/{list → snapshot/list}/listUpdateInfo.d.ts +0 -0
- /package/runtime/lib/{list → snapshot/list}/listUpdateInfo.js +0 -0
- /package/runtime/lib/{list → snapshot/list}/pendingListUpdates.d.ts +0 -0
- /package/runtime/lib/{list → snapshot/list}/pendingListUpdates.js +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/calledByNative.d.ts +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/component.d.ts +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/component.js +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/dynamic-js.d.ts +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/dynamic-js.js +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/env.d.ts +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/injectLepusMethods.d.ts +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/injectLepusMethods.js +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/lazy-bundle.d.ts +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/lazy-bundle.js +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/performance.d.ts +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/runWithForce.d.ts +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/suspense.d.ts +0 -0
- /package/runtime/lib/{lynx → snapshot/lynx}/tt.d.ts +0 -0
- /package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/hydrate.d.ts +0 -0
- /package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/index.d.ts +0 -0
- /package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/opcodes.d.ts +0 -0
- /package/runtime/lib/snapshot/{constants.d.ts → snapshot/constants.d.ts} +0 -0
- /package/runtime/lib/snapshot/{constants.js → snapshot/constants.js} +0 -0
- /package/runtime/lib/snapshot/{event.d.ts → snapshot/event.d.ts} +0 -0
- /package/runtime/lib/snapshot/{event.js → snapshot/event.js} +0 -0
- /package/runtime/lib/snapshot/{gesture.d.ts → snapshot/gesture.d.ts} +0 -0
- /package/runtime/lib/snapshot/{gesture.js → snapshot/gesture.js} +0 -0
- /package/runtime/lib/snapshot/{list.d.ts → snapshot/list.d.ts} +0 -0
- /package/runtime/lib/snapshot/{list.js → snapshot/list.js} +0 -0
- /package/runtime/lib/snapshot/{platformInfo.d.ts → snapshot/platformInfo.d.ts} +0 -0
- /package/runtime/lib/snapshot/{platformInfo.js → snapshot/platformInfo.js} +0 -0
- /package/runtime/lib/snapshot/{snapshotInstanceHydrationMap.d.ts → snapshot/snapshotInstanceHydrationMap.d.ts} +0 -0
- /package/runtime/lib/snapshot/{snapshotInstanceHydrationMap.js → snapshot/snapshotInstanceHydrationMap.js} +0 -0
- /package/runtime/lib/snapshot/{spread.d.ts → snapshot/spread.d.ts} +0 -0
- /package/runtime/lib/snapshot/{types.js → snapshot/types.js} +0 -0
- /package/runtime/lib/snapshot/{utils.d.ts → snapshot/utils.d.ts} +0 -0
- /package/runtime/lib/snapshot/{utils.js → snapshot/utils.js} +0 -0
- /package/runtime/lib/snapshot/{workletEvent.d.ts → snapshot/workletEvent.d.ts} +0 -0
- /package/runtime/lib/snapshot/{workletEvent.js → snapshot/workletEvent.js} +0 -0
- /package/runtime/lib/snapshot/{workletRef.d.ts → snapshot/workletRef.d.ts} +0 -0
- /package/runtime/lib/snapshot/{workletRef.js → snapshot/workletRef.js} +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/delayedRunOnMainThreadData.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/delayedRunOnMainThreadData.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/execMap.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/execMap.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/functionCall.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/functionCall.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/runOnBackground.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/runOnBackground.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/runOnMainThread.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/runOnMainThread.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/transformToWorklet.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/call/transformToWorklet.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/ctx.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/ctx.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/destroy.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/destroy.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/functionality.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/hmr.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/hmr.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/indexMap.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/indexMap.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/ref/updateInitValue.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/ref/updateInitValue.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/ref/workletRef.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/ref/workletRef.js +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/ref/workletRefPool.d.ts +0 -0
- /package/runtime/lib/{worklet → snapshot/worklet}/ref/workletRefPool.js +0 -0
|
@@ -8,30 +8,69 @@ Similar to [react-testing-library](https://github.com/testing-library/react-test
|
|
|
8
8
|
|
|
9
9
|
## Setup
|
|
10
10
|
|
|
11
|
+
### Rstest
|
|
12
|
+
|
|
13
|
+
Setup rstest with `@lynx-js/react/testing-library/rstest-config`.
|
|
14
|
+
|
|
15
|
+
Recommended for library projects:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { defineConfig } from '@rstest/core';
|
|
19
|
+
import { withDefaultConfig } from '@lynx-js/react/testing-library/rstest-config';
|
|
20
|
+
|
|
21
|
+
export default defineConfig({
|
|
22
|
+
extends: withDefaultConfig(),
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Use `withLynxConfig` when you want to reuse your app's `lynx.config.ts`:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
// rstest.config.ts
|
|
30
|
+
import { defineConfig } from '@rstest/core';
|
|
31
|
+
import { withLynxConfig } from '@lynx-js/react/testing-library/rstest-config';
|
|
32
|
+
|
|
33
|
+
export default defineConfig({
|
|
34
|
+
extends: withLynxConfig(),
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Difference between `withLynxConfig` and `withDefaultConfig`:
|
|
39
|
+
|
|
40
|
+
- `withLynxConfig`: app-oriented. Loads your `lynx.config.ts` and converts it to rstest config, so rspeedy/lynx settings are reused in tests.
|
|
41
|
+
- `withDefaultConfig`: library-oriented. Only applies testing-library defaults (`jsdom`, setup files, globals) and lets you provide the rest via `modifyRstestConfig`.
|
|
42
|
+
|
|
43
|
+
Then you can start writing tests and run them with rstest!
|
|
44
|
+
|
|
45
|
+
For more usage detail, see https://rstest.rs/
|
|
46
|
+
|
|
47
|
+
### Vitest
|
|
48
|
+
|
|
11
49
|
Setup vitest:
|
|
12
50
|
|
|
13
51
|
```js
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
import { createVitestConfig } from '@lynx-js/react/testing-library/vitest-config';
|
|
52
|
+
import { defineConfig } from 'vitest/config';
|
|
53
|
+
import { vitestTestingLibraryPlugin } from '@lynx-js/react/testing-library/plugins';
|
|
17
54
|
|
|
18
|
-
|
|
19
|
-
|
|
55
|
+
export default defineConfig({
|
|
56
|
+
plugins: [
|
|
57
|
+
vitestTestingLibraryPlugin(),
|
|
58
|
+
],
|
|
20
59
|
test: {
|
|
21
60
|
// ...
|
|
22
61
|
},
|
|
23
62
|
});
|
|
24
|
-
|
|
25
|
-
export default mergeConfig(defaultConfig, config);
|
|
26
63
|
```
|
|
27
64
|
|
|
28
65
|
Then you can start writing tests and run them with vitest!
|
|
29
66
|
|
|
67
|
+
`createVitestConfig` is still supported for backward compatibility, but is deprecated.
|
|
68
|
+
|
|
30
69
|
## Usage
|
|
31
70
|
|
|
32
|
-
```
|
|
71
|
+
```jsx
|
|
33
72
|
import '@testing-library/jest-dom';
|
|
34
|
-
import { test, expect } from 'vitest';
|
|
73
|
+
import { test, expect } from 'vitest'; // or '@rstest/core'
|
|
35
74
|
import { render } from '@lynx-js/react/testing-library';
|
|
36
75
|
|
|
37
76
|
test('renders options.wrapper around node', async () => {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { mergeRsbuildConfig } from "@rsbuild/core";
|
|
2
|
+
function toRstestConfig({ environmentName, rsbuildConfig: rawRsbuildConfig, modifyRsbuildConfig }) {
|
|
3
|
+
const { environments, ...rawBuildConfig } = rawRsbuildConfig;
|
|
4
|
+
const environmentConfig = environmentName ? environments?.[environmentName] : void 0;
|
|
5
|
+
const rsbuildConfig = environmentConfig ? mergeRsbuildConfig(rawBuildConfig, environmentConfig) : rawBuildConfig;
|
|
6
|
+
const finalBuildConfig = modifyRsbuildConfig ? modifyRsbuildConfig(rsbuildConfig) : rsbuildConfig;
|
|
7
|
+
const { rspack, swc, bundlerChain } = finalBuildConfig.tools || {};
|
|
8
|
+
const { cssModules, target, module } = finalBuildConfig.output || {};
|
|
9
|
+
const { decorators, define, include, exclude, tsconfigPath } = finalBuildConfig.source || {};
|
|
10
|
+
return {
|
|
11
|
+
root: finalBuildConfig.root,
|
|
12
|
+
name: environmentName,
|
|
13
|
+
plugins: [
|
|
14
|
+
...finalBuildConfig.plugins || [],
|
|
15
|
+
{
|
|
16
|
+
name: 'remove-useless-plugins',
|
|
17
|
+
remove: [
|
|
18
|
+
'rsbuild:type-check'
|
|
19
|
+
],
|
|
20
|
+
setup: ()=>{}
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
source: {
|
|
24
|
+
decorators,
|
|
25
|
+
define,
|
|
26
|
+
include,
|
|
27
|
+
exclude,
|
|
28
|
+
tsconfigPath
|
|
29
|
+
},
|
|
30
|
+
resolve: finalBuildConfig.resolve,
|
|
31
|
+
output: {
|
|
32
|
+
cssModules,
|
|
33
|
+
module
|
|
34
|
+
},
|
|
35
|
+
tools: {
|
|
36
|
+
rspack,
|
|
37
|
+
swc,
|
|
38
|
+
bundlerChain
|
|
39
|
+
},
|
|
40
|
+
testEnvironment: 'node' === target ? 'node' : 'happy-dom'
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export { toRstestConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createRequire } from "node:module";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from '../../../types/entry.d.ts';
|