@bgub/fig-dom 0.0.1 → 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +427 -0
- package/README.md +12 -0
- package/dist/act.d.ts +1 -1
- package/dist/act.js +1 -1
- package/dist/index.d.ts +44 -276
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/jsx-C3owhMDw.d.ts +247 -0
- package/dist/jsx-runtime.d.ts +16 -0
- package/dist/jsx-runtime.js +1 -0
- package/dist/refresh-internal-B05aFp_T.js +2 -0
- package/dist/refresh-internal-B05aFp_T.js.map +1 -0
- package/dist/refresh.d.ts +4 -5
- package/dist/refresh.js +1 -2
- package/dist/renderer-HA5C4hQE.js +2 -0
- package/dist/renderer-HA5C4hQE.js.map +1 -0
- package/dist/view-transitions.d.ts +21 -0
- package/dist/view-transitions.js +2 -0
- package/dist/view-transitions.js.map +1 -0
- package/package.json +21 -6
- package/dist/refresh.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1 +1,428 @@
|
|
|
1
|
+
## @bgub/fig-dom@0.1.0-alpha.1
|
|
2
|
+
|
|
3
|
+
### Asset descriptors use native names and preserve native ordering
|
|
4
|
+
|
|
5
|
+
Client-inserted and host-rendered stylesheets now form precedence buckets in
|
|
6
|
+
the order each distinct precedence value is first discovered. A stylesheet
|
|
7
|
+
discovered later for an existing bucket is inserted before the following
|
|
8
|
+
bucket, keeping lazy and payload-delivered CSS in its intended cascade order.
|
|
9
|
+
|
|
10
|
+
Raw `<script>` elements now enter the asset registry only when explicitly
|
|
11
|
+
marked `async`. Non-async scripts retain their native document position and
|
|
12
|
+
execution semantics; explicit `script()` descriptors continue to support all
|
|
13
|
+
asset-delivery modes.
|
|
14
|
+
|
|
15
|
+
Asset descriptor options and serialized payload asset rows now use native HTML
|
|
16
|
+
attribute names: `crossorigin`, `fetchpriority`, and `http-equiv`. The previous
|
|
17
|
+
React-style `crossOrigin`, `fetchPriority`, and `httpEquiv` spellings are
|
|
18
|
+
removed.
|
|
19
|
+
|
|
20
|
+
Host resource resolution now receives the actual host parent and fixes
|
|
21
|
+
out-of-band placement once per fiber. SVG and MathML titles consequently stay
|
|
22
|
+
in their native namespace, while HTML titles carrying `itemprop` stay in-tree;
|
|
23
|
+
ordinary document titles continue to use the shared head registry.
|
|
24
|
+
|
|
25
|
+
### Restore shadowed document metadata when its winner leaves
|
|
26
|
+
|
|
27
|
+
Client title and meta entries now keep stable per-fiber ownership claims. The
|
|
28
|
+
latest acquired live claim controls the single canonical DOM element; updates
|
|
29
|
+
to shadowed claims stay dormant, and removing the winner immediately restores
|
|
30
|
+
the latest remaining value.
|
|
31
|
+
|
|
32
|
+
Hoisted host and declarative asset lifecycle callbacks receive an opaque,
|
|
33
|
+
stable `AssetResourceOwner`. Hoisted updates own the complete canonical host
|
|
34
|
+
update, including text, so a shadowed fiber cannot overwrite registry state.
|
|
35
|
+
|
|
36
|
+
### Stable client-reference identity across decodes
|
|
37
|
+
|
|
38
|
+
`@bgub/fig/payload` exposes `createPayloadClientReferenceResolver(resolve)`:
|
|
39
|
+
a caller-owned stateful resolver passed as the `resolveClientReference`
|
|
40
|
+
decode option. With one, every resolvable client reference decodes to one
|
|
41
|
+
resolver-owned wrapper per reference id across all decodes sharing the
|
|
42
|
+
resolver — gated, ungated, or asynchronously resolved — so re-decoding a
|
|
43
|
+
payload updates islands in place instead of remounting them. Reveal gates
|
|
44
|
+
ride the decoded element instances rather than the wrapper: each decode
|
|
45
|
+
gates exactly its own content, so a newer decode's pending assets never
|
|
46
|
+
re-suspend an island already on screen, while its new island instances
|
|
47
|
+
still wait for the stylesheets they declared. The caller owns the
|
|
48
|
+
resolver's lifetime; under fast refresh no manual invalidation is needed
|
|
49
|
+
(hot edits remap the latched resolution through component families, and
|
|
50
|
+
unaccepted updates full-reload), while `delete`/`clear` cover manifest
|
|
51
|
+
swaps without a reload. With a plain resolve function, gated and async
|
|
52
|
+
references keep their per-decode wrapper identity, now with the same
|
|
53
|
+
per-element gating.
|
|
54
|
+
|
|
55
|
+
`@bgub/fig-dom`'s `payloadDataLoader` accepts the stateful resolver through
|
|
56
|
+
its existing `resolveClientReference` option.
|
|
57
|
+
|
|
58
|
+
Framework adapters can retain one resolver across refreshes and navigations,
|
|
59
|
+
preventing asset-gated islands from remounting on every re-decode.
|
|
60
|
+
|
|
61
|
+
### Publish metadata only with its visible owner
|
|
62
|
+
|
|
63
|
+
Title and meta resources now travel through Payload as owner-bound
|
|
64
|
+
declarations and update the document only when their decoded tree commits.
|
|
65
|
+
Pending or superseded refreshes keep the previous metadata visible.
|
|
66
|
+
|
|
67
|
+
Streaming HTML now treats Suspense fallbacks as metadata owners and reconciles
|
|
68
|
+
the completed visible metadata snapshot in the boundary reveal operation.
|
|
69
|
+
Partial segments and failed or abandoned primary work cannot mutate the head.
|
|
70
|
+
|
|
71
|
+
The obsolete `onAssetError` option and its asset-diagnostic types are removed:
|
|
72
|
+
late metadata is delivered with its owner instead of being dropped.
|
|
73
|
+
|
|
74
|
+
### Recover full-document Suspense hydration mismatches
|
|
75
|
+
|
|
76
|
+
Full-document hydration now escalates a mismatch inside the document-level
|
|
77
|
+
Suspense boundary to root recovery, preserves the document doctype, and
|
|
78
|
+
rebuilds the document without reusing cleared insertion anchors.
|
|
79
|
+
|
|
80
|
+
### Make `configureDomRefreshScheduler` internal
|
|
81
|
+
|
|
82
|
+
The `@bgub/fig-dom/refresh` subpath now exports only `scheduleRefresh`
|
|
83
|
+
and the `RefreshFamily`/`RefreshUpdate` types. The wiring setter was
|
|
84
|
+
called by exactly one place — fig-dom's own renderer, as a module side
|
|
85
|
+
effect — and HMR runtimes only ever needed `scheduleRefresh`. The
|
|
86
|
+
before-main-entry update buffering is unchanged and keeps living in a
|
|
87
|
+
single shared module, so pre-evaluation refreshes still replay once the
|
|
88
|
+
renderer configures itself.
|
|
89
|
+
|
|
90
|
+
### Split fig-dom's oversized modules into focused ones
|
|
91
|
+
|
|
92
|
+
Internal restructuring with no API or behavior change. The host config and
|
|
93
|
+
renderer wiring move out of the package entry into `renderer.ts`; form
|
|
94
|
+
control value/checked/select handling, style application, the `on()` event
|
|
95
|
+
descriptor, and the propagation-state patching each get their own module.
|
|
96
|
+
Event slot attachment state is now a discriminated union instead of four
|
|
97
|
+
nullable fields.
|
|
98
|
+
|
|
99
|
+
### Serialized components move to the data-resource model
|
|
100
|
+
|
|
101
|
+
Serialized trees are now ordinary data resources: servers return plain
|
|
102
|
+
Payload streams, and clients consume them through keyed `dataResource`
|
|
103
|
+
instances with `payloadDataLoader`. Refresh is `refreshData`, navigation can
|
|
104
|
+
select a new key, and back/forward navigations reuse cached entries. Commits
|
|
105
|
+
wait for the incoming Payload, island modules, and stylesheet gates.
|
|
106
|
+
|
|
107
|
+
Supporting API additions: `payloadDataLoader` accepts a `prepareAssets`
|
|
108
|
+
override (defaults to `insertAssetResources`), and `decodePayloadStream`
|
|
109
|
+
accepts an `onClientReference` observer for reference metadata.
|
|
110
|
+
|
|
111
|
+
### Diagnose hoisted resource declassification
|
|
112
|
+
|
|
113
|
+
Development now throws when an update would turn a permanently hoisted host
|
|
114
|
+
fiber into an ordinary in-tree element, naming the affected asset and
|
|
115
|
+
explaining that changing placement requires a different Fig element key.
|
|
116
|
+
Production ignores the update instead of mutating a shared delivery asset or
|
|
117
|
+
overwriting the owner's last valid title or metadata claim.
|
|
118
|
+
|
|
119
|
+
### Compose host behavior with mixins
|
|
120
|
+
|
|
121
|
+
Core now exports `createMixin()` and resolves render-time host behavior through
|
|
122
|
+
the `mix` prop. Mixins may contribute host props or nested mixins while keeping
|
|
123
|
+
the host type and subtree fixed. Explicit host props form the baseline; mixins
|
|
124
|
+
run in authoring order, and later results win.
|
|
125
|
+
|
|
126
|
+
DOM event listeners now use `mix={on(type, callback)}`. Migrate
|
|
127
|
+
`events={[on(type, callback)]}` to `mix={on(type, callback)}`; multiple or
|
|
128
|
+
conditional descriptors move into `mix={[...]}` and preserve positional
|
|
129
|
+
listener identity.
|
|
130
|
+
|
|
131
|
+
### Keep `useId` stable through selective hydration
|
|
132
|
+
|
|
133
|
+
`useId` now follows one canonical server/hydration tree path through Suspense
|
|
134
|
+
and Activity. Dehydrated boundaries snapshot that path when they claim their
|
|
135
|
+
server marker, then restore it when hydration resumes, so client updates that
|
|
136
|
+
insert or move surrounding siblings cannot renumber ids already present in the
|
|
137
|
+
server HTML. Suspense's private Activity wrapper is transparent to the path.
|
|
138
|
+
|
|
139
|
+
Components mounted only on the client now receive ids from a separate
|
|
140
|
+
`fig-C-*` namespace. Those ids remain stable for the component lifetime and
|
|
141
|
+
cannot collide with ids reserved by server-rendered content that has not
|
|
142
|
+
hydrated yet.
|
|
143
|
+
|
|
144
|
+
### Trim DOM renderer hot-path work
|
|
145
|
+
|
|
146
|
+
The DOM renderer now avoids transient collections while diffing host props,
|
|
147
|
+
updating event descriptors, and scanning document assets. Event routing keeps
|
|
148
|
+
root state in one container record, stores less per-listener metadata, and
|
|
149
|
+
builds dispatch paths in place. Host configuration callbacks whose signatures
|
|
150
|
+
already match now connect directly instead of paying forwarding closures.
|
|
151
|
+
|
|
152
|
+
Controlled single-select elements also keep their scalar value without
|
|
153
|
+
allocating a one-entry `Set`; multi-select values retain set lookup behavior.
|
|
154
|
+
These changes preserve the public API while reducing the production entry
|
|
155
|
+
bundle and allocation pressure during mount, update, dispatch, and teardown.
|
|
156
|
+
|
|
157
|
+
### Payload exposes rendering and decoding, not its implementation
|
|
158
|
+
|
|
159
|
+
The payload packages now present two primary operations:
|
|
160
|
+
`renderToPayloadStream` on the server and `decodePayloadStream` in the
|
|
161
|
+
browser-safe core entry. Row/model types, value encoding, codec machinery,
|
|
162
|
+
content-type negotiation helpers, and framework document transports are
|
|
163
|
+
internal implementation details.
|
|
164
|
+
|
|
165
|
+
Client references use one `resolveClientReference(reference)` seam that may
|
|
166
|
+
return a component synchronously or asynchronously. It replaces the separate
|
|
167
|
+
load, resolve, and observation callbacks; reference metadata now includes its
|
|
168
|
+
stream-safe assets. The unused `load` field is also removed from
|
|
169
|
+
`clientReference(...)` declarations.
|
|
170
|
+
|
|
171
|
+
`payloadDataLoader` keeps only `request`, `resolveClientReference`, and the
|
|
172
|
+
optional `prepareAssets` override. Payload encoding is fixed internally rather
|
|
173
|
+
than exposed as a speculative custom-codec interface.
|
|
174
|
+
|
|
175
|
+
### Make DOM View Transitions explicitly optional
|
|
176
|
+
|
|
177
|
+
`enableViewTransitions()` from `@bgub/fig-dom/view-transitions` explicitly
|
|
178
|
+
activates native DOM View Transitions, including after roots exist. Applications
|
|
179
|
+
that omit the optional entry exclude both the reconciler planner and browser
|
|
180
|
+
adapter from their bundles.
|
|
181
|
+
|
|
182
|
+
Renderer authors can install the optional View Transition planner through the
|
|
183
|
+
new single-owner commit-coordinator seam. Coordinator types preserve the host's
|
|
184
|
+
container and instance identities, while a private type-only contract keeps the
|
|
185
|
+
planner's fiber and root views aligned with the reconciler.
|
|
186
|
+
|
|
187
|
+
### Make Payload trees directly renderable
|
|
188
|
+
|
|
189
|
+
`createPayloadComponent` now creates a props-typed component backed by Fig's
|
|
190
|
+
ordinary data store. Complete props form its cache identity by default through
|
|
191
|
+
a canonical encoding of Payload-compatible values, and the component works
|
|
192
|
+
with route loaders and the existing data-resource freshness APIs and explicit
|
|
193
|
+
store handles.
|
|
194
|
+
|
|
195
|
+
The lower-level `payloadDataLoader` and `PayloadDataLoaderOptions` exports have
|
|
196
|
+
been removed. Use `createPayloadComponent`, or `decodePayloadStream` when
|
|
197
|
+
managing the transport and data integration directly.
|
|
198
|
+
|
|
199
|
+
TanStack Start replaces `payloadResource({ key, render })` with
|
|
200
|
+
`createPayloadComponent({ key, load: serverPayload(render) })`. Its compiler
|
|
201
|
+
can extract a component imported from `.server.tsx`, while initial companion
|
|
202
|
+
streams, client references, and compiled asset dependencies keep their existing
|
|
203
|
+
transport behavior.
|
|
204
|
+
|
|
205
|
+
Payload component loaders receive the resolved resource `key` alongside
|
|
206
|
+
`signal`, so framework transports can register responses under the exact cache
|
|
207
|
+
entry without changing ordinary data loaders.
|
|
208
|
+
|
|
209
|
+
Default keys are canonical across plain-object property order, and Payload
|
|
210
|
+
components use their namespace as their DevTools label. TanStack Start renders
|
|
211
|
+
the supplied component inside the Payload renderer so root-level reads and
|
|
212
|
+
suspension work, and rejects uncompiled `serverPayload` calls before invoking
|
|
213
|
+
application code.
|
|
214
|
+
|
|
215
|
+
Payload rendering also rejects nesting one Payload component inside another in
|
|
216
|
+
development. Payload components are client-visible delivery boundaries;
|
|
217
|
+
compose ordinary server components inside them or mount separate Payload
|
|
218
|
+
components from the client tree to preserve independent refresh keys.
|
|
219
|
+
|
|
220
|
+
### Generation-lifetime loader signals and `payloadDataLoader`
|
|
221
|
+
|
|
222
|
+
Data-resource loader signals now live as long as their load's generation,
|
|
223
|
+
not just the pending promise: the `{ signal }` a loader receives stays
|
|
224
|
+
unaborted after the value lands and aborts when the generation loses
|
|
225
|
+
authority — a newer load supersedes it, a server push hydrates over it, the
|
|
226
|
+
entry evicts, or the store is disposed. A rejected load's own signal aborts
|
|
227
|
+
on settlement, and `invalidateData` never aborts (marking stale does not
|
|
228
|
+
revoke authority). Loaders that stream into their value in the background —
|
|
229
|
+
payload decodes filling holes — tie that work to the signal; plain fetch
|
|
230
|
+
loaders are unaffected.
|
|
231
|
+
|
|
232
|
+
The load context also carries an internal, generation-guarded hydration
|
|
233
|
+
capability (symbol-keyed; read through `@bgub/fig/internal`) that hydrates
|
|
234
|
+
server-pushed `data` rows through the calling store only while the load is
|
|
235
|
+
authoritative, skipping rows that target the loading entry's own key.
|
|
236
|
+
|
|
237
|
+
New in `@bgub/fig-dom`: `payloadDataLoader({ request,
|
|
238
|
+
resolveClientReference?, prepareAssets? })` adapts a payload-stream
|
|
239
|
+
endpoint into an ordinary data-resource loader. It validates the response
|
|
240
|
+
(status, body, payload codec content-type; unusable bodies are cancelled),
|
|
241
|
+
wires `decodePayloadStream` to the generation-lifetime signal, hydrates
|
|
242
|
+
`data` rows through the store capability, inserts stream-discovered assets
|
|
243
|
+
with `insertAssetResources` (stylesheet gates delay only dependent reveal),
|
|
244
|
+
and resolves with the decoded root value — so `readData(postResource, slug)`
|
|
245
|
+
suspends like any read and returns renderable elements while streamed holes
|
|
246
|
+
keep filling in the background.
|
|
247
|
+
|
|
248
|
+
### Move `createPortalNode` to `@bgub/fig/internal`
|
|
249
|
+
|
|
250
|
+
`createPortalNode` is the cross-package seam renderers wrap in their
|
|
251
|
+
container-typed `createPortal`; apps never call it directly. It now lives
|
|
252
|
+
on the internal entry with the other renderer protocol exports instead of
|
|
253
|
+
the app-facing main entry. Portal-creating apps keep using
|
|
254
|
+
`createPortal(children, container, key?)` from `@bgub/fig-dom`; the
|
|
255
|
+
`FigPortal` type stays on the main entry because it appears in public
|
|
256
|
+
signatures.
|
|
257
|
+
|
|
258
|
+
### Promise-shaped payload decoder
|
|
259
|
+
|
|
260
|
+
`decodePayloadStream` now returns `Promise<FigNode>` directly — the root
|
|
261
|
+
value promise — instead of a `PayloadDecode` handle. Cancellation is
|
|
262
|
+
signal-only (`options.signal`, unchanged); the redundant `abort()` method is
|
|
263
|
+
gone. The `completion` promise is replaced by an `onStreamDone(result)`
|
|
264
|
+
decode option, called exactly once when ingestion settles as `complete`,
|
|
265
|
+
`failed`, or `aborted` — post-root failures that strand no pending hole
|
|
266
|
+
remain observable there. The callback is never awaited and its exceptions
|
|
267
|
+
and rejections are swallowed, so an observer — sync or async — cannot break
|
|
268
|
+
decode teardown or leak an unhandled rejection. The
|
|
269
|
+
`PayloadDecode` interface and its non-thenable caveat are deleted;
|
|
270
|
+
`PayloadDecodeCompletion` remains as the callback's result type.
|
|
271
|
+
|
|
272
|
+
`@bgub/fig-dom`'s `payloadDataLoader` migrates internally; its public API is
|
|
273
|
+
unchanged.
|
|
274
|
+
|
|
275
|
+
Also considered and declined: narrowing `ResolveClientReference` to an
|
|
276
|
+
opaque id. The reference's `exportName`/`ssr`/`assets` mirror the `client`
|
|
277
|
+
row's wire fields and are all load-bearing in framework document pipelines;
|
|
278
|
+
the rationale is recorded in `docs/concepts/payload.md`.
|
|
279
|
+
|
|
280
|
+
### Promise-valued children render through Suspense
|
|
281
|
+
|
|
282
|
+
`FigNode` now accepts promises of nodes. Promise children occupy distinct,
|
|
283
|
+
host-transparent child slots, suspend through the nearest `Suspense`, and route
|
|
284
|
+
rejections or invalid resolved children through normal error handling.
|
|
285
|
+
|
|
286
|
+
HTML rendering retains exact promise children as independent streaming tasks,
|
|
287
|
+
while Payload uses node-validated promise rows that decode to the same child
|
|
288
|
+
shape. Payload-rendered async components are invoked once and retain their
|
|
289
|
+
component-scoped assets on the outlined row.
|
|
290
|
+
|
|
291
|
+
### Tighten public component, loader, asset, and bind signatures
|
|
292
|
+
|
|
293
|
+
`@bgub/fig` now names the shared data loader contract as
|
|
294
|
+
`DataResourceLoader`, constrains lazy loaders to components, and exposes
|
|
295
|
+
`ComponentProps` so lazy wrappers preserve the loaded component's props
|
|
296
|
+
without exposing its implementation statics. Client-reference SSR
|
|
297
|
+
implementations stay aligned with the reference's props. Stable-event typing
|
|
298
|
+
now models the trailing lifecycle signal separately from caller arguments.
|
|
299
|
+
|
|
300
|
+
`meta()` descriptors now require exactly one valid metadata identity:
|
|
301
|
+
`charset`, `name` plus `content`, `property` plus `content`, or `http-equiv`
|
|
302
|
+
plus `content`. Raw meta elements that do not satisfy the same shape remain
|
|
303
|
+
ordinary host elements instead of entering the asset registry.
|
|
304
|
+
|
|
305
|
+
`@bgub/fig-dom` payload requests now receive the standard
|
|
306
|
+
`DataResourceLoadContext`, portals retain their DOM container type in the
|
|
307
|
+
returned `FigPortal`, and bind callbacks must return `undefined`; cleanup is
|
|
308
|
+
exclusively driven by their `AbortSignal`.
|
|
309
|
+
|
|
310
|
+
### Move `act` to `@bgub/fig-reconciler/test-utils`
|
|
311
|
+
|
|
312
|
+
`act` is testing infrastructure, not renderer construction, so it moves
|
|
313
|
+
off the main entry onto a `./test-utils` subpath — the same shape as
|
|
314
|
+
`@bgub/fig-dom/test-utils`. DOM tests keep importing `act` from
|
|
315
|
+
`@bgub/fig-dom/test-utils`; renderer tests now import it from
|
|
316
|
+
`@bgub/fig-reconciler/test-utils`. Behavior is unchanged; the subpath
|
|
317
|
+
shares the scheduler instance with the main entry.
|
|
318
|
+
|
|
319
|
+
### Attribute rejected payload holes to their data resource
|
|
320
|
+
|
|
321
|
+
Payload hole errors are attributed to the authoritative owning data-resource
|
|
322
|
+
generation. Error boundaries receive `dataResourceKeys`, and
|
|
323
|
+
`invalidateDataError` retires the broken fulfilled value before retrying so a
|
|
324
|
+
remounted boundary suspends on fresh content instead of immediately catching
|
|
325
|
+
the same rejected hole. `decodePayloadStream` also exposes an observational
|
|
326
|
+
`onHoleError` callback.
|
|
327
|
+
|
|
328
|
+
The load context's hydration capability now shares the same authority window:
|
|
329
|
+
a still-visible generation's `data` rows keep hydrating through a superseding
|
|
330
|
+
refresh's window instead of being dropped the moment the refresh starts.
|
|
331
|
+
|
|
332
|
+
### Fix first-load styling and development client navigation
|
|
333
|
+
|
|
334
|
+
Keep TanStack Start's compiler-sensitive client modules out of Vite dependency
|
|
335
|
+
prebundling so client navigation uses the client server-function transport
|
|
336
|
+
instead of executing server-only context access in the browser. Preserve
|
|
337
|
+
browser-extension roots appended to document singletons during hydration so a
|
|
338
|
+
third-party node cannot trigger document replacement and remove stylesheets.
|
|
339
|
+
|
|
340
|
+
### Preserve framework-managed asset placement
|
|
341
|
+
|
|
342
|
+
Framework adapters can now keep externally managed head and body tags in their
|
|
343
|
+
declared positions without exposing a DOM prop. TanStack Router uses this for
|
|
344
|
+
route-managed links, styles, and scripts while continuing to map title and meta
|
|
345
|
+
entries through Fig asset resources. Full-document hydration now ignores the
|
|
346
|
+
doctype and one shared marker identifies every server-owned node without a
|
|
347
|
+
client fiber. Declarative asset lists also gain a client commit lifecycle, so
|
|
348
|
+
route titles and metadata update during navigation.
|
|
349
|
+
|
|
350
|
+
### Add Payload routes to the TanStack Start adapter
|
|
351
|
+
|
|
352
|
+
`@bgub/fig-tanstack-start/payload` now exposes `payloadResource`, which compiles
|
|
353
|
+
an inline render callback into a private server function and Fig-owned route
|
|
354
|
+
data resource. Applications supply the cache key and component tree without
|
|
355
|
+
authoring transport plumbing. The shared declaration can stay in one
|
|
356
|
+
`.payload.tsx` module; its render callback and render-only imports are omitted
|
|
357
|
+
from the browser build. The initial SSR response is embedded into the document
|
|
358
|
+
and adopted without refetching; client navigation and refresh use the same
|
|
359
|
+
resource request path. Payload data rows
|
|
360
|
+
hydrate the shared store, asset resources are retained on their owning server
|
|
361
|
+
segments or inserted through the browser registry, and client references retain
|
|
362
|
+
their resolver-defined identity. `decodePayloadStream` and `payloadDataLoader`
|
|
363
|
+
now expose `retainAssets` for server document renderers that need this delivery
|
|
364
|
+
path.
|
|
365
|
+
|
|
366
|
+
`@bgub/fig-tanstack-start/server` exposes the lower-level
|
|
367
|
+
`renderPayloadResponse` used by the generated TanStack server function; it
|
|
368
|
+
defaults its render abort signal to the incoming request, so a disconnected
|
|
369
|
+
client cancels the Payload render. Shell
|
|
370
|
+
HTML streams while outlined Suspense holes settle, and the completed initial
|
|
371
|
+
responses are embedded before TanStack starts full-document hydration. The Vite
|
|
372
|
+
adapter also publishes assets imported only by server modules into the client
|
|
373
|
+
build output. Fig Router links also consume TanStack's `viewTransition`
|
|
374
|
+
navigation option without forwarding it as an invalid attribute to the rendered
|
|
375
|
+
anchor, and derive active state from the resolved route instead of an in-flight
|
|
376
|
+
location.
|
|
377
|
+
|
|
378
|
+
### Add the TanStack Start runtime adapter
|
|
379
|
+
|
|
380
|
+
`createDataStore` now creates a root-neutral Fig store that route loaders can
|
|
381
|
+
populate before a renderer exists. Server and client renderers adopt that exact
|
|
382
|
+
store, preserving one cache while attaching their lifecycle and scheduling.
|
|
383
|
+
|
|
384
|
+
The new TanStack Start runtime uses the store for route loading, server
|
|
385
|
+
rendering, Fig-owned document serialization, client deserialization, and
|
|
386
|
+
hydration. Route-managed head and script output maps through the Router adapter,
|
|
387
|
+
including Fig asset resources. The end-to-end contract verifies no initial
|
|
388
|
+
client refetch and exactly one reload after invalidation.
|
|
389
|
+
|
|
390
|
+
### Share the text-separator protocol constant; small DOM cleanups
|
|
391
|
+
|
|
392
|
+
The `<!--,-->` text-separator comment the server writes between adjacent text
|
|
393
|
+
fibers was hardcoded independently by the server renderer and fig-dom's
|
|
394
|
+
hydration cursor. The comment data now lives in `@bgub/fig/internal` as
|
|
395
|
+
`TEXT_SEPARATOR_DATA`, next to the other streaming protocol constants, so the
|
|
396
|
+
two sides cannot drift. No wire change — the emitted markup is identical.
|
|
397
|
+
|
|
398
|
+
fig-dom also drops an unused internal `rootFor` helper, routes style clearing
|
|
399
|
+
through the shared `isEmptyPropValue` predicate, and simplifies a redundant
|
|
400
|
+
branch in select-value syncing. No behavior change.
|
|
401
|
+
|
|
402
|
+
### Add typed View Transition scopes and abortable lifecycle events
|
|
403
|
+
|
|
404
|
+
`transition` and the `useTransition` starter now accept explicit transition
|
|
405
|
+
types, which Fig carries with the updates that reach each root and forwards to
|
|
406
|
+
the browser without leaking into unrelated commits.
|
|
407
|
+
|
|
408
|
+
`ViewTransition` adds one `onTransition(event, signal)` lifecycle callback for
|
|
409
|
+
enter, exit, share, and update phases. Events expose all participating surfaces
|
|
410
|
+
and the commit's transition types. Fig DOM's optional View Transition entry can
|
|
411
|
+
resolve those opaque surfaces into group, image-pair, old, and new pseudo
|
|
412
|
+
handles for animation and inspection; the signal aborts when the native
|
|
413
|
+
transition finishes.
|
|
414
|
+
|
|
415
|
+
### Bound stalled view-transition waits
|
|
416
|
+
|
|
417
|
+
Transition-eligible commits and annotated streaming reveals now wait at most 60
|
|
418
|
+
seconds for a previous browser View Transition. If its completion promise never
|
|
419
|
+
settles, Fig releases the document mutex and proceeds with the latest work
|
|
420
|
+
instead of parking it forever.
|
|
421
|
+
|
|
422
|
+
## @bgub/fig-dom@0.1.0-alpha.0 (alpha)
|
|
423
|
+
|
|
424
|
+
### Initial alpha release
|
|
425
|
+
|
|
426
|
+
First public alpha release of Fig.
|
|
427
|
+
|
|
1
428
|
# Changelog
|
package/README.md
CHANGED
|
@@ -23,6 +23,18 @@ bindings/events, and reports recoverable mismatches through
|
|
|
23
23
|
`useSyncExternalStore` use their server snapshot during hydration, then subscribe
|
|
24
24
|
and reconcile to the current client snapshot after commit.
|
|
25
25
|
|
|
26
|
+
For full-document rendering, pass the `Document` itself as the container. A
|
|
27
|
+
root-neutral data store can be populated before hydration and adopted without
|
|
28
|
+
copying its entries:
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { createDataStore } from "@bgub/fig";
|
|
32
|
+
import { hydrateRoot } from "@bgub/fig-dom";
|
|
33
|
+
|
|
34
|
+
const dataStore = createDataStore({ initialData });
|
|
35
|
+
hydrateRoot(document, <App />, { dataStore });
|
|
36
|
+
```
|
|
37
|
+
|
|
26
38
|
Suspense hydration is boundary-based: server Suspense markers stay
|
|
27
39
|
dehydrated after the shell hydrates, then hydrate in background work or
|
|
28
40
|
synchronously when an interaction lands inside that boundary. Pending
|
package/dist/act.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { act } from "@bgub/fig-reconciler";
|
|
1
|
+
import { act } from "@bgub/fig-reconciler/test-utils";
|
|
2
2
|
export { act };
|
package/dist/act.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{act as e}from"@bgub/fig-reconciler";export{e as act};
|
|
1
|
+
import{act as e}from"@bgub/fig-reconciler/test-utils";export{e as act};
|