@timber-js/app 0.1.40 → 0.1.42
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/adapters/nitro.d.ts.map +1 -1
- package/dist/adapters/nitro.js +14 -11
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/navigation-context.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/plugins/chunks.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/nitro.ts +6 -1
- package/src/client/navigation-context.ts +2 -0
- package/src/plugins/chunks.ts +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../../src/plugins/chunks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../../src/plugins/chunks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAwGnC;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA4B1D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,GAAG,SAAS,CAcrB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAoBrC"}
|
package/package.json
CHANGED
package/src/adapters/nitro.ts
CHANGED
|
@@ -288,10 +288,15 @@ export function generateNitroEntry(
|
|
|
288
288
|
: await handler(webRequest)`
|
|
289
289
|
: ` const webResponse = await handler(webRequest)`;
|
|
290
290
|
|
|
291
|
+
// Build manifest init must be imported before the handler so that
|
|
292
|
+
// globalThis.__TIMBER_BUILD_MANIFEST__ is set when the virtual module evaluates.
|
|
293
|
+
// ESM guarantees imports are evaluated in order.
|
|
294
|
+
const manifestImport = hasManifestInit ? "import './_timber-manifest-init.js'\n" : '';
|
|
295
|
+
|
|
291
296
|
return `// Generated by @timber-js/app/adapters/nitro
|
|
292
297
|
// Do not edit — this file is regenerated on each build.
|
|
293
298
|
|
|
294
|
-
import { defineEventHandler } from 'nitro/h3'
|
|
299
|
+
${manifestImport}import { defineEventHandler } from 'nitro/h3'
|
|
295
300
|
import handler, { runWithEarlyHintsSender } from '${serverEntryRelative}'
|
|
296
301
|
import { compressResponse } from './_compress.mjs'
|
|
297
302
|
|
package/src/plugins/chunks.ts
CHANGED
|
@@ -97,10 +97,15 @@ function isReactVendor(id: string): boolean {
|
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* Check if a module is part of the timber framework runtime (tier 2).
|
|
100
|
+
*
|
|
101
|
+
* Matches both monorepo paths (packages/timber-app/...) and consumer
|
|
102
|
+
* project paths (node_modules/@timber-js/app/...) so the chunk
|
|
103
|
+
* assignment is consistent regardless of how timber is installed.
|
|
100
104
|
*/
|
|
101
105
|
function isTimberRuntime(id: string): boolean {
|
|
102
106
|
return (
|
|
103
107
|
id.includes('/timber-app/') ||
|
|
108
|
+
id.includes('/@timber-js/app/') ||
|
|
104
109
|
id.includes('react-server-dom') ||
|
|
105
110
|
id.includes('@vitejs/plugin-rsc')
|
|
106
111
|
);
|
|
@@ -175,7 +180,8 @@ export function assignClientChunk(meta: {
|
|
|
175
180
|
serverChunk: string;
|
|
176
181
|
}): string | undefined {
|
|
177
182
|
// Timber framework client modules → vendor-timber
|
|
178
|
-
|
|
183
|
+
// Match both monorepo paths (/timber-app/) and consumer paths (/@timber-js/app/)
|
|
184
|
+
if (meta.id.includes('/timber-app/') || meta.id.includes('/@timber-js/app/')) return 'vendor-timber';
|
|
179
185
|
|
|
180
186
|
// Small user client components → shared-client (prevents facade micro-chunks)
|
|
181
187
|
if (!meta.id.includes('\0') && meta.id.startsWith('/')) {
|