@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.
- package/package.json +1 -1
- package/patches/@nativescript-community__octane@0.2.5.patch +335 -174
- package/patches/@nativescript-community__vite-octane@0.2.1.patch +35 -4
- package/patches/{@nativescript__vite@8.0.17.patch → @nativescript__vite@8.0.20.patch} +171 -164
- package/patches/{octane@0.11.0.patch → octane@0.14.0.patch} +272 -393
- package/patches/shaders@4.0.0.patch +60 -0
- package/patches/@nativescript-community__ui-image@5.0.17.patch +0 -30
- package/patches/@triniwiz__nativescript-masonkit@1.0.0-beta.110.patch +0 -13
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
diff --git a/dist/cjs/runtime.cjs b/dist/cjs/runtime.cjs
|
|
2
|
-
index
|
|
3
|
-
--- a/dist/cjs/runtime.cjs
|
|
4
|
-
+++ b/dist/cjs/runtime.cjs
|
|
5
|
-
@@ -
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
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
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
+
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
|
52
|
+
index bfa5529..a106df1 100644
|
|
57
53
|
--- a/dist/cjs/signals/document-owner.cjs
|
|
58
54
|
+++ b/dist/cjs/signals/document-owner.cjs
|
|
59
|
-
@@ -
|
|
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
|
|
69
|
+
index a425c5f..e81719a 100644
|
|
74
70
|
--- a/dist/cjs/signals/facade.cjs
|
|
75
71
|
+++ b/dist/cjs/signals/facade.cjs
|
|
76
|
-
@@ -
|
|
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
|
|
212
|
+
index 4ef283f..d3f3e0a 100644
|
|
217
213
|
--- a/dist/compiler/compile.js
|
|
218
214
|
+++ b/dist/compiler/compile.js
|
|
219
|
-
@@ -
|
|
220
|
-
|
|
215
|
+
@@ -2599,7 +2599,7 @@ function classifyViewTransitionOwnership(astBody, production, ownComponents) {
|
|
216
|
+
|
|
221
217
|
function hookRuntimeModulesForCompile(options, universalUnits = []) {
|
|
222
|
-
|
|
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
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
@@ -
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
@@ -
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
@@ -
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
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
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
@@ -
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
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
|
-
|
|
292
|
-
|
|
293
|
-
@@ -
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
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
|
-
|
|
307
|
-
|
|
308
|
-
@@ -
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
@@ -
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
|
|
336
|
-
|
|
337
|
-
|
|
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
|
|
289
|
+
index 7b2acff..d3356b4 100644
|
|
340
290
|
--- a/dist/compiler/native-read-diagnostics.js
|
|
341
291
|
+++ b/dist/compiler/native-read-diagnostics.js
|
|
342
|
-
@@ -
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
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
|
-
@@ -
|
|
363
|
-
|
|
364
|
-
|
|
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
|
-
|
|
383
|
-
|
|
384
|
-
|
|
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
|
|
325
|
+
index e4c9bfb..7ca6112 100644
|
|
387
326
|
--- a/dist/compiler/slot-hooks.js
|
|
388
327
|
+++ b/dist/compiler/slot-hooks.js
|
|
389
|
-
@@ -
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
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
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
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
|
-
|
|
413
|
-
|
|
414
|
-
@@ -
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
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
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
@@ -
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
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
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
@@ -
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
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
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
} from "
|
|
472
|
-
+
|
|
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
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
+
|
|
489
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
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
|
|
421
|
+
index 3b50394..e809030 100644
|
|
518
422
|
--- a/dist/node/signals/document-owner.js
|
|
519
423
|
+++ b/dist/node/signals/document-owner.js
|
|
520
|
-
@@ -
|
|
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
|
|
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
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
|
|
692
|
+
try {
|
|
693
|
+
- output = build();
|
|
796
694
|
+ output = runWithSignalOwner(signalOwner, build);
|
|
797
|
-
|
|
798
|
-
|
|
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
|
-
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
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
|
|
1056
|
-
--- a/dist/runtime.js
|
|
1057
|
-
+++ b/dist/runtime.js
|
|
1058
|
-
@@ -
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
} from "
|
|
1062
|
-
|
|
1063
|
-
|
|
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
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
+
|
|
1079
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
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
|
|
1006
|
+
index 6f2891f..557d6cc 100644
|
|
1118
1007
|
--- a/dist/signals/document-owner.js
|
|
1119
1008
|
+++ b/dist/signals/document-owner.js
|
|
1120
|
-
@@ -
|
|
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
|
|
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
|
|
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
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
|
|
1349
|
+
try {
|
|
1350
|
+
- output = build();
|
|
1468
1351
|
+ output = runWithSignalOwner(signalOwner, build);
|
|
1469
|
-
|
|
1470
|
-
|
|
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
|
-
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
@@ -
|
|
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
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
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) {
|