@timber-js/app 0.2.0-alpha.51 → 0.2.0-alpha.52
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/rsc-entry/index.ts"],"names":[],"mappings":"AA4DA,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AAiCtB;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,mBAAmB,EAAE,KAAK,IAAI,GACtF,IAAI,CAEN;AAscD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;8BAvS3C,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC;AAyShD,wBAAiE"}
|
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.52",
|
|
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",
|
|
@@ -85,18 +85,13 @@ export function collectRouteCss(segments: SegmentWithFiles[], manifest: BuildMan
|
|
|
85
85
|
* via injectHead() before </head>.
|
|
86
86
|
*/
|
|
87
87
|
export function buildCssLinkTags(cssUrls: string[]): string {
|
|
88
|
-
// Emit
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
// explicit <link rel="stylesheet"> may be dropped. The preload hint
|
|
96
|
-
// survives regardless and suppresses the browser warning.
|
|
97
|
-
const preloads = cssUrls.map((url) => `<link rel="preload" href="${url}" as="style">`).join('');
|
|
98
|
-
const stylesheets = cssUrls.map((url) => `<link rel="stylesheet" href="${url}">`).join('');
|
|
99
|
-
return preloads + stylesheets;
|
|
88
|
+
// Emit <link rel="stylesheet"> tags as a fallback for platforms where
|
|
89
|
+
// React's Float system (via @vitejs/plugin-rsc preinit with
|
|
90
|
+
// data-precedence) doesn't handle CSS injection. In practice, Float
|
|
91
|
+
// deduplicates and these may be dropped. No preload hints — Float
|
|
92
|
+
// already starts the fetch via preinit(), and redundant preloads
|
|
93
|
+
// cause "ignored due to unknown as/type" browser warnings.
|
|
94
|
+
return cssUrls.map((url) => `<link rel="stylesheet" href="${url}">`).join('');
|
|
100
95
|
}
|
|
101
96
|
|
|
102
97
|
/**
|
|
@@ -29,10 +29,8 @@ import { handleActionRequest, isActionRequest } from '#/server/action-handler.js
|
|
|
29
29
|
import type { BodyLimitsConfig } from '#/server/body-limits.js';
|
|
30
30
|
import type { BuildManifest } from '#/server/build-manifest.js';
|
|
31
31
|
import {
|
|
32
|
-
buildCssLinkTags,
|
|
33
32
|
buildFontPreloadTags,
|
|
34
33
|
buildModulepreloadTags,
|
|
35
|
-
collectRouteCss,
|
|
36
34
|
collectRouteFonts,
|
|
37
35
|
collectRouteModulepreloads,
|
|
38
36
|
} from '#/server/build-manifest.js';
|
|
@@ -427,10 +425,17 @@ async function renderRoute(
|
|
|
427
425
|
const typedManifest = buildManifest as BuildManifest;
|
|
428
426
|
let headHtml = '';
|
|
429
427
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
428
|
+
// CSS is handled by the RSC plugin via ReactDOM.preinit() with
|
|
429
|
+
// data-precedence attributes. This injects <link rel="stylesheet">
|
|
430
|
+
// tags during the RSC render phase — before our headHtml injection.
|
|
431
|
+
// We do NOT emit additional <link rel="stylesheet"> tags here because:
|
|
432
|
+
// 1. React's Float system deduplicates them, making ours redundant
|
|
433
|
+
// 2. The duplicate reference confuses React's client-side preload
|
|
434
|
+
// deduplication, causing "preload ignored" browser warnings
|
|
435
|
+
//
|
|
436
|
+
// CSS URLs are still collected for Early Hints (Link headers) in
|
|
437
|
+
// buildEarlyHintsHeaders() — those are HTTP headers, not DOM elements,
|
|
438
|
+
// so they don't conflict with Float.
|
|
434
439
|
|
|
435
440
|
// Inline font CSS as a <style> tag — @font-face rules and scoped classes.
|
|
436
441
|
// The font CSS is set on globalThis by the transformed font file's
|