@lynx-js/react 0.121.1 → 0.121.2

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.
Files changed (139) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/package.json +4 -4
  3. package/runtime/lazy/element-template-import.js +73 -0
  4. package/runtime/lazy/import.js +4 -0
  5. package/runtime/lazy/target.js +23 -0
  6. package/runtime/lib/{snapshot/legacy-react-runtime/index.d.ts → core/compat/legacy-react-runtime.d.ts} +4 -4
  7. package/runtime/lib/{snapshot/legacy-react-runtime/index.js → core/compat/legacy-react-runtime.js} +6 -6
  8. package/runtime/lib/core/compat/legacy-react-runtime.js.map +1 -0
  9. package/runtime/lib/{snapshot → core}/compat/lynxComponent.d.ts +2 -1
  10. package/runtime/lib/{snapshot → core}/compat/lynxComponent.js +11 -5
  11. package/runtime/lib/core/compat/lynxComponent.js.map +1 -0
  12. package/runtime/lib/core/component.d.ts +2 -0
  13. package/runtime/lib/{snapshot/lynx → core}/component.js +37 -31
  14. package/runtime/lib/core/component.js.map +1 -0
  15. package/runtime/lib/{snapshot/lynx/dynamic-js.js → core/lynx/dynamic-import.js} +1 -1
  16. package/runtime/lib/core/lynx/dynamic-import.js.map +1 -0
  17. package/runtime/lib/core/lynx/lazy-bundle.js.map +1 -0
  18. package/runtime/lib/core/lynx/runtime-backend.d.ts +5 -0
  19. package/runtime/lib/core/lynx/runtime-backend.js +20 -0
  20. package/runtime/lib/core/lynx/runtime-backend.js.map +1 -0
  21. package/runtime/lib/core/performance.d.ts +30 -0
  22. package/runtime/lib/core/performance.js +145 -0
  23. package/runtime/lib/core/performance.js.map +1 -0
  24. package/runtime/lib/element-template/background/commit-hook.js +2 -2
  25. package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
  26. package/runtime/lib/element-template/background/document.js +7 -1
  27. package/runtime/lib/element-template/background/document.js.map +1 -1
  28. package/runtime/lib/element-template/background/hydrate.d.ts +2 -3
  29. package/runtime/lib/element-template/background/hydrate.js +211 -55
  30. package/runtime/lib/element-template/background/hydrate.js.map +1 -1
  31. package/runtime/lib/element-template/background/hydration-listener.js +6 -25
  32. package/runtime/lib/element-template/background/hydration-listener.js.map +1 -1
  33. package/runtime/lib/element-template/background/instance.d.ts +30 -3
  34. package/runtime/lib/element-template/background/instance.js +209 -28
  35. package/runtime/lib/element-template/background/instance.js.map +1 -1
  36. package/runtime/lib/element-template/debug/alog.d.ts +14 -0
  37. package/runtime/lib/element-template/debug/alog.js +23 -0
  38. package/runtime/lib/element-template/debug/alog.js.map +1 -1
  39. package/runtime/lib/element-template/debug/elementPAPICall.js +1 -0
  40. package/runtime/lib/element-template/debug/elementPAPICall.js.map +1 -1
  41. package/runtime/lib/element-template/index.d.ts +3 -2
  42. package/runtime/lib/element-template/index.js +6 -7
  43. package/runtime/lib/element-template/index.js.map +1 -1
  44. package/runtime/lib/element-template/internal.d.ts +4 -0
  45. package/runtime/lib/element-template/internal.js +4 -4
  46. package/runtime/lib/element-template/internal.js.map +1 -1
  47. package/runtime/lib/element-template/lynx/performance.d.ts +0 -21
  48. package/runtime/lib/element-template/lynx/performance.js +4 -121
  49. package/runtime/lib/element-template/lynx/performance.js.map +1 -1
  50. package/runtime/lib/element-template/native/index.js +1 -1
  51. package/runtime/lib/element-template/native/index.js.map +1 -1
  52. package/runtime/lib/element-template/native/main-thread-api.js +1 -1
  53. package/runtime/lib/element-template/native/main-thread-api.js.map +1 -1
  54. package/runtime/lib/element-template/native/mts-destroy.js +2 -0
  55. package/runtime/lib/element-template/native/mts-destroy.js.map +1 -1
  56. package/runtime/lib/element-template/native/patch-listener.js +1 -1
  57. package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
  58. package/runtime/lib/element-template/native/reload-background.d.ts +1 -0
  59. package/runtime/lib/element-template/native/{reload.js → reload-background.js} +1 -26
  60. package/runtime/lib/element-template/native/reload-background.js.map +1 -0
  61. package/runtime/lib/element-template/native/{reload.d.ts → reload-main-thread.d.ts} +0 -1
  62. package/runtime/lib/element-template/native/reload-main-thread.js +35 -0
  63. package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -0
  64. package/runtime/lib/element-template/protocol/opcodes.d.ts +3 -0
  65. package/runtime/lib/element-template/protocol/opcodes.js +3 -0
  66. package/runtime/lib/element-template/protocol/opcodes.js.map +1 -1
  67. package/runtime/lib/element-template/protocol/template-type.d.ts +6 -0
  68. package/runtime/lib/element-template/protocol/template-type.js +20 -0
  69. package/runtime/lib/element-template/protocol/template-type.js.map +1 -0
  70. package/runtime/lib/element-template/protocol/types.d.ts +33 -13
  71. package/runtime/lib/element-template/runtime/list/list.d.ts +65 -0
  72. package/runtime/lib/element-template/runtime/list/list.js +587 -0
  73. package/runtime/lib/element-template/runtime/list/list.js.map +1 -0
  74. package/runtime/lib/element-template/runtime/patch.js +177 -74
  75. package/runtime/lib/element-template/runtime/patch.js.map +1 -1
  76. package/runtime/lib/element-template/runtime/render/render-main-thread.js +13 -0
  77. package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
  78. package/runtime/lib/element-template/runtime/render/render-opcodes.js +80 -43
  79. package/runtime/lib/element-template/runtime/render/render-opcodes.js.map +1 -1
  80. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js +32 -1
  81. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js.map +1 -1
  82. package/runtime/lib/element-template/runtime/template/handle.d.ts +3 -2
  83. package/runtime/lib/element-template/runtime/template/handle.js +5 -0
  84. package/runtime/lib/element-template/runtime/template/handle.js.map +1 -1
  85. package/runtime/lib/element-template/runtime/template/registry.d.ts +2 -0
  86. package/runtime/lib/element-template/runtime/template/registry.js +5 -0
  87. package/runtime/lib/element-template/runtime/template/registry.js.map +1 -1
  88. package/runtime/lib/element-template/runtime-backend-marker.js +6 -0
  89. package/runtime/lib/element-template/runtime-backend-marker.js.map +1 -0
  90. package/runtime/lib/index.d.ts +1 -1
  91. package/runtime/lib/index.js +3 -1
  92. package/runtime/lib/index.js.map +1 -1
  93. package/runtime/lib/internal.d.ts +4 -3
  94. package/runtime/lib/internal.js +5 -4
  95. package/runtime/lib/internal.js.map +1 -1
  96. package/runtime/lib/runtime-backend-marker.d.ts +1 -0
  97. package/runtime/lib/runtime-backend-marker.js +6 -0
  98. package/runtime/lib/runtime-backend-marker.js.map +1 -0
  99. package/runtime/lib/snapshot/lifecycle/patch/commit.js +1 -1
  100. package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -1
  101. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js +1 -1
  102. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -1
  103. package/runtime/lib/snapshot/lynx/calledByNative.js +1 -1
  104. package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -1
  105. package/runtime/lib/snapshot/lynx/performance.d.ts +0 -21
  106. package/runtime/lib/snapshot/lynx/performance.js +7 -121
  107. package/runtime/lib/snapshot/lynx/performance.js.map +1 -1
  108. package/runtime/lib/snapshot/lynx/tt.js +1 -1
  109. package/runtime/lib/snapshot/lynx/tt.js.map +1 -1
  110. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js +1 -1
  111. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
  112. package/runtime/lib/snapshot/snapshot/snapshot.js +1 -1
  113. package/runtime/lib/snapshot/snapshot/snapshot.js.map +1 -1
  114. package/runtime/lib/tsconfig.tsbuildinfo +1 -1
  115. package/runtime/worklet-runtime/dev.js +1 -2
  116. package/runtime/worklet-runtime/main.js +1 -1
  117. package/testing-library/dist/{rslib-runtime.js → 0~rslib-runtime.js} +14 -13
  118. package/testing-library/dist/env/vitest.js +1 -1
  119. package/testing-library/dist/plugins/index.js +1 -1
  120. package/testing-library/dist/pure.js +18 -18
  121. package/testing-library/dist/rstest-config.js +2 -4
  122. package/testing-library/dist/setupFiles/common/bootstrap.js +1 -0
  123. package/testing-library/dist/setupFiles/common/runtime-setup.js +1 -1
  124. package/testing-library/dist/setupFiles/inner/rstest.js +2 -1
  125. package/testing-library/dist/setupFiles/inner/vitest.js +2 -1
  126. package/testing-library/dist/type-entry/index.js +1 -0
  127. package/transform/dist/wasm.cjs +113 -40
  128. package/runtime/lib/element-template/native/reload.js.map +0 -1
  129. package/runtime/lib/snapshot/compat/lynxComponent.js.map +0 -1
  130. package/runtime/lib/snapshot/legacy-react-runtime/index.js.map +0 -1
  131. package/runtime/lib/snapshot/lynx/component.js.map +0 -1
  132. package/runtime/lib/snapshot/lynx/dynamic-js.js.map +0 -1
  133. package/runtime/lib/snapshot/lynx/lazy-bundle.js.map +0 -1
  134. package/testing-library/dist/881.js +0 -1
  135. /package/runtime/lib/{snapshot/lynx/dynamic-js.d.ts → core/lynx/dynamic-import.d.ts} +0 -0
  136. /package/runtime/lib/{snapshot → core}/lynx/lazy-bundle.d.ts +0 -0
  137. /package/runtime/lib/{snapshot → core}/lynx/lazy-bundle.js +0 -0
  138. /package/runtime/lib/{snapshot/lynx/component.d.ts → element-template/runtime-backend-marker.d.ts} +0 -0
  139. /package/testing-library/dist/{0~123.js → 0~@rstest/adapter-rsbuild.js} +0 -0
