@exactjs/core 0.6.3 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +2 -0
  2. package/dist/client/component/resumption.js +5 -1
  3. package/dist/client/component/resumption.js.map +1 -1
  4. package/dist/client/framework/fragment-target-projection-plan.d.ts +9 -0
  5. package/dist/client/framework/fragment-target-projection-plan.d.ts.map +1 -0
  6. package/dist/client/framework/fragment-target-projection-plan.js +99 -0
  7. package/dist/client/framework/fragment-target-projection-plan.js.map +1 -0
  8. package/dist/client/framework/fragment-target-projection.d.ts +1 -5
  9. package/dist/client/framework/fragment-target-projection.d.ts.map +1 -1
  10. package/dist/client/framework/fragment-target-projection.js +5 -95
  11. package/dist/client/framework/fragment-target-projection.js.map +1 -1
  12. package/dist/client/framework/server-fragment-target-projection.d.ts +4 -0
  13. package/dist/client/framework/server-fragment-target-projection.d.ts.map +1 -0
  14. package/dist/client/framework/server-fragment-target-projection.js +7 -0
  15. package/dist/client/framework/server-fragment-target-projection.js.map +1 -0
  16. package/dist/client/framework/server-render-structure.d.ts +1 -0
  17. package/dist/client/framework/server-render-structure.d.ts.map +1 -1
  18. package/dist/client/framework/server-render-structure.js +1 -0
  19. package/dist/client/framework/server-render-structure.js.map +1 -1
  20. package/dist/client/tasks/contracts.d.ts +2 -0
  21. package/dist/client/tasks/contracts.d.ts.map +1 -1
  22. package/dist/client/tasks/contracts.js.map +1 -1
  23. package/dist/client/tasks/runtime-types.d.ts +0 -1
  24. package/dist/client/tasks/runtime-types.d.ts.map +1 -1
  25. package/dist/client/tasks/runtime-types.js.map +1 -1
  26. package/dist/client/tasks/runtime.js +5 -9
  27. package/dist/client/tasks/runtime.js.map +1 -1
  28. package/dist/component/resumption.js +5 -1
  29. package/dist/component/resumption.js.map +1 -1
  30. package/dist/framework/fragment-target-projection-plan.d.ts +9 -0
  31. package/dist/framework/fragment-target-projection-plan.d.ts.map +1 -0
  32. package/dist/framework/fragment-target-projection-plan.js +99 -0
  33. package/dist/framework/fragment-target-projection-plan.js.map +1 -0
  34. package/dist/framework/fragment-target-projection.d.ts +1 -5
  35. package/dist/framework/fragment-target-projection.d.ts.map +1 -1
  36. package/dist/framework/fragment-target-projection.js +5 -95
  37. package/dist/framework/fragment-target-projection.js.map +1 -1
  38. package/dist/framework/server-fragment-target-projection.d.ts +4 -0
  39. package/dist/framework/server-fragment-target-projection.d.ts.map +1 -0
  40. package/dist/framework/server-fragment-target-projection.js +7 -0
  41. package/dist/framework/server-fragment-target-projection.js.map +1 -0
  42. package/dist/framework/server-render-structure.d.ts +1 -0
  43. package/dist/framework/server-render-structure.d.ts.map +1 -1
  44. package/dist/framework/server-render-structure.js +1 -0
  45. package/dist/framework/server-render-structure.js.map +1 -1
  46. package/dist/server/component/resumption.js +5 -1
  47. package/dist/server/component/resumption.js.map +1 -1
  48. package/dist/server/framework/fragment-target-projection-plan.d.ts +9 -0
  49. package/dist/server/framework/fragment-target-projection-plan.d.ts.map +1 -0
  50. package/dist/server/framework/fragment-target-projection-plan.js +99 -0
  51. package/dist/server/framework/fragment-target-projection-plan.js.map +1 -0
  52. package/dist/server/framework/fragment-target-projection.d.ts +1 -5
  53. package/dist/server/framework/fragment-target-projection.d.ts.map +1 -1
  54. package/dist/server/framework/fragment-target-projection.js +5 -95
  55. package/dist/server/framework/fragment-target-projection.js.map +1 -1
  56. package/dist/server/framework/server-fragment-target-projection.d.ts +4 -0
  57. package/dist/server/framework/server-fragment-target-projection.d.ts.map +1 -0
  58. package/dist/server/framework/server-fragment-target-projection.js +7 -0
  59. package/dist/server/framework/server-fragment-target-projection.js.map +1 -0
  60. package/dist/server/framework/server-render-structure.d.ts +1 -0
  61. package/dist/server/framework/server-render-structure.d.ts.map +1 -1
  62. package/dist/server/framework/server-render-structure.js +1 -0
  63. package/dist/server/framework/server-render-structure.js.map +1 -1
  64. package/dist/server/tasks/contracts.d.ts +2 -0
  65. package/dist/server/tasks/contracts.d.ts.map +1 -1
  66. package/dist/server/tasks/contracts.js.map +1 -1
  67. package/dist/server/tasks/runtime-types.d.ts +0 -1
  68. package/dist/server/tasks/runtime-types.d.ts.map +1 -1
  69. package/dist/server/tasks/runtime-types.js.map +1 -1
  70. package/dist/server/tasks/runtime.js +5 -9
  71. package/dist/server/tasks/runtime.js.map +1 -1
  72. package/dist/tasks/contracts.d.ts +2 -0
  73. package/dist/tasks/contracts.d.ts.map +1 -1
  74. package/dist/tasks/contracts.js.map +1 -1
  75. package/dist/tasks/runtime-types.d.ts +0 -1
  76. package/dist/tasks/runtime-types.d.ts.map +1 -1
  77. package/dist/tasks/runtime-types.js.map +1 -1
  78. package/dist/tasks/runtime.js +5 -9
  79. package/dist/tasks/runtime.js.map +1 -1
  80. package/package.json +1 -1
package/README.md CHANGED
@@ -66,6 +66,8 @@ install localization explicitly with `import '@exactjs/core/localization'`. Comp
66
66
  no such import.
67
67
 
68
68
  Use explicit task policy for placement, scheduling, cancellation, keys, or inspectable identity.
69
+ Task status includes queued and running work, including nonblocking and deferred tasks. Readiness
70
+ policy independently controls whether Suspense waits.
69
71
  Framework integrations use the `runtime/render`, `runtime/registry`, and `framework/component-contracts` subpaths.
70
72
 
71
73
  ## Learn more
@@ -32,7 +32,11 @@ function writePath(target, path, value) {
32
32
  cursor = created;
33
33
  }
34
34
  }
35
- cursor[segments.at(-1)] = value;
35
+ const key = segments.at(-1);
36
+ // A captured collection already restores derived reads such as Map/Set.size.
37
+ // Reassigning that identical read would attempt to write a native getter-only property.
38
+ if (!Object.is(cursor[key], value))
39
+ cursor[key] = value;
36
40
  }
37
41
  /** Rejects prototype-bearing path segments before touching reactive state. */
