@lynx-js/react 0.126.1 → 0.126.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 (271) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/components/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +3 -3
  4. package/refresh/.turbo/turbo-build.log +3 -3
  5. package/refresh/dist/index.js +1 -2
  6. package/refresh/package.json +1 -1
  7. package/runtime/__test__/element-template/debug/profile-installation.test.tsx +97 -1
  8. package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/children.non-string-raw-text-key-on-main/output.txt +1 -1
  9. package/runtime/__test__/element-template/fixtures/render/child-siblings/index.js.txt +15 -11
  10. package/runtime/__test__/element-template/fixtures/render/component/index.js.txt +8 -7
  11. package/runtime/__test__/element-template/fixtures/render/component-slot-content/index.js.txt +14 -10
  12. package/runtime/__test__/element-template/fixtures/render/css-scope-dynamic-bundle-url/index.js.txt +4 -3
  13. package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/_shared.ts +2 -9
  14. package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/appends-root-text-via-append-element/case.ts +2 -4
  15. package/runtime/__test__/element-template/fixtures/render/direct-native/creates-template-from-attrs-and-slot-text/case.ts +20 -0
  16. package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/handles-multiple-template-children-in-the-same-slot/case.ts +3 -16
  17. package/runtime/__test__/element-template/fixtures/render/direct-native/handles-multiple-text-nodes-in-the-same-slot/case.ts +18 -0
  18. package/runtime/__test__/element-template/fixtures/render/direct-native/inserts-nested-templates-into-parent-slots/case.ts +20 -0
  19. package/runtime/__test__/element-template/fixtures/render/direct-native/keeps-slot-children-separated-and-ordered/case.ts +18 -0
  20. package/runtime/__test__/element-template/fixtures/render/direct-native/passes-bundle-url-to-native-create/case.ts +15 -0
  21. package/runtime/__test__/element-template/fixtures/render/mapped-view-children/index.js.txt +12 -11
  22. package/runtime/__test__/element-template/fixtures/render/mixed-children/index.js.txt +8 -7
  23. package/runtime/__test__/element-template/fixtures/render/multiple-text/index.js.txt +15 -13
  24. package/runtime/__test__/element-template/fixtures/render/nested-templates/index.js.txt +9 -7
  25. package/runtime/__test__/element-template/fixtures/render/react-example/index.js.txt +17 -20
  26. package/runtime/__test__/element-template/fixtures/render/sparse-element-slot/index.js.txt +13 -10
  27. package/runtime/__test__/element-template/fixtures/render/template-dedupe/index.js.txt +14 -11
  28. package/runtime/__test__/element-template/imports/suspense-lazy.test.ts +52 -7
  29. package/runtime/__test__/element-template/native/reload.test.ts +10 -26
  30. package/runtime/__test__/element-template/runtime/background/component-stack.test.tsx +76 -0
  31. package/runtime/__test__/element-template/runtime/background/hydrate.test.ts +87 -43
  32. package/runtime/__test__/element-template/runtime/background/instance.test.ts +14 -0
  33. package/runtime/__test__/element-template/runtime/render/compact-host-debug.test.ts +57 -0
  34. package/runtime/__test__/element-template/runtime/render/compact-host.test.ts +199 -0
  35. package/runtime/__test__/element-template/runtime/render/render-components.test.jsx +292 -0
  36. package/runtime/__test__/element-template/runtime/render/{render-opcodes-into-element-template.et.test.tsx → render-direct-native.test.tsx} +50 -314
  37. package/runtime/__test__/element-template/runtime/render/render-direct-suspense.test.ts +378 -0
  38. package/runtime/__test__/element-template/runtime/render/render-direct.test.ts +491 -0
  39. package/runtime/__test__/element-template/runtime/render/render-main-thread.contract.test.ts +2 -28
  40. package/runtime/__test__/element-template/runtime/render/render-main-thread.test.ts +21 -35
  41. package/runtime/__test__/element-template/runtime/render/render-transform.contract.test.ts +6 -5
  42. package/runtime/__test__/element-template/test-utils/debug/renderFixtureRunner.ts +4 -4
  43. package/runtime/__test__/element-template/vitest.config.ts +2 -1
  44. package/runtime/__test__/snapshot/debug/main-thread-children-with-same-key.test.ts +28 -0
  45. package/runtime/__test__/snapshot/debug/profile.test.jsx +108 -3
  46. package/runtime/__test__/snapshot/lazy.test.js +44 -9
  47. package/runtime/__test__/snapshot/lifecycle/reloadGc.test.jsx +66 -0
  48. package/runtime/__test__/snapshot/lynx/runtime-version.test.ts +140 -0
  49. package/runtime/__test__/snapshot/spread.test.jsx +22 -15
  50. package/runtime/__test__/snapshot/ssr.legacy-slot.test.jsx +168 -0
  51. package/runtime/__test__/snapshot/ssr.list.test.jsx +211 -0
  52. package/runtime/__test__/worklet-runtime/hydrate.test.js +92 -0
  53. package/runtime/__test__/worklet-runtime/runOnBackground.test.js +8 -6
  54. package/runtime/__test__/worklet-runtime/workletRuntime.test.js +3 -2
  55. package/runtime/lazy/element-template-import.js +0 -4
  56. package/runtime/lazy/element-template-internal.js +18 -8
  57. package/runtime/lazy/element-template-jsx-dev-runtime.js +1 -8
  58. package/runtime/lazy/element-template-jsx-runtime.js +1 -3
  59. package/runtime/lazy/element-template.js +1 -3
  60. package/runtime/lazy/import.js +0 -4
  61. package/runtime/lazy/internal.js +15 -1
  62. package/runtime/lazy/target.js +0 -21
  63. package/runtime/lib/core/hooks/react.d.ts +2 -0
  64. package/runtime/lib/core/hooks/react.js +2 -0
  65. package/runtime/lib/core/hooks/react.js.map +1 -1
  66. package/runtime/lib/core/lynx/runtime-version.d.ts +16 -0
  67. package/runtime/lib/core/lynx/runtime-version.js +51 -0
  68. package/runtime/lib/core/lynx/runtime-version.js.map +1 -0
  69. package/runtime/lib/element-template/background/document.d.ts +1 -1
  70. package/runtime/lib/element-template/background/document.js +1 -1
  71. package/runtime/lib/element-template/background/document.js.map +1 -1
  72. package/runtime/lib/element-template/background/hydrate.js +51 -19
  73. package/runtime/lib/element-template/background/hydrate.js.map +1 -1
  74. package/runtime/lib/element-template/background/instance.js +5 -6
  75. package/runtime/lib/element-template/background/instance.js.map +1 -1
  76. package/runtime/lib/element-template/debug/profile.js +38 -22
  77. package/runtime/lib/element-template/debug/profile.js.map +1 -1
  78. package/runtime/lib/element-template/index.d.ts +1 -1
  79. package/runtime/lib/element-template/index.js +1 -1
  80. package/runtime/lib/element-template/index.js.map +1 -1
  81. package/runtime/lib/element-template/internal.d.ts +4 -1
  82. package/runtime/lib/element-template/internal.js +6 -1
  83. package/runtime/lib/element-template/internal.js.map +1 -1
  84. package/runtime/lib/element-template/native/index.js +4 -0
  85. package/runtime/lib/element-template/native/index.js.map +1 -1
  86. package/runtime/lib/element-template/runtime/list/list.d.ts +1 -0
  87. package/runtime/lib/element-template/runtime/list/list.js +3 -0
  88. package/runtime/lib/element-template/runtime/list/list.js.map +1 -1
  89. package/runtime/lib/element-template/runtime/render/create-rendered-host.d.ts +7 -0
  90. package/runtime/lib/element-template/runtime/render/create-rendered-host.js +65 -0
  91. package/runtime/lib/element-template/runtime/render/create-rendered-host.js.map +1 -0
  92. package/runtime/lib/element-template/runtime/render/host.d.ts +18 -0
  93. package/runtime/lib/element-template/runtime/render/host.js +25 -0
  94. package/runtime/lib/element-template/runtime/render/host.js.map +1 -0
  95. package/runtime/lib/element-template/runtime/render/render-components.d.ts +6 -0
  96. package/runtime/lib/element-template/runtime/render/render-components.js +190 -0
  97. package/runtime/lib/element-template/runtime/render/render-components.js.map +1 -0
  98. package/runtime/lib/element-template/runtime/render/{render-opcodes.d.ts → render-direct.d.ts} +3 -1
  99. package/runtime/lib/element-template/runtime/render/render-direct.js +194 -0
  100. package/runtime/lib/element-template/runtime/render/render-direct.js.map +1 -0
  101. package/runtime/lib/element-template/runtime/render/render-main-thread.js +10 -9
  102. package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
  103. package/runtime/lib/element-template/runtime/template/handle.d.ts +2 -1
  104. package/runtime/lib/element-template/runtime/template/handle.js +12 -4
  105. package/runtime/lib/element-template/runtime/template/handle.js.map +1 -1
  106. package/runtime/lib/element-template/runtime-marker.js +13 -0
  107. package/runtime/lib/element-template/runtime-marker.js.map +1 -0
  108. package/runtime/lib/index.d.ts +1 -1
  109. package/runtime/lib/index.js +1 -1
  110. package/runtime/lib/index.js.map +1 -1
  111. package/runtime/lib/internal.d.ts +3 -1
  112. package/runtime/lib/internal.js +5 -1
  113. package/runtime/lib/internal.js.map +1 -1
  114. package/runtime/lib/lynx-api.d.ts +15 -6
  115. package/runtime/lib/lynx-api.js +13 -4
  116. package/runtime/lib/lynx-api.js.map +1 -1
  117. package/runtime/lib/runtime-marker.js +13 -0
  118. package/runtime/lib/runtime-marker.js.map +1 -0
  119. package/runtime/lib/shared/component-stack.js +5 -1
  120. package/runtime/lib/shared/component-stack.js.map +1 -1
  121. package/runtime/lib/snapshot/debug/profileHooks.js +38 -22
  122. package/runtime/lib/snapshot/debug/profileHooks.js.map +1 -1
  123. package/runtime/lib/snapshot/lifecycle/reload.js +3 -0
  124. package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -1
  125. package/runtime/lib/snapshot/lynx/calledByNative.js +3 -0
  126. package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -1
  127. package/runtime/lib/snapshot/lynx/element.d.ts +2 -0
  128. package/runtime/lib/snapshot/lynx/element.js +2 -0
  129. package/runtime/lib/snapshot/lynx/element.js.map +1 -1
  130. package/runtime/lib/snapshot/renderToOpcodes/opcodes.js +2 -1
  131. package/runtime/lib/snapshot/renderToOpcodes/opcodes.js.map +1 -1
  132. package/runtime/lib/tsconfig.tsbuildinfo +1 -1
  133. package/runtime/lib/worklet-runtime/bindings/types.d.ts +1 -1
  134. package/runtime/lib/worklet-runtime/hydrate.js +1 -1
  135. package/runtime/lib/worklet-runtime/hydrate.js.map +1 -1
  136. package/runtime/lib/worklet-runtime/workletRuntime.js +5 -14
  137. package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
  138. package/runtime/src/core/hooks/react.ts +2 -0
  139. package/runtime/src/core/lynx/runtime-version.ts +62 -0
  140. package/runtime/src/element-template/background/document.ts +3 -3
  141. package/runtime/src/element-template/background/hydrate.ts +61 -29
  142. package/runtime/src/element-template/background/instance.ts +5 -6
  143. package/runtime/src/element-template/debug/profile.ts +48 -36
  144. package/runtime/src/element-template/index.ts +1 -1
  145. package/runtime/src/element-template/internal.ts +12 -1
  146. package/runtime/src/element-template/native/index.ts +4 -0
  147. package/runtime/src/element-template/runtime/list/list.ts +4 -0
  148. package/runtime/src/element-template/runtime/render/create-rendered-host.ts +126 -0
  149. package/runtime/src/element-template/runtime/render/host.ts +51 -0
  150. package/runtime/src/element-template/runtime/render/render-components.ts +255 -0
  151. package/runtime/src/element-template/runtime/render/render-direct.ts +275 -0
  152. package/runtime/src/element-template/runtime/render/render-main-thread.ts +10 -9
  153. package/runtime/src/element-template/runtime/template/handle.ts +17 -7
  154. package/runtime/src/element-template/runtime-marker.ts +17 -0
  155. package/runtime/src/index.ts +1 -1
  156. package/runtime/src/internal.ts +10 -1
  157. package/runtime/src/lynx-api.ts +15 -6
  158. package/runtime/src/runtime-marker.ts +17 -0
  159. package/runtime/src/shared/component-stack.ts +5 -1
  160. package/runtime/src/snapshot/debug/profileHooks.ts +52 -40
  161. package/runtime/src/snapshot/lifecycle/reload.ts +4 -0
  162. package/runtime/src/snapshot/lynx/calledByNative.ts +4 -0
  163. package/runtime/src/snapshot/lynx/element.ts +2 -0
  164. package/runtime/src/snapshot/renderToOpcodes/opcodes.ts +2 -1
  165. package/runtime/src/worklet-runtime/bindings/types.ts +1 -1
  166. package/runtime/src/worklet-runtime/hydrate.ts +1 -1
  167. package/runtime/src/worklet-runtime/workletRuntime.ts +5 -14
  168. package/runtime/types/types.d.ts +2 -0
  169. package/runtime/worklet-runtime/dev.js +4 -16
  170. package/runtime/worklet-runtime/main.js +1 -1
  171. package/testing-library/.turbo/turbo-build.log +12 -12
  172. package/testing-library/dist/env/index.js +2 -2
  173. package/testing-library/dist/index.d.ts +2 -2
  174. package/testing-library/dist/plugins/index.js +1 -1
  175. package/testing-library/dist/pure.js +45 -44
  176. package/testing-library/etc/react-lynx-testing-library.api.md +1 -1
  177. package/testing-library/node_modules/.bin/rsbuild +19 -6
  178. package/testing-library/node_modules/.bin/rspeedy +17 -4
  179. package/testing-library/node_modules/.bin/rstest +19 -6
  180. package/testing-library/package.json +2 -2
  181. package/testing-library/src/__tests__/reload/reloadGc.test.jsx +64 -0
  182. package/testing-library/src/__tests__/reload/reloadTemplate.js +39 -0
  183. package/testing-library/types/entry.d.ts +2 -2
  184. package/transform/.turbo/turbo-build$colon$wasm.log +68 -56
  185. package/transform/__test__/fixture.spec.js +17 -20
  186. package/transform/__test__/text.spec.js +75 -0
  187. package/transform/crates/swc_plugin_compat/lib.rs +4 -3
  188. package/transform/crates/swc_plugin_compat/napi.rs +4 -3
  189. package/transform/crates/swc_plugin_define_dce/napi.rs +1 -1
  190. package/transform/crates/swc_plugin_dynamic_import/lib.rs +105 -3
  191. package/transform/crates/swc_plugin_dynamic_import/tests/__swc_snapshots__/lib.rs/should_suffix_webpack_chunk_name.js +5 -0
  192. package/transform/crates/swc_plugin_element_template/host_lowering.rs +111 -0
  193. package/transform/crates/swc_plugin_element_template/lib.rs +41 -5
  194. package/transform/crates/swc_plugin_element_template/lowering.rs +39 -7
  195. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_generate_attribute_slots_for_dynamic_attributes.snap +1 -1
  196. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_background_conditional_attributes.snap +1 -1
  197. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_boolean_and_number_attributes.snap +1 -1
  198. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_complex_text_structure.snap +1 -1
  199. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_dataset_attributes.snap +1 -1
  200. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_deeply_nested_user_components.snap +1 -1
  201. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_dynamic_class_attributes.snap +1 -1
  202. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_events_lepus.snap +1 -1
  203. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_id_attributes.snap +1 -1
  204. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_inline_styles.snap +1 -1
  205. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_interpolated_text_with_siblings_lepus.snap +1 -1
  206. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_mixed_content.snap +1 -1
  207. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_nested_structure_and_dynamic_content.snap +1 -1
  208. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_refs_lepus.snap +1 -1
  209. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_sibling_user_components.snap +1 -1
  210. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_spread_attributes.snap +1 -1
  211. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_user_component.snap +1 -1
  212. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_isolate_arrays_with_child_slot_placeholder.snap +1 -1
  213. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_keep_code_and_template_attribute_slots_in_sync_for_spread.snap +1 -1
  214. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_output_element_template_simple_lepus.snap +1 -1
  215. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_output_template_with_static_attributes.snap +1 -1
  216. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_verify_template_structure_complex.snap +1 -1
  217. package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_verify_text_attribute_and_child_text_slots.snap +1 -1
  218. package/transform/crates/swc_plugin_element_template/tests/element_template.rs +70 -66
  219. package/transform/crates/swc_plugin_element_template/tests/element_template_contract.rs +94 -8
  220. package/transform/crates/swc_plugin_shake/lib.rs +1 -1
  221. package/transform/crates/swc_plugin_shake/napi.rs +1 -1
  222. package/transform/crates/swc_plugin_text/lib.rs +57 -16
  223. package/transform/crates/swc_plugin_text/tests/__swc_snapshots__/lib.rs/should_keep_children_for_dynamic_or_multiple_text.js +13 -0
  224. package/transform/crates/swc_plugin_text/tests/__swc_snapshots__/lib.rs/should_transform_string_expressions_to_text_attr.js +13 -0
  225. package/transform/crates/swc_plugins_shared/jsx_helpers.rs +8 -4
  226. package/transform/dist/wasm.cjs +1 -1
  227. package/transform/index.d.ts +7 -6
  228. package/transform/node_modules/.bin/esbuild +17 -4
  229. package/transform/node_modules/.bin/napi +17 -4
  230. package/transform/rspack-napi/tsconfig.tsbuildinfo +1 -1
  231. package/transform/src/swc_plugin_extract_str/mod.rs +1 -1
  232. package/transform/swc-plugin-reactlynx/.turbo/turbo-build.log +310 -114
  233. package/transform/swc-plugin-reactlynx/index.d.ts +2 -2
  234. package/transform/swc-plugin-reactlynx/swc_plugin_reactlynx.wasm +0 -0
  235. package/transform/swc-plugin-reactlynx-compat/.turbo/turbo-build.log +10 -208
  236. package/transform/swc-plugin-reactlynx-compat/index.d.ts +3 -3
  237. package/transform/swc-plugin-reactlynx-compat/swc_plugin_reactlynx_compat.wasm +0 -0
  238. package/runtime/__test__/element-template/fixtures/render/opcodes-into-element-template/creates-template-from-attrs-and-slot-text/case.ts +0 -39
  239. package/runtime/__test__/element-template/fixtures/render/opcodes-into-element-template/handles-multiple-text-nodes-in-the-same-slot/case.ts +0 -29
  240. package/runtime/__test__/element-template/fixtures/render/opcodes-into-element-template/inserts-nested-templates-into-parent-slots/case.ts +0 -42
  241. package/runtime/__test__/element-template/fixtures/render/opcodes-into-element-template/keeps-slot-children-separated-and-ordered/case.ts +0 -31
  242. package/runtime/__test__/element-template/fixtures/render/opcodes-into-element-template/passes-bundle-url-to-native-create/case.ts +0 -20
  243. package/runtime/__test__/element-template/runtime/render/render-to-opcodes.et.test.jsx +0 -522
  244. package/runtime/lib/element-template/runtime/render/render-opcodes.js +0 -216
  245. package/runtime/lib/element-template/runtime/render/render-opcodes.js.map +0 -1
  246. package/runtime/lib/element-template/runtime/render/render-to-opcodes.d.ts +0 -16
  247. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js +0 -324
  248. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js.map +0 -1
  249. package/runtime/lib/element-template/runtime-backend-marker.js +0 -6
  250. package/runtime/lib/element-template/runtime-backend-marker.js.map +0 -1
  251. package/runtime/lib/runtime-backend-marker.js +0 -6
  252. package/runtime/lib/runtime-backend-marker.js.map +0 -1
  253. package/runtime/src/element-template/runtime/render/render-opcodes.ts +0 -313
  254. package/runtime/src/element-template/runtime/render/render-to-opcodes.ts +0 -411
  255. package/runtime/src/element-template/runtime-backend-marker.ts +0 -7
  256. package/runtime/src/runtime-backend-marker.ts +0 -7
  257. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/appends-root-text-via-append-element/native-log.txt +0 -0
  258. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/appends-root-text-via-append-element/output.txt +0 -0
  259. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/creates-template-from-attrs-and-slot-text/native-log.txt +0 -0
  260. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/creates-template-from-attrs-and-slot-text/output.txt +0 -0
  261. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/handles-multiple-template-children-in-the-same-slot/native-log.txt +0 -0
  262. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/handles-multiple-template-children-in-the-same-slot/output.txt +0 -0
  263. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/handles-multiple-text-nodes-in-the-same-slot/native-log.txt +0 -0
  264. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/handles-multiple-text-nodes-in-the-same-slot/output.txt +0 -0
  265. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/inserts-nested-templates-into-parent-slots/native-log.txt +0 -0
  266. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/inserts-nested-templates-into-parent-slots/output.txt +0 -0
  267. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/keeps-slot-children-separated-and-ordered/native-log.txt +0 -0
  268. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/keeps-slot-children-separated-and-ordered/output.txt +0 -0
  269. /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/passes-bundle-url-to-native-create/native-log.txt +0 -0
  270. /package/runtime/lib/element-template/{runtime-backend-marker.d.ts → runtime-marker.d.ts} +0 -0
  271. /package/runtime/lib/{runtime-backend-marker.d.ts → runtime-marker.d.ts} +0 -0