@@ -14,7 +14,7 @@ import { initApiEnv } from "../../../../runtime/lib/worklet-runtime/api/lynxApi.
14
14
  import { initEventListeners } from "../../../../runtime/lib/worklet-runtime/listeners.js";
15
15
  import { initWorklet } from "../../../../runtime/lib/worklet-runtime/workletRuntime.js";
16
16
  import { setupBackgroundDocument, setupDocument } from "../../../../runtime/lib/document.js";
17
- const { onInjectMainThreadGlobals, onInjectBackgroundThreadGlobals, onResetLynxTestingEnv, onSwitchedToMainThread, onSwitchedToBackgroundThread, onInitWorkletRuntime } = globalThis;
17
+ const { onInjectMainThreadGlobals: onInjectMainThreadGlobals, onInjectBackgroundThreadGlobals: onInjectBackgroundThreadGlobals, onResetLynxTestingEnv: onResetLynxTestingEnv, onSwitchedToMainThread: onSwitchedToMainThread, onSwitchedToBackgroundThread: onSwitchedToBackgroundThread, onInitWorkletRuntime: onInitWorkletRuntime } = globalThis;
18
18
  injectCalledByNative();
19
19
  injectUpdateMainThread();
20
20
  injectUpdateMTRefInitValue();
@@ -1,7 +1,8 @@
1
- const { onInjectBackgroundThreadGlobals } = globalThis;
1
+ const { onInjectBackgroundThreadGlobals: onInjectBackgroundThreadGlobals } = globalThis;
2
2
  globalThis.onInjectBackgroundThreadGlobals = (target)=>{
3
3
  if (onInjectBackgroundThreadGlobals) onInjectBackgroundThreadGlobals(target);
4
4
  target.lynx.requireModuleAsync = async (url, _callback)=>{
5
5
  throw new Error('lynx.requireModuleAsync not implemented for rstest');
6
6
  };
7
7
  };
8
+ export { };
@@ -1,4 +1,4 @@
1
- const { onInjectBackgroundThreadGlobals } = globalThis;
1
+ const { onInjectBackgroundThreadGlobals: onInjectBackgroundThreadGlobals } = globalThis;
2
2
  globalThis.onInjectBackgroundThreadGlobals = (target)=>{
3
3
  if (onInjectBackgroundThreadGlobals) onInjectBackgroundThreadGlobals(target);
4
4
  target.lynx.requireModuleAsync = async (url, callback)=>{
@@ -9,3 +9,4 @@ globalThis.onInjectBackgroundThreadGlobals = (target)=>{
9
9
  }
10
10
  };
11
11
  };
12
+ export { };
@@ -0,0 +1 @@
1
+ export { };