@timber-js/app 0.2.0-alpha.140 → 0.2.0-alpha.142
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 +11 -3
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/client/nuqs-adapter.d.ts +1 -1
- package/dist/client/nuqs-adapter.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/server/early-hints.d.ts.map +1 -1
- package/dist/server/internal.js.map +1 -1
- package/package.json +7 -6
- package/src/adapters/nitro.ts +5 -1
- package/src/cli.ts +0 -0
- package/src/fonts/dev-middleware.ts +1 -1
- package/src/server/build-manifest.ts +6 -6
- package/src/server/early-hints.ts +2 -0
- package/LICENSE +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timber-js/app",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.142",
|
|
4
4
|
"description": "Vite-native React framework built for Servers and Serverless Platforms — correct HTTP semantics, real status codes, pages that work without JavaScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare-workers",
|
|
@@ -114,6 +114,11 @@
|
|
|
114
114
|
"publishConfig": {
|
|
115
115
|
"access": "public"
|
|
116
116
|
},
|
|
117
|
+
"scripts": {
|
|
118
|
+
"build": "vite build --config vite.lib.config.ts && tsc --emitDeclarationOnly --project tsconfig.json --outDir dist",
|
|
119
|
+
"typecheck": "tsgo --noEmit",
|
|
120
|
+
"prepublishOnly": "pnpm run build"
|
|
121
|
+
},
|
|
117
122
|
"dependencies": {
|
|
118
123
|
"@opentelemetry/api": "^1.9.1",
|
|
119
124
|
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
@@ -127,7 +132,7 @@
|
|
|
127
132
|
"@content-collections/vite": "^0.2.0",
|
|
128
133
|
"@mdx-js/rollup": "^3.0.0",
|
|
129
134
|
"@vitejs/plugin-react": "^6.0.0",
|
|
130
|
-
"@vitejs/plugin-rsc": ">=0.5.
|
|
135
|
+
"@vitejs/plugin-rsc": ">=0.5.27",
|
|
131
136
|
"nuqs": "^2.0.0",
|
|
132
137
|
"react": "19.3.0-canary-d5736f09-20260507",
|
|
133
138
|
"react-dom": "19.3.0-canary-d5736f09-20260507",
|
|
@@ -157,9 +162,5 @@
|
|
|
157
162
|
},
|
|
158
163
|
"engines": {
|
|
159
164
|
"node": ">=22.12.0"
|
|
160
|
-
},
|
|
161
|
-
"scripts": {
|
|
162
|
-
"build": "vite build --config vite.lib.config.ts && tsc --emitDeclarationOnly --project tsconfig.json --outDir dist",
|
|
163
|
-
"typecheck": "tsgo --noEmit"
|
|
164
165
|
}
|
|
165
166
|
}
|
package/src/adapters/nitro.ts
CHANGED
|
@@ -364,6 +364,7 @@ export function generateNitroConfig(
|
|
|
364
364
|
// See design/25-production-deployments.md §"CDN / Edge Cache"
|
|
365
365
|
routeRules: {
|
|
366
366
|
'/assets/**': { headers: { 'Cache-Control': IMMUTABLE_CACHE } },
|
|
367
|
+
'/_timber/fonts/**': { headers: { 'Cache-Control': IMMUTABLE_CACHE } },
|
|
367
368
|
},
|
|
368
369
|
...presetConfig.extraConfig,
|
|
369
370
|
...userConfig,
|
|
@@ -483,7 +484,9 @@ const server = createServer(async (req, res) => {
|
|
|
483
484
|
const contentType = MIME_TYPES[ext] || 'application/octet-stream';
|
|
484
485
|
const body = await readFile(filePath);
|
|
485
486
|
// Hashed assets get immutable cache, others get short cache.
|
|
486
|
-
const
|
|
487
|
+
const isImmutable =
|
|
488
|
+
url.pathname.startsWith('/assets/') || url.pathname.startsWith('/_timber/fonts/');
|
|
489
|
+
const cacheControl = isImmutable
|
|
487
490
|
? 'public, max-age=31536000, immutable'
|
|
488
491
|
: 'public, max-age=3600, must-revalidate';
|
|
489
492
|
res.writeHead(200, {
|
|
@@ -711,6 +714,7 @@ async function runNitroBuild(
|
|
|
711
714
|
output: { dir: join(nitroDir, presetConfig.outputDir) },
|
|
712
715
|
routeRules: {
|
|
713
716
|
'/assets/**': { headers: { 'Cache-Control': IMMUTABLE_CACHE } },
|
|
717
|
+
'/_timber/fonts/**': { headers: { 'Cache-Control': IMMUTABLE_CACHE } },
|
|
714
718
|
},
|
|
715
719
|
// Don't bundle the timber RSC/SSR build output — it has its own
|
|
716
720
|
// internal file references that nitro's bundler can't follow.
|
package/src/cli.ts
CHANGED
|
File without changes
|
|
@@ -51,7 +51,7 @@ export function installFontDevMiddleware(server: ViteDevServer, pipeline: FontPi
|
|
|
51
51
|
if (font.provider !== 'local' || !font.localSources) continue;
|
|
52
52
|
for (const src of font.localSources) {
|
|
53
53
|
const basename = src.path.split('/').pop() ?? '';
|
|
54
|
-
if (basename !== requestedFilename) continue;
|
|
54
|
+
if (basename !== requestedFilename && src.hashedBasename !== requestedFilename) continue;
|
|
55
55
|
|
|
56
56
|
const absolutePath = normalize(resolve(src.path));
|
|
57
57
|
if (!existsSync(absolutePath)) {
|
|
@@ -92,12 +92,12 @@ export function collectRouteCss(segments: SegmentWithFiles[], manifest: BuildMan
|
|
|
92
92
|
* via injectHead() before </head>.
|
|
93
93
|
*/
|
|
94
94
|
export function buildCssLinkTags(cssUrls: string[]): string {
|
|
95
|
-
// Emit <link rel="stylesheet">
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
//
|
|
95
|
+
// Emit only <link rel="stylesheet"> — no preload tags. CSS preloading
|
|
96
|
+
// is handled by 103 Early Hints (Link header) which fires before the
|
|
97
|
+
// HTML stream. Float also emits `<link rel="stylesheet" data-precedence>`
|
|
98
|
+
// at the top of <head> during Fizz rendering — the browser discovers
|
|
99
|
+
// CSS from that tag. A <link rel="preload"> here would arrive *after*
|
|
100
|
+
// Float's stylesheet tag and trigger "Preload was ignored" warnings.
|
|
101
101
|
return cssUrls.map((url) => `<link rel="stylesheet" href="${url}">`).join('');
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -127,6 +127,8 @@ export function collectEarlyHintHeaders(
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
// Per-route CSS — as=style; rel=preload
|
|
130
|
+
// The HTML <head> also contains a matching <link rel="preload" as="style">
|
|
131
|
+
// tag so browsers can deduplicate the 103 hint against the HTML tag.
|
|
130
132
|
for (const url of collectRouteCss(segments, manifest)) {
|
|
131
133
|
add(url, formatLinkHeader({ href: url, rel: 'preload', as: 'style' }));
|
|
132
134
|
}
|
package/LICENSE
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
DONTFUCKINGUSE LICENSE
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Daniel Saewitz
|
|
4
|
-
|
|
5
|
-
This software may not be used, copied, modified, merged, published,
|
|
6
|
-
distributed, sublicensed, or sold by anyone other than the copyright holder.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
|