@adobe-commerce/elsie 3.0.0 → 3.0.1-alpha-20261103114012

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @adobe-commerce/elsie
2
2
 
3
+ ## 3.0.1-alpha-20261103114012
4
+
5
+ ### Patch Changes
6
+
7
+ - dc2c0f3: fix(elsie): render the latest context after an async slot callback
8
+ resolves
9
+
10
+ Context changes made while an async `slot` callback was pending were dropped:
11
+ once the callback resolved, `Slot` rendered with the children and context from
12
+ its first render and passed that stale context to `onRender`. It now renders
13
+ with the latest children and context.
14
+
3
15
  ## 3.0.0
4
16
 
5
17
  ### Major Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe-commerce/elsie",
3
- "version": "3.0.0",
3
+ "version": "3.0.1-alpha-20261103114012",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "description": "Domain Package SDK",
6
6
  "engines": {
package/src/lib/slot.tsx CHANGED
@@ -337,6 +337,9 @@ export function useSlot<K, V extends HTMLElement>(
337
337
  status.current = 'ready';
338
338
  }, [children, context, name, props, render, state]);
339
339
 
340
+ const handleLifeCycleRenderRef = useRef(handleLifeCycleRender);
341
+ handleLifeCycleRenderRef.current = handleLifeCycleRender;
342
+
340
343
  // Initialization
341
344
  const handleLifeCycleInit = useCallback(async () => {
342
345
  if (!callback) return;
@@ -355,9 +358,9 @@ export function useSlot<K, V extends HTMLElement>(
355
358
  status.current = 'ready';
356
359
 
357
360
  // first render
358
- await handleLifeCycleRender();
361
+ await handleLifeCycleRenderRef.current();
359
362
  }
360
- }, [callback, context, handleLifeCycleRender, name]);
363
+ }, [callback, context, name]);
361
364
 
362
365
  // Initialization
363
366
  useEffect(() => {