@nifrajs/web 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +5 -1
- package/dist/build.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +24 -3
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -6
- package/dist/index.js.map +1 -1
- package/dist/navigation.d.ts +31 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +27 -0
- package/dist/navigation.js.map +1 -0
- package/dist/query.d.ts +108 -6
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +309 -34
- package/dist/query.js.map +1 -1
- package/package.json +2 -2
- package/src/build.ts +6 -1
- package/src/client.ts +24 -3
- package/src/index.ts +70 -5
- package/src/navigation.ts +42 -0
- package/src/query.ts +477 -37
package/dist/query.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The agnostic keyed query-cache — a `query(key, fn)` primitive with in-flight dedup, `staleTime`
|
|
3
|
-
* freshness, prefix `invalidateQueries`,
|
|
3
|
+
* freshness, prefix `invalidateQueries`, imperative cache read/write, prefetch, SSR dehydrate/hydrate,
|
|
4
|
+
* infinite (paged) queries, and standalone mutations. Pure logic, no `window`, no framework, no
|
|
4
5
|
* `Date.now`/timers (the clock is injected) — so it unit-tests deterministically and is safe to import
|
|
5
|
-
* from the SSR core's main entry. A per-adapter binding (`useQuery`/`createQuery`)
|
|
6
|
-
* query's `subscribe`/`snapshot` store (the same shape the router + fetchers
|
|
6
|
+
* from the SSR core's main entry. A per-adapter binding (`useQuery`/`useMutation`/`createQuery`)
|
|
7
|
+
* subscribes to a query/mutation's `subscribe`/`snapshot` store (the same shape the router + fetchers
|
|
8
|
+
* use).
|
|
7
9
|
*
|
|
8
10
|
* This is a SECOND keyed cache, distinct from the router's path-keyed route cache (F16): route loaders
|
|
9
11
|
* + navigation use the path cache; component-level interactive data (search, infinite scroll, polling)
|
|
@@ -41,9 +43,13 @@ const PENDING = Object.freeze({
|
|
|
41
43
|
isFetching: false,
|
|
42
44
|
updatedAt: Number.NEGATIVE_INFINITY,
|
|
43
45
|
});
|
|
46
|
+
/** Build a success state for freshly-set data (imperative writes + hydration). */
|
|
47
|
+
function successState(data, updatedAt) {
|
|
48
|
+
return { status: "success", data, error: undefined, isFetching: false, updatedAt };
|
|
49
|
+
}
|
|
44
50
|
export function createQueryClient(options) {
|
|
45
51
|
const { now } = options;
|
|
46
|
-
const
|
|
52
|
+
const defaultStaleTime = options.staleTime ?? 0;
|
|
47
53
|
const gcTime = options.gcTime ?? 5 * 60_000;
|
|
48
54
|
const max = options.max ?? 1000;
|
|
49
55
|
const cache = new Map();
|
|
@@ -64,17 +70,14 @@ export function createQueryClient(options) {
|
|
|
64
70
|
cache.delete(h); // oldest-inserted unsubscribed first (Map order)
|
|
65
71
|
}
|
|
66
72
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (existing !== undefined) {
|
|
72
|
-
existing.fn = fn; // re-bind the latest closure
|
|
73
|
-
return existing.handle;
|
|
74
|
-
}
|
|
73
|
+
// Build a cache entry + its handle. `fn`/`staleTime` are mutated in place on re-bind (closures change
|
|
74
|
+
// between renders). All the fetch/dedup/generation machinery lives here so query(), prefetchQuery(),
|
|
75
|
+
// setQueryData(), and invalidateQueries() share exactly one implementation.
|
|
76
|
+
const makeEntry = (key, fn, staleTime) => {
|
|
75
77
|
const entry = {
|
|
76
78
|
key,
|
|
77
|
-
fn
|
|
79
|
+
fn,
|
|
80
|
+
staleTime,
|
|
78
81
|
state: PENDING,
|
|
79
82
|
promise: undefined,
|
|
80
83
|
promiseGen: 0,
|
|
@@ -83,25 +86,25 @@ export function createQueryClient(options) {
|
|
|
83
86
|
subscribers: 0,
|
|
84
87
|
gcAt: undefined,
|
|
85
88
|
listeners: new Set(),
|
|
86
|
-
|
|
89
|
+
setState: undefined,
|
|
90
|
+
run: undefined,
|
|
87
91
|
handle: undefined,
|
|
88
92
|
};
|
|
89
93
|
const emit = () => {
|
|
90
|
-
// Iterate the live set — no per-emit copy (the common case is 0–1 subscribers
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
// store bindings don't (un/subscribe happens in a later effect/cleanup tick).
|
|
94
|
+
// Iterate the live set — no per-emit copy (the common case is 0–1 subscribers). Contract: a
|
|
95
|
+
// listener must not synchronously subscribe/unsubscribe during notification — `useSyncExternalStore`/
|
|
96
|
+
// signal/store bindings don't (un/subscribe happens in a later effect/cleanup tick).
|
|
94
97
|
if (entry.listeners.size === 0)
|
|
95
98
|
return;
|
|
96
99
|
for (const l of entry.listeners)
|
|
97
100
|
l();
|
|
98
101
|
};
|
|
99
|
-
|
|
102
|
+
entry.setState = (next) => {
|
|
100
103
|
entry.state = Object.freeze(next);
|
|
101
104
|
emit();
|
|
102
105
|
};
|
|
103
|
-
const isStale = () => entry.invalidated || now() - entry.state.updatedAt >= staleTime;
|
|
104
|
-
|
|
106
|
+
const isStale = () => entry.invalidated || now() - entry.state.updatedAt >= entry.staleTime;
|
|
107
|
+
entry.run = (force) => {
|
|
105
108
|
// Dedup — but join the in-flight fetch ONLY when it belongs to the current generation. An
|
|
106
109
|
// `invalidateQueries` bumps `generation`, so a fetch that started *before* the invalidation is
|
|
107
110
|
// superseded and must NOT satisfy this call (its data is pre-mutation); fall through and kick a
|
|
@@ -111,7 +114,7 @@ export function createQueryClient(options) {
|
|
|
111
114
|
if (!force && entry.state.status === "success" && !isStale())
|
|
112
115
|
return Promise.resolve(entry.state.data); // fresh cache hit — no fn call
|
|
113
116
|
const gen = entry.generation;
|
|
114
|
-
setState({ ...entry.state, isFetching: true }); // show the background/initial fetch
|
|
117
|
+
entry.setState({ ...entry.state, isFetching: true }); // show the background/initial fetch
|
|
115
118
|
const promise = (async () => {
|
|
116
119
|
try {
|
|
117
120
|
const data = await entry.fn();
|
|
@@ -121,18 +124,12 @@ export function createQueryClient(options) {
|
|
|
121
124
|
if (gen !== entry.generation)
|
|
122
125
|
return data;
|
|
123
126
|
entry.invalidated = false;
|
|
124
|
-
setState(
|
|
125
|
-
status: "success",
|
|
126
|
-
data,
|
|
127
|
-
error: undefined,
|
|
128
|
-
isFetching: false,
|
|
129
|
-
updatedAt: now(),
|
|
130
|
-
});
|
|
127
|
+
entry.setState(successState(data, now()));
|
|
131
128
|
return data;
|
|
132
129
|
}
|
|
133
130
|
catch (error) {
|
|
134
131
|
if (gen === entry.generation)
|
|
135
|
-
setState({ ...entry.state, status: "error", error, isFetching: false });
|
|
132
|
+
entry.setState({ ...entry.state, status: "error", error, isFetching: false });
|
|
136
133
|
throw error;
|
|
137
134
|
}
|
|
138
135
|
finally {
|
|
@@ -160,11 +157,28 @@ export function createQueryClient(options) {
|
|
|
160
157
|
entry.gcAt = now() + gcTime;
|
|
161
158
|
};
|
|
162
159
|
},
|
|
163
|
-
fetch: () => run(false),
|
|
164
|
-
refetch: () => run(true),
|
|
160
|
+
fetch: () => entry.run(false),
|
|
161
|
+
refetch: () => entry.run(true),
|
|
165
162
|
};
|
|
163
|
+
return entry;
|
|
164
|
+
};
|
|
165
|
+
// Get an entry by key, or create + insert a fresh one. `fn`/`staleTime` re-bind on an existing entry.
|
|
166
|
+
const upsert = (key, fn, staleTime) => {
|
|
167
|
+
const h = hashQueryKey(key);
|
|
168
|
+
const existing = cache.get(h);
|
|
169
|
+
if (existing !== undefined) {
|
|
170
|
+
existing.fn = fn;
|
|
171
|
+
existing.staleTime = staleTime;
|
|
172
|
+
return existing;
|
|
173
|
+
}
|
|
174
|
+
const entry = makeEntry(key, fn, staleTime);
|
|
166
175
|
cache.set(h, entry);
|
|
167
|
-
return entry
|
|
176
|
+
return entry;
|
|
177
|
+
};
|
|
178
|
+
const query = (key, fn, opts) => {
|
|
179
|
+
sweep();
|
|
180
|
+
return upsert(key, fn, opts?.staleTime ?? defaultStaleTime)
|
|
181
|
+
.handle;
|
|
168
182
|
};
|
|
169
183
|
const invalidateQueries = (keyOrPrefix) => {
|
|
170
184
|
for (const entry of cache.values()) {
|
|
@@ -179,6 +193,267 @@ export function createQueryClient(options) {
|
|
|
179
193
|
void entry.handle.refetch().catch(() => { }); // refresh mounted now (best-effort)
|
|
180
194
|
}
|
|
181
195
|
};
|
|
182
|
-
|
|
196
|
+
const getQueryData = (key) => {
|
|
197
|
+
const entry = cache.get(hashQueryKey(key));
|
|
198
|
+
return entry !== undefined && entry.state.status === "success"
|
|
199
|
+
? entry.state.data
|
|
200
|
+
: undefined;
|
|
201
|
+
};
|
|
202
|
+
const setQueryData = (key, updater) => {
|
|
203
|
+
// Create a placeholder entry if none exists — its `fn` throws until a real `query(key, fn)` re-binds
|
|
204
|
+
// it, so a `setQueryData` for a key nobody queries yet never triggers a fetch on its own.
|
|
205
|
+
const entry = upsert(key, cache.get(hashQueryKey(key))?.fn ??
|
|
206
|
+
(() => Promise.reject(new Error("[nifra/web] query has no fetcher (setQueryData-only key)"))), defaultStaleTime);
|
|
207
|
+
const prev = entry.state.status === "success" ? entry.state.data : undefined;
|
|
208
|
+
const data = typeof updater === "function" ? updater(prev) : updater;
|
|
209
|
+
// A direct write is the new truth — bump the generation so any in-flight fetch can't overwrite it,
|
|
210
|
+
// and clear the invalidated flag (the caller just supplied fresh data).
|
|
211
|
+
entry.generation++;
|
|
212
|
+
entry.invalidated = false;
|
|
213
|
+
entry.setState(successState(data, now()));
|
|
214
|
+
};
|
|
215
|
+
const prefetchQuery = async (key, fn, opts) => {
|
|
216
|
+
sweep();
|
|
217
|
+
await upsert(key, fn, opts?.staleTime ?? defaultStaleTime).run(false);
|
|
218
|
+
};
|
|
219
|
+
const dehydrate = () => {
|
|
220
|
+
const queries = [];
|
|
221
|
+
for (const entry of cache.values()) {
|
|
222
|
+
if (entry.state.status === "success")
|
|
223
|
+
queries.push({ key: entry.key, data: entry.state.data, updatedAt: entry.state.updatedAt });
|
|
224
|
+
}
|
|
225
|
+
return { queries };
|
|
226
|
+
};
|
|
227
|
+
const hydrate = (state) => {
|
|
228
|
+
for (const q of state.queries) {
|
|
229
|
+
const entry = upsert(q.key, cache.get(hashQueryKey(q.key))?.fn ??
|
|
230
|
+
(() => Promise.reject(new Error("[nifra/web] hydrated query has no fetcher yet"))), defaultStaleTime);
|
|
231
|
+
// Don't clobber a client entry that's already fresher than the server snapshot (the client may
|
|
232
|
+
// have refetched between SSR and hydration). Seed only when we have no successful data or the
|
|
233
|
+
// incoming snapshot is newer.
|
|
234
|
+
if (entry.state.status !== "success" || q.updatedAt > entry.state.updatedAt)
|
|
235
|
+
entry.setState(successState(q.data, q.updatedAt));
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
// --- Infinite (paged) queries -----------------------------------------------------------------
|
|
239
|
+
const infiniteQuery = (key, fn, opts) => {
|
|
240
|
+
sweep();
|
|
241
|
+
const h = hashQueryKey(key);
|
|
242
|
+
const existing = infinite.get(h);
|
|
243
|
+
if (existing !== undefined) {
|
|
244
|
+
existing.rebind(fn, opts);
|
|
245
|
+
return existing.handle;
|
|
246
|
+
}
|
|
247
|
+
const created = makeInfinite(fn, opts);
|
|
248
|
+
infinite.set(h, created);
|
|
249
|
+
return created.handle;
|
|
250
|
+
};
|
|
251
|
+
const infinite = new Map();
|
|
252
|
+
const makeInfinite = (fetchPage, initialOpts) => {
|
|
253
|
+
let fn = fetchPage;
|
|
254
|
+
let opts = initialOpts;
|
|
255
|
+
let state = PENDING;
|
|
256
|
+
let generation = 0;
|
|
257
|
+
let promise;
|
|
258
|
+
let subscribers = 0;
|
|
259
|
+
const listeners = new Set();
|
|
260
|
+
const emit = () => {
|
|
261
|
+
for (const l of listeners)
|
|
262
|
+
l();
|
|
263
|
+
};
|
|
264
|
+
const setState = (next) => {
|
|
265
|
+
state = Object.freeze(next);
|
|
266
|
+
emit();
|
|
267
|
+
};
|
|
268
|
+
const nextParam = (data) => {
|
|
269
|
+
const last = data.pages[data.pages.length - 1];
|
|
270
|
+
if (last === undefined)
|
|
271
|
+
return undefined;
|
|
272
|
+
return opts.getNextPageParam(last, data.pages, data.pageParams[data.pageParams.length - 1], data.pageParams);
|
|
273
|
+
};
|
|
274
|
+
const prevParam = (data) => {
|
|
275
|
+
if (opts.getPreviousPageParam === undefined || data.pages.length === 0)
|
|
276
|
+
return undefined;
|
|
277
|
+
return opts.getPreviousPageParam(data.pages[0], data.pages, data.pageParams[0], data.pageParams);
|
|
278
|
+
};
|
|
279
|
+
const isStale = () => now() - state.updatedAt >= (opts.staleTime ?? defaultStaleTime);
|
|
280
|
+
// Run a paged operation under a fresh generation, guarding against a superseding op (like `run`).
|
|
281
|
+
const runPaged = (build) => {
|
|
282
|
+
if (promise !== undefined)
|
|
283
|
+
return promise;
|
|
284
|
+
const gen = ++generation;
|
|
285
|
+
setState({ ...state, isFetching: true });
|
|
286
|
+
const p = (async () => {
|
|
287
|
+
try {
|
|
288
|
+
const data = await build();
|
|
289
|
+
if (gen !== generation)
|
|
290
|
+
return data;
|
|
291
|
+
setState(successState(data, now()));
|
|
292
|
+
return data;
|
|
293
|
+
}
|
|
294
|
+
catch (error) {
|
|
295
|
+
if (gen === generation)
|
|
296
|
+
setState({ ...state, status: "error", error, isFetching: false });
|
|
297
|
+
throw error;
|
|
298
|
+
}
|
|
299
|
+
finally {
|
|
300
|
+
if (gen === generation)
|
|
301
|
+
promise = undefined;
|
|
302
|
+
}
|
|
303
|
+
})();
|
|
304
|
+
promise = p;
|
|
305
|
+
return p;
|
|
306
|
+
};
|
|
307
|
+
const fetchFirst = (force) => {
|
|
308
|
+
if (!force && state.status === "success" && !isStale() && state.data !== undefined)
|
|
309
|
+
return Promise.resolve(state.data);
|
|
310
|
+
return runPaged(async () => {
|
|
311
|
+
const page = await fn(opts.initialPageParam);
|
|
312
|
+
return { pages: [page], pageParams: [opts.initialPageParam] };
|
|
313
|
+
});
|
|
314
|
+
};
|
|
315
|
+
const handle = {
|
|
316
|
+
snapshot: () => state,
|
|
317
|
+
subscribe: (listener) => {
|
|
318
|
+
subscribers++;
|
|
319
|
+
listeners.add(listener);
|
|
320
|
+
return () => {
|
|
321
|
+
listeners.delete(listener);
|
|
322
|
+
subscribers--;
|
|
323
|
+
};
|
|
324
|
+
},
|
|
325
|
+
fetch: () => fetchFirst(false),
|
|
326
|
+
refetch: () => runPaged(async () => {
|
|
327
|
+
const current = state.data;
|
|
328
|
+
if (current === undefined || current.pages.length === 0) {
|
|
329
|
+
const page = await fn(opts.initialPageParam);
|
|
330
|
+
return { pages: [page], pageParams: [opts.initialPageParam] };
|
|
331
|
+
}
|
|
332
|
+
// Refetch every loaded page in order with its original param, so the list stays the same size.
|
|
333
|
+
const pages = [];
|
|
334
|
+
for (const param of current.pageParams)
|
|
335
|
+
pages.push(await fn(param));
|
|
336
|
+
return { pages, pageParams: [...current.pageParams] };
|
|
337
|
+
}),
|
|
338
|
+
fetchNextPage: () => {
|
|
339
|
+
const current = state.data;
|
|
340
|
+
if (current === undefined)
|
|
341
|
+
return fetchFirst(false);
|
|
342
|
+
const param = nextParam(current);
|
|
343
|
+
if (param === undefined || param === null)
|
|
344
|
+
return Promise.resolve(current);
|
|
345
|
+
return runPaged(async () => {
|
|
346
|
+
const page = await fn(param);
|
|
347
|
+
return { pages: [...current.pages, page], pageParams: [...current.pageParams, param] };
|
|
348
|
+
});
|
|
349
|
+
},
|
|
350
|
+
fetchPreviousPage: () => {
|
|
351
|
+
const current = state.data;
|
|
352
|
+
if (current === undefined)
|
|
353
|
+
return fetchFirst(false);
|
|
354
|
+
const param = prevParam(current);
|
|
355
|
+
if (param === undefined || param === null)
|
|
356
|
+
return Promise.resolve(current);
|
|
357
|
+
return runPaged(async () => {
|
|
358
|
+
const page = await fn(param);
|
|
359
|
+
return { pages: [page, ...current.pages], pageParams: [param, ...current.pageParams] };
|
|
360
|
+
});
|
|
361
|
+
},
|
|
362
|
+
hasNextPage: () => {
|
|
363
|
+
const p = state.data === undefined ? undefined : nextParam(state.data);
|
|
364
|
+
return p !== undefined && p !== null;
|
|
365
|
+
},
|
|
366
|
+
hasPreviousPage: () => {
|
|
367
|
+
const p = state.data === undefined ? undefined : prevParam(state.data);
|
|
368
|
+
return p !== undefined && p !== null;
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
return {
|
|
372
|
+
handle: handle,
|
|
373
|
+
rebind: (nextFn, nextOpts) => {
|
|
374
|
+
fn = nextFn;
|
|
375
|
+
opts = nextOpts;
|
|
376
|
+
},
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
return {
|
|
380
|
+
query,
|
|
381
|
+
infiniteQuery,
|
|
382
|
+
invalidateQueries,
|
|
383
|
+
getQueryData,
|
|
384
|
+
setQueryData,
|
|
385
|
+
prefetchQuery,
|
|
386
|
+
dehydrate,
|
|
387
|
+
hydrate,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
const IDLE_MUTATION = Object.freeze({
|
|
391
|
+
status: "idle",
|
|
392
|
+
data: undefined,
|
|
393
|
+
error: undefined,
|
|
394
|
+
variables: undefined,
|
|
395
|
+
});
|
|
396
|
+
/**
|
|
397
|
+
* Create a standalone mutation state machine — framework-agnostic, so a per-adapter `useMutation`
|
|
398
|
+
* binding just subscribes to it. Single-flight by a monotonic token: overlapping `mutate` calls each
|
|
399
|
+
* run their `fn`, but only the latest publishes state (an older, slower response can't clobber a newer
|
|
400
|
+
* one). The callbacks fire in TanStack order: `onMutate` (before), then `onSuccess`/`onError`, then
|
|
401
|
+
* `onSettled`.
|
|
402
|
+
*/
|
|
403
|
+
export function createMutation(fn, callbacks = {}) {
|
|
404
|
+
let mutationFn = fn;
|
|
405
|
+
let cbs = callbacks;
|
|
406
|
+
let state = IDLE_MUTATION;
|
|
407
|
+
let token = 0;
|
|
408
|
+
const listeners = new Set();
|
|
409
|
+
const emit = () => {
|
|
410
|
+
for (const l of listeners)
|
|
411
|
+
l();
|
|
412
|
+
};
|
|
413
|
+
const setState = (next) => {
|
|
414
|
+
state = Object.freeze(next);
|
|
415
|
+
emit();
|
|
416
|
+
};
|
|
417
|
+
return {
|
|
418
|
+
snapshot: () => state,
|
|
419
|
+
subscribe: (listener) => {
|
|
420
|
+
listeners.add(listener);
|
|
421
|
+
return () => {
|
|
422
|
+
listeners.delete(listener);
|
|
423
|
+
};
|
|
424
|
+
},
|
|
425
|
+
rebind: (nextFn, nextCallbacks) => {
|
|
426
|
+
mutationFn = nextFn;
|
|
427
|
+
cbs = nextCallbacks;
|
|
428
|
+
},
|
|
429
|
+
reset: () => setState(IDLE_MUTATION),
|
|
430
|
+
mutate: async (variables) => {
|
|
431
|
+
const mine = ++token;
|
|
432
|
+
setState({ status: "pending", data: undefined, error: undefined, variables });
|
|
433
|
+
// Only await a callback when one is actually supplied — an `await undefined` would insert a
|
|
434
|
+
// needless microtask before the mutationFn runs (and complicates single-flight timing).
|
|
435
|
+
if (cbs.onMutate !== undefined)
|
|
436
|
+
await cbs.onMutate(variables);
|
|
437
|
+
try {
|
|
438
|
+
const data = await mutationFn(variables);
|
|
439
|
+
if (mine === token)
|
|
440
|
+
setState({ status: "success", data, error: undefined, variables });
|
|
441
|
+
if (cbs.onSuccess !== undefined)
|
|
442
|
+
await cbs.onSuccess(data, variables);
|
|
443
|
+
if (cbs.onSettled !== undefined)
|
|
444
|
+
await cbs.onSettled(data, undefined, variables);
|
|
445
|
+
return data;
|
|
446
|
+
}
|
|
447
|
+
catch (error) {
|
|
448
|
+
if (mine === token)
|
|
449
|
+
setState({ status: "error", data: undefined, error, variables });
|
|
450
|
+
if (cbs.onError !== undefined)
|
|
451
|
+
await cbs.onError(error, variables);
|
|
452
|
+
if (cbs.onSettled !== undefined)
|
|
453
|
+
await cbs.onSettled(undefined, error, variables);
|
|
454
|
+
throw error;
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
};
|
|
183
458
|
}
|
|
184
459
|
//# sourceMappingURL=query.js.map
|
package/dist/query.js.map
CHANGED
|
@@ -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AAQ,KAAK,SAAS;gBAAE,MAAM,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;YAC7D,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,CAAA;gBACxC,IAAI,IAAI,KAAK,KAAK;oBAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAA;gBACtF,IAAI,GAAG,CAAC,SAAS,KAAK,SAAS;oBAAE,MAAM,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;gBACrE,IAAI,GAAG,CAAC,SAAS,KAAK,SAAS;oBAAE,MAAM,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;gBAChF,OAAO,IAAI,CAAA;YACb,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,IAAI,KAAK,KAAK;oBAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;gBACpF,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS;oBAAE,MAAM,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;gBAClE,IAAI,GAAG,CAAC,SAAS,KAAK,SAAS;oBAAE,MAAM,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAA;gBACjF,MAAM,KAAK,CAAA;YACb,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nifrajs/web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Framework-agnostic SSR core for nifra — the render seam + HTML document orchestration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"access": "public"
|
|
113
113
|
},
|
|
114
114
|
"dependencies": {
|
|
115
|
-
"@nifrajs/core": "1.
|
|
115
|
+
"@nifrajs/core": "1.9.0"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
118
|
"sass": "^1.0.0",
|
package/src/build.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* are Bun-specific and never on the request path (own subpath, like `@nifrajs/web/fs`); the *output*
|
|
6
6
|
* runs on any runtime.
|
|
7
7
|
*/
|
|
8
|
-
import { mkdirSync, writeFileSync } from "node:fs"
|
|
8
|
+
import { mkdirSync, rmSync, writeFileSync } from "node:fs"
|
|
9
9
|
import { dirname, relative, resolve as resolvePath } from "node:path"
|
|
10
10
|
import type { BunPlugin } from "bun"
|
|
11
11
|
import { sanitizeOutputNames } from "./chunk-names.ts"
|
|
@@ -705,6 +705,11 @@ export async function buildClient(options: BuildClientOptions): Promise<BuildMan
|
|
|
705
705
|
)
|
|
706
706
|
}
|
|
707
707
|
|
|
708
|
+
// The generated client-entry SOURCE (`_nifra-entry.ts`) was written into outDir only to serve as a
|
|
709
|
+
// Bun.build entrypoint; the shipped artifact is the content-hashed `_nifra-entry-<hash>.js` the HTML
|
|
710
|
+
// references. Remove the leftover source so it never ships in a static deploy dir (nothing links it).
|
|
711
|
+
rmSync(entryFile, { force: true })
|
|
712
|
+
|
|
708
713
|
// #4: a `node:` builtin (e.g. `node:crypto`) pulled into a CLIENT chunk builds fine (Bun substitutes
|
|
709
714
|
// a browser polyfill) but breaks/leaks at runtime. Fail the build with a named, actionable error
|
|
710
715
|
// instead — caught at build time, not by a confused user in the browser. Graph-based (the metafile's
|
package/src/client.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* a full page load). DOM-only — never imported on the server, so the store stays SSR-safe.
|
|
6
6
|
*/
|
|
7
7
|
import type { Meta } from "./manifest.ts"
|
|
8
|
+
import { type BrowserNavigate, setBrowserNavigate } from "./navigation.ts"
|
|
8
9
|
import type { ClientRouter } from "./router.ts"
|
|
9
10
|
|
|
10
11
|
export interface InstallHistoryOptions {
|
|
@@ -80,9 +81,14 @@ export function installHistory(
|
|
|
80
81
|
for (const p of [vt.ready, vt.finished, vt.updateCallbackDone]) p.catch(() => {})
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
const go = (path: string,
|
|
84
|
+
const go = (path: string, mode: "push" | "replace"): void => {
|
|
84
85
|
const url = new URL(path, location.origin)
|
|
85
|
-
if (
|
|
86
|
+
if (mode === "replace") {
|
|
87
|
+
// Replace the current entry with the new URL. The entry we're leaving is discarded, so its scroll
|
|
88
|
+
// isn't worth saving; the new route scrolls to its fragment target, else the top.
|
|
89
|
+
history.replaceState({}, "", path)
|
|
90
|
+
pendingScroll = url.hash !== "" ? { hash: hashId(url.hash) } : { pos: [0, 0] }
|
|
91
|
+
} else {
|
|
86
92
|
// Save the leaving entry's scroll, push a fresh entry (URL incl. any #hash), then scroll the new
|
|
87
93
|
// route: to the fragment target if one was given, else to the top.
|
|
88
94
|
history.replaceState({ ...(history.state ?? {}), nifraScroll: [scrollX, scrollY] }, "")
|
|
@@ -93,6 +99,20 @@ export function installHistory(
|
|
|
93
99
|
transition(() => router.navigate(url.pathname + url.search).catch(() => fallback(path)))
|
|
94
100
|
}
|
|
95
101
|
|
|
102
|
+
// Programmatic navigation for adapter `useNavigate` bindings, published through the DOM-free bridge
|
|
103
|
+
// (`@nifrajs/web`'s `getBrowserNavigate`). A string path pushes (or replaces); a number is a history
|
|
104
|
+
// delta (`-1` back / `1` forward), matching `history.go`. An off-route / cross-origin push still goes
|
|
105
|
+
// through `go`, whose `router.navigate` no-ops an unmatched path and whose fetch-failure falls back to
|
|
106
|
+
// a full load — same graceful degradation as a link click.
|
|
107
|
+
const navigate: BrowserNavigate = (to, navOptions) => {
|
|
108
|
+
if (typeof to === "number") {
|
|
109
|
+
history.go(to)
|
|
110
|
+
return
|
|
111
|
+
}
|
|
112
|
+
go(to, navOptions?.replace === true ? "replace" : "push")
|
|
113
|
+
}
|
|
114
|
+
setBrowserNavigate(navigate)
|
|
115
|
+
|
|
96
116
|
// Resolve an event target to an in-app route path, or null (cross-origin, unknown route, or an
|
|
97
117
|
// anchor opting out via target/download/rel=external). Shared by click + hover/focus prefetch.
|
|
98
118
|
const inAppHref = (target: EventTarget | null): string | null => {
|
|
@@ -121,7 +141,7 @@ export function installHistory(
|
|
|
121
141
|
const href = inAppHref(event.target)
|
|
122
142
|
if (href === null) return
|
|
123
143
|
event.preventDefault()
|
|
124
|
-
go(href,
|
|
144
|
+
go(href, "push")
|
|
125
145
|
}
|
|
126
146
|
|
|
127
147
|
// Hover/focus an in-app link → warm its chunk + data (the store dedupes the spam).
|
|
@@ -165,6 +185,7 @@ export function installHistory(
|
|
|
165
185
|
window.addEventListener("popstate", onPopState)
|
|
166
186
|
return () => {
|
|
167
187
|
unsubscribe()
|
|
188
|
+
setBrowserNavigate(undefined) // stop routing `useNavigate` to a torn-down router
|
|
168
189
|
document.removeEventListener("click", onClick)
|
|
169
190
|
document.removeEventListener("pointerover", onPrefetch)
|
|
170
191
|
document.removeEventListener("focusin", onPrefetch)
|