@@ -1,216 +0,0 @@
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 { __OpAttr, __OpBegin, __OpEnd, __OpPageEnd, __OpPageStart, __OpSlot, __OpText } from './render-to-opcodes.js';
5
- import { elementTemplateIdentityKey, parseElementTemplateType } from '../../protocol/template-type.js';
6
- import { composeElementTemplateListAttributes, createElementTemplateListState, registerElementTemplateListItem, registerElementTemplateListState, } from '../list/list.js';
7
- import { __etAttrPlanMap, hasMainThreadRefAttrSlot } from '../template/attr-slot-plan.js';
8
- import { createElementTemplateWithReservedHandle, createTypedElementTemplateWithReservedHandle, reserveElementTemplateId, } from '../template/handle.js';
9
- import { prepareTypedElementAttributes } from '../template/typed-attributes.js';
10
- const BUILTIN_RAW_TEXT_TEMPLATE_KEY = '_et_builtin_raw_text';
11
- const TYPED_LIST_HOST_TYPE = 'list';
12
- const EMPTY_LIST_ITEM_UIDS = [];
13
- function appendChildToParent(parentTemplateKey, parentActiveChildSlot, parentListItemUids, rootRefs, rootSubtreeHandles, elementRef, uid, subtreeHandles) {
14
- if (parentTemplateKey === null) {
15
- rootRefs.push(elementRef);
16
- rootSubtreeHandles.push(subtreeHandles);
17
- return;
18
- }
19
- if (__DEV__ && !parentActiveChildSlot) {
20
- throw new Error(`Template '${parentTemplateKey}' received a child outside of any child slot.`);
21
- }
22
- parentActiveChildSlot.push(elementRef);
23
- parentListItemUids?.push(uid);
24
- }
25
- export function renderOpcodesIntoElementTemplate(opcodes) {
26
- const rootRefs = [];
27
- const rootSubtreeHandles = [];
28
- let pageAttributes;
29
- let isInsideAuthoredPage = false;
30
- const typeStack = [null];
31
- // The host type determines whether its payload is compiled slots or typed attributes.
32
- const attributesStack = [undefined];
33
- const childSlotsStack = [undefined];
34
- const listItemUidsStack = [undefined];
35
- const materializationHandlesStack = [undefined];
36
- const activeChildSlotStack = [undefined];
37
- const activeListItemUidsStack = [undefined];
38
- const listItemPlatformInfoStack = [undefined];
39
- const deferredListItemMarkerStack = [false];
40
- let stackTop = 0;
41
- for (let i = 0; i < opcodes.length;) {
42
- const opcode = opcodes[i];
43
- switch (opcode) {
44
- case __OpBegin: {
45
- if (__DEV__ && stackTop === 0 && pageAttributes !== undefined && !isInsideAuthoredPage) {
46
- throw new Error('Element Template authored <page /> must wrap all materialized roots.');
47
- }
48
- const vnode = opcodes[i + 1];
49
- const props = vnode.props;
50
- const parentType = typeStack[stackTop];
51
- stackTop += 1;
52
- typeStack[stackTop] = vnode.type;
53
- attributesStack[stackTop] = undefined;
54
- childSlotsStack[stackTop] = undefined;
55
- listItemUidsStack[stackTop] = undefined;
56
- materializationHandlesStack[stackTop] = stackTop === 1 || parentType === TYPED_LIST_HOST_TYPE
57
- ? []
58
- : materializationHandlesStack[stackTop - 1];
59
- activeChildSlotStack[stackTop] = undefined;
60
- activeListItemUidsStack[stackTop] = undefined;
61
- listItemPlatformInfoStack[stackTop] = props?.['__listItemPlatformInfo'];
62
- deferredListItemMarkerStack[stackTop] = props?.['isReady'] !== undefined;
63
- i += 2;
64
- break;
65
- }
66
- case __OpEnd: {
67
- if (__DEV__ && stackTop === 0) {
68
- throw new Error('Instruction mismatch: Popped root frame at __OpEnd');
69
- }
70
- const type = typeStack[stackTop];
71
- const attributes = attributesStack[stackTop];
72
- const childSlots = childSlotsStack[stackTop];
73
- const listItemUids = listItemUidsStack[stackTop];
74
- const materializationHandles = materializationHandlesStack[stackTop];
75
- const listItemPlatformInfo = listItemPlatformInfoStack[stackTop];
76
- const deferredListItemMarker = deferredListItemMarkerStack[stackTop];
77
- stackTop -= 1;
78
- const concreteType = type;
79
- const parentTemplateKey = stackTop === 0 ? null : typeStack[stackTop];
80
- const parentActiveChildSlot = activeChildSlotStack[stackTop];
81
- const parentListItemUids = activeListItemUidsStack[stackTop];
82
- if (concreteType === TYPED_LIST_HOST_TYPE) {
83
- const listChildren = childSlots?.[0] ?? [];
84
- const handleId = reserveElementTemplateId();
85
- const preparedTypedAttributes = prepareTypedElementAttributes(handleId, attributes);
86
- const listState = createElementTemplateListState(listItemUids ?? EMPTY_LIST_ITEM_UIDS, preparedTypedAttributes);
87
- const attrsWithCallbacks = composeElementTemplateListAttributes(undefined, listState);
88
- const elementRef = createTypedElementTemplateWithReservedHandle(handleId, TYPED_LIST_HOST_TYPE, attrsWithCallbacks, null, { listChildren });
89
- registerElementTemplateListState(handleId, listState, true, elementRef);
90
- appendChildToParent(parentTemplateKey, parentActiveChildSlot, parentListItemUids, rootRefs, rootSubtreeHandles, elementRef, handleId, []);
91
- i += 1;
92
- break;
93
- }
94
- if (__DEV__ && parentTemplateKey === TYPED_LIST_HOST_TYPE) {
95
- if (deferredListItemMarker) {
96
- throw new Error('Element Template typed list does not support deferred list items.');
97
- }
98
- if (listItemPlatformInfo === undefined) {
99
- throw new Error('Element Template typed list received a non-list-item root in logical slot $0.');
100
- }
101
- }
102
- const attrPlan = __etAttrPlanMap[concreteType];
103
- const handleId = reserveElementTemplateId();
104
- const attributeSlots = attributes;
105
- let preparedAttributeSlots = attributeSlots ?? null;
106
- if (attrPlan !== undefined) {
107
- preparedAttributeSlots = attributeSlots?.slice() ?? [];
108
- for (let planIndex = 0; planIndex < attrPlan.length; planIndex += 2) {
109
- const attrSlotIndex = attrPlan[planIndex];
110
- const adapter = attrPlan[planIndex + 1];
111
- preparedAttributeSlots[attrSlotIndex] = adapter(handleId, attrSlotIndex, preparedAttributeSlots[attrSlotIndex]);
112
- }
113
- }
114
- const nativeTemplate = parseElementTemplateType(concreteType);
115
- const hasMainThreadRef = hasMainThreadRefAttrSlot(concreteType);
116
- const elementRef = createElementTemplateWithReservedHandle(handleId, nativeTemplate.templateKey, nativeTemplate.bundleUrl, preparedAttributeSlots, childSlots ?? null);
117
- if (hasMainThreadRef) {
118
- materializationHandles.push({
119
- uid: handleId,
120
- ref: elementRef,
121
- });
122
- }
123
- if (listItemPlatformInfo !== undefined) {
124
- registerElementTemplateListItem(handleId, elementRef, {
125
- // The native list identifies items by the same identity the template
126
- // was registered under (sentinel stripped for the main card), so the
127
- // update path (`resolveTypedListItem`) stays consistent with it.
128
- templateKey: elementTemplateIdentityKey(nativeTemplate.templateKey, nativeTemplate.bundleUrl),
129
- platformInfo: listItemPlatformInfo,
130
- });
131
- }
132
- appendChildToParent(parentTemplateKey, parentActiveChildSlot, parentListItemUids, rootRefs, rootSubtreeHandles, elementRef, handleId, materializationHandles);
133
- i += 1;
134
- break;
135
- }
136
- case __OpAttr: {
137
- attributesStack[stackTop] = opcodes[i + 1];
138
- i += 2;
139
- break;
140
- }
141
- case __OpPageStart: {
142
- if (__DEV__ && stackTop !== 0) {
143
- throw new Error('Element Template authored <page /> must be the outermost element.');
144
- }
145
- if (__DEV__ && pageAttributes !== undefined) {
146
- throw new Error('Element Template does not support multiple authored <page /> elements.');
147
- }
148
- if (__DEV__ && rootRefs.length !== 0) {
149
- throw new Error('Element Template authored <page /> must wrap all materialized roots.');
150
- }
151
- pageAttributes = opcodes[i + 1];
152
- isInsideAuthoredPage = true;
153
- i += 2;
154
- break;
155
- }
156
- case __OpPageEnd: {
157
- if (__DEV__) {
158
- isInsideAuthoredPage = false;
159
- }
160
- i += 1;
161
- break;
162
- }
163
- case __OpSlot: {
164
- const slotId = opcodes[i + 1];
165
- if (__DEV__ && typeStack[stackTop] === TYPED_LIST_HOST_TYPE && slotId !== 0) {
166
- throw new Error('Element Template typed list only supports logical slot $0.');
167
- }
168
- const childSlots = childSlotsStack[stackTop] ?? (childSlotsStack[stackTop] = []);
169
- const activeChildSlot = childSlots[slotId] = [];
170
- activeChildSlotStack[stackTop] = activeChildSlot;
171
- if (typeStack[stackTop] === TYPED_LIST_HOST_TYPE && slotId === 0) {
172
- const activeListItemUids = listItemUidsStack[stackTop] = [];
173
- activeListItemUidsStack[stackTop] = activeListItemUids;
174
- }
175
- else {
176
- activeListItemUidsStack[stackTop] = undefined;
177
- }
178
- i += 2;
179
- break;
180
- }
181
- case __OpText: {
182
- if (__DEV__ && stackTop === 0 && pageAttributes !== undefined && !isInsideAuthoredPage) {
183
- throw new Error('Element Template authored <page /> must wrap all materialized roots.');
184
- }
185
- const text = opcodes[i + 1];
186
- const parentTemplateKey = stackTop === 0 ? null : typeStack[stackTop];
187
- if (__DEV__ && parentTemplateKey === TYPED_LIST_HOST_TYPE) {
188
- throw new Error('Element Template typed list received text logical child.');
189
- }
190
- const handleId = reserveElementTemplateId();
191
- const textRef = createElementTemplateWithReservedHandle(handleId, BUILTIN_RAW_TEXT_TEMPLATE_KEY, null, [String(text)], []);
192
- if (parentTemplateKey === null) {
193
- rootRefs.push(textRef);
194
- rootSubtreeHandles.push([]);
195
- }
196
- else {
197
- const activeChildSlot = activeChildSlotStack[stackTop];
198
- if (__DEV__ && !activeChildSlot) {
199
- throw new Error(`Template '${parentTemplateKey}' received a text child outside of any child slot.`);
200
- }
201
- activeChildSlot.push(textRef);
202
- }
203
- i += 2;
204
- break;
205
- }
206
- default:
207
- throw new Error(`Unknown opcode: ${opcode}`);
208
- }
209
- }
210
- return {
211
- pageAttributes: pageAttributes ?? null,
212
- rootRefs,
213
- rootSubtreeHandles,
214
- };
215
- }
216
- //# sourceMappingURL=render-opcodes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render-opcodes.js","sourceRoot":"","sources":["../../../../src/element-template/runtime/render/render-opcodes.ts"],"names":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,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Render Preact JSX + Components to an HTML string.
3
- * @param {VNode} vnode JSX Element / VNode to render
4
- * @param {object} [context] Initial root context object
5
- */
6
- export declare function renderToString(vnode: any, context: any): any[];
7
- export declare const __OpBegin = 0;
8
- export declare const __OpEnd = 1;
9
- export declare const __OpAttr = 2;
10
- export declare const __OpText = 3;
11
- export declare const __OpSlot = 4;
12
- export declare const __OpPageStart = 5;
13
- export declare const __OpPageEnd = 6;
14
- export default renderToString;
15
- export declare const render: typeof renderToString;
16
- export declare const renderToStaticMarkup: typeof renderToString;
@@ -1,324 +0,0 @@
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
- /**
5
- * Implements rendering to opcodes.
6
- * This module is modified from preact-render-to-string@6.0.3 to generate
7
- * opcodes instead of HTML strings for Lynx.
8
- */
9
- // @ts-nocheck
10
- import { Fragment, h, options } from 'preact';
11
- import { BITS, CHILDREN, COMMIT, COMPONENT, COMPONENT_DIRTY, DIFF, DIFF2, DIFFED, GLOBAL_CONTEXT, NEXT_STATE, PARENT, RENDER, SKIP_EFFECTS, VNODE, } from '../../../shared/render-constants.js';
12
- import { ELEMENT_TEMPLATE_PAGE_HANDLE_ID } from '../../protocol/page.js';
13
- import { __ElementTemplatePage } from '../page/authored-page.js';
14
- import { prepareTypedElementAttributes } from '../template/typed-attributes.js';
15
- /** @typedef {import('preact').VNode} VNode */
16
- const EMPTY_ARR = [];
17
- const isArray = /* @__PURE__ */ Array.isArray;
18
- const assign = /* @__PURE__ */ Object.assign;
19
- // Global state for the current render pass
20
- let beforeDiff, beforeDiff2, afterDiff, renderHook, ummountHook;
21
- /**
22
- * Render Preact JSX + Components to an HTML string.
23
- * @param {VNode} vnode JSX Element / VNode to render
24
- * @param {object} [context] Initial root context object
25
- */
26
- export function renderToString(vnode, context) {
27
- // Performance optimization: `renderToString` is synchronous and we
28
- // therefore don't execute any effects. To do that we pass an empty
29
- // array to `options._commit` (`__c`). But we can go one step further
30
- // and avoid a lot of dirty checks and allocations by setting
31
- // `options._skipEffects` (`__s`) too.
32
- const previousSkipEffects = options[SKIP_EFFECTS];
33
- options[SKIP_EFFECTS] = true;
34
- // store options hooks once before each synchronous render call
35
- beforeDiff = options[DIFF];
36
- beforeDiff2 = options[DIFF2];
37
- afterDiff = options[DIFFED];
38
- renderHook = options[RENDER];
39
- ummountHook = options.unmount;
40
- const parent = h(Fragment, null);
41
- parent[CHILDREN] = [vnode];
42
- const opcodes = [];
43
- try {
44
- _renderToString(vnode, context || EMPTY_OBJ, parent, opcodes);
45
- }
46
- finally {
47
- // options._commit, we don't schedule any effects in this library right now,
48
- // so we can pass an empty queue to this hook.
49
- if (options[COMMIT])
50
- options[COMMIT](vnode, EMPTY_ARR);
51
- options[SKIP_EFFECTS] = previousSkipEffects;
52
- EMPTY_ARR.length = 0;
53
- }
54
- return opcodes;
55
- }
56
- // Installed as setState/forceUpdate for function components
57
- /* v8 ignore start */
58
- function markAsDirty() {
59
- this[BITS] |= COMPONENT_DIRTY;
60
- }
61
- /* v8 ignore stop */
62
- const EMPTY_OBJ = {};
63
- const TYPED_LIST_HOST_TYPE = 'list';
64
- const TYPED_LIST_LOGICAL_SLOT_PROP = '$0';
65
- export const __OpBegin = 0;
66
- export const __OpEnd = 1;
67
- export const __OpAttr = 2;
68
- export const __OpText = 3;
69
- export const __OpSlot = 4;
70
- export const __OpPageStart = 5;
71
- export const __OpPageEnd = 6;
72
- /**
73
- * @param {VNode} vnode
74
- * @param {Record<string, unknown>} context
75
- */
76
- function renderClassComponent(vnode, context, globalContext) {
77
- const type = /** @type {import("preact").ComponentClass<typeof vnode.props>} */ (vnode.type);
78
- let c;
79
- if (vnode[COMPONENT]) {
80
- c = vnode[COMPONENT];
81
- c.state = c[NEXT_STATE];
82
- }
83
- else {
84
- c = new type(vnode.props, context);
85
- }
86
- vnode[COMPONENT] = c;
87
- c[VNODE] = vnode;
88
- c.props = vnode.props;
89
- c.context = context;
90
- c[GLOBAL_CONTEXT] = globalContext;
91
- // turn off stateful re-rendering:
92
- c[BITS] |= COMPONENT_DIRTY;
93
- if (c.state == null)
94
- c.state = EMPTY_OBJ;
95
- if (c[NEXT_STATE] == null) {
96
- c[NEXT_STATE] = c.state;
97
- }
98
- if (type.getDerivedStateFromProps) {
99
- c.state = assign({}, c.state, type.getDerivedStateFromProps(c.props, c.state));
100
- }
101
- if (renderHook)
102
- renderHook(vnode);
103
- return c.render(c.props, c.state, context);
104
- }
105
- function cleanupVNode(vnode) {
106
- if (afterDiff)
107
- afterDiff(vnode);
108
- vnode[PARENT] = undefined;
109
- if (ummountHook)
110
- ummountHook(vnode);
111
- }
112
- function shouldRenderEtChild(child) {
113
- return child != null && child !== false && child !== true;
114
- }
115
- function isCompiledEtHostType(type) {
116
- return type.startsWith('_et_')
117
- || type.includes(':_et_');
118
- }
119
- function renderEtSlotArray(slotChildrenById, context, vnode, opcodes) {
120
- for (let slotId = 0; slotId < slotChildrenById.length; slotId += 1) {
121
- const slotChildren = slotChildrenById[slotId];
122
- if (!shouldRenderEtChild(slotChildren)) {
123
- continue;
124
- }
125
- opcodes.push(__OpSlot, slotId);
126
- _renderToString(slotChildren, context, vnode, opcodes);
127
- }
128
- }
129
- function renderComponentVNode(vnode, type, props, context, opcodes) {
130
- let cctx = context;
131
- let rendered;
132
- let component;
133
- const opcodesLength = opcodes.length;
134
- if (type === Fragment) {
135
- rendered = props.children;
136
- }
137
- else {
138
- const contextType = type.contextType;
139
- if (contextType != null) {
140
- const provider = context[contextType.__c];
141
- cctx = provider ? provider.props.value : contextType.__;
142
- }
143
- if (type.prototype && typeof type.prototype.render === 'function') {
144
- rendered = /**#__NOINLINE__**/ renderClassComponent(vnode, cctx, context);
145
- component = vnode[COMPONENT];
146
- }
147
- else {
148
- component = {
149
- __v: vnode,
150
- props,
151
- context: cctx,
152
- [GLOBAL_CONTEXT]: context,
153
- // silently drop state updates
154
- setState: markAsDirty,
155
- forceUpdate: markAsDirty,
156
- __g: COMPONENT_DIRTY,
157
- // hooks
158
- __h: [],
159
- };
160
- vnode[COMPONENT] = component;
161
- component.constructor = type;
162
- component.render = doRender;
163
- let count = 0;
164
- while (component[BITS] & COMPONENT_DIRTY && count++ < 25) {
165
- component[BITS] &= ~COMPONENT_DIRTY;
166
- if (renderHook)
167
- renderHook(vnode);
168
- rendered = component.render(props, component.state, cctx);
169
- }
170
- component[BITS] |= COMPONENT_DIRTY;
171
- }
172
- if (component.getChildContext != null) {
173
- context = assign({}, context, component.getChildContext());
174
- }
175
- }
176
- const isTopLevelFragment = rendered != null && rendered.type === Fragment
177
- && rendered.key == null;
178
- rendered = isTopLevelFragment ? rendered.props.children : rendered;
179
- try {
180
- _renderToString(rendered, context, vnode, opcodes);
181
- }
182
- catch (e) {
183
- if (e && typeof e === 'object' && e.then && component && /* _childDidSuspend */ component.__c) {
184
- component.setState({ /* _suspended */ __a: true });
185
- if (component[BITS] & COMPONENT_DIRTY) {
186
- rendered = renderClassComponent(vnode, context, context);
187
- component = vnode[COMPONENT];
188
- opcodes.length = opcodesLength;
189
- _renderToString(rendered, context, vnode, opcodes);
190
- }
191
- }
192
- else {
193
- throw e;
194
- }
195
- }
196
- finally {
197
- cleanupVNode(vnode);
198
- }
199
- }
200
- function renderCompiledEtHostVNode(vnode, props, context, opcodes) {
201
- opcodes.push(__OpBegin, vnode);
202
- const attributeSlots = props.attributeSlots;
203
- if (attributeSlots !== undefined) {
204
- opcodes.push(__OpAttr, attributeSlots);
205
- }
206
- // ET host nodes are compiler-generated; `swc_plugin_element_template`
207
- // (lowering.rs) emits dynamic children as `$N` named props only — no
208
- // `children` prop is produced — so the renderer only consumes `$N`.
209
- let childSlots;
210
- for (const name in props) {
211
- if (name.startsWith('$')) {
212
- (childSlots ??= [])[+name.slice(1)] = props[name];
213
- }
214
- }
215
- if (childSlots !== undefined) {
216
- renderEtSlotArray(childSlots, context, vnode, opcodes);
217
- }
218
- cleanupVNode(vnode);
219
- opcodes.push(__OpEnd);
220
- }
221
- function renderTypedListHostVNode(vnode, props, context, opcodes) {
222
- opcodes.push(__OpBegin, vnode);
223
- try {
224
- if (__DEV__) {
225
- for (const name in props) {
226
- if (name.startsWith('$') && name !== TYPED_LIST_LOGICAL_SLOT_PROP) {
227
- throw new Error('Element Template typed list only supports logical slot $0.');
228
- }
229
- }
230
- }
231
- const attributes = props.attributes;
232
- if (attributes !== undefined) {
233
- opcodes.push(__OpAttr, attributes);
234
- }
235
- const listChildren = props[TYPED_LIST_LOGICAL_SLOT_PROP];
236
- if (shouldRenderEtChild(listChildren)) {
237
- opcodes.push(__OpSlot, 0);
238
- _renderToString(listChildren, context, vnode, opcodes);
239
- }
240
- }
241
- finally {
242
- cleanupVNode(vnode);
243
- }
244
- opcodes.push(__OpEnd);
245
- }
246
- function renderStringHostVNode(type, vnode, props, context, opcodes) {
247
- if (type === TYPED_LIST_HOST_TYPE) {
248
- renderTypedListHostVNode(vnode, props, context, opcodes);
249
- return;
250
- }
251
- if (!isCompiledEtHostType(type)) {
252
- cleanupVNode(vnode);
253
- throw new Error(`Element Template main-thread renderer received an uncompiled host vnode: ${type}`);
254
- }
255
- renderCompiledEtHostVNode(vnode, props, context, opcodes);
256
- }
257
- /**
258
- * Recursively render VNodes to HTML.
259
- * @param {VNode|any} vnode
260
- * @param {any} context
261
- * @param {VNode} parent
262
- * @param opcodes
263
- */
264
- function _renderToString(vnode, context, parent, opcodes) {
265
- // Ignore non-rendered VNodes/values
266
- if (vnode == null || vnode === true || vnode === false || vnode === '') {
267
- return;
268
- }
269
- // Text VNodes: escape as HTML
270
- if (typeof vnode !== 'object') {
271
- if (typeof vnode === 'function')
272
- return;
273
- opcodes.push(__OpText, vnode + '');
274
- return;
275
- }
276
- // Recurse into children / Arrays
277
- if (isArray(vnode)) {
278
- parent[CHILDREN] = vnode;
279
- for (let i = 0; i < vnode.length; i++) {
280
- const child = vnode[i];
281
- if (child == null || typeof child === 'boolean')
282
- continue;
283
- _renderToString(child, context, parent, opcodes);
284
- }
285
- return;
286
- }
287
- // VNodes have {constructor:undefined} to prevent JSON injection:
288
- // if (vnode.constructor !== undefined) return;
289
- vnode[PARENT] = parent;
290
- if (beforeDiff)
291
- beforeDiff(vnode);
292
- if (beforeDiff2)
293
- beforeDiff2(vnode, EMPTY_OBJ);
294
- let type = vnode.type, props = vnode.props;
295
- // Invoke rendering on Components
296
- if (typeof type === 'function') {
297
- if (type === __ElementTemplatePage) {
298
- opcodes.push(__OpPageStart, prepareTypedElementAttributes(ELEMENT_TEMPLATE_PAGE_HANDLE_ID, props.attributes));
299
- renderComponentVNode(vnode, type, props, context, opcodes);
300
- if (__DEV__) {
301
- opcodes.push(__OpPageEnd);
302
- }
303
- return;
304
- }
305
- renderComponentVNode(vnode, type, props, context, opcodes);
306
- return;
307
- }
308
- if (typeof type === 'string') {
309
- renderStringHostVNode(type, vnode, props, context, opcodes);
310
- return;
311
- }
312
- if (__DEV__) {
313
- cleanupVNode(vnode);
314
- throw new Error('Element Template main-thread renderer received an invalid vnode.');
315
- }
316
- }
317
- /** The `.render()` method for a PFC backing instance. */
318
- function doRender(props, state, context) {
319
- return this.constructor(props, context);
320
- }
321
- export default renderToString;
322
- export const render = renderToString;
323
- export const renderToStaticMarkup = renderToString;
324
- //# sourceMappingURL=render-to-opcodes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render-to-opcodes.js","sourceRoot":"","sources":["../../../../src/element-template/runtime/render/render-to-opcodes.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D;;;;GAIG;AAEH,cAAc;AAEd,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,SAAS,EACT,eAAe,EACf,IAAI,EACJ,KAAK,EACL,MAAM,EACN,cAAc,EACd,UAAU,EACV,M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AC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC5B,CAAC;YACD,OAAO;QACT,CAAC;QACD,oBAAoB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO;IACT,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,qBAAqB,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5D,OAAO;IACT,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;AACH,CAAC;AAED,yDAAyD;AACzD,SAAS,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO;IACrC,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,eAAe,cAAc,CAAC;AAC9B,MAAM,CAAC,MAAM,MAAM,GAA0B,cAAc,CAAC;AAC5D,MAAM,CAAC,MAAM,oBAAoB,GAA0B,cAAc,CAAC"}
@@ -1,6 +0,0 @@
1
- // Copyright 2026 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 { RUNTIME_BACKEND_ELEMENT_TEMPLATE, registerRuntimeBackend } from '../core/lynx/runtime-backend.js';
5
- registerRuntimeBackend(RUNTIME_BACKEND_ELEMENT_TEMPLATE);
6
- //# sourceMappingURL=runtime-backend-marker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-backend-marker.js","sourceRoot":"","sources":["../../src/element-template/runtime-backend-marker.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,gCAAgC,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE3G,sBAAsB,CAAC,gCAAgC,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- // Copyright 2026 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 { RUNTIME_BACKEND_SNAPSHOT, registerRuntimeBackend } from './core/lynx/runtime-backend.js';
5
- registerRuntimeBackend(RUNTIME_BACKEND_SNAPSHOT);
6
- //# sourceMappingURL=runtime-backend-marker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-backend-marker.js","sourceRoot":"","sources":["../src/runtime-backend-marker.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAElG,sBAAsB,CAAC,wBAAwB,CAAC,CAAC"}