@timber-js/app 0.2.0-alpha.237 → 0.2.0-alpha.238
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/_chunks/chains-CmzbpG-6.js +1 -0
- package/dist/_chunks/{chains-BsGKkMTK.js → chains-DMoHX4yH.js} +2 -2
- package/dist/_chunks/{chains-BsGKkMTK.js.map → chains-DMoHX4yH.js.map} +1 -1
- package/dist/_chunks/{classify-cmE0Gins.js → classify-BwyAd-dZ.js} +3 -3
- package/dist/_chunks/{classify-cmE0Gins.js.map → classify-BwyAd-dZ.js.map} +1 -1
- package/dist/_chunks/{cli-check-BwiahbTC.js → cli-check-DQAD9MLo.js} +3 -3
- package/dist/_chunks/{cli-check-BwiahbTC.js.map → cli-check-DQAD9MLo.js.map} +1 -1
- package/dist/_chunks/{cli-schema-sync-Brw7kTmm.js → cli-schema-sync-C_xNLqBj.js} +1 -1
- package/dist/_chunks/{cli-schema-sync-B2ldclRO.js → cli-schema-sync-CmGls3dc.js} +2 -2
- package/dist/_chunks/{cli-schema-sync-B2ldclRO.js.map → cli-schema-sync-CmGls3dc.js.map} +1 -1
- package/dist/_chunks/{client-dep-entries-C1nMlLKV.js → client-dep-entries-C5BTQtFS.js} +2 -2
- package/dist/_chunks/{client-dep-entries-C1nMlLKV.js.map → client-dep-entries-C5BTQtFS.js.map} +1 -1
- package/dist/_chunks/{convention-lint-CLpuzY5h.js → convention-lint-GQA6WTRo.js} +2 -2
- package/dist/_chunks/{convention-lint-CLpuzY5h.js.map → convention-lint-GQA6WTRo.js.map} +1 -1
- package/dist/_chunks/dev-server--4_Ogy_6.js +1 -0
- package/dist/_chunks/{dev-server-lrdpD7Ws.js → dev-server-Cr3_Fu5A.js} +244 -26
- package/dist/_chunks/dev-server-Cr3_Fu5A.js.map +1 -0
- package/dist/_chunks/{scanner-CrB_h6FA.js → interception-CtNt9jPt.js} +169 -1043
- package/dist/_chunks/interception-CtNt9jPt.js.map +1 -0
- package/dist/_chunks/{live-graph-ChuFfmLi.js → live-graph-HcLScfiV.js} +4 -4
- package/dist/_chunks/{live-graph-ChuFfmLi.js.map → live-graph-HcLScfiV.js.map} +1 -1
- package/dist/_chunks/{metadata-routes-BL26HCDd.js → metadata-routes-MXNjWOt5.js} +60 -2
- package/dist/_chunks/metadata-routes-MXNjWOt5.js.map +1 -0
- package/dist/_chunks/{poison-scan-CJ9QfJWb.js → poison-scan-DONdiCGX.js} +2 -2
- package/dist/_chunks/{poison-scan-CJ9QfJWb.js.map → poison-scan-DONdiCGX.js.map} +1 -1
- package/dist/_chunks/scanner-DSAJjH0x.js +1043 -0
- package/dist/_chunks/scanner-DSAJjH0x.js.map +1 -0
- package/dist/_chunks/{walkers-BUvpsb2Q.js → walkers-96YopJds.js} +3 -3
- package/dist/_chunks/{walkers-BUvpsb2Q.js.map → walkers-96YopJds.js.map} +1 -1
- package/dist/analyze/crawl-entry.js +3 -3
- package/dist/analyze/graph-command.js +2 -2
- package/dist/cli.js +3 -3
- package/dist/config-types.d.ts +11 -0
- package/dist/config-types.d.ts.map +1 -1
- package/dist/config-validation.d.ts.map +1 -1
- package/dist/index.js +6 -155
- package/dist/index.js.map +1 -1
- package/dist/plugins/dev-precompile.d.ts +42 -14
- package/dist/plugins/dev-precompile.d.ts.map +1 -1
- package/dist/plugins/dev-server.d.ts.map +1 -1
- package/dist/routing/index.js +3 -2
- package/dist/routing/manifest-codegen.d.ts +2 -0
- package/dist/routing/manifest-codegen.d.ts.map +1 -1
- package/dist/server/internal.js +1 -2
- package/dist/server/internal.js.map +1 -1
- package/docs/api/34-api-config.mdx +18 -0
- package/package.json +1 -1
- package/src/config-types.ts +11 -0
- package/src/config-validation.ts +15 -8
- package/src/plugins/dev-precompile.ts +108 -20
- package/src/plugins/dev-server.ts +12 -11
- package/src/routing/manifest-codegen.ts +2 -2
- package/dist/_chunks/chains-DHmoKxkO.js +0 -1
- package/dist/_chunks/dev-server-BGGGhHXx.js +0 -1
- package/dist/_chunks/dev-server-lrdpD7Ws.js.map +0 -1
- package/dist/_chunks/metadata-routes-BL26HCDd.js.map +0 -1
- package/dist/_chunks/scanner-CrB_h6FA.js.map +0 -1
- package/dist/_chunks/segment-keys-Y60KNc8C.js +0 -61
- package/dist/_chunks/segment-keys-Y60KNc8C.js.map +0 -1
- package/dist/_chunks/tree-match-Bqdr9szG.js +0 -168
- package/dist/_chunks/tree-match-Bqdr9szG.js.map +0 -1
|
@@ -13,9 +13,15 @@
|
|
|
13
13
|
* - `env.transformRequest()` only: nothing executes, so the app's
|
|
14
14
|
* instrumentation `register()` and cache handler setup still run at the
|
|
15
15
|
* first request, as before.
|
|
16
|
-
* - Static imports only (`result.deps`), from the entries and
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* - Static imports only (`result.deps`), from the entries and every module
|
|
17
|
+
* file in the route tree ({@link routeTreeSeeds}). Route files are dynamic
|
|
18
|
+
* imports of the route manifest, which the crawl does not follow, so they
|
|
19
|
+
* are seeded directly. Crawling only the root layout left most of an app
|
|
20
|
+
* whose UI sits in route groups and slots to the first request: on
|
|
21
|
+
* relisten-web it covered 53 of the 499 SSR modules `GET /` needed, and the
|
|
22
|
+
* whole route tree (~960 modules) takes ~1.6s (TIM-1630).
|
|
23
|
+
* - In waves: what `GET /` can load first, RSC then SSR, so the
|
|
24
|
+
* most common first request is ready soonest; then the rest.
|
|
19
25
|
* - Errors are swallowed. The request that loads the module hits the same
|
|
20
26
|
* error and reports it as it always has; Vite's `warmupRequest` was
|
|
21
27
|
* rejected because it logs each error a second time.
|
|
@@ -28,24 +34,43 @@
|
|
|
28
34
|
*
|
|
29
35
|
* `analyze/crawl.ts` also walks `transformRequest`, for a different job:
|
|
30
36
|
* classifying every module the app can reach, dynamic imports included, in
|
|
31
|
-
* a throwaway middleware-mode server.
|
|
32
|
-
*
|
|
37
|
+
* a throwaway middleware-mode server.
|
|
38
|
+
*
|
|
39
|
+
* `dev.precompile: false` in timber.config, or `TIMBER_DEV_PRECOMPILE=0`,
|
|
40
|
+
* turns it off.
|
|
33
41
|
*
|
|
34
42
|
* See design/21-dev-server.md §"Server Pre-compile".
|
|
35
43
|
*/
|
|
36
44
|
import { type DevEnvironment, type ViteDevServer } from 'vite';
|
|
45
|
+
import type { RouteTree } from '../routing/types.ts';
|
|
37
46
|
/** `TIMBER_DEV_PRECOMPILE=0` turns the crawl off (A/B measurement, escape hatch). */
|
|
38
47
|
export declare const PRECOMPILE_ENV = "TIMBER_DEV_PRECOMPILE";
|
|
39
48
|
/**
|
|
40
|
-
* Past this, the crawl starts no new transform. Generous:
|
|
41
|
-
*
|
|
49
|
+
* Past this, the crawl starts no new transform. Generous: the whole route
|
|
50
|
+
* tree takes ~1.6s on relisten-web. It bounds a crawl stuck behind a slow
|
|
51
|
+
* transform plugin, or an app too large to finish.
|
|
42
52
|
*/
|
|
43
53
|
export declare const PRECOMPILE_DEADLINE_MS = 60000;
|
|
44
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* The roots of each server environment's crawl. `rsc` is crawled in waves,
|
|
56
|
+
* in order; after each wave the SSR environment crawls `ssr` and every
|
|
57
|
+
* client reference recorded so far.
|
|
58
|
+
*/
|
|
45
59
|
export interface PrecompileRoots {
|
|
46
|
-
rsc: string[];
|
|
60
|
+
rsc: string[][];
|
|
47
61
|
ssr: string[];
|
|
48
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Every module file in the route tree, in two waves. `home` is what `GET /`
|
|
65
|
+
* can load: `proxy.ts`, `global-error`, the root segment, and under it the
|
|
66
|
+
* pathless segments (groups, optional catch-alls) with a page or handler at
|
|
67
|
+
* `/`, and the slots of those. A group that only organises other sections
|
|
68
|
+
* (`(admin)/admin/…`) is not in it. `rest` is every other segment's.
|
|
69
|
+
*/
|
|
70
|
+
export declare function routeTreeSeeds(tree: RouteTree): {
|
|
71
|
+
home: string[];
|
|
72
|
+
rest: string[];
|
|
73
|
+
};
|
|
49
74
|
/**
|
|
50
75
|
* The id `transformRequest` takes for an entry of `result.deps`, or null for
|
|
51
76
|
* one it must not follow: a bare specifier, which in a server environment is
|
|
@@ -66,13 +91,16 @@ export declare function fileUrl(file: string, root: string): string;
|
|
|
66
91
|
/**
|
|
67
92
|
* Transform `roots` and every module they statically import in `env`.
|
|
68
93
|
* Starts no transform once `shouldStop()` is true. Resolves with the
|
|
69
|
-
* number of
|
|
94
|
+
* number of ids in `seen` (every module visited in `env` so far, across
|
|
95
|
+
* crawls that share it) once the graph is done; never rejects. `seen`
|
|
96
|
+
* carries visited ids across crawls of one environment, so a later wave
|
|
97
|
+
* skips what an earlier one transformed.
|
|
70
98
|
*/
|
|
71
|
-
export declare function crawlServerGraph(env: DevEnvironment, roots: string[], shouldStop?: () => boolean): Promise<number>;
|
|
99
|
+
export declare function crawlServerGraph(env: DevEnvironment, roots: string[], shouldStop?: () => boolean, seen?: Set<string>): Promise<number>;
|
|
72
100
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* already in flight for the URLs it asks for.
|
|
101
|
+
* For each RSC wave, crawl the RSC graph, then the SSR graph with the client
|
|
102
|
+
* references found so far. A request that arrives mid-crawl shares the
|
|
103
|
+
* transforms already in flight for the URLs it asks for.
|
|
76
104
|
*/
|
|
77
105
|
export declare function precompileServerGraphs(server: ViteDevServer, roots: PrecompileRoots, shouldStop: () => boolean): Promise<void>;
|
|
78
106
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-precompile.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-precompile.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"dev-precompile.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-precompile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAiB,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,MAAM,CAAC;AAE9E,OAAO,KAAK,EAAa,SAAS,EAA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,MAAM,EAGZ,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,WAAW,CAAC;AAKjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAiC1D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AA2BpC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAGL,KAAK,MAAM,EAGZ,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,WAAW,CAAC;AAKjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAiC1D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AA2BpC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA0P1D;AAgOD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,IAAI,CA6CrE"}
|
package/dist/routing/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as scanRoutes } from "../_chunks/scanner-DSAJjH0x.js";
|
|
2
2
|
import { t as generateRouteMap } from "../_chunks/codegen-vaCyFyVN.js";
|
|
3
3
|
import { a as INTERCEPTION_MARKERS, i as DEFAULT_PAGE_EXTENSIONS, n as classifyUrlSegment, t as classifySegment } from "../_chunks/segment-classify-Ho8jXWeC.js";
|
|
4
|
-
import {
|
|
4
|
+
import { t as collectInterceptionRewrites } from "../_chunks/interception-CtNt9jPt.js";
|
|
5
|
+
import { n as collectDynamicSegmentsFromTree, r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "../_chunks/walkers-96YopJds.js";
|
|
5
6
|
export { DEFAULT_PAGE_EXTENSIONS, INTERCEPTION_MARKERS, classifySegment, classifyUrlSegment, collectDynamicSegmentsFromTree, collectInterceptionRewrites, collectLeafRoutes, generateRouteMap, scanRoutes, validateSchemaAgainstRoutes };
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* Task: TIM-1071 item 8
|
|
9
9
|
*/
|
|
10
10
|
import type { RouteTree } from './types.ts';
|
|
11
|
+
export declare const SINGLE_FILE_KEYS: readonly ['page', 'layout', 'middleware', 'access', 'route', 'error', 'default', 'denied'];
|
|
12
|
+
export declare const RECORD_FILE_KEYS: readonly ['statusFiles', 'jsonStatusFiles', 'metadataRoutes'];
|
|
11
13
|
/**
|
|
12
14
|
* Generate the virtual module source for the route manifest.
|
|
13
15
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-codegen.d.ts","sourceRoot":"","sources":["../../src/routing/manifest-codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,SAAS,EAA0B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest-codegen.d.ts","sourceRoot":"","sources":["../../src/routing/manifest-codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,SAAS,EAA0B,MAAM,YAAY,CAAC;AAKpE,eAAO,MAAM,gBAAgB,YAC3B,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,CACA,CAAC;AAIX,eAAO,MAAM,gBAAgB,YAAI,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,CAAU,CAAC;AAM9F;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAmJhF;AAID;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA8B3D"}
|
package/dist/server/internal.js
CHANGED
|
@@ -4,7 +4,7 @@ import { c as collectRouteModulepreloads, i as traceTimingEntry, o as collectRou
|
|
|
4
4
|
import { c as drainWithDeadline, d as isAbortError, f as releaseReason, i as withResponseInit, m as onAbortUntil, n as discardResponseBody, o as concatBytes, p as endScope, r as nodeBodyOps, u as wrapResponseWithStreamTiming } from "../_chunks/node-response-omewa8e6.js";
|
|
5
5
|
import { A as runWithTraceId, E as getOtelTraceId, F as isControlFlowSignal, I as isDenySignal, L as isRedirectSignal, M as withSpan, O as getTraceId, T as generateTraceId, _ as logWaitUntilRejected, b as swallow, c as logMiddlewareShortCircuit, d as logRequestCompleted, f as logRequestReceived, g as logSwrRefetchFailed, h as logSlowRequest, i as logCsrfRejected, j as setSpanAttribute, k as replaceTraceId, l as logProxyError, m as logRouteSetupError, n as logCacheMiss, p as logRouteError, s as logMiddlewareError, t as getLogger, u as logRenderError, v as logWaitUntilUnsupported, x as isDebug, y as setLogger } from "../_chunks/logger-DDLtp5e-.js";
|
|
6
6
|
import { _ as getWaitUntil, a as storeOverlayEntry, c as lookupArtifactSeed, d as checkVersionSkew, g as observeKeyDiscipline, i as overlayKey, l as setPrebuiltPayloadSource, n as lookupOverlay, o as hasPrebuiltPayloadSource, r as mayStoreRerender, s as isParamIndependent, u as applyReloadHeaders } from "../_chunks/cache-api-Bo8c7XVF.js";
|
|
7
|
-
import { i as getMetadataRouteServePath, n as classifyMetadataRoute, r as getMetadataRouteAutoLink, t as METADATA_ROUTE_CONVENTIONS } from "../_chunks/metadata-routes-
|
|
7
|
+
import { c as computeSegmentTreePaths, i as getMetadataRouteServePath, n as classifyMetadataRoute, r as getMetadataRouteAutoLink, t as METADATA_ROUTE_CONVENTIONS } from "../_chunks/metadata-routes-MXNjWOt5.js";
|
|
8
8
|
import { i as canonicalize, r as canonicalRequestPath } from "../_chunks/canonicalize-CqK135BN.js";
|
|
9
9
|
import { n as isRscContentType, r as isRscRequest } from "../_chunks/rsc-media-type-m8jz9u6_.js";
|
|
10
10
|
import { i as isRscCacheKeyShape, n as RSC_KEY_PARAM, r as appVisibleSearch, s as rscCacheKey, t as RSC_KEY_HEADERS } from "../_chunks/rsc-cache-key-D0cb0Gmc.js";
|
|
@@ -15,7 +15,6 @@ import { n as hasSchemaCodecs, t as getSchemaCodec } from "../_chunks/codec-regi
|
|
|
15
15
|
import { t as normalizeParamValue } from "../_chunks/param-value-DqlGfF57.js";
|
|
16
16
|
import { n as isHttpMethod, t as HTTP_METHODS } from "../_chunks/route-methods-Dk2kZc0n.js";
|
|
17
17
|
import { i as resolveRenderTimeoutMs, r as RenderTimeoutError, t as DEFAULT_RENDER_TIMEOUT_MS } from "../_chunks/render-timeout-MrrqD1wd.js";
|
|
18
|
-
import { t as computeSegmentTreePaths } from "../_chunks/segment-keys-Y60KNc8C.js";
|
|
19
18
|
import { _ as wasInvalidatedSince, a as devEntryKey, c as getDevSeed, d as isDevPrebuiltStoreActive, f as isHardReload, h as lastInvalidationEpochFor, m as currentInvalidationEpoch, n as clearDevPrebuiltStore, p as setDevSeed, r as devComponentTag, s as discardDevEntry, u as isDevPrebuiltCacheBypassed } from "../_chunks/dev-store-BvdqtHvK.js";
|
|
20
19
|
import { n as createSingleflight } from "../_chunks/singleflight-CzoOVB9Y.js";
|
|
21
20
|
import { createHash } from "node:crypto";
|