summaryrefslogtreecommitdiffhomepage
path: root/patches
diff options
context:
space:
mode:
authorBrendan Allan <[email protected]>2025-09-03 13:28:34 +0800
committerGitHub <[email protected]>2025-09-03 01:28:34 -0400
commit854f9227a21d34252a3d54fbd0385c1745730152 (patch)
tree57edac0e8c39c56da89d279b4b29cc796d917232 /patches
parent8d368fdfd2d1ea363f29710bada6e538ad64fb2e (diff)
downloadopencode-854f9227a21d34252a3d54fbd0385c1745730152.tar.gz
opencode-854f9227a21d34252a3d54fbd0385c1745730152.zip
Patch Start to preload route css in SSR (#2389)
Diffstat (limited to 'patches')
-rw-r--r--patches/@solidjs%[email protected]18
1 files changed, 18 insertions, 0 deletions
diff --git a/patches/@solidjs%[email protected] b/patches/@solidjs%[email protected]
new file mode 100644
index 000000000..6cb620124
--- /dev/null
+++ b/patches/@solidjs%[email protected]
@@ -0,0 +1,18 @@
+diff --git a/dist/server/StartServer.jsx b/dist/server/StartServer.jsx
+index 0c6a9fe3121a88520db252570a8b5997a36e0452..b3479cdb78c70d7a655d302d8e6ab536b4ff07a3 100644
+--- a/dist/server/StartServer.jsx
++++ b/dist/server/StartServer.jsx
+@@ -52,11 +52,11 @@ export function StartServer(props) {
+ else if (import.meta.env.DEV)
+ console.warn("No route matched for preloading js assets");
+ }
+- assets = await Promise.all(assetPromises).then(a =>
++ assets = await Promise.all(assetPromises).then(a =>
+ // dedupe assets
+ [...new Map(a.flat().map(item => [item.attrs.key, item])).values()].filter(asset => import.meta.env.START_ISLANDS
+ ? false
+- : asset.attrs.rel === "modulepreload" &&
++ : (asset.attrs.rel === "modulepreload" || asset.attrs.rel === "stylesheet") &&
+ !context.assets.find((a) => a.attrs.key === asset.attrs.key)));
+ });
+ useAssets(() => (assets.length ? assets.map(m => renderAsset(m)) : undefined));