xote 4.15.2 → 4.15.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xote",
3
- "version": "4.15.2",
3
+ "version": "4.15.3",
4
4
  "repository": {
5
5
  "url": "https://github.com/brnrdog/xote"
6
6
  },
package/src/Xote__JSX.res CHANGED
@@ -9,8 +9,12 @@ type component<'props> = 'props => element
9
9
 
10
10
  type componentLike<'props, 'return> = 'props => 'return
11
11
 
12
- /* JSX functions for component creation - all delegate to the component function */
13
- let jsx = (component: component<'props>, props: 'props): element => component(props)
12
+ /* JSX functions for component creation - wrap in LazyComponent to defer evaluation.
13
+ * This ensures component functions (which may create effects/computeds) are not
14
+ * evaluated during a Computed context, which would incorrectly track their
15
+ * dependencies as belonging to the outer computed. */
16
+ let jsx = (component: component<'props>, props: 'props): element =>
17
+ Component.LazyComponent(() => component(props))
14
18
 
15
19
  let jsxs = jsx
16
20
 
@@ -5,11 +5,17 @@ import * as Xote__Component from "./Xote__Component.res.mjs";
5
5
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
6
6
 
7
7
  function jsx(component, props) {
8
- return component(props);
8
+ return {
9
+ TAG: "LazyComponent",
10
+ _0: () => component(props)
11
+ };
9
12
  }
10
13
 
11
14
  function jsxKeyed(component, props, key, param) {
12
- return component(props);
15
+ return {
16
+ TAG: "LazyComponent",
17
+ _0: () => component(props)
18
+ };
13
19
  }
14
20
 
15
21
  function jsxFragment(props) {