38
42
  function safeSegment(segment) {
@@ -1 +1 @@
1
- {"version":3,"file":"resumption.js","sourceRoot":"","sources":["../../../src/component/resumption.ts"],"names":[],"mappings":"AAKA,4FAA4F;AAC5F,MAAM,UAAU,wBAAwB,CACvC,KAAwC,EACxC,UAAqC;IAErC,MAAM,MAAM,GAAG,aAAa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C/E,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC5C,MAAM,GAAG,OAAkC,CAAC;QAC7C,CAAC;aAAM,CAAC;YACP,MAAM,OAAO,GAA4B,EAAE,CAAC;YAC5C,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;YAC1B,MAAM,GAAG,OAAO,CAAC;QAClB,CAAC;IACF,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,GAAG,KAAK,CAAC;AAClC,CAAC;AAED,8EAA8E;AAC9E,SAAS,WAAW,CAAC,OAAe;IACnC,OAAO,CACN,OAAO,CAAC,MAAM,GAAG,CAAC;QAClB,OAAO,KAAK,WAAW;QACvB,OAAO,KAAK,WAAW;QACvB,OAAO,KAAK,aAAa,CACzB,CAAC;AACH,CAAC","sourcesContent":["import type { Reactive } from '@exactjs/reactive/framework/runtime';\nimport type { ComponentResumptionSource } from './contracts.js';\n\ntype IndexedResumptionField = readonly [field: number | string, value: unknown];\n\n/** Applies compiler-selected SSR state paths without replacing client-local setup state. */\nexport function applyComponentResumption(\n\tstate: Reactive<Record<string, unknown>>,\n\tresumption: ComponentResumptionSource\n): void {\n\tconst values = 'componentId' in resumption ? resumption.values : (resumption[1] ?? []);\n\tif (Array.isArray(values)) {\n\t\tfor (const [field, value] of values as unknown as readonly IndexedResumptionField[]) {\n\t\t\tif (typeof field !== 'string')\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`eXact indexed resumption was not prepared for ${'componentId' in resumption ? resumption.componentId : resumption[0]}`\n\t\t\t\t);\n\t\t\twritePath(state, field, value);\n\t\t}\n\t\treturn;\n\t}\n\tfor (const [path, value] of Object.entries(values)) writePath(state, path, value);\n}\n\n/** Materializes one validated dotted state path into the live reactive state object. */\nfunction writePath(target: Record<string, unknown>, path: string, value: unknown): void {\n\tconst segments = path.split('.');\n\tif (!segments.length || !segments.every(safeSegment)) {\n\t\tthrow new Error(`Malformed eXact component resumption state path ${path}`);\n\t}\n\tlet cursor = target;\n\tfor (const segment of segments.slice(0, -1)) {\n\t\tconst current = cursor[segment];\n\t\t// A child path can accompany its captured parent or a setup-owned array.\n\t\t// Traversing `.length` or an indexed item must preserve that array's identity.\n\t\tif (current && typeof current === 'object') {\n\t\t\tcursor = current as Record<string, unknown>;\n\t\t} else {\n\t\t\tconst created: Record<string, unknown> = {};\n\t\t\tcursor[segment] = created;\n\t\t\tcursor = created;\n\t\t}\n\t}\n\tcursor[segments.at(-1)!] = value;\n}\n\n/** Rejects prototype-bearing path segments before touching reactive state. */\nfunction safeSegment(segment: string): boolean {\n\treturn (\n\t\tsegment.length > 0 &&\n\t\tsegment !== '__proto__' &&\n\t\tsegment !== 'prototype' &&\n\t\tsegment !== 'constructor'\n\t);\n}\n"]}
1
+ {"version":3,"file":"resumption.js","sourceRoot":"","sources":["../../../src/component/resumption.ts"],"names":[],"mappings":"AAKA,4FAA4F;AAC5F,MAAM,UAAU,wBAAwB,CACvC,KAAwC,EACxC,UAAqC;IAErC,MAAM,MAAM,GAAG,aAAa,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACvF,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAsD,EAAE,CAAC;YACrF,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAC5B,MAAM,IAAI,KAAK,CACd,iDAAiD,aAAa,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CACvH,CAAC;YACH,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,OAAO;IACR,CAAC;IACD,KAAK,MAAM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OAAO,CACN,OAAO,CAAC,MAAM,GAAG,CAAC;QAClB,OAAO,KAAK,WAAW;QACvB,OAAO,KAAK,WAAW;QACvB,OAAO,KAAK,aAAa,CACzB,CAAC;AACH,CAAC","sourcesContent":["import type { Reactive } from '@exactjs/reactive/framework/runtime';\nimport type { ComponentResumptionSource } from './contracts.js';\n\ntype IndexedResumptionField = readonly [field: number | string, value: unknown];\n\n/** Applies compiler-selected SSR state paths without replacing client-local setup state. */\nexport function applyComponentResumption(\n\tstate: Reactive<Record<string, unknown>>,\n\tresumption: ComponentResumptionSource\n): void {\n\tconst values = 'componentId' in resumption ? resumption.values : (resumption[1] ?? []);\n\tif (Array.isArray(values)) {\n\t\tfor (const [field, value] of values as unknown as readonly IndexedResumptionField[]) {\n\t\t\tif (typeof field !== 'string')\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`eXact indexed resumption was not prepared for ${'componentId' in resumption ? resumption.componentId : resumption[0]}`\n\t\t\t\t);\n\t\t\twritePath(state, field, value);\n\t\t}\n\t\treturn;\n\t}\n\tfor (const [path, value] of Object.entries(values)) writePath(state, path, value);\n}\n\n/** Materializes one validated dotted state path into the live reactive state object. */\nfunction writePath(target: Record<string, unknown>, path: string, value: unknown): void {\n\tconst segments = path.split('.');\n\tif (!segments.length || !segments.every(safeSegment)) {\n\t\tthrow new Error(`Malformed eXact component resumption state path ${path}`);\n\t}\n\tlet cursor = target;\n\tfor (const segment of segments.slice(0, -1)) {\n\t\tconst current = cursor[segment];\n\t\t// A child path can accompany its captured parent or a setup-owned array.\n\t\t// Traversing `.length` or an indexed item must preserve that array's identity.\n\t\tif (current && typeof current === 'object') {\n\t\t\tcursor = current as Record<string, unknown>;\n\t\t} else {\n\t\t\tconst created: Record<string, unknown> = {};\n\t\t\tcursor[segment] = created;\n\t\t\tcursor = created;\n\t\t}\n\t}\n\tconst key = segments.at(-1)!;\n\t// A captured collection already restores derived reads such as Map/Set.size.\n\t// Reassigning that identical read would attempt to write a native getter-only property.\n\tif (!Object.is(cursor[key], value)) cursor[key] = value;\n}\n\n/** Rejects prototype-bearing path segments before touching reactive state. */\nfunction safeSegment(segment: string): boolean {\n\treturn (\n\t\tsegment.length > 0 &&\n\t\tsegment !== '__proto__' &&\n\t\tsegment !== 'prototype' &&\n\t\tsegment !== 'constructor'\n\t);\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { AnyComponentInstance, Child } from '../component/contracts.js';
2
+ /**
3
+ * Projects only one enhancement owner's supplied placement, preserving its authored structure.
4
+ * Nested component implementations stay opaque. Each owner is a host-coalescing barrier; transparent
5
+ * consecutive owners are grouped before this path. The caller supplies range evaluation: clients
6
+ * retain invalidation, while servers resolve the current render attempt without subscriptions.
7
+ */
8
+ export declare function createFragmentTargetProjectionWithRanges(supplied: Child | (() => Child), tag: string, owner: AnyComponentInstance | undefined, projectRange: (read: () => Child, markerId?: string, mayReplaceSubtree?: boolean) => Child): (children: readonly Child[]) => Child[];
9
+ //# sourceMappingURL=fragment-target-projection-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fragment-target-projection-plan.d.ts","sourceRoot":"","sources":["../../../src/framework/fragment-target-projection-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AA6B7E;;;;;GAKG;AACH,wBAAgB,wCAAwC,CACvD,QAAQ,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,EAC/B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,oBAAoB,GAAG,SAAS,EACvC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,OAAO,KAAK,KAAK,GACxF,CAAC,QAAQ,EAAE,SAAS,KAAK,EAAE,KAAK,KAAK,EAAE,CAmGzC"}
@@ -0,0 +1,99 @@
1
+ import { unwrap } from '@exactjs/reactive/framework/values';
2
+ import { readCompiledTargetReceipt, createCompiledTargetReceipt } from '../component-abi/target-receipt.js';
3
+ import { readCompiledIntrinsicReceipt, withIntrinsicReceiptChildren } from '../component-abi/intrinsic-receipt.js';
4
+ import { readCompiledFragmentReceipt, createCompiledFragmentReceipt, createCompiledFragmentPresentation } from '../component-abi/fragment-receipt.js';
5
+ import { readChildRangeReceipt } from '../component-abi/child-range-receipt.js';
6
+ import { readPreparedServerChildRange, createPreparedServerChildRange } from '../component-abi/server-child-range.js';
7
+ import { readPreparedServerRenderProgram } from '../server-render-program.js';
8
+ import { readRenderProgramReceipt, createPreparedRenderProgram, readRenderProgramSlot } from '../render-program.js';
9
+ import { readPreparedTargetOutput } from './prepared-target-output.js';
10
+ import { FragmentPresentationHosts } from './fragment-hosts.js';
11
+ /**
12
+ * Projects only one enhancement owner's supplied placement, preserving its authored structure.
13
+ * Nested component implementations stay opaque. Each owner is a host-coalescing barrier; transparent
14
+ * consecutive owners are grouped before this path. The caller supplies range evaluation: clients
15
+ * retain invalidation, while servers resolve the current render attempt without subscriptions.
16
+ */
17
+ export function createFragmentTargetProjectionWithRanges(supplied, tag, owner, projectRange) {
18
+ const identity = Symbol('fragment contribution');
19
+ const hosts = new FragmentPresentationHosts();
20
+ const cache = new WeakMap();
21
+ const map = (raw) => {
22
+ const selected = typeof supplied === 'function' ? supplied() : supplied;
23
+ if (raw === selected)
24
+ return raw;
25
+ const value = unwrap(raw);
26
+ if (value === selected)
27
+ return value;
28
+ if (Array.isArray(value))
29
+ return value.map(map);
30
+ if (typeof value !== 'object' || value === null)
31
+ return value;
32
+ const retained = cache.get(value);
33
+ if (retained !== undefined)
34
+ return retained;
35
+ const target = readCompiledTargetReceipt(value);
36
+ let result = value;
37
+ if (target) {
38
+ const contribution = readPreparedTargetOutput([value], selected);
39
+ const presentation = createCompiledFragmentPresentation(selected, hosts
40
+ .reconcile([
41
+ {
42
+ owner: identity,
43
+ tag,
44
+ props: contribution.props,
45
+ declaredHostProps: contribution.declaredHostProps
46
+ }
47
+ ])
48
+ .map((host) => ({
49
+ identity: host.identity,
50
+ tag: host.tag,
51
+ contributions: [{ identity, props: contribution.props, owner }]
52
+ })));
53
+ result = createCompiledTargetReceipt(null, presentation);
54
+ }
55
+ else {
56
+ const intrinsic = readCompiledIntrinsicReceipt(value);
57
+ const fragment = readCompiledFragmentReceipt(value);
58
+ const range = readChildRangeReceipt(value);
59
+ const serverRange = readPreparedServerChildRange(value);
60
+ const program = readRenderProgramReceipt(value);
61
+ const serverProgram = readPreparedServerRenderProgram(value);
62
+ if (intrinsic)
63
+ result = withIntrinsicReceiptChildren(value, intrinsic.children.map((child) => map(child)));
64
+ else if (fragment)
65
+ result = createCompiledFragmentReceipt({ ...fragment.props, key: fragment.key, __exactEnhancements: fragment.enhancement }, ...fragment.children.map(map));
66
+ else if (range && !range.dynamicComponent)
67
+ result = projectRange(() => map(range.value), range.markerId, range.mayReplaceSubtree);
68
+ else if (serverRange)
69
+ result = createPreparedServerChildRange(map(serverRange.value), serverRange.markerId, serverRange.mayReplaceSubtree);
70
+ else if (program) {
71
+ const invocation = program.invocation;
72
+ const slots = new Set(invocation.program.targetSlots ?? []);
73
+ result = createPreparedRenderProgram(invocation.program, (index) => slots.has(index)
74
+ ? map(readRenderProgramSlot(invocation, index))
75
+ : readRenderProgramSlot(invocation, index), invocation.owner, invocation.propertyWriter, program.enhancement);
76
+ }
77
+ else if (serverProgram) {
78
+ const slots = new Set(serverProgram.program.targetSlots ?? []);
79
+ const values = (input) => input.map((entry, index) => (slots.has(index) ? map(entry) : entry));
80
+ result = {
81
+ ...serverProgram,
82
+ eagerValues: values(serverProgram.eagerValues),
83
+ ...(serverProgram.deferredValues
84
+ ? {
85
+ deferredValues: {
86
+ ...serverProgram.deferredValues,
87
+ read: () => values(serverProgram.deferredValues.read())
88
+ }
89
+ }
90
+ : {})
91
+ };
92
+ }
93
+ }
94
+ cache.set(value, result);
95
+ return result;
96
+ };
97
+ return (children) => children.map((child) => map(child));
98
+ }
99
+ //# sourceMappingURL=fragment-target-projection-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fragment-target-projection-plan.js","sourceRoot":"","sources":["../../../src/framework/fragment-target-projection-plan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EACN,yBAAyB,EACzB,2BAA2B,EAC3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,4BAA4B,EAC5B,4BAA4B,EAC5B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,2BAA2B,EAC3B,6BAA6B,EAC7B,kCAAkC,EAClC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EACN,4BAA4B,EAC5B,8BAA8B,EAC9B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EACN,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,UAAU,wCAAwC,CACvD,QAA+B,EAC/B,GAAW,EACX,KAAuC,EACvC,YAA0F;IAE1F,MAAM,QAAQ,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,IAAI,yBAAyB,EAAE,CAAC;IAC9C,MAAM,KAAK,GAAG,IAAI,OAAO,EAAiB,CAAC;IAC3C,MAAM,GAAG,GAAG,CAAC,GAAY,EAAW,EAAE;QACrC,MAAM,QAAQ,GAAG,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;QACxE,IAAI,GAAG,KAAK,QAAQ;YAAE,OAAO,GAAG,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AO,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAU,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import type { AnyComponentInstance, Child } from '../component/contracts.js';\nimport { unwrap } from '@exactjs/reactive/framework/values';\nimport {\n\treadCompiledTargetReceipt,\n\tcreateCompiledTargetReceipt\n} from '../component-abi/target-receipt.js';\nimport {\n\treadCompiledIntrinsicReceipt,\n\twithIntrinsicReceiptChildren\n} from '../component-abi/intrinsic-receipt.js';\nimport {\n\treadCompiledFragmentReceipt,\n\tcreateCompiledFragmentReceipt,\n\tcreateCompiledFragmentPresentation\n} from '../component-abi/fragment-receipt.js';\nimport { readChildRangeReceipt } from '../component-abi/child-range-receipt.js';\nimport {\n\treadPreparedServerChildRange,\n\tcreatePreparedServerChildRange\n} from '../component-abi/server-child-range.js';\nimport { readPreparedServerRenderProgram } from '../server-render-program.js';\nimport {\n\treadRenderProgramReceipt,\n\tcreatePreparedRenderProgram,\n\treadRenderProgramSlot\n} from '../render-program.js';\nimport { readPreparedTargetOutput } from './prepared-target-output.js';\nimport { FragmentPresentationHosts } from './fragment-hosts.js';\n\n/**\n * Projects only one enhancement owner's supplied placement, preserving its authored structure.\n * Nested component implementations stay opaque. Each owner is a host-coalescing barrier; transparent\n * consecutive owners are grouped before this path. The caller supplies range evaluation: clients\n * retain invalidation, while servers resolve the current render attempt without subscriptions.\n */\nexport function createFragmentTargetProjectionWithRanges(\n\tsupplied: Child | (() => Child),\n\ttag: string,\n\towner: AnyComponentInstance | undefined,\n\tprojectRange: (read: () => Child, markerId?: string, mayReplaceSubtree?: boolean) => Child\n): (children: readonly Child[]) => Child[] {\n\tconst identity = Symbol('fragment contribution');\n\tconst hosts = new FragmentPresentationHosts();\n\tconst cache = new WeakMap<object, Child>();\n\tconst map = (raw: unknown): unknown => {\n\t\tconst selected = typeof supplied === 'function' ? supplied() : supplied;\n\t\tif (raw === selected) return raw;\n\t\tconst value = unwrap(raw);\n\t\tif (value === selected) return value;\n\t\tif (Array.isArray(value)) return value.map(map);\n\t\tif (typeof value !== 'object' || value === null) return value;\n\t\tconst retained = cache.get(value);\n\t\tif (retained !== undefined) return retained;\n\t\tconst target = readCompiledTargetReceipt(value);\n\t\tlet result: unknown = value;\n\t\tif (target) {\n\t\t\tconst contribution = readPreparedTargetOutput([value as Child], selected)!;\n\t\t\tconst presentation = createCompiledFragmentPresentation(\n\t\t\t\tselected,\n\t\t\t\thosts\n\t\t\t\t\t.reconcile([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\towner: identity,\n\t\t\t\t\t\t\ttag,\n\t\t\t\t\t\t\tprops: contribution.props,\n\t\t\t\t\t\t\tdeclaredHostProps: contribution.declaredHostProps\n\t\t\t\t\t\t}\n\t\t\t\t\t])\n\t\t\t\t\t.map((host) => ({\n\t\t\t\t\t\tidentity: host.identity,\n\t\t\t\t\t\ttag: host.tag,\n\t\t\t\t\t\tcontributions: [{ identity, props: contribution.props, owner }]\n\t\t\t\t\t}))\n\t\t\t);\n\t\t\tresult = createCompiledTargetReceipt(null, presentation);\n\t\t} else {\n\t\t\tconst intrinsic = readCompiledIntrinsicReceipt(value);\n\t\t\tconst fragment = readCompiledFragmentReceipt(value);\n\t\t\tconst range = readChildRangeReceipt(value);\n\t\t\tconst serverRange = readPreparedServerChildRange(value);\n\t\t\tconst program = readRenderProgramReceipt(value);\n\t\t\tconst serverProgram = readPreparedServerRenderProgram(value);\n\t\t\tif (intrinsic)\n\t\t\t\tresult = withIntrinsicReceiptChildren(\n\t\t\t\t\tvalue,\n\t\t\t\t\tintrinsic.children.map((child) => map(child) as Child)\n\t\t\t\t);\n\t\t\telse if (fragment)\n\t\t\t\tresult = createCompiledFragmentReceipt(\n\t\t\t\t\t{ ...fragment.props, key: fragment.key, __exactEnhancements: fragment.enhancement },\n\t\t\t\t\t...fragment.children.map(map)\n\t\t\t\t);\n\t\t\telse if (range && !range.dynamicComponent)\n\t\t\t\tresult = projectRange(\n\t\t\t\t\t() => map(range.value) as Child,\n\t\t\t\t\trange.markerId,\n\t\t\t\t\trange.mayReplaceSubtree\n\t\t\t\t);\n\t\t\telse if (serverRange)\n\t\t\t\tresult = createPreparedServerChildRange(\n\t\t\t\t\tmap(serverRange.value) as Child,\n\t\t\t\t\tserverRange.markerId,\n\t\t\t\t\tserverRange.mayReplaceSubtree\n\t\t\t\t);\n\t\t\telse if (program) {\n\t\t\t\tconst invocation = program.invocation;\n\t\t\t\tconst slots = new Set(invocation.program.targetSlots ?? []);\n\t\t\t\tresult = createPreparedRenderProgram(\n\t\t\t\t\tinvocation.program,\n\t\t\t\t\t(index) =>\n\t\t\t\t\t\tslots.has(index)\n\t\t\t\t\t\t\t? map(readRenderProgramSlot(invocation, index))\n\t\t\t\t\t\t\t: readRenderProgramSlot(invocation, index),\n\t\t\t\t\tinvocation.owner,\n\t\t\t\t\tinvocation.propertyWriter,\n\t\t\t\t\tprogram.enhancement\n\t\t\t\t);\n\t\t\t} else if (serverProgram) {\n\t\t\t\tconst slots = new Set(serverProgram.program.targetSlots ?? []);\n\t\t\t\tconst values = (input: readonly unknown[]) =>\n\t\t\t\t\tinput.map((entry, index) => (slots.has(index) ? map(entry) : entry));\n\t\t\t\tresult = {\n\t\t\t\t\t...serverProgram,\n\t\t\t\t\teagerValues: values(serverProgram.eagerValues),\n\t\t\t\t\t...(serverProgram.deferredValues\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tdeferredValues: {\n\t\t\t\t\t\t\t\t\t...serverProgram.deferredValues,\n\t\t\t\t\t\t\t\t\tread: () => values(serverProgram.deferredValues!.read())\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: {})\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tcache.set(value, result as Child);\n\t\treturn result;\n\t};\n\treturn (children) => children.map((child) => map(child) as Child);\n}\n"]}
@@ -1,8 +1,4 @@
1
1
  import type { AnyComponentInstance, Child } from '../component/contracts.js';
2
- /**
3
- * Projects only one enhancement owner's supplied placement, preserving its authored structure.
4
- * Nested component implementations stay opaque. Each owner is a host-coalescing barrier; transparent
5
- * consecutive owners are grouped before this path. Reactive ranges retain their existing invalidation.
6
- */
2
+ /** Projects fragment targets while retaining client range subscriptions and ownership. */
7
3
  export declare function createFragmentTargetProjection(supplied: Child | (() => Child), tag: string, owner?: AnyComponentInstance): (children: readonly Child[]) => Child[];
8
4
  //# sourceMappingURL=fragment-target-projection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fragment-target-projection.d.ts","sourceRoot":"","sources":["../../../src/framework/fragment-target-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAgC7E;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC7C,QAAQ,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,EAC/B,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,oBAAoB,GAC1B,CAAC,QAAQ,EAAE,SAAS,KAAK,EAAE,KAAK,KAAK,EAAE,CAmGzC"}
1
+ {"version":3,"file":"fragment-target-projection.d.ts","sourceRoot":"","sources":["../../../src/framework/fragment-target-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAK7E,0FAA0F;AAC1F,wBAAgB,8BAA8B,CAC7C,QAAQ,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,EAC/B,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,oBAAoB,GAC1B,CAAC,QAAQ,EAAE,SAAS,KAAK,EAAE,KAAK,KAAK,EAAE,CAQzC"}
@@ -1,98 +1,8 @@
1
- import { computed, unwrap } from '@exactjs/reactive/framework/runtime';
2
- import { readCompiledTargetReceipt, createCompiledTargetReceipt } from '../component-abi/target-receipt.js';
3
- import { readCompiledIntrinsicReceipt, withIntrinsicReceiptChildren } from '../component-abi/intrinsic-receipt.js';
4
- import { readCompiledFragmentReceipt, createCompiledFragmentReceipt, createCompiledFragmentPresentation } from '../component-abi/fragment-receipt.js';
5
- import { readChildRangeReceipt, createChildRangeReceipt } from '../component-abi/child-range-receipt.js';
6
- import { readPreparedServerChildRange, createPreparedServerChildRange } from '../component-abi/server-child-range.js';
7
- import { readPreparedServerRenderProgram } from '../server-render-program.js';
8
- import { readRenderProgramReceipt, createPreparedRenderProgram, readRenderProgramSlot } from '../render-program.js';
9
- import { readPreparedTargetOutput } from './prepared-target-output.js';
10
- import { FragmentPresentationHosts } from './fragment-hosts.js';
11
- /**
12
- * Projects only one enhancement owner's supplied placement, preserving its authored structure.
13
- * Nested component implementations stay opaque. Each owner is a host-coalescing barrier; transparent
14
- * consecutive owners are grouped before this path. Reactive ranges retain their existing invalidation.
15
- */
1
+ import { computed } from '@exactjs/reactive/framework/runtime';
2
+ import { createChildRangeReceipt } from '../component-abi/child-range-receipt.js';
3
+ import { createFragmentTargetProjectionWithRanges } from './fragment-target-projection-plan.js';
4
+ /** Projects fragment targets while retaining client range subscriptions and ownership. */
16
5
  export function createFragmentTargetProjection(supplied, tag, owner) {
17
- const identity = Symbol('fragment contribution');
18
- const hosts = new FragmentPresentationHosts();
19
- const cache = new WeakMap();
20
- const map = (raw) => {
21
- const selected = typeof supplied === 'function' ? supplied() : supplied;
22
- if (raw === selected)
23
- return raw;
24
- const value = unwrap(raw);
25
- if (value === selected)
26
- return value;
27
- if (Array.isArray(value))
28
- return value.map(map);
29
- if (typeof value !== 'object' || value === null)
30
- return value;
31
- const retained = cache.get(value);
32
- if (retained !== undefined)
33
- return retained;
34
- const target = readCompiledTargetReceipt(value);
35
- let result = value;
36
- if (target) {
37
- const contribution = readPreparedTargetOutput([value], selected);
38
- const presentation = createCompiledFragmentPresentation(selected, hosts
39
- .reconcile([
40
- {
41
- owner: identity,
42
- tag,
43
- props: contribution.props,
44
- declaredHostProps: contribution.declaredHostProps
45
- }
46
- ])
47
- .map((host) => ({
48
- identity: host.identity,
49
- tag: host.tag,
50
- contributions: [{ identity, props: contribution.props, owner }]
51
- })));
52
- result = createCompiledTargetReceipt(null, presentation);
53
- }
54
- else {
55
- const intrinsic = readCompiledIntrinsicReceipt(value);
56
- const fragment = readCompiledFragmentReceipt(value);
57
- const range = readChildRangeReceipt(value);
58
- const serverRange = readPreparedServerChildRange(value);
59
- const program = readRenderProgramReceipt(value);
60
- const serverProgram = readPreparedServerRenderProgram(value);
61
- if (intrinsic)
62
- result = withIntrinsicReceiptChildren(value, intrinsic.children.map((child) => map(child)));
63
- else if (fragment)
64
- result = createCompiledFragmentReceipt({ ...fragment.props, key: fragment.key, __exactEnhancements: fragment.enhancement }, ...fragment.children.map(map));
65
- else if (range && !range.dynamicComponent)
66
- result = createChildRangeReceipt(computed(() => map(range.value)), range.markerId, range.mayReplaceSubtree);
67
- else if (serverRange)
68
- result = createPreparedServerChildRange(map(serverRange.value), serverRange.markerId, serverRange.mayReplaceSubtree);
69
- else if (program) {
70
- const invocation = program.invocation;
71
- const slots = new Set(invocation.program.targetSlots ?? []);
72
- result = createPreparedRenderProgram(invocation.program, (index) => slots.has(index)
73
- ? map(readRenderProgramSlot(invocation, index))
74
- : readRenderProgramSlot(invocation, index), invocation.owner, invocation.propertyWriter, program.enhancement);
75
- }
76
- else if (serverProgram) {
77
- const slots = new Set(serverProgram.program.targetSlots ?? []);
78
- const values = (input) => input.map((entry, index) => (slots.has(index) ? map(entry) : entry));
79
- result = {
80
- ...serverProgram,
81
- eagerValues: values(serverProgram.eagerValues),
82
- ...(serverProgram.deferredValues
83
- ? {
84
- deferredValues: {
85
- ...serverProgram.deferredValues,
86
- read: () => values(serverProgram.deferredValues.read())
87
- }
88
- }
89
- : {})
90
- };
91
- }
92
- }
93
- cache.set(value, result);
94
- return result;
95
- };
96
- return (children) => children.map((child) => map(child));
6
+ return createFragmentTargetProjectionWithRanges(supplied, tag, owner, (read, markerId, mayReplaceSubtree) => createChildRangeReceipt(computed(read), markerId, mayReplaceSubtree));
97
7
  }
98
8
  //# sourceMappingURL=fragment-target-projection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fragment-target-projection.js","sourceRoot":"","sources":["../../../src/framework/fragment-target-projection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EACN,yBAAyB,EACzB,2BAA2B,EAC3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,4BAA4B,EAC5B,4BAA4B,EAC5B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,2BAA2B,EAC3B,6BAA6B,EAC7B,kCAAkC,EAClC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,qBAAqB,EACrB,uBAAuB,EACvB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACN,4BAA4B,EAC5B,8BAA8B,EAC9B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EACN,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAC7C,QAA+B,EAC/B,GAAW,EACX,KAA4B;IAE5B,MAAM,QAAQ,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,IAAI,yBAAyB,EAAE,CAAC;IAC9C,MAAM,KAAK,GAAG,IAAI,OAAO,EAAiB,CAAC;IAC3C,MAAM,GAAG,GAAG,CAAC,GAAY,EAAW,EAAE;QACrC,MAAM,QAAQ,GAAG,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,Q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,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,MAAe,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC;IACf,CAAC,CAAC;IACF,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAU,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import type { AnyComponentInstance, Child } from '../component/contracts.js';\nimport { computed, unwrap } from '@exactjs/reactive/framework/runtime';\nimport {\n\treadCompiledTargetReceipt,\n\tcreateCompiledTargetReceipt\n} from '../component-abi/target-receipt.js';\nimport {\n\treadCompiledIntrinsicReceipt,\n\twithIntrinsicReceiptChildren\n} from '../component-abi/intrinsic-receipt.js';\nimport {\n\treadCompiledFragmentReceipt,\n\tcreateCompiledFragmentReceipt,\n\tcreateCompiledFragmentPresentation\n} from '../component-abi/fragment-receipt.js';\nimport {\n\treadChildRangeReceipt,\n\tcreateChildRangeReceipt\n} from '../component-abi/child-range-receipt.js';\nimport {\n\treadPreparedServerChildRange,\n\tcreatePreparedServerChildRange\n} from '../component-abi/server-child-range.js';\nimport { readPreparedServerRenderProgram } from '../server-render-program.js';\nimport {\n\treadRenderProgramReceipt,\n\tcreatePreparedRenderProgram,\n\treadRenderProgramSlot\n} from '../render-program.js';\nimport { readPreparedTargetOutput } from './prepared-target-output.js';\nimport { FragmentPresentationHosts } from './fragment-hosts.js';\n\n/**\n * Projects only one enhancement owner's supplied placement, preserving its authored structure.\n * Nested component implementations stay opaque. Each owner is a host-coalescing barrier; transparent\n * consecutive owners are grouped before this path. Reactive ranges retain their existing invalidation.\n */\nexport function createFragmentTargetProjection(\n\tsupplied: Child | (() => Child),\n\ttag: string,\n\towner?: AnyComponentInstance\n): (children: readonly Child[]) => Child[] {\n\tconst identity = Symbol('fragment contribution');\n\tconst hosts = new FragmentPresentationHosts();\n\tconst cache = new WeakMap<object, Child>();\n\tconst map = (raw: unknown): unknown => {\n\t\tconst selected = typeof supplied === 'function' ? supplied() : supplied;\n\t\tif (raw === selected) return raw;\n\t\tconst value = unwrap(raw);\n\t\tif (value === selected) return value;\n\t\tif (Array.isArray(value)) return value.map(map);\n\t\tif (typeof value !== 'object' || value === null) return value;\n\t\tconst retained = cache.get(value);\n\t\tif (retained !== undefined) return retained;\n\t\tconst target = readCompiledTargetReceipt(value);\n\t\tlet result: unknown = value;\n\t\tif (target) {\n\t\t\tconst contribution = readPreparedTargetOutput([value as Child], selected)!;\n\t\t\tconst presentation = createCompiledFragmentPresentation(\n\t\t\t\tselected,\n\t\t\t\thosts\n\t\t\t\t\t.reconcile([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\towner: identity,\n\t\t\t\t\t\t\ttag,\n\t\t\t\t\t\t\tprops: contribution.props,\n\t\t\t\t\t\t\tdeclaredHostProps: contribution.declaredHostProps\n\t\t\t\t\t\t}\n\t\t\t\t\t])\n\t\t\t\t\t.map((host) => ({\n\t\t\t\t\t\tidentity: host.identity,\n\t\t\t\t\t\ttag: host.tag,\n\t\t\t\t\t\tcontributions: [{ identity, props: contribution.props, owner }]\n\t\t\t\t\t}))\n\t\t\t);\n\t\t\tresult = createCompiledTargetReceipt(null, presentation);\n\t\t} else {\n\t\t\tconst intrinsic = readCompiledIntrinsicReceipt(value);\n\t\t\tconst fragment = readCompiledFragmentReceipt(value);\n\t\t\tconst range = readChildRangeReceipt(value);\n\t\t\tconst serverRange = readPreparedServerChildRange(value);\n\t\t\tconst program = readRenderProgramReceipt(value);\n\t\t\tconst serverProgram = readPreparedServerRenderProgram(value);\n\t\t\tif (intrinsic)\n\t\t\t\tresult = withIntrinsicReceiptChildren(\n\t\t\t\t\tvalue,\n\t\t\t\t\tintrinsic.children.map((child) => map(child) as Child)\n\t\t\t\t);\n\t\t\telse if (fragment)\n\t\t\t\tresult = createCompiledFragmentReceipt(\n\t\t\t\t\t{ ...fragment.props, key: fragment.key, __exactEnhancements: fragment.enhancement },\n\t\t\t\t\t...fragment.children.map(map)\n\t\t\t\t);\n\t\t\telse if (range && !range.dynamicComponent)\n\t\t\t\tresult = createChildRangeReceipt(\n\t\t\t\t\tcomputed(() => map(range.value)),\n\t\t\t\t\trange.markerId,\n\t\t\t\t\trange.mayReplaceSubtree\n\t\t\t\t);\n\t\t\telse if (serverRange)\n\t\t\t\tresult = createPreparedServerChildRange(\n\t\t\t\t\tmap(serverRange.value) as Child,\n\t\t\t\t\tserverRange.markerId,\n\t\t\t\t\tserverRange.mayReplaceSubtree\n\t\t\t\t);\n\t\t\telse if (program) {\n\t\t\t\tconst invocation = program.invocation;\n\t\t\t\tconst slots = new Set(invocation.program.targetSlots ?? []);\n\t\t\t\tresult = createPreparedRenderProgram(\n\t\t\t\t\tinvocation.program,\n\t\t\t\t\t(index) =>\n\t\t\t\t\t\tslots.has(index)\n\t\t\t\t\t\t\t? map(readRenderProgramSlot(invocation, index))\n\t\t\t\t\t\t\t: readRenderProgramSlot(invocation, index),\n\t\t\t\t\tinvocation.owner,\n\t\t\t\t\tinvocation.propertyWriter,\n\t\t\t\t\tprogram.enhancement\n\t\t\t\t);\n\t\t\t} else if (serverProgram) {\n\t\t\t\tconst slots = new Set(serverProgram.program.targetSlots ?? []);\n\t\t\t\tconst values = (input: readonly unknown[]) =>\n\t\t\t\t\tinput.map((entry, index) => (slots.has(index) ? map(entry) : entry));\n\t\t\t\tresult = {\n\t\t\t\t\t...serverProgram,\n\t\t\t\t\teagerValues: values(serverProgram.eagerValues),\n\t\t\t\t\t...(serverProgram.deferredValues\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tdeferredValues: {\n\t\t\t\t\t\t\t\t\t...serverProgram.deferredValues,\n\t\t\t\t\t\t\t\t\tread: () => values(serverProgram.deferredValues!.read())\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: {})\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tcache.set(value, result as Child);\n\t\treturn result;\n\t};\n\treturn (children) => children.map((child) => map(child) as Child);\n}\n"]}
1
+ {"version":3,"file":"fragment-target-projection.js","sourceRoot":"","sources":["../../../src/framework/fragment-target-projection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,wCAAwC,EAAE,MAAM,sCAAsC,CAAC;AAEhG,0FAA0F;AAC1F,MAAM,UAAU,8BAA8B,CAC7C,QAA+B,EAC/B,GAAW,EACX,KAA4B;IAE5B,OAAO,wCAAwC,CAC9C,QAAQ,EACR,GAAG,EACH,KAAK,EACL,CAAC,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,EAAE,CACrC,uBAAuB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CACrE,CAAC;AACH,CAAC","sourcesContent":["import type { AnyComponentInstance, Child } from '../component/contracts.js';\nimport { computed } from '@exactjs/reactive/framework/runtime';\nimport { createChildRangeReceipt } from '../component-abi/child-range-receipt.js';\nimport { createFragmentTargetProjectionWithRanges } from './fragment-target-projection-plan.js';\n\n/** Projects fragment targets while retaining client range subscriptions and ownership. */\nexport function createFragmentTargetProjection(\n\tsupplied: Child | (() => Child),\n\ttag: string,\n\towner?: AnyComponentInstance\n): (children: readonly Child[]) => Child[] {\n\treturn createFragmentTargetProjectionWithRanges(\n\t\tsupplied,\n\t\ttag,\n\t\towner,\n\t\t(read, markerId, mayReplaceSubtree) =>\n\t\t\tcreateChildRangeReceipt(computed(read), markerId, mayReplaceSubtree)\n\t);\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { AnyComponentInstance, Child } from '../component/contracts.js';
2
+ /** Projects one server render attempt without creating client subscriptions or effect scopes. */
3
+ export declare function createServerFragmentTargetProjection(supplied: Child | (() => Child), tag: string, owner?: AnyComponentInstance): (children: readonly Child[]) => Child[];
4
+ //# sourceMappingURL=server-fragment-target-projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-fragment-target-projection.d.ts","sourceRoot":"","sources":["../../../src/framework/server-fragment-target-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAI7E,iGAAiG;AACjG,wBAAgB,oCAAoC,CACnD,QAAQ,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,EAC/B,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,oBAAoB,GAC1B,CAAC,QAAQ,EAAE,SAAS,KAAK,EAAE,KAAK,KAAK,EAAE,CAQzC"}
@@ -0,0 +1,7 @@
1
+ import { createPreparedServerChildRange } from '../component-abi/server-child-range.js';
2
+ import { createFragmentTargetProjectionWithRanges } from './fragment-target-projection-plan.js';
3
+ /** Projects one server render attempt without creating client subscriptions or effect scopes. */
4
+ export function createServerFragmentTargetProjection(supplied, tag, owner) {
5
+ return createFragmentTargetProjectionWithRanges(supplied, tag, owner, (read, markerId, mayReplaceSubtree) => createPreparedServerChildRange(read(), markerId, mayReplaceSubtree));
6
+ }
7
+ //# sourceMappingURL=server-fragment-target-projection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-fragment-target-projection.js","sourceRoot":"","sources":["../../../src/framework/server-fragment-target-projection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAE,wCAAwC,EAAE,MAAM,sCAAsC,CAAC;AAEhG,iGAAiG;AACjG,MAAM,UAAU,oCAAoC,CACnD,QAA+B,EAC/B,GAAW,EACX,KAA4B;IAE5B,OAAO,wCAAwC,CAC9C,QAAQ,EACR,GAAG,EACH,KAAK,EACL,CAAC,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,EAAE,CACrC,8BAA8B,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CACpE,CAAC;AACH,CAAC","sourcesContent":["import type { AnyComponentInstance, Child } from '../component/contracts.js';\nimport { createPreparedServerChildRange } from '../component-abi/server-child-range.js';\nimport { createFragmentTargetProjectionWithRanges } from './fragment-target-projection-plan.js';\n\n/** Projects one server render attempt without creating client subscriptions or effect scopes. */\nexport function createServerFragmentTargetProjection(\n\tsupplied: Child | (() => Child),\n\ttag: string,\n\towner?: AnyComponentInstance\n): (children: readonly Child[]) => Child[] {\n\treturn createFragmentTargetProjectionWithRanges(\n\t\tsupplied,\n\t\ttag,\n\t\towner,\n\t\t(read, markerId, mayReplaceSubtree) =>\n\t\t\tcreatePreparedServerChildRange(read(), markerId, mayReplaceSubtree)\n\t);\n}\n"]}
@@ -16,4 +16,5 @@ export declare function createForwardedExpression<T>(compute: () => T): T;
16
16
  export declare function createDynamicChild(compute: () => RenderResult, markerId?: string, mayReplaceSubtree?: boolean): ExactPreparedServerChildRange;
17
17
  /** Creates the eager server operation for one compiler-owned dynamic child range. */
18
18
  export declare function createCompiledChildRangeReceipt(compute: () => RenderResult, markerId?: string, mayReplaceSubtree?: boolean): ExactPreparedServerChildRange;
19
+ export { createServerFragmentTargetProjection } from './server-fragment-target-projection.js';
19
20
  //# sourceMappingURL=server-render-structure.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-render-structure.d.ts","sourceRoot":"","sources":["../../../src/framework/server-render-structure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAEN,KAAK,6BAA6B,EAClC,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EACN,2BAA2B,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,EAAE,MAAM,YAAY,EAC3B,QAAQ,CAAC,EAAE,MAAM,EACjB,iBAAiB,UAAO,GACtB,6BAA6B,CAE/B"}
1
+ {"version":3,"file":"server-render-structure.d.ts","sourceRoot":"","sources":["../../../src/framework/server-render-structure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAEN,KAAK,6BAA6B,EAClC,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EACN,2BAA2B,EAC3B,iCAAiC,EACjC,4BAA4B,EAC5B,+BAA+B,EAC/B,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,sCAAsC,EACtC,oDAAoD,EACpD,oCAAoC,EACpC,KAAK,qCAAqC,EAC1C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,4BAA4B,EAC5B,KAAK,6BAA6B,EAClC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,8BAA8B,EAC9B,4BAA4B,EAC5B,KAAK,6BAA6B,EAClC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,MAAM,+CAA+C,CAAC;AAEvD,4FAA4F;AAC5F,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAEvD;AAED,2FAA2F;AAC3F,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAEhE;AAED,6FAA6F;AAC7F,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,MAAM,YAAY,EAC3B,QAAQ,CAAC,EAAE,MAAM,EACjB,iBAAiB,UAAO,GACtB,6BAA6B,CAE/B;AAED,qFAAqF;AACrF,wBAAgB,+BAA+B,CAC9C,OAAO,EAAE,MAAM,YAAY,EAC3B,QAAQ,CAAC,EAAE,MAAM,EACjB,iBAAiB,UAAO,GACtB,6BAA6B,CAE/B;AAED,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC"}
@@ -23,4 +23,5 @@ export function createDynamicChild(compute, markerId, mayReplaceSubtree = true)
23
23
  export function createCompiledChildRangeReceipt(compute, markerId, mayReplaceSubtree = true) {
24
24
  return createPreparedServerChildRange(compute(), markerId, mayReplaceSubtree);
25
25
  }
26
+ export { createServerFragmentTargetProjection } from './server-fragment-target-projection.js';
26
27
  //# sourceMappingURL=server-render-structure.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-render-structure.js","sourceRoot":"","sources":["../../../src/framework/server-render-structure.ts"],"names":[],"mappings":"AACA,OAAO,EACN,8BAA8B,EAE9B,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EACN,2BAA2B,EAC3B,iCAAiC,EACjC,4BAA4B,EAC5B,+BAA+B,EAC/B,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EAmBrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,sCAAsC,EACtC,oDAAoD,EACpD,oCAAoC,EAEpC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,4BAA4B,EAE5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,8BAA8B,EAC9B,4BAA4B,EAE5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,MAAM,+CAA+C,CAAC;AAEvD,4FAA4F;AAC5F,MAAM,UAAU,gBAAgB,CAAI,OAAgB;IACnD,OAAO,OAAO,EAAE,CAAC;AAClB,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,yBAAyB,CAAI,OAAgB;IAC5D,OAAO,OAAO,EAAE,CAAC;AAClB,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,kBAAkB,CACjC,OAA2B,EAC3B,QAAiB,EACjB,iBAAiB,GAAG,IAAI;IAExB,OAAO,8BAA8B,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AAC/E,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,+BAA+B,CAC9C,OAA2B,EAC3B,QAAiB,EACjB,iBAAiB,GAAG,IAAI;IAExB,OAAO,8BAA8B,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import type { RenderResult } from '../component/contracts.js';\nimport {\n\tcreatePreparedServerChildRange,\n\ttype ExactPreparedServerChildRange\n} from '../component-abi/server-child-range.js';\n\nexport { isFiniteClientBoundary, markFiniteClientBoundary } from '../hydration-boundary.js';\nexport { hasIndependentAsyncSiblings, markIndependentAsyncSiblings } from '../ssr-independence.js';\nexport { RenderProgram, ServerBoundary, ServerSlot } from '../symbols.js';\nexport {\n\tcreatePreparedRenderProgram,\n\tcreatePreparedServerRenderProgram,\n\tprepareCompiledRenderProgram,\n\treadPreparedServerRenderProgram,\n\treadRenderProgram,\n\treadRenderProgramReceipt,\n\treadRenderProgramSlot,\n\ttype ExactRenderProgram,\n\ttype ExactDirectRenderProgram,\n\ttype ExactDomRenderProgram,\n\ttype ExactRenderProgramBinding,\n\ttype ExactRenderProgramBinder,\n\ttype ExactRenderProgramBindingTarget,\n\ttype ExactRenderProgramInvocation,\n\ttype ExactRenderProgramReceipt,\n\ttype ExactRenderProgramReceiptData,\n\ttype ExactPreparedServerRenderProgram,\n\ttype ExactRenderProgramNode,\n\ttype ExactRenderProgramSlot,\n\ttype ExactRenderProgramSsrOperations,\n\ttype ExactRenderProgramSsrOutput,\n\ttype ExactRenderProgramSsrInvocation,\n\ttype ExactRenderProgramSsrWriter,\n\ttype ExactSsrRenderProgram,\n\ttype ExactTableRenderProgram\n} from '../render-program.js';\nexport {\n\tcreatePreparedServerComponentReference,\n\tcreatePreparedServerComponentReferenceFromPlainProps,\n\treadPreparedServerComponentReference,\n\ttype ExactPreparedServerComponentReference\n} from '../component-abi/receipt.js';\nexport {\n\treadPreparedServerChildRange,\n\ttype ExactPreparedServerChildRange\n} from '../component-abi/server-child-range.js';\nexport {\n\tcreatePreparedServerKeyedChild,\n\treadPreparedServerKeyedChild,\n\ttype ExactPreparedServerKeyedChild\n} from '../component-abi/server-keyed-child.js';\nexport {\n\tcreateKeyedServerSlot,\n\tcreateServerBoundary,\n\tcreateServerSlot\n} from '../component-abi/server-structure-receipts.js';\n\n/** Evaluates a compiler-known expression directly in a compiler-closed server component. */\nexport function createExpression<T>(compute: () => T): T {\n\treturn compute();\n}\n\n/** Evaluates a compiler-forwarded input directly in a compiler-closed server component. */\nexport function createForwardedExpression<T>(compute: () => T): T {\n\treturn compute();\n}\n\n/** Creates an eager focused child range for a direct server render or its local fallback. */\nexport function createDynamicChild(\n\tcompute: () => RenderResult,\n\tmarkerId?: string,\n\tmayReplaceSubtree = true\n): ExactPreparedServerChildRange {\n\treturn createPreparedServerChildRange(compute(), markerId, mayReplaceSubtree);\n}\n\n/** Creates the eager server operation for one compiler-owned dynamic child range. */\nexport function createCompiledChildRangeReceipt(\n\tcompute: () => RenderResult,\n\tmarkerId?: string,\n\tmayReplaceSubtree = true\n): ExactPreparedServerChildRange {\n\treturn createPreparedServerChildRange(compute(), markerId, mayReplaceSubtree);\n}\n"]}
1
+ {"version":3,"file":"server-render-structure.js","sourceRoot":"","sources":["../../../src/framework/server-render-structure.ts"],"names":[],"mappings":"AACA,OAAO,EACN,8BAA8B,EAE9B,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EACN,2BAA2B,EAC3B,iCAAiC,EACjC,4BAA4B,EAC5B,+BAA+B,EAC/B,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EAmBrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,sCAAsC,EACtC,oDAAoD,EACpD,oCAAoC,EAEpC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,4BAA4B,EAE5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,8BAA8B,EAC9B,4BAA4B,EAE5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,MAAM,+CAA+C,CAAC;AAEvD,4FAA4F;AAC5F,MAAM,UAAU,gBAAgB,CAAI,OAAgB;IACnD,OAAO,OAAO,EAAE,CAAC;AAClB,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,yBAAyB,CAAI,OAAgB;IAC5D,OAAO,OAAO,EAAE,CAAC;AAClB,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,kBAAkB,CACjC,OAA2B,EAC3B,QAAiB,EACjB,iBAAiB,GAAG,IAAI;IAExB,OAAO,8BAA8B,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AAC/E,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,+BAA+B,CAC9C,OAA2B,EAC3B,QAAiB,EACjB,iBAAiB,GAAG,IAAI;IAExB,OAAO,8BAA8B,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AAC/E,CAAC;AAED,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC","sourcesContent":["import type { RenderResult } from '../component/contracts.js';\nimport {\n\tcreatePreparedServerChildRange,\n\ttype ExactPreparedServerChildRange\n} from '../component-abi/server-child-range.js';\n\nexport { isFiniteClientBoundary, markFiniteClientBoundary } from '../hydration-boundary.js';\nexport { hasIndependentAsyncSiblings, markIndependentAsyncSiblings } from '../ssr-independence.js';\nexport { RenderProgram, ServerBoundary, ServerSlot } from '../symbols.js';\nexport {\n\tcreatePreparedRenderProgram,\n\tcreatePreparedServerRenderProgram,\n\tprepareCompiledRenderProgram,\n\treadPreparedServerRenderProgram,\n\treadRenderProgram,\n\treadRenderProgramReceipt,\n\treadRenderProgramSlot,\n\ttype ExactRenderProgram,\n\ttype ExactDirectRenderProgram,\n\ttype ExactDomRenderProgram,\n\ttype ExactRenderProgramBinding,\n\ttype ExactRenderProgramBinder,\n\ttype ExactRenderProgramBindingTarget,\n\ttype ExactRenderProgramInvocation,\n\ttype ExactRenderProgramReceipt,\n\ttype ExactRenderProgramReceiptData,\n\ttype ExactPreparedServerRenderProgram,\n\ttype ExactRenderProgramNode,\n\ttype ExactRenderProgramSlot,\n\ttype ExactRenderProgramSsrOperations,\n\ttype ExactRenderProgramSsrOutput,\n\ttype ExactRenderProgramSsrInvocation,\n\ttype ExactRenderProgramSsrWriter,\n\ttype ExactSsrRenderProgram,\n\ttype ExactTableRenderProgram\n} from '../render-program.js';\nexport {\n\tcreatePreparedServerComponentReference,\n\tcreatePreparedServerComponentReferenceFromPlainProps,\n\treadPreparedServerComponentReference,\n\ttype ExactPreparedServerComponentReference\n} from '../component-abi/receipt.js';\nexport {\n\treadPreparedServerChildRange,\n\ttype ExactPreparedServerChildRange\n} from '../component-abi/server-child-range.js';\nexport {\n\tcreatePreparedServerKeyedChild,\n\treadPreparedServerKeyedChild,\n\ttype ExactPreparedServerKeyedChild\n} from '../component-abi/server-keyed-child.js';\nexport {\n\tcreateKeyedServerSlot,\n\tcreateServerBoundary,\n\tcreateServerSlot\n} from '../component-abi/server-structure-receipts.js';\n\n/** Evaluates a compiler-known expression directly in a compiler-closed server component. */\nexport function createExpression<T>(compute: () => T): T {\n\treturn compute();\n}\n\n/** Evaluates a compiler-forwarded input directly in a compiler-closed server component. */\nexport function createForwardedExpression<T>(compute: () => T): T {\n\treturn compute();\n}\n\n/** Creates an eager focused child range for a direct server render or its local fallback. */\nexport function createDynamicChild(\n\tcompute: () => RenderResult,\n\tmarkerId?: string,\n\tmayReplaceSubtree = true\n): ExactPreparedServerChildRange {\n\treturn createPreparedServerChildRange(compute(), markerId, mayReplaceSubtree);\n}\n\n/** Creates the eager server operation for one compiler-owned dynamic child range. */\nexport function createCompiledChildRangeReceipt(\n\tcompute: () => RenderResult,\n\tmarkerId?: string,\n\tmayReplaceSubtree = true\n): ExactPreparedServerChildRange {\n\treturn createPreparedServerChildRange(compute(), markerId, mayReplaceSubtree);\n}\n\nexport { createServerFragmentTargetProjection } from './server-fragment-target-projection.js';\n"]}
@@ -36,7 +36,9 @@ export interface TaskOwner extends AsyncDisposable {
36
36
  }
37
37
  /** Owner-bound observable state for one task definition. */
38
38
  export interface TaskStatus<Result> {
39
+ /** Whether any generation is queued or running, regardless of its readiness policy. */
39
40
  readonly pending: boolean;
41
+ /** Number of unsettled generations, including nonblocking and deferred work. */
40
42
  readonly pendingCount: number;
41
43
  readonly generation: number;
42
44
  readonly result: Result | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/tasks/contracts.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GACvB,gBAAgB,GAChB,UAAU,GACV,aAAa,GACb,SAAS,GACT,WAAW,CAAC;AAEf,6CAA6C;AAC7C,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,UAAU,CAAC,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACnC,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACnD,GAAG,CAAC,CAAC,SAAS,UAAU,GAAG,eAAe,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;CAC5D;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACrD,MAAM,IAAI,iBAAiB,CAAC;IAC5B,MAAM,IAAI,iBAAiB,CAAC;IAC5B,+EAA+E;IAC/E,QAAQ,IAAI,iBAAiB,CAAC;IAC9B,QAAQ,IAAI,iBAAiB,CAAC;IAC9B,MAAM,IAAI,iBAAiB,CAAC;IAC5B,KAAK,IAAI,iBAAiB,CAAC;IAC3B,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,iBAAiB,CAAC;IACpC,SAAS,IAAI,iBAAiB,CAAC;IAC/B,MAAM,IAAI,iBAAiB,CAAC;IAC5B,QAAQ,IAAI,i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AE,IAAI,KAAK,OAAO,CAAC;IACrD;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,SAAS,OAAO,EAAE,CAAC;IACpE,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,aAAa,CAAC;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,MAAM,CAAE,SAAQ,UAAU;IACvF,CAAC,GAAG,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/tasks/contracts.ts"],"names":[],"mappings":"","sourcesContent":["/** Describes why a task generation began. */\nexport type TaskActivation =\n\t| 'initialization'\n\t| 'reactive'\n\t| 'interaction'\n\t| 'invoked'\n\t| 'lifecycle';\n\n/** Capabilities scoped to one task frame. */\nexport interface TaskContext {\n\treadonly signal: AbortSignal;\n\treadonly generation: number;\n\treadonly activation: TaskActivation;\n\tpeek<T>(read: () => T): T;\n\toptimistic(work: () => void): void;\n\tcleanup(cleanup: () => void | Promise<void>): void;\n\town<T extends Disposable | AsyncDisposable>(resource: T): T;\n}\n\n/**\n * Declarative task policy accepted only as the default value of a final\n * {@link TaskContext} parameter in compiler-authored source.\n */\nexport interface TaskContextPolicy extends TaskContext {\n\tclient(): TaskContextPolicy;\n\tserver(): TaskContextPolicy;\n\t/** Declares a missable snapshot receiver for browser-initiated server work. */\n\tprogress(): TaskContextPolicy;\n\tparallel(): TaskContextPolicy;\n\tlatest(): TaskContextPolicy;\n\tqueue(): TaskContextPolicy;\n\tkey<T>(value: T): TaskContextPolicy;\n\timmediate(): TaskContextPolicy;\n\tnormal(): TaskContextPolicy;\n\tdeferred(): TaskContextPolicy;\n\tblocking(): TaskContextPolicy;\n\tnonblocking(): TaskContextPolicy;\n\tdetached(): TaskContextPolicy;\n}\n\n/** Durable cancellation and concurrency ownership for task generations. */\nexport interface TaskOwner extends AsyncDisposable {\n\treadonly signal: AbortSignal;\n}\n\n/** Owner-bound observable state for one task definition. */\nexport interface TaskStatus<Result> {\n\treadonly pending: boolean;\n\treadonly pendingCount: number;\n\treadonly generation: number;\n\treadonly result: Result | undefined;\n\treadonly error: unknown;\n\tcancel(reason?: unknown): void;\n}\n\n/** A thenable whose result settles only after its attached task subtree. */\nexport interface TaskInvocation<Result> extends PromiseLike<Result> {\n\tthen<TResult1 = Result, TResult2 = never>(\n\t\tonFulfilled?: ((value: Result) => TResult1 | PromiseLike<TResult1>) | null,\n\t\tonRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null\n\t): TaskInvocation<TResult1 | TResult2>;\n\tcatch<TResult = never>(\n\t\tonRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null\n\t): TaskInvocation<Result | TResult>;\n\tfinally(onFinally?: (() => void) | null): TaskInvocation<Result>;\n\treadonly [Symbol.toStringTag]: 'TaskInvocation';\n}\n\n/** Callable runtime task definition. */\nexport interface TaskFunction<Args extends unknown[], Result> {\n\t(...args: Args): TaskInvocation<Result>;\n}\n\n/** Existential task function retained where authored argument tuples are not inspected. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Runtime task registries preserve arbitrary authored argument tuples through callable identity.\nexport type AnyTaskFunction<Result = unknown> = TaskFunction<any[], Result>;\n\n/** Owner-bound task callable with aggregate status. */\nexport interface BoundTaskFunction<Args extends unknown[], Result>\n\textends TaskFunction<Args, Result>,\n\t\tTaskStatus<Result> {}\n\n/** Runtime policy required when an integration defines a task outside compiled component source. */\nexport interface RuntimeTaskOptions<Args extends unknown[]> {\n\treadonly label?: string;\n\treadonly placement?: 'current' | 'client' | 'server';\n\treadonly priority?: 'immediate' | 'normal' | 'deferred';\n\treadonly concurrency?: 'parallel' | 'latest' | 'queue';\n\treadonly concurrencyKey?: (...args: Args) => unknown;\n\t/**\n\t * Compiler-generated resolver for defaulted task parameters. It evaluates\n\t * omitted defaults once per generation without subscribing the task to\n\t * reactive reads performed while resolving them.\n\t */\n\treadonly captureArguments?: (args: unknown[]) => readonly unknown[];\n\treadonly readiness?: 'blocking' | 'nonblocking';\n\treadonly detached?: boolean;\n\treadonly owner?: TaskOwner;\n}\n\n/** Reserved callback that must run or be explicitly released exactly once. */\nexport interface ReservedTaskCallback<Args extends unknown[], Result> extends Disposable {\n\t(...args: Args): Result;\n\tcancel(reason?: unknown): void;\n}\n"]}
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/tasks/contracts.ts"],"names":[],"mappings":"","sourcesContent":["/** Describes why a task generation began. */\nexport type TaskActivation =\n\t| 'initialization'\n\t| 'reactive'\n\t| 'interaction'\n\t| 'invoked'\n\t| 'lifecycle';\n\n/** Capabilities scoped to one task frame. */\nexport interface TaskContext {\n\treadonly signal: AbortSignal;\n\treadonly generation: number;\n\treadonly activation: TaskActivation;\n\tpeek<T>(read: () => T): T;\n\toptimistic(work: () => void): void;\n\tcleanup(cleanup: () => void | Promise<void>): void;\n\town<T extends Disposable | AsyncDisposable>(resource: T): T;\n}\n\n/**\n * Declarative task policy accepted only as the default value of a final\n * {@link TaskContext} parameter in compiler-authored source.\n */\nexport interface TaskContextPolicy extends TaskContext {\n\tclient(): TaskContextPolicy;\n\tserver(): TaskContextPolicy;\n\t/** Declares a missable snapshot receiver for browser-initiated server work. */\n\tprogress(): TaskContextPolicy;\n\tparallel(): TaskContextPolicy;\n\tlatest(): TaskContextPolicy;\n\tqueue(): TaskContextPolicy;\n\tkey<T>(value: T): TaskContextPolicy;\n\timmediate(): TaskContextPolicy;\n\tnormal(): TaskContextPolicy;\n\tdeferred(): TaskContextPolicy;\n\tblocking(): TaskContextPolicy;\n\tnonblocking(): TaskContextPolicy;\n\tdetached(): TaskContextPolicy;\n}\n\n/** Durable cancellation and concurrency ownership for task generations. */\nexport interface TaskOwner extends AsyncDisposable {\n\treadonly signal: AbortSignal;\n}\n\n/** Owner-bound observable state for one task definition. */\nexport interface TaskStatus<Result> {\n\t/** Whether any generation is queued or running, regardless of its readiness policy. */\n\treadonly pending: boolean;\n\t/** Number of unsettled generations, including nonblocking and deferred work. */\n\treadonly pendingCount: number;\n\treadonly generation: number;\n\treadonly result: Result | undefined;\n\treadonly error: unknown;\n\tcancel(reason?: unknown): void;\n}\n\n/** A thenable whose result settles only after its attached task subtree. */\nexport interface TaskInvocation<Result> extends PromiseLike<Result> {\n\tthen<TResult1 = Result, TResult2 = never>(\n\t\tonFulfilled?: ((value: Result) => TResult1 | PromiseLike<TResult1>) | null,\n\t\tonRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null\n\t): TaskInvocation<TResult1 | TResult2>;\n\tcatch<TResult = never>(\n\t\tonRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null\n\t): TaskInvocation<Result | TResult>;\n\tfinally(onFinally?: (() => void) | null): TaskInvocation<Result>;\n\treadonly [Symbol.toStringTag]: 'TaskInvocation';\n}\n\n/** Callable runtime task definition. */\nexport interface TaskFunction<Args extends unknown[], Result> {\n\t(...args: Args): TaskInvocation<Result>;\n}\n\n/** Existential task function retained where authored argument tuples are not inspected. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Runtime task registries preserve arbitrary authored argument tuples through callable identity.\nexport type AnyTaskFunction<Result = unknown> = TaskFunction<any[], Result>;\n\n/** Owner-bound task callable with aggregate status. */\nexport interface BoundTaskFunction<Args extends unknown[], Result>\n\textends TaskFunction<Args, Result>,\n\t\tTaskStatus<Result> {}\n\n/** Runtime policy required when an integration defines a task outside compiled component source. */\nexport interface RuntimeTaskOptions<Args extends unknown[]> {\n\treadonly label?: string;\n\treadonly placement?: 'current' | 'client' | 'server';\n\treadonly priority?: 'immediate' | 'normal' | 'deferred';\n\treadonly concurrency?: 'parallel' | 'latest' | 'queue';\n\treadonly concurrencyKey?: (...args: Args) => unknown;\n\t/**\n\t * Compiler-generated resolver for defaulted task parameters. It evaluates\n\t * omitted defaults once per generation without subscribing the task to\n\t * reactive reads performed while resolving them.\n\t */\n\treadonly captureArguments?: (args: unknown[]) => readonly unknown[];\n\treadonly readiness?: 'blocking' | 'nonblocking';\n\treadonly detached?: boolean;\n\treadonly owner?: TaskOwner;\n}\n\n/** Reserved callback that must run or be explicitly released exactly once. */\nexport interface ReservedTaskCallback<Args extends unknown[], Result> extends Disposable {\n\t(...args: Args): Result;\n\tcancel(reason?: unknown): void;\n}\n"]}
@@ -14,7 +14,6 @@ export type InternalTaskGeneration<Result> = {
14
14
  readonly reject: (error: unknown) => void;
15
15
  readonly parent: TaskFrameRecord | undefined;
16
16
  readonly releaseReservation?: () => void;
17
- readonly foreground: boolean;
18
17
  readonly activation: TaskActivation;
19
18
  /** Effective lane policy; dependency-driven activation always uses latest-wins. */
20
19
  readonly concurrency: 'parallel' | 'latest' | 'queue';
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-types.d.ts","sourceRoot":"","sources":["../../../src/tasks/runtime-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAEnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,+EAA+E;AAC/E,MAAM,MAAM,sBAAsB,CAAC,MAAM,IAAI;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC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,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,sBAAsB,CAAC,MAAM,IAAI;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-types.js","sourceRoot":"","sources":["../../../src/tasks/runtime-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactiveMutationJournal } from '@exactjs/reactive/framework/runtime';\n\nimport type { AnyComponentInstance } from '../component/contracts.js';\nimport type { ComponentTraceSpan } from '../component/performance-trace.js';\nimport type { TaskActivation } from './contracts.js';\nimport type { TaskFrameRecord } from './frame-runtime.js';\n\n/** Mutable execution record for one owner- and lane-scoped task generation. */\nexport type InternalTaskGeneration<Result> = {\n\treadonly generation: number;\n\treadonly controller: AbortController;\n\treadonly args: readonly unknown[];\n\treadonly journals: ReactiveMutationJournal[];\n\treadonly promise: Promise<Result>;\n\treadonly resolve: (value: Result) => void;\n\treadonly reject: (error: unknown) => void;\n\treadonly parent: TaskFrameRecord | undefined;\n\treadonly releaseReservation?: () => void;\n\treadonly foreground: boolean;\n\treadonly activation: TaskActivation;\n\t/** Effective lane policy; dependency-driven activation always uses latest-wins. */\n\treadonly concurrency: 'parallel' | 'latest' | 'queue';\n\treadonly readiness: 'blocking' | 'nonblocking';\n\treadinessRegistration?: { cancel(): void };\n\tpriority: 'immediate' | 'normal' | 'deferred';\n\tscheduledWork?: () => void;\n\tobserved: boolean;\n\tstarted: boolean;\n\texecuting: boolean;\n\ttrace?: {\n\t\treadonly owner: AnyComponentInstance;\n\t\treadonly span: ComponentTraceSpan;\n\t};\n};\n\n/** Concurrency lane state shared by generations with the same task key. */\nexport type InternalTaskLane<Result> = {\n\treadonly key: unknown;\n\treadonly active: Set<InternalTaskGeneration<Result>>;\n\treadonly queue: InternalTaskGeneration<Result>[];\n\tpendingCount: number;\n\tgeneration: number;\n\tresult: Result | undefined;\n\terror: unknown;\n};\n\n/** Aggregate status and keyed lanes for one task definition under one owner. */\nexport type InternalTaskOwnerState<Result> = {\n\tnextGeneration: number;\n\tgeneration: number;\n\tpendingCount: number;\n\tresult: Result | undefined;\n\terror: unknown;\n\treadonly lanes: Map<unknown, InternalTaskLane<Result>>;\n\tlanesVersion: number;\n};\n"]}
1
+ {"version":3,"file":"runtime-types.js","sourceRoot":"","sources":["../../../src/tasks/runtime-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactiveMutationJournal } from '@exactjs/reactive/framework/runtime';\n\nimport type { AnyComponentInstance } from '../component/contracts.js';\nimport type { ComponentTraceSpan } from '../component/performance-trace.js';\nimport type { TaskActivation } from './contracts.js';\nimport type { TaskFrameRecord } from './frame-runtime.js';\n\n/** Mutable execution record for one owner- and lane-scoped task generation. */\nexport type InternalTaskGeneration<Result> = {\n\treadonly generation: number;\n\treadonly controller: AbortController;\n\treadonly args: readonly unknown[];\n\treadonly journals: ReactiveMutationJournal[];\n\treadonly promise: Promise<Result>;\n\treadonly resolve: (value: Result) => void;\n\treadonly reject: (error: unknown) => void;\n\treadonly parent: TaskFrameRecord | undefined;\n\treadonly releaseReservation?: () => void;\n\treadonly activation: TaskActivation;\n\t/** Effective lane policy; dependency-driven activation always uses latest-wins. */\n\treadonly concurrency: 'parallel' | 'latest' | 'queue';\n\treadonly readiness: 'blocking' | 'nonblocking';\n\treadinessRegistration?: { cancel(): void };\n\tpriority: 'immediate' | 'normal' | 'deferred';\n\tscheduledWork?: () => void;\n\tobserved: boolean;\n\tstarted: boolean;\n\texecuting: boolean;\n\ttrace?: {\n\t\treadonly owner: AnyComponentInstance;\n\t\treadonly span: ComponentTraceSpan;\n\t};\n};\n\n/** Concurrency lane state shared by generations with the same task key. */\nexport type InternalTaskLane<Result> = {\n\treadonly key: unknown;\n\treadonly active: Set<InternalTaskGeneration<Result>>;\n\treadonly queue: InternalTaskGeneration<Result>[];\n\tpendingCount: number;\n\tgeneration: number;\n\tresult: Result | undefined;\n\terror: unknown;\n};\n\n/** Aggregate status and keyed lanes for one task definition under one owner. */\nexport type InternalTaskOwnerState<Result> = {\n\tnextGeneration: number;\n\tgeneration: number;\n\tpendingCount: number;\n\tresult: Result | undefined;\n\terror: unknown;\n\treadonly lanes: Map<unknown, InternalTaskLane<Result>>;\n\tlanesVersion: number;\n};\n"]}
@@ -132,7 +132,6 @@ function invokeDefinition(definition, explicitOwner, explicitParent, args, activ
132
132
  reject,
133
133
  parent: ambient,
134
134
  releaseReservation,
135
- foreground,
136
135
  activation,
137
136
  concurrency,
138
137
  readiness,
@@ -151,10 +150,9 @@ function invokeDefinition(definition, explicitOwner, explicitParent, args, activ
151
150
  }
152
151
  void promise.finally(() => owner.settlements.delete(promise)).catch(() => undefined);
153
152
  lane.active.add(record);
154
- if (foreground) {
155
- state.pendingCount++;
156
- lane.pendingCount++;
157
- }
153
+ // Status describes all unsettled generations; readiness is registered separately above.
154
+ state.pendingCount++;
155
+ lane.pendingCount++;
158
156
  if (concurrency === 'queue') {
159
157
  lane.queue.push(record);
160
158
  pumpLane(definition, owner, state, lane);
@@ -226,10 +224,8 @@ function startGeneration(definition, owner, state, lane, record) {
226
224
  }
227
225
  function finishGeneration(definition, owner, state, lane, record) {
228
226
  lane.active.delete(record);
229
- if (record.foreground)
230
- state.pendingCount = Math.max(0, state.pendingCount - 1);
231
- if (record.foreground)
232
- lane.pendingCount = Math.max(0, lane.pendingCount - 1);
227
+ state.pendingCount = Math.max(0, state.pendingCount - 1);
228
+ lane.pendingCount = Math.max(0, lane.pendingCount - 1);
233
229
  if (record.concurrency === 'queue') {
234
230
  const next = lane.queue.shift();
235
231
  if (next) {