@timber-js/app 0.2.0-alpha.50 → 0.2.0-alpha.51

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timber-js/app",
3
- "version": "0.2.0-alpha.50",
3
+ "version": "0.2.0-alpha.51",
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,7 +85,18 @@ export function collectRouteCss(segments: SegmentWithFiles[], manifest: BuildMan
85
85
  * via injectHead() before </head>.
86
86
  */
87
87
  export function buildCssLinkTags(cssUrls: string[]): string {
88
- return cssUrls.map((url) => `<link rel="stylesheet" href="${url}">`).join('');
88
+ // Emit both preload hints and stylesheet links. The preload hints
89
+ // ensure the browser starts fetching CSS early (before it parses
90
+ // the full <head>). The `as="style"` attribute is required by the
91
+ // spec — without it browsers emit a console warning.
92
+ //
93
+ // React's Float system (via @vitejs/plugin-rsc preinit) also emits
94
+ // stylesheet links with data-precedence. React deduplicates, so the
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;
89
100
  }
90
101
 
91
102
  /**