@octane-xplat/patches 0.16.1 → 0.17.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.
@@ -1,32 +1,33 @@
1
- diff --git a/dist/cjs/runtime.cjs b/dist/cjs/runtime.cjs
2
- index a035f05..e1c9ca1 100644
3
- --- a/dist/cjs/runtime.cjs
4
- +++ b/dist/cjs/runtime.cjs
5
- @@ -365,6 +365,7 @@ var import_stream_protocol = require("./stream-protocol.cjs");
6
- var import_renderer_bridge = require("./renderer-bridge.cjs");
7
- var import_context_identity = require("./context-identity.cjs");
8
- var import_native_read_client = require("./signals/native-read-client.cjs");
9
- +var import_local_hook = require("./signals/local-hook.cjs");
10
- var import_native_read_collector = require("./signals/native-read-collector.cjs");
11
- var import_native_read_retry = require("./signals/native-read-retry.cjs");
12
- var import_transition_state = require("./signals/transition-state.cjs");
13
- @@ -8525,6 +8526,7 @@ function nativeLocalHook(name, initialize, dispose, slot) {
1
+ diff --git a/dist/cjs/runtime/hooks.cjs b/dist/cjs/runtime/hooks.cjs
2
+ index ee8fd63..9026e11 100644
3
+ --- a/dist/cjs/runtime/hooks.cjs
4
+ +++ b/dist/cjs/runtime/hooks.cjs
5
+ @@ -1,4 +1,5 @@
6
+ "use strict";
7
+ +var import_local_hook = require("../signals/local-hook.cjs");
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __getOwnPropNames = Object.getOwnPropertyNames;
11
+ @@ -156,6 +157,7 @@ function nativeLocalHook(name, initialize, dispose, slot) {
14
12
  }
15
13
  return cell.nativeValue;
16
14
  }
17
- +(0, import_local_hook.registerLocalSignalHook)(() => CURRENT_SCOPE === null ? null : nativeLocalHook);
18
- function useState(initial, slot) {
19
- const s = readStateHook(initial, slot, arguments.length === 1);
20
- return [s.value, s.setter];
21
- @@ -9659,6 +9661,8 @@ function renderClientContextProvider(context, props, renderScope) {
22
- ensureHooks(scope).set(CHILDREN_DIALECT_SLOT, dialect);
23
- }
24
- renderSharedBody(childrenAsBody(children), void 0, scope, void 0);
25
- + } else {
26
- + resetScopeChildren(scope);
27
- }
15
+ +(0, import_local_hook.registerLocalSignalHook)(() => import_render.CURRENT_SCOPE === null ? null : nativeLocalHook);
16
+ function applyHookUpdate(state, action, reducer) {
17
+ return reducer !== null ? reducer(state, action) : typeof action === "function" ? action(state) : action;
18
+ }
19
+ diff --git a/dist/cjs/runtime/templates.cjs b/dist/cjs/runtime/templates.cjs
20
+ index 94e2ab9..e51a764 100644
21
+ --- a/dist/cjs/runtime/templates.cjs
22
+ +++ b/dist/cjs/runtime/templates.cjs
23
+ @@ -440,6 +440,7 @@ function bag16(s, r, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, $ = 0, next
24
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, __journalWindow: 0, $, next, [import_commit.BINDING_BAG_ARITY]: 16 });
28
25
  }
29
- let SHARED_BODY_SCOPE = null;
26
+ function bagOf(s, r, bag) {
27
+ + bag[import_commit.BINDING_BAG_ARITY] = -1;
28
+ return commitBag(s, r, bag);
29
+ }
30
+ function coerceText(value) {
30
31
  diff --git a/dist/cjs/signals/client.cjs b/dist/cjs/signals/client.cjs
31
32
  index 28e2844..af40518 100644
32
33
  --- a/dist/cjs/signals/client.cjs
@@ -36,27 +37,22 @@ index 28e2844..af40518 100644
36
37
  module.exports = __toCommonJS(client_exports);
37
38
  __reExport(client_exports, require("./index.cjs"), module.exports);
38
39
  -var import_runtime = require("../runtime.cjs");
39
- -var import_engine = require("./engine.cjs");
40
- -function disposeLocalSignal(cell) {
41
- - cell.scope.dispose();
42
- -}
43
- -function useSignal$(initial, slot) {
44
- - const cell = (0, import_runtime.nativeLocalHook)(
45
- +var import_engine = require("./engine.cjs");
40
+ var import_engine = require("./engine.cjs");
46
41
  +var import_local_hook = require("./local-hook.cjs");
47
- +function disposeLocalSignal(cell) {
48
- + cell.scope.dispose();
49
- +}
50
- +function useSignal$(initial, slot) {
42
+ function disposeLocalSignal(cell) {
43
+ cell.scope.dispose();
44
+ }
45
+ function useSignal$(initial, slot) {
46
+ - const cell = (0, import_runtime.nativeLocalHook)(
51
47
  + const cell = (0, import_local_hook.localSignalHook)(
52
48
  "useSignal$",
53
49
  () => {
54
50
  const value = typeof initial === "function" ? initial() : initial;
55
51
  diff --git a/dist/cjs/signals/document-owner.cjs b/dist/cjs/signals/document-owner.cjs
56
- index dbfcce2..ec264d5 100644
52
+ index bfa5529..a106df1 100644
57
53
  --- a/dist/cjs/signals/document-owner.cjs
58
54
  +++ b/dist/cjs/signals/document-owner.cjs
59
- @@ -52,9 +52,9 @@ function enableSignalDocument(abi = 1) {
55
+ @@ -53,9 +53,9 @@ function enableSignalDocument(abi = 1) {
60
56
  if (defaultInstalled) return;
61
57
  defaultInstalled = true;
62
58
  signalOwnerFrame = { enter: import_owner_context.enterSynchronousSignalOwner, restore: import_owner_context.restoreSynchronousSignalOwner };
@@ -70,11 +66,11 @@ index dbfcce2..ec264d5 100644
70
66
  function installStreamedSignalOwnerActivator(activate) {
71
67
  if (streamedSignalOwnerActivator !== void 0) {
72
68
  diff --git a/dist/cjs/signals/facade.cjs b/dist/cjs/signals/facade.cjs
73
- index 6b6d10a..917422a 100644
69
+ index a425c5f..e81719a 100644
74
70
  --- a/dist/cjs/signals/facade.cjs
75
71
  +++ b/dist/cjs/signals/facade.cjs
76
- @@ -338,7 +338,7 @@ class Descriptor {
77
- }
72
+ @@ -330,7 +330,7 @@ class Descriptor {
73
+ lexical;
78
74
  /** The owner a use resolves for: its reader, or for a lexical handle its declaring owner. */
79
75
  reader() {
80
76
  - return this.lexical === this ? this.owner : requireOwner();
@@ -213,283 +209,196 @@ index 0000000..00c323a
213
209
  + universalSignalDocument
214
210
  +});
215
211
  diff --git a/dist/compiler/compile.js b/dist/compiler/compile.js
216
- index b891c6a..c736d3c 100644
212
+ index 4ef283f..d3f3e0a 100644
217
213
  --- a/dist/compiler/compile.js
218
214
  +++ b/dist/compiler/compile.js
219
- @@ -2493,7 +2493,7 @@ function classifyViewTransitionOwnership(astBody, production, ownComponents) {
220
-
215
+ @@ -2599,7 +2599,7 @@ function classifyViewTransitionOwnership(astBody, production, ownComponents) {
216
+
221
217
  function hookRuntimeModulesForCompile(options, universalUnits = []) {
222
- - const modules = new Set(options?.__hookRuntimeModules || []);
218
+ const modules = new Set(options?.__hookRuntimeModules || []);
223
219
  - if (options?.nativeReads === true) {
224
- - modules.add('octane/signals/client');
225
- - modules.add('octane/signals/server');
226
- - }
227
- + const modules = new Set(options?.__hookRuntimeModules || []);
228
220
  + if (options?.nativeReads === true || options?.__universalSignalReads === true) {
229
- + modules.add('octane/signals/client');
230
- + modules.add('octane/signals/server');
231
- + }
232
- @@ -11087,6 +11087,11 @@ function compileInternal(
233
- - universalRuntime: undefined,
234
- - rendererBoundaries: undefined,
235
- - rendererRegistry: undefined,
236
- - __hookRuntimeModules: [...(options?.__hookRuntimeModules || []), renderer.module],
237
- - __runtimeImportRoutes: [
238
- - ...(options?.__runtimeImportRoutes ?? []),
239
- + universalRuntime: undefined,
240
- + rendererBoundaries: undefined,
241
- + rendererRegistry: undefined,
221
+ modules.add('octane/signals/client');
222
+ modules.add('octane/signals/server');
223
+ }
224
+ @@ -11633,6 +11633,11 @@ function compileInternal(
225
+ universalRuntime: undefined,
226
+ rendererBoundaries: undefined,
227
+ rendererRegistry: undefined,
242
228
  + // Universal owners observe reads at render time; the inner
243
229
  + // compile must not emit the DOM native-read runtime helpers,
244
230
  + // but signal hook classification still applies.
245
231
  + nativeReads: false,
246
232
  + __universalSignalReads: options.nativeReads === true,
247
- + __hookRuntimeModules: [...(options?.__hookRuntimeModules || []), renderer.module],
248
- + __runtimeImportRoutes: [
249
- + ...(options?.__runtimeImportRoutes ?? []),
250
- @@ -11346,6 +11351,7 @@ function compileInternal(
251
- - nativeReads: options?.nativeReads === true,
252
- - opaqueSignalHandles:
253
- - options?.opaqueSignalHandles === true || options?.__signalModuleImport === true,
254
- - nativeModuleStyles: options?.nativeReads === true && hasModuleStyleMaps(ast.body),
255
- - signalHookSites: domSignalTarget(options),
256
- - // A split Hydrate query module is invoked as the existing server-rendered
257
- + nativeReads: options?.nativeReads === true,
258
- + opaqueSignalHandles:
259
- + options?.opaqueSignalHandles === true || options?.__signalModuleImport === true,
233
+ __hookRuntimeModules: [...(options?.__hookRuntimeModules || []), renderer.module],
234
+ __runtimeImportRoutes: [
235
+ ...(options?.__runtimeImportRoutes ?? []),
236
+ @@ -11920,6 +11925,7 @@ function compileInternal(
237
+ nativeReads: options?.nativeReads === true,
238
+ opaqueSignalHandles:
239
+ options?.opaqueSignalHandles === true || options?.__signalModuleImport === true,
260
240
  + signalReads: options?.nativeReads === true || options?.__universalSignalReads === true,
261
- + nativeModuleStyles: options?.nativeReads === true && hasModuleStyleMaps(ast.body),
262
- + signalHookSites: domSignalTarget(options),
263
- + // A split Hydrate query module is invoked as the existing server-rendered
264
- @@ -12814,6 +12820,7 @@ function compileServer(
265
- - nativeReads: options?.nativeReads === true,
266
- - opaqueSignalHandles:
267
- - options?.opaqueSignalHandles === true || options?.__signalModuleImport === true,
268
- - nativeModuleStyles: options?.nativeReads === true && hasModuleStyleMaps(ast.body),
269
- - signalHookSites: domSignalTarget(options),
270
- - hmr: false, // SSR never hot-swaps in place; client/server production slot shapes stay aligned
271
- + nativeReads: options?.nativeReads === true,
272
- + opaqueSignalHandles:
273
- + options?.opaqueSignalHandles === true || options?.__signalModuleImport === true,
241
+ nativeModuleStyles: options?.nativeReads === true && hasModuleStyleMaps(ast.body),
242
+ signalHookSites: domSignalTarget(options),
243
+ // A split Hydrate query module is invoked as the existing server-rendered
244
+ @@ -13467,6 +13473,7 @@ function compileServer(
245
+ nativeReads: options?.nativeReads === true,
246
+ opaqueSignalHandles:
247
+ options?.opaqueSignalHandles === true || options?.__signalModuleImport === true,
274
248
  + signalReads: options?.nativeReads === true || options?.__universalSignalReads === true,
275
- + nativeModuleStyles: options?.nativeReads === true && hasModuleStyleMaps(ast.body),
276
- + signalHookSites: domSignalTarget(options),
277
- + hmr: false, // SSR never hot-swaps in place; client/server production slot shapes stay aligned
278
- @@ -20130,7 +20137,7 @@ function slotKeyedHookName(n, ctx) {
279
- - ctx.foreignImportLocals?.has(local) === true;
280
- - if (
281
- - imported !== undefined &&
249
+ nativeModuleStyles: options?.nativeReads === true && hasModuleStyleMaps(ast.body),
250
+ signalHookSites: domSignalTarget(options),
251
+ hmr: false, // SSR never hot-swaps in place; client/server production slot shapes stay aligned
252
+ @@ -21093,7 +21100,7 @@ function slotKeyedHookName(n, ctx) {
253
+ ctx.foreignImportLocals?.has(local) === true;
254
+ if (
255
+ imported !== undefined &&
282
256
  - (HOOK_NAMES.has(imported) || (ctx.nativeReads && NATIVE_SIGNAL_HOOK_NAMES.has(imported)))
283
- - )
284
- - return imported;
285
- - if (!shadowsImport && HOOK_NAMES.has(local)) return local;
286
- + ctx.foreignImportLocals?.has(local) === true;
287
- + if (
288
- + imported !== undefined &&
289
257
  + (HOOK_NAMES.has(imported) || (ctx.signalReads && NATIVE_SIGNAL_HOOK_NAMES.has(imported)))
290
- + )
291
- + return imported;
292
- + if (!shadowsImport && HOOK_NAMES.has(local)) return local;
293
- @@ -20140,7 +20147,7 @@ function slotKeyedHookName(n, ctx) {
294
- - const imported = n._octaneImportedHook ?? n._octaneHookRuntimeImportedHook;
295
- - if (
296
- - imported !== undefined &&
258
+ )
259
+ return imported;
260
+ if (!shadowsImport && HOOK_NAMES.has(local)) return local;
261
+ @@ -21103,7 +21110,7 @@ function slotKeyedHookName(n, ctx) {
262
+ const imported = n._octaneImportedHook ?? n._octaneHookRuntimeImportedHook;
263
+ if (
264
+ imported !== undefined &&
297
265
  - (HOOK_NAMES.has(imported) || (ctx.nativeReads && NATIVE_SIGNAL_HOOK_NAMES.has(imported)))
298
- - ) {
299
- - return imported;
300
- - }
301
- + const imported = n._octaneImportedHook ?? n._octaneHookRuntimeImportedHook;
302
- + if (
303
- + imported !== undefined &&
304
266
  + (HOOK_NAMES.has(imported) || (ctx.signalReads && NATIVE_SIGNAL_HOOK_NAMES.has(imported)))
305
- + ) {
306
- + return imported;
307
- + }
308
- @@ -20996,7 +21003,7 @@ function rewriteHookCalls(node, ctx, componentName, localRoot = false) {
309
- - // enforced by rejectHookInJsLoop.
310
- - const isBuiltin =
311
- - (HOOK_NAMES.has(name) ||
267
+ ) {
268
+ return imported;
269
+ }
270
+ @@ -21966,7 +21973,7 @@ function rewriteHookCalls(node, ctx, componentName, localRoot = false) {
271
+ // enforced by rejectHookInJsLoop.
272
+ const isBuiltin =
273
+ (HOOK_NAMES.has(name) ||
312
274
  - (ctx.nativeReads &&
313
- - hookRuntimeImportedName !== undefined &&
314
- - NATIVE_SIGNAL_HOOK_NAMES.has(name))) &&
315
- - (generated ||
316
- + // enforced by rejectHookInJsLoop.
317
- + const isBuiltin =
318
- + (HOOK_NAMES.has(name) ||
319
275
  + (ctx.signalReads &&
320
- + hookRuntimeImportedName !== undefined &&
321
- + NATIVE_SIGNAL_HOOK_NAMES.has(name))) &&
322
- + (generated ||
323
- @@ -21127,7 +21134,7 @@ function rewriteHookCalls(node, ctx, componentName, localRoot = false) {
324
- - ) {
325
- - const name = n._octaneImportedHook ?? n._octaneHookRuntimeImportedHook;
326
- - const isBuiltin =
276
+ hookRuntimeImportedName !== undefined &&
277
+ NATIVE_SIGNAL_HOOK_NAMES.has(name))) &&
278
+ (generated ||
279
+ @@ -22097,7 +22104,7 @@ function rewriteHookCalls(node, ctx, componentName, localRoot = false) {
280
+ ) {
281
+ const name = n._octaneImportedHook ?? n._octaneHookRuntimeImportedHook;
282
+ const isBuiltin =
327
283
  - HOOK_NAMES.has(name) || (ctx.nativeReads && NATIVE_SIGNAL_HOOK_NAMES.has(name));
328
- - const isServerUse = name === 'use' && ctx.mode === 'server';
329
- - if (isBuiltin || isServerUse) {
330
- - if (isBuiltin) {
331
- + ) {
332
- + const name = n._octaneImportedHook ?? n._octaneHookRuntimeImportedHook;
333
- + const isBuiltin =
334
284
  + HOOK_NAMES.has(name) || (ctx.signalReads && NATIVE_SIGNAL_HOOK_NAMES.has(name));
335
- + const isServerUse = name === 'use' && ctx.mode === 'server';
336
- + if (isBuiltin || isServerUse) {
337
- + if (isBuiltin) {
285
+ const isServerUse = name === 'use' && ctx.mode === 'server';
286
+ if (isBuiltin || isServerUse) {
287
+ if (isBuiltin) {
338
288
  diff --git a/dist/compiler/native-read-diagnostics.js b/dist/compiler/native-read-diagnostics.js
339
- index 89c9b5a..3baf9e9 100644
289
+ index 7b2acff..d3356b4 100644
340
290
  --- a/dist/compiler/native-read-diagnostics.js
341
291
  +++ b/dist/compiler/native-read-diagnostics.js
342
- @@ -100,9 +100,12 @@ export function assertNativeReadOptions(options) {
343
- - if (
344
- - options?.nativeReads === true &&
345
- - options.renderer?.target != null &&
292
+ @@ -149,9 +149,12 @@ export function assertNativeReadOptions(options) {
293
+ if (
294
+ options?.nativeReads === true &&
295
+ options.renderer?.target != null &&
346
296
  - options.renderer.target !== 'dom'
347
- - ) {
348
- - throw new Error('Octane native signal reads support only the DOM client and server.');
349
- - }
350
- + if (
351
- + options?.nativeReads === true &&
352
- + options.renderer?.target != null &&
353
297
  + options.renderer.target !== 'dom' &&
354
298
  + options.renderer.target !== 'universal'
355
- + ) {
299
+ ) {
300
+ - throw new Error('Octane native signal reads support only the DOM client and server.');
356
301
  + throw new Error(
357
302
  + 'Octane native signal reads support only the DOM client, DOM server, and universal renderers.',
358
303
  + );
359
- + }
304
+ }
360
305
  }
361
-
362
- @@ -121,11 +124,11 @@ export function analyzeNativeReadDiagnostics(ast, source, filename, options = {}
363
- - filename,
364
- - rendererBoundaries: options.rendererBoundaries,
365
- - });
306
+
307
+ @@ -200,11 +203,11 @@ export function analyzeNativeReadDiagnostics(ast, source, filename, options = {}
308
+ filename,
309
+ rendererBoundaries: options.rendererBoundaries,
310
+ });
366
311
  - const unsupported = boundaries.find(
367
312
  - (boundary) =>
368
313
  - boundary.childRenderer !== 'dom' &&
369
314
  - options.rendererRegistry?.[boundary.childRenderer]?.target !== 'dom',
370
315
  - );
371
- - if (unsupported)
372
- - return [
373
- - nativeReadDiagnostic(
374
- + filename,
375
- + rendererBoundaries: options.rendererBoundaries,
376
- + });
377
316
  + const unsupported = boundaries.find((boundary) => {
378
317
  + if (boundary.childRenderer === 'dom') return false;
379
318
  + const target = options.rendererRegistry?.[boundary.childRenderer]?.target;
380
319
  + return target !== 'dom' && target !== 'universal';
381
320
  + });
382
- + if (unsupported)
383
- + return [
384
- + nativeReadDiagnostic(
321
+ if (unsupported)
322
+ return [
323
+ nativeReadDiagnostic(
385
324
  diff --git a/dist/compiler/slot-hooks.js b/dist/compiler/slot-hooks.js
386
- index 90848a6..474c2bb 100644
325
+ index e4c9bfb..7ca6112 100644
387
326
  --- a/dist/compiler/slot-hooks.js
388
327
  +++ b/dist/compiler/slot-hooks.js
389
- @@ -1034,12 +1034,12 @@ function walk(node, owner, st) {
390
- - }
391
- - const imported =
392
- - node._octaneImportedHook ??
328
+ @@ -1044,12 +1044,12 @@ function walk(node, owner, st) {
329
+ }
330
+ const imported =
331
+ node._octaneImportedHook ??
393
332
  - (st.nativeReads ? node._octaneHookRuntimeImportedHook : undefined);
394
- - collectStateGetterEdit(node, imported, st);
395
- - if (
396
- - !st.manualSlots &&
397
- - imported &&
398
- - (HOOK_NAMES.has(imported) || (st.nativeReads && NATIVE_SIGNAL_HOOK_NAMES.has(imported)))
399
- - ) {
400
- - const local =
401
- - node.callee?.type === 'Identifier'
402
- + }
403
- + const imported =
404
- + node._octaneImportedHook ??
405
333
  + (st.signalReads ? node._octaneHookRuntimeImportedHook : undefined);
406
- + collectStateGetterEdit(node, imported, st);
407
- + if (
408
- + !st.manualSlots &&
409
- + imported &&
334
+ collectStateGetterEdit(node, imported, st);
335
+ if (
336
+ !st.manualSlots &&
337
+ imported &&
338
+ - (HOOK_NAMES.has(imported) || (st.nativeReads && NATIVE_SIGNAL_HOOK_NAMES.has(imported)))
410
339
  + (HOOK_NAMES.has(imported) || (st.signalReads && NATIVE_SIGNAL_HOOK_NAMES.has(imported)))
411
- + ) {
412
- + const local =
413
- + node.callee?.type === 'Identifier'
414
- @@ -1255,7 +1255,9 @@ export function slotHooks(source, id, options) {
415
- - HOOK_NAMES.has(name),
416
- - );
417
- - const manualProviders = options?.manualSlots ? findManualHookProviders(ast) : new Map();
340
+ ) {
341
+ const local =
342
+ node.callee?.type === 'Identifier'
343
+ @@ -1265,7 +1265,9 @@ export function slotHooks(source, id, options) {
344
+ HOOK_NAMES.has(name),
345
+ );
346
+ const manualProviders = options?.manualSlots ? findManualHookProviders(ast) : new Map();
418
347
  - const nativeReadActivation = options?.nativeReads === true && importsNativeRenderer(ast);
419
- - // Native signal reads exist only for the DOM client and server renderers.
420
- - const signalHookSites =
421
- - (options?.renderer?.target ?? 'dom') === 'dom' && options?.universalRuntime == null;
422
- + HOOK_NAMES.has(name),
423
- + );
424
- + const manualProviders = options?.manualSlots ? findManualHookProviders(ast) : new Map();
425
348
  + const universalTarget = options?.renderer?.target === 'universal';
426
349
  + const nativeReadActivation =
427
350
  + options?.nativeReads === true && !universalTarget && importsNativeRenderer(ast);
428
- + // Native signal reads exist only for the DOM client and server renderers.
429
- + const signalHookSites =
430
- + (options?.renderer?.target ?? 'dom') === 'dom' && options?.universalRuntime == null;
431
- @@ -1350,7 +1352,8 @@ export function slotHooks(source, id, options) {
432
- - ]),
433
- - ),
434
- - manualSlots: options?.manualSlots === true,
351
+ // Native signal reads exist only for the DOM client and server renderers.
352
+ const signalHookSites =
353
+ (options?.renderer?.target ?? 'dom') === 'dom' && options?.universalRuntime == null;
354
+ @@ -1376,7 +1378,8 @@ export function slotHooks(source, id, options) {
355
+ ]),
356
+ ),
357
+ manualSlots: options?.manualSlots === true,
435
358
  - nativeReads: options?.nativeReads === true,
436
- - signalHookSites,
437
- - locals: importInfo.locals,
438
- - source,
439
- + ]),
440
- + ),
441
- + manualSlots: options?.manualSlots === true,
442
359
  + nativeReads: options?.nativeReads === true && !universalTarget,
443
360
  + signalReads: options?.nativeReads === true,
444
- + signalHookSites,
445
- + locals: importInfo.locals,
446
- + source,
447
- @@ -1459,7 +1462,9 @@ export function slotHooks(source, id, options) {
448
- - ? 'enableServerSignalBindings'
449
- - : nativeReadActivation
450
- - ? 'enableSignalBindings'
451
- - : '__enableSignalDocument';
452
- - const local = allocSlotName(st, `_$${imported}`);
453
- - let specifiers = signalHelperImports.get(request);
454
- - if (specifiers === undefined) signalHelperImports.set(request, (specifiers = []));
455
- + ? 'enableServerSignalBindings'
456
- + : nativeReadActivation
457
- + ? 'enableSignalBindings'
361
+ signalHookSites,
362
+ locals: importInfo.locals,
363
+ source,
364
+ @@ -1489,6 +1492,8 @@ export function slotHooks(source, id, options) {
365
+ ? 'enableServerSignalBindings'
366
+ : nativeReadActivation
367
+ ? 'enableSignalBindings'
458
368
  + : universalTarget
459
369
  + ? '__enableUniversalSignalDocument'
460
- + : '__enableSignalDocument';
461
- + const local = allocSlotName(st, `_$${imported}`);
462
- + let specifiers = signalHelperImports.get(request);
463
- + if (specifiers === undefined) signalHelperImports.set(request, (specifiers = []));
464
- diff --git a/dist/node/runtime.js b/dist/node/runtime.js
465
- index 927d060..d311ac9 100644
466
- --- a/dist/node/runtime.js
467
- +++ b/dist/node/runtime.js
468
- @@ -185,6 +185,7 @@ import {
469
- createNativeReadDriver,
470
- rebaseNativeRead
471
- } from "./signals/native-read-client.js";
472
- +import { registerLocalSignalHook } from "./signals/local-hook.js";
473
- import {
474
- validateNativeReadWitness
475
- } from "./signals/native-read-collector.js";
476
- @@ -8398,6 +8399,7 @@ function nativeLocalHook(name, initialize, dispose, slot) {
370
+ : '__enableSignalDocument';
371
+ const local = allocSlotName(st, `_$${imported}`);
372
+ let specifiers = signalHelperImports.get(request);
373
+ diff --git a/dist/node/runtime/hooks.js b/dist/node/runtime/hooks.js
374
+ index 76f5deb..96fd3ac 100644
375
+ --- a/dist/node/runtime/hooks.js
376
+ +++ b/dist/node/runtime/hooks.js
377
+ @@ -1,3 +1,4 @@
378
+ +import { registerLocalSignalHook } from "../signals/local-hook.js";
379
+ const __octaneDev = process.env.NODE_ENV !== "production";
380
+ import {} from "./view-transition.js";
381
+ import { resolveHookPath } from "../hook-slot-cache.js";
382
+ @@ -102,6 +103,7 @@ function nativeLocalHook(name, initialize, dispose, slot) {
477
383
  }
478
384
  return cell.nativeValue;
479
385
  }
480
386
  +registerLocalSignalHook(() => CURRENT_SCOPE === null ? null : nativeLocalHook);
481
- function useState(initial, slot) {
482
- const s = readStateHook(initial, slot, arguments.length === 1);
483
- return [s.value, s.setter];
484
- @@ -9532,6 +9534,8 @@ function renderClientContextProvider(context, props, renderScope) {
485
- ensureHooks(scope).set(CHILDREN_DIALECT_SLOT, dialect);
486
- }
487
- renderSharedBody(childrenAsBody(children), void 0, scope, void 0);
488
- + } else {
489
- + resetScopeChildren(scope);
490
- }
387
+ function applyHookUpdate(state, action, reducer) {
388
+ return reducer !== null ? reducer(state, action) : typeof action === "function" ? action(state) : action;
389
+ }
390
+ diff --git a/dist/node/runtime/templates.js b/dist/node/runtime/templates.js
391
+ index 860aacd..af91a29 100644
392
+ --- a/dist/node/runtime/templates.js
393
+ +++ b/dist/node/runtime/templates.js
394
+ @@ -388,6 +388,7 @@ function bag16(s, r, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, $ = 0, next
395
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, __journalWindow: 0, $, next, [BINDING_BAG_ARITY]: 16 });
396
+ }
397
+ function bagOf(s, r, bag) {
398
+ + bag[BINDING_BAG_ARITY] = -1;
399
+ return commitBag(s, r, bag);
491
400
  }
492
- let SHARED_BODY_SCOPE = null;
401
+ function coerceText(value) {
493
402
  diff --git a/dist/node/signals/client.js b/dist/node/signals/client.js
494
403
  index 21a39c3..3f85700 100644
495
404
  --- a/dist/node/signals/client.js
@@ -497,27 +406,22 @@ index 21a39c3..3f85700 100644
497
406
  @@ -1,11 +1,11 @@
498
407
  export * from "./index.js";
499
408
  -import { nativeLocalHook } from "../runtime.js";
500
- -import { createLocalScope } from "./engine.js";
501
- -function disposeLocalSignal(cell) {
502
- - cell.scope.dispose();
503
- -}
504
- -function useSignal$(initial, slot) {
505
- - const cell = nativeLocalHook(
506
- +import { createLocalScope } from "./engine.js";
409
+ import { createLocalScope } from "./engine.js";
507
410
  +import { localSignalHook } from "./local-hook.js";
508
- +function disposeLocalSignal(cell) {
509
- + cell.scope.dispose();
510
- +}
511
- +function useSignal$(initial, slot) {
411
+ function disposeLocalSignal(cell) {
412
+ cell.scope.dispose();
413
+ }
414
+ function useSignal$(initial, slot) {
415
+ - const cell = nativeLocalHook(
512
416
  + const cell = localSignalHook(
513
417
  "useSignal$",
514
418
  () => {
515
419
  const value = typeof initial === "function" ? initial() : initial;
516
420
  diff --git a/dist/node/signals/document-owner.js b/dist/node/signals/document-owner.js
517
- index 35db8d5..aeeaabc 100644
421
+ index 3b50394..e809030 100644
518
422
  --- a/dist/node/signals/document-owner.js
519
423
  +++ b/dist/node/signals/document-owner.js
520
- @@ -28,9 +28,8 @@ function enableSignalDocument(abi = 1) {
424
+ @@ -30,9 +30,8 @@ function enableSignalDocument(abi = 1) {
521
425
  if (defaultInstalled) return;
522
426
  defaultInstalled = true;
523
427
  signalOwnerFrame = { enter: enterSynchronousSignalOwner, restore: restoreSynchronousSignalOwner };
@@ -530,11 +434,11 @@ index 35db8d5..aeeaabc 100644
530
434
  function installStreamedSignalOwnerActivator(activate) {
531
435
  if (streamedSignalOwnerActivator !== void 0) {
532
436
  diff --git a/dist/node/signals/facade.js b/dist/node/signals/facade.js
533
- index 11ec297..575233b 100644
437
+ index 5b5554e..1deabb0 100644
534
438
  --- a/dist/node/signals/facade.js
535
439
  +++ b/dist/node/signals/facade.js
536
440
  @@ -326,7 +326,7 @@ class Descriptor {
537
- }
441
+ lexical;
538
442
  /** The owner a use resolves for: its reader, or for a lexical handle its declaring owner. */
539
443
  reader() {
540
444
  - return this.lexical === this ? this.owner : requireOwner();
@@ -614,7 +518,7 @@ index 0000000..ff5eb43
614
518
  + universalSignalDocument
615
519
  +};
616
520
  diff --git a/dist/node/universal-core.js b/dist/node/universal-core.js
617
- index aa045ee..38d6b2b 100644
521
+ index 8c89dbd..ff1defa 100644
618
522
  --- a/dist/node/universal-core.js
619
523
  +++ b/dist/node/universal-core.js
620
524
  @@ -17,6 +17,10 @@ import {
@@ -762,7 +666,7 @@ index aa045ee..38d6b2b 100644
762
666
  function universalChildren(renderer, render) {
763
667
  assertRendererId(renderer, "universalChildren renderer");
764
668
  if (typeof render !== "function") throw new TypeError("universalChildren expected a function.");
765
- @@ -863,6 +994,7 @@ function draftOwner(record, parent, replayPath) {
669
+ @@ -856,6 +987,7 @@ function draftOwner(record, parent, replayPath) {
766
670
  boundaryThenable: record.boundaryThenable,
767
671
  isBoundary: record.isBoundary,
768
672
  canHandleSuspense: record.canHandleSuspense,
@@ -770,7 +674,7 @@ index aa045ee..38d6b2b 100644
770
674
  visibility: parent?.visibility ?? record.visibility,
771
675
  contextStable: null
772
676
  };
773
- @@ -1033,6 +1165,7 @@ function executeOwner(owner, build, initialRenderCount = 0) {
677
+ @@ -1066,6 +1198,7 @@ function executeOwner(owner, build, initialRenderCount = 0) {
774
678
  owner.contextStable = null;
775
679
  owner.needsRender = false;
776
680
  owner.implicitSlot = 0;
@@ -778,33 +682,29 @@ index aa045ee..38d6b2b 100644
778
682
  const previousOwner = CURRENT_OWNER;
779
683
  const previousAttemptOwner = attempt.owner;
780
684
  CURRENT_OWNER = owner;
781
- @@ -1044,13 +1177,18 @@ function executeOwner(owner, build, initialRenderCount = 0) {
685
+ @@ -1077,13 +1210,18 @@ function executeOwner(owner, build, initialRenderCount = 0) {
782
686
  const profileFrame = typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__ && component !== null ? __profileBeginRender(owner.record, component, owner.record.mounted) : null;
783
687
  let didThrow = false;
784
688
  let thrown;
785
- - try {
786
- - output = build();
787
- - } catch (error) {
788
- - didThrow = true;
789
- - thrown = error;
790
- - throw error;
791
- - } finally {
792
689
  + const signalOwner = universalSignalOwner(owner.record);
793
690
  + const previousReadObserver = setNativeReadObserver(observeUniversalSignalRead);
794
691
  + const writeGuard = beginNativeWriteGuard();
795
- + try {
692
+ try {
693
+ - output = build();
796
694
  + output = runWithSignalOwner(signalOwner, build);
797
- + } catch (error) {
798
- + didThrow = true;
695
+ } catch (error) {
696
+ didThrow = true;
697
+ - thrown = error;
698
+ - throw error;
799
699
  + thrown = isThenable(error) ? new UniversalSuspense(error) : error;
800
700
  + throw thrown;
801
- + } finally {
701
+ } finally {
802
702
  + endNativeWriteGuard(writeGuard);
803
703
  + setNativeReadObserver(previousReadObserver);
804
704
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__) {
805
705
  __profileEndRender(profileFrame, didThrow, thrown);
806
706
  }
807
- @@ -1214,6 +1352,8 @@ function disposeUncommittedDraft(owner) {
707
+ @@ -1247,6 +1385,8 @@ function disposeUncommittedDraft(owner) {
808
708
  owner.record.componentProps = null;
809
709
  owner.record.range = null;
810
710
  owner.record.updates.clear();
@@ -813,7 +713,7 @@ index aa045ee..38d6b2b 100644
813
713
  for (const hook of owner.hooks.values()) {
814
714
  if (hook.kind === "effect-event") hook.cell.active = false;
815
715
  }
816
- @@ -3048,6 +3188,7 @@ function tryCreateCompactTemplateUpdateTransaction(root, blueprint, attempt, com
716
+ @@ -3081,6 +3221,7 @@ function tryCreateCompactTemplateUpdateTransaction(root, blueprint, attempt, com
817
717
  owner.componentProps = draftOwner2.componentProps;
818
718
  owner.componentRevision = draftOwner2.componentRevision;
819
719
  owner.hooks = draftOwner2.hooks;
@@ -821,7 +721,7 @@ index aa045ee..38d6b2b 100644
821
721
  for (const [slot, applied] of draftOwner2.appliedUpdates) {
822
722
  const queue = owner.updates.get(slot);
823
723
  if (queue !== applied.queue || applied.lane) continue;
824
- @@ -3514,6 +3655,86 @@ function scheduleOwner(owner, slot) {
724
+ @@ -3628,6 +3769,86 @@ function scheduleOwner(owner, slot) {
825
725
  }
826
726
  owner.root.scheduleOwned(owner);
827
727
  }
@@ -908,7 +808,7 @@ index aa045ee..38d6b2b 100644
908
808
  function currentDraftOwner() {
909
809
  currentAttempt();
910
810
  const owner = activateLazyLeafOwner();
911
- @@ -4628,15 +4849,35 @@ function use(usable) {
811
+ @@ -4742,15 +4963,35 @@ function use(usable) {
912
812
  function useImperativeHandle(ref, create, deps, slot) {
913
813
  useLayoutEffect(
914
814
  () => {
@@ -918,9 +818,6 @@ index aa045ee..38d6b2b 100644
918
818
  - return () => {
919
819
  - if (typeof ref === "function") ref(null);
920
820
  - else if (ref !== null) ref.current = null;
921
- - };
922
- - },
923
- - deps,
924
821
  + const cleanups = [];
925
822
  + let value;
926
823
  + let initialized = false;
@@ -941,32 +838,32 @@ index aa045ee..38d6b2b 100644
941
838
  + target.current = value;
942
839
  + cleanups.push(() => { target.current = null; });
943
840
  + }
944
- + };
841
+ };
945
842
  + try {
946
843
  + attach(ref);
947
844
  + } catch (error) {
948
845
  + try { runCommitTasks(cleanups); } finally { throw error; }
949
846
  + }
950
847
  + return () => runCommitTasks(cleanups);
951
- + },
848
+ },
849
+ - deps,
952
850
  + deps == null ? deps : [...deps, ref],
953
851
  slot
954
852
  );
955
853
  }
956
- @@ -5631,9 +5872,9 @@ class UniversalRootImpl {
854
+ @@ -5745,9 +5986,9 @@ class UniversalRootImpl {
957
855
  }
958
856
  let result;
959
857
  try {
960
858
  - result = event.handler(payload);
961
- - } catch (error) {
962
- - if (!routeUniversalOwnerError(event.owner, error)) throw error;
963
859
  + result = runWithSignalOwner(universalSignalOwner(event.owner), () => event.handler(payload));
964
- + } catch (error) {
860
+ } catch (error) {
861
+ - if (!routeUniversalOwnerError(event.owner, error)) throw error;
965
862
  + if (!routeUniversalOwnerError(event.owner, error) && !reportUniversalUncaughtError(this, error)) throw error;
966
863
  }
967
864
  return result;
968
865
  }
969
- @@ -6204,6 +6445,8 @@ class UniversalRootImpl {
866
+ @@ -6318,6 +6559,8 @@ class UniversalRootImpl {
970
867
  draft.record.componentProps = null;
971
868
  draft.record.range = null;
972
869
  draft.record.updates.clear();
@@ -975,7 +872,7 @@ index aa045ee..38d6b2b 100644
975
872
  for (const hook of draft.hooks.values()) {
976
873
  if (hook.kind === "effect-event") hook.cell.active = false;
977
874
  }
978
- @@ -6721,6 +6964,7 @@ class UniversalRootImpl {
875
+ @@ -6836,6 +7079,7 @@ class UniversalRootImpl {
979
876
  record.componentRevision = draft.componentRevision;
980
877
  record.parent = draft.parent?.record ?? null;
981
878
  record.hooks = draft.hooks;
@@ -983,7 +880,7 @@ index aa045ee..38d6b2b 100644
983
880
  record.effectOrder = [...draft.seenEffects];
984
881
  for (let index = 0; index < draft.seenEffects.length; index++) {
985
882
  draft.seenEffects[index].previous = null;
986
- @@ -8369,6 +8613,8 @@ class UniversalRootImpl {
883
+ @@ -8484,6 +8728,8 @@ class UniversalRootImpl {
987
884
  owner.componentProps = null;
988
885
  owner.range = null;
989
886
  owner.updates.clear();
@@ -992,7 +889,7 @@ index aa045ee..38d6b2b 100644
992
889
  }
993
890
  for (const draft of draftOwnersParentFirst) {
994
891
  const record = draft.record;
995
- @@ -8378,6 +8624,7 @@ class UniversalRootImpl {
892
+ @@ -8493,6 +8739,7 @@ class UniversalRootImpl {
996
893
  record.parent = draft.parent?.record ?? null;
997
894
  }
998
895
  record.hooks = draft.hooks;
@@ -1000,7 +897,7 @@ index aa045ee..38d6b2b 100644
1000
897
  record.effectOrder = [...draft.seenEffects];
1001
898
  for (let index = 0; index < draft.seenEffects.length; index++) {
1002
899
  draft.seenEffects[index].previous = null;
1003
- @@ -8889,6 +9136,8 @@ class UniversalRootImpl {
900
+ @@ -9004,6 +9251,8 @@ class UniversalRootImpl {
1004
901
  owner.componentProps = null;
1005
902
  owner.range = null;
1006
903
  owner.updates.clear();
@@ -1009,7 +906,7 @@ index aa045ee..38d6b2b 100644
1009
906
  }
1010
907
  const deactivatedRegionCells = /* @__PURE__ */ new Set();
1011
908
  for (const bridge of regionBridges) {
1012
- @@ -10105,6 +10354,7 @@ function createObjectDriver(renderer = "object") {
909
+ @@ -10220,6 +10469,7 @@ function createObjectDriver(renderer = "object") {
1013
910
  };
1014
911
  }
1015
912
  export {
@@ -1025,14 +922,11 @@ index 55ac9b6..399633e 100644
1025
922
  import {
1026
923
  universalContext
1027
924
  } from "./universal-core.js";
1028
- -import { registerRendererContext, renderRendererContextProvider } from "./renderer-bridge.js";
1029
- -import { CONTEXT_TAG } from "./runtime-tags.js";
1030
- -import { registerContext } from "./context-identity.js";
1031
925
  +export { Children } from "./universal-core.js";
1032
926
  +import { enableUniversalSignalDocument } from "./signals/universal-owner.js";
1033
- +import { registerRendererContext, renderRendererContextProvider } from "./renderer-bridge.js";
1034
- +import { CONTEXT_TAG } from "./runtime-tags.js";
1035
- +import { registerContext } from "./context-identity.js";
927
+ import { registerRendererContext, renderRendererContextProvider } from "./renderer-bridge.js";
928
+ import { CONTEXT_TAG } from "./runtime-tags.js";
929
+ import { registerContext } from "./context-identity.js";
1036
930
  +enableUniversalSignalDocument();
1037
931
  // @__NO_SIDE_EFFECTS__
1038
932
  function createContext(defaultValue) {
@@ -1051,35 +945,35 @@ index 6427a01..8049b78 100644
1051
945
  export {
1052
946
  createContext,
1053
947
  createSubSlot,
1054
- diff --git a/dist/runtime.js b/dist/runtime.js
1055
- index 67ace09..afeb8ea 100644
1056
- --- a/dist/runtime.js
1057
- +++ b/dist/runtime.js
1058
- @@ -184,6 +184,7 @@ import {
1059
- createNativeReadDriver,
1060
- rebaseNativeRead
1061
- } from "./signals/native-read-client.js";
1062
- +import { registerLocalSignalHook } from "./signals/local-hook.js";
1063
- import {
1064
- validateNativeReadWitness
1065
- } from "./signals/native-read-collector.js";
1066
- @@ -8397,6 +8398,7 @@ function nativeLocalHook(name, initialize, dispose, slot) {
948
+ diff --git a/dist/runtime/hooks.js b/dist/runtime/hooks.js
949
+ index 3365680..b369f2d 100644
950
+ --- a/dist/runtime/hooks.js
951
+ +++ b/dist/runtime/hooks.js
952
+ @@ -1,3 +1,4 @@
953
+ +import { registerLocalSignalHook } from "../signals/local-hook.js";
954
+ import {} from "./view-transition.js";
955
+ import { resolveHookPath } from "../hook-slot-cache.js";
956
+ import { __profileResolveHook, __profileSchedule, __profileCacheHit } from "../profiling.js";
957
+ @@ -101,6 +102,7 @@ function nativeLocalHook(name, initialize, dispose, slot) {
1067
958
  }
1068
959
  return cell.nativeValue;
1069
960
  }
1070
961
  +registerLocalSignalHook(() => CURRENT_SCOPE === null ? null : nativeLocalHook);
1071
- function useState(initial, slot) {
1072
- const s = readStateHook(initial, slot, arguments.length === 1);
1073
- return [s.value, s.setter];
1074
- @@ -9531,6 +9533,8 @@ function renderClientContextProvider(context, props, renderScope) {
1075
- ensureHooks(scope).set(CHILDREN_DIALECT_SLOT, dialect);
1076
- }
1077
- renderSharedBody(childrenAsBody(children), void 0, scope, void 0);
1078
- + } else {
1079
- + resetScopeChildren(scope);
1080
- }
962
+ function applyHookUpdate(state, action, reducer) {
963
+ return reducer !== null ? reducer(state, action) : typeof action === "function" ? action(state) : action;
964
+ }
965
+ diff --git a/dist/runtime/templates.js b/dist/runtime/templates.js
966
+ index 5aa86e8..b700681 100644
967
+ --- a/dist/runtime/templates.js
968
+ +++ b/dist/runtime/templates.js
969
+ @@ -387,6 +387,7 @@ function bag16(s, r, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, $ = 0, next
970
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, __journalWindow: 0, $, next, [BINDING_BAG_ARITY]: 16 });
1081
971
  }
1082
- let SHARED_BODY_SCOPE = null;
972
+ function bagOf(s, r, bag) {
973
+ + bag[BINDING_BAG_ARITY] = -1;
974
+ return commitBag(s, r, bag);
975
+ }
976
+ function coerceText(value) {
1083
977
  diff --git a/dist/signals/client.d.ts b/dist/signals/client.d.ts
1084
978
  index 6388c2f..f9e9862 100644
1085
979
  --- a/dist/signals/client.d.ts
@@ -1097,27 +991,22 @@ index 21a39c3..3f85700 100644
1097
991
  @@ -1,11 +1,11 @@
1098
992
  export * from "./index.js";
1099
993
  -import { nativeLocalHook } from "../runtime.js";
1100
- -import { createLocalScope } from "./engine.js";
1101
- -function disposeLocalSignal(cell) {
1102
- - cell.scope.dispose();
1103
- -}
1104
- -function useSignal$(initial, slot) {
1105
- - const cell = nativeLocalHook(
1106
- +import { createLocalScope } from "./engine.js";
994
+ import { createLocalScope } from "./engine.js";
1107
995
  +import { localSignalHook } from "./local-hook.js";
1108
- +function disposeLocalSignal(cell) {
1109
- + cell.scope.dispose();
1110
- +}
1111
- +function useSignal$(initial, slot) {
996
+ function disposeLocalSignal(cell) {
997
+ cell.scope.dispose();
998
+ }
999
+ function useSignal$(initial, slot) {
1000
+ - const cell = nativeLocalHook(
1112
1001
  + const cell = localSignalHook(
1113
1002
  "useSignal$",
1114
1003
  () => {
1115
1004
  const value = typeof initial === "function" ? initial() : initial;
1116
1005
  diff --git a/dist/signals/document-owner.js b/dist/signals/document-owner.js
1117
- index 4ad3aca..b2a5d0e 100644
1006
+ index 6f2891f..557d6cc 100644
1118
1007
  --- a/dist/signals/document-owner.js
1119
1008
  +++ b/dist/signals/document-owner.js
1120
- @@ -27,9 +27,8 @@ function enableSignalDocument(abi = 1) {
1009
+ @@ -29,9 +29,8 @@ function enableSignalDocument(abi = 1) {
1121
1010
  if (defaultInstalled) return;
1122
1011
  defaultInstalled = true;
1123
1012
  signalOwnerFrame = { enter: enterSynchronousSignalOwner, restore: restoreSynchronousSignalOwner };
@@ -1130,11 +1019,11 @@ index 4ad3aca..b2a5d0e 100644
1130
1019
  function installStreamedSignalOwnerActivator(activate) {
1131
1020
  if (streamedSignalOwnerActivator !== void 0) {
1132
1021
  diff --git a/dist/signals/facade.js b/dist/signals/facade.js
1133
- index 478c29d..b6b18b4 100644
1022
+ index 808e4ec..0ab799a 100644
1134
1023
  --- a/dist/signals/facade.js
1135
1024
  +++ b/dist/signals/facade.js
1136
1025
  @@ -325,7 +325,7 @@ class Descriptor {
1137
- }
1026
+ lexical;
1138
1027
  /** The owner a use resolves for: its reader, or for a lexical handle its declaring owner. */
1139
1028
  reader() {
1140
1029
  - return this.lexical === this ? this.owner : requireOwner();
@@ -1264,7 +1153,7 @@ index 0000000..ff5eb43
1264
1153
  + universalSignalDocument
1265
1154
  +};
1266
1155
  diff --git a/dist/universal-core.d.ts b/dist/universal-core.d.ts
1267
- index ddf95b3..3a6b744 100644
1156
+ index 15ecadf..716ac7f 100644
1268
1157
  --- a/dist/universal-core.d.ts
1269
1158
  +++ b/dist/universal-core.d.ts
1270
1159
  @@ -791,9 +791,8 @@ export declare function lazy<C extends UniversalComponent<any>>(load: () => Prom
@@ -1286,7 +1175,7 @@ index ddf95b3..3a6b744 100644
1286
1175
  +
1287
1176
  +export declare const Children: { toArray(children: UniversalRenderable): UniversalRenderable[]; map(children: UniversalRenderable, fn: (child: UniversalRenderable, index: number) => UniversalRenderable): UniversalRenderable[]; };
1288
1177
  diff --git a/dist/universal-core.js b/dist/universal-core.js
1289
- index aa045ee..38d6b2b 100644
1178
+ index 8c89dbd..ff1defa 100644
1290
1179
  --- a/dist/universal-core.js
1291
1180
  +++ b/dist/universal-core.js
1292
1181
  @@ -17,6 +17,10 @@ import {
@@ -1434,7 +1323,7 @@ index aa045ee..38d6b2b 100644
1434
1323
  function universalChildren(renderer, render) {
1435
1324
  assertRendererId(renderer, "universalChildren renderer");
1436
1325
  if (typeof render !== "function") throw new TypeError("universalChildren expected a function.");
1437
- @@ -863,6 +994,7 @@ function draftOwner(record, parent, replayPath) {
1326
+ @@ -856,6 +987,7 @@ function draftOwner(record, parent, replayPath) {
1438
1327
  boundaryThenable: record.boundaryThenable,
1439
1328
  isBoundary: record.isBoundary,
1440
1329
  canHandleSuspense: record.canHandleSuspense,
@@ -1442,7 +1331,7 @@ index aa045ee..38d6b2b 100644
1442
1331
  visibility: parent?.visibility ?? record.visibility,
1443
1332
  contextStable: null
1444
1333
  };
1445
- @@ -1033,6 +1165,7 @@ function executeOwner(owner, build, initialRenderCount = 0) {
1334
+ @@ -1066,6 +1198,7 @@ function executeOwner(owner, build, initialRenderCount = 0) {
1446
1335
  owner.contextStable = null;
1447
1336
  owner.needsRender = false;
1448
1337
  owner.implicitSlot = 0;
@@ -1450,33 +1339,29 @@ index aa045ee..38d6b2b 100644
1450
1339
  const previousOwner = CURRENT_OWNER;
1451
1340
  const previousAttemptOwner = attempt.owner;
1452
1341
  CURRENT_OWNER = owner;
1453
- @@ -1044,13 +1177,18 @@ function executeOwner(owner, build, initialRenderCount = 0) {
1342
+ @@ -1077,13 +1210,18 @@ function executeOwner(owner, build, initialRenderCount = 0) {
1454
1343
  const profileFrame = typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__ && component !== null ? __profileBeginRender(owner.record, component, owner.record.mounted) : null;
1455
1344
  let didThrow = false;
1456
1345
  let thrown;
1457
- - try {
1458
- - output = build();
1459
- - } catch (error) {
1460
- - didThrow = true;
1461
- - thrown = error;
1462
- - throw error;
1463
- - } finally {
1464
1346
  + const signalOwner = universalSignalOwner(owner.record);
1465
1347
  + const previousReadObserver = setNativeReadObserver(observeUniversalSignalRead);
1466
1348
  + const writeGuard = beginNativeWriteGuard();
1467
- + try {
1349
+ try {
1350
+ - output = build();
1468
1351
  + output = runWithSignalOwner(signalOwner, build);
1469
- + } catch (error) {
1470
- + didThrow = true;
1352
+ } catch (error) {
1353
+ didThrow = true;
1354
+ - thrown = error;
1355
+ - throw error;
1471
1356
  + thrown = isThenable(error) ? new UniversalSuspense(error) : error;
1472
1357
  + throw thrown;
1473
- + } finally {
1358
+ } finally {
1474
1359
  + endNativeWriteGuard(writeGuard);
1475
1360
  + setNativeReadObserver(previousReadObserver);
1476
1361
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__) {
1477
1362
  __profileEndRender(profileFrame, didThrow, thrown);
1478
1363
  }
1479
- @@ -1214,6 +1352,8 @@ function disposeUncommittedDraft(owner) {
1364
+ @@ -1247,6 +1385,8 @@ function disposeUncommittedDraft(owner) {
1480
1365
  owner.record.componentProps = null;
1481
1366
  owner.record.range = null;
1482
1367
  owner.record.updates.clear();
@@ -1485,7 +1370,7 @@ index aa045ee..38d6b2b 100644
1485
1370
  for (const hook of owner.hooks.values()) {
1486
1371
  if (hook.kind === "effect-event") hook.cell.active = false;
1487
1372
  }
1488
- @@ -3048,6 +3188,7 @@ function tryCreateCompactTemplateUpdateTransaction(root, blueprint, attempt, com
1373
+ @@ -3081,6 +3221,7 @@ function tryCreateCompactTemplateUpdateTransaction(root, blueprint, attempt, com
1489
1374
  owner.componentProps = draftOwner2.componentProps;
1490
1375
  owner.componentRevision = draftOwner2.componentRevision;
1491
1376
  owner.hooks = draftOwner2.hooks;
@@ -1493,7 +1378,7 @@ index aa045ee..38d6b2b 100644
1493
1378
  for (const [slot, applied] of draftOwner2.appliedUpdates) {
1494
1379
  const queue = owner.updates.get(slot);
1495
1380
  if (queue !== applied.queue || applied.lane) continue;
1496
- @@ -3514,6 +3655,86 @@ function scheduleOwner(owner, slot) {
1381
+ @@ -3628,6 +3769,86 @@ function scheduleOwner(owner, slot) {
1497
1382
  }
1498
1383
  owner.root.scheduleOwned(owner);
1499
1384
  }
@@ -1580,7 +1465,7 @@ index aa045ee..38d6b2b 100644
1580
1465
  function currentDraftOwner() {
1581
1466
  currentAttempt();
1582
1467
  const owner = activateLazyLeafOwner();
1583
- @@ -4628,15 +4849,35 @@ function use(usable) {
1468
+ @@ -4742,15 +4963,35 @@ function use(usable) {
1584
1469
  function useImperativeHandle(ref, create, deps, slot) {
1585
1470
  useLayoutEffect(
1586
1471
  () => {
@@ -1590,9 +1475,6 @@ index aa045ee..38d6b2b 100644
1590
1475
  - return () => {
1591
1476
  - if (typeof ref === "function") ref(null);
1592
1477
  - else if (ref !== null) ref.current = null;
1593
- - };
1594
- - },
1595
- - deps,
1596
1478
  + const cleanups = [];
1597
1479
  + let value;
1598
1480
  + let initialized = false;
@@ -1613,32 +1495,32 @@ index aa045ee..38d6b2b 100644
1613
1495
  + target.current = value;
1614
1496
  + cleanups.push(() => { target.current = null; });
1615
1497
  + }
1616
- + };
1498
+ };
1617
1499
  + try {
1618
1500
  + attach(ref);
1619
1501
  + } catch (error) {
1620
1502
  + try { runCommitTasks(cleanups); } finally { throw error; }
1621
1503
  + }
1622
1504
  + return () => runCommitTasks(cleanups);
1623
- + },
1505
+ },
1506
+ - deps,
1624
1507
  + deps == null ? deps : [...deps, ref],
1625
1508
  slot
1626
1509
  );
1627
1510
  }
1628
- @@ -5631,9 +5872,9 @@ class UniversalRootImpl {
1511
+ @@ -5745,9 +5986,9 @@ class UniversalRootImpl {
1629
1512
  }
1630
1513
  let result;
1631
1514
  try {
1632
1515
  - result = event.handler(payload);
1633
- - } catch (error) {
1634
- - if (!routeUniversalOwnerError(event.owner, error)) throw error;
1635
1516
  + result = runWithSignalOwner(universalSignalOwner(event.owner), () => event.handler(payload));
1636
- + } catch (error) {
1517
+ } catch (error) {
1518
+ - if (!routeUniversalOwnerError(event.owner, error)) throw error;
1637
1519
  + if (!routeUniversalOwnerError(event.owner, error) && !reportUniversalUncaughtError(this, error)) throw error;
1638
1520
  }
1639
1521
  return result;
1640
1522
  }
1641
- @@ -6204,6 +6445,8 @@ class UniversalRootImpl {
1523
+ @@ -6318,6 +6559,8 @@ class UniversalRootImpl {
1642
1524
  draft.record.componentProps = null;
1643
1525
  draft.record.range = null;
1644
1526
  draft.record.updates.clear();
@@ -1647,7 +1529,7 @@ index aa045ee..38d6b2b 100644
1647
1529
  for (const hook of draft.hooks.values()) {
1648
1530
  if (hook.kind === "effect-event") hook.cell.active = false;
1649
1531
  }
1650
- @@ -6721,6 +6964,7 @@ class UniversalRootImpl {
1532
+ @@ -6836,6 +7079,7 @@ class UniversalRootImpl {
1651
1533
  record.componentRevision = draft.componentRevision;
1652
1534
  record.parent = draft.parent?.record ?? null;
1653
1535
  record.hooks = draft.hooks;
@@ -1655,7 +1537,7 @@ index aa045ee..38d6b2b 100644
1655
1537
  record.effectOrder = [...draft.seenEffects];
1656
1538
  for (let index = 0; index < draft.seenEffects.length; index++) {
1657
1539
  draft.seenEffects[index].previous = null;
1658
- @@ -8369,6 +8613,8 @@ class UniversalRootImpl {
1540
+ @@ -8484,6 +8728,8 @@ class UniversalRootImpl {
1659
1541
  owner.componentProps = null;
1660
1542
  owner.range = null;
1661
1543
  owner.updates.clear();
@@ -1664,7 +1546,7 @@ index aa045ee..38d6b2b 100644
1664
1546
  }
1665
1547
  for (const draft of draftOwnersParentFirst) {
1666
1548
  const record = draft.record;
1667
- @@ -8378,6 +8624,7 @@ class UniversalRootImpl {
1549
+ @@ -8493,6 +8739,7 @@ class UniversalRootImpl {
1668
1550
  record.parent = draft.parent?.record ?? null;
1669
1551
  }
1670
1552
  record.hooks = draft.hooks;
@@ -1672,7 +1554,7 @@ index aa045ee..38d6b2b 100644
1672
1554
  record.effectOrder = [...draft.seenEffects];
1673
1555
  for (let index = 0; index < draft.seenEffects.length; index++) {
1674
1556
  draft.seenEffects[index].previous = null;
1675
- @@ -8889,6 +9136,8 @@ class UniversalRootImpl {
1557
+ @@ -9004,6 +9251,8 @@ class UniversalRootImpl {
1676
1558
  owner.componentProps = null;
1677
1559
  owner.range = null;
1678
1560
  owner.updates.clear();
@@ -1681,7 +1563,7 @@ index aa045ee..38d6b2b 100644
1681
1563
  }
1682
1564
  const deactivatedRegionCells = /* @__PURE__ */ new Set();
1683
1565
  for (const bridge of regionBridges) {
1684
- @@ -10105,6 +10354,7 @@ function createObjectDriver(renderer = "object") {
1566
+ @@ -10220,6 +10469,7 @@ function createObjectDriver(renderer = "object") {
1685
1567
  };
1686
1568
  }
1687
1569
  export {
@@ -1697,14 +1579,11 @@ index 55ac9b6..399633e 100644
1697
1579
  import {
1698
1580
  universalContext
1699
1581
  } from "./universal-core.js";
1700
- -import { registerRendererContext, renderRendererContextProvider } from "./renderer-bridge.js";
1701
- -import { CONTEXT_TAG } from "./runtime-tags.js";
1702
- -import { registerContext } from "./context-identity.js";
1703
1582
  +export { Children } from "./universal-core.js";
1704
1583
  +import { enableUniversalSignalDocument } from "./signals/universal-owner.js";
1705
- +import { registerRendererContext, renderRendererContextProvider } from "./renderer-bridge.js";
1706
- +import { CONTEXT_TAG } from "./runtime-tags.js";
1707
- +import { registerContext } from "./context-identity.js";
1584
+ import { registerRendererContext, renderRendererContextProvider } from "./renderer-bridge.js";
1585
+ import { CONTEXT_TAG } from "./runtime-tags.js";
1586
+ import { registerContext } from "./context-identity.js";
1708
1587
  +enableUniversalSignalDocument();
1709
1588
  // @__NO_SIDE_EFFECTS__
1710
1589
  function createContext(defaultValue) {