From e76eeceb1daeb4d79fab96de8155245ffbb82aa3 Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Mon, 20 Jul 2026 21:29:48 +0100 Subject: [PATCH] fix: refresh asset resource fixtures --- .../.template/package.json | 1 + .../$resources.asset-query-manifest.ts | 2 + .../$resources.asset-query-runtime.ts | 7 ++ .../app/routes/[another-page]._index.tsx | 11 ++- .../app/routes/_index.tsx | 11 ++- fixtures/react-router-cloudflare/package.json | 3 +- .../.template/package.json | 1 + .../$resources.asset-query-manifest.ts | 2 + .../$resources.asset-query-runtime.ts | 7 ++ .../app/routes/[another-page]._index.tsx | 11 ++- .../react-router-docker/app/routes/_index.tsx | 11 ++- fixtures/react-router-docker/package.json | 3 +- .../.template/package.json | 1 + .../$resources.asset-query-manifest.ts | 2 + .../$resources.asset-query-runtime.ts | 7 ++ .../app/routes/[another-page]._index.tsx | 11 ++- .../app/routes/_index.tsx | 11 ++- fixtures/react-router-netlify/package.json | 3 +- .../.template/package.json | 1 + .../$resources.asset-query-manifest.ts | 2 + .../$resources.asset-query-runtime.ts | 7 ++ .../app/routes/[another-page]._index.tsx | 11 ++- .../react-router-vercel/app/routes/_index.tsx | 11 ++- fixtures/react-router-vercel/package.json | 3 +- .../$resources.asset-query-manifest.ts | 2 + .../$resources.asset-query-runtime.ts | 7 ++ .../app/asset-resource-fetch.ts | 91 +++++++++++++++++++ fixtures/ssg-cloudflare-pages/package.json | 3 +- .../pages/another-page/+data.ts | 23 ++++- .../ssg-cloudflare-pages/pages/index/+data.ts | 23 ++++- fixtures/ssg-cloudflare-pages/vite.config.ts | 7 +- .../$resources.asset-query-manifest.ts | 2 + .../$resources.asset-query-runtime.ts | 7 ++ .../app/asset-resource-fetch.ts | 91 +++++++++++++++++++ .../ssg-netlify-by-project-id/package.json | 3 +- .../pages/index/+data.ts | 23 ++++- .../pages/redirect/+data.ts | 23 ++++- .../ssg-netlify-by-project-id/vite.config.ts | 7 +- .../$resources.asset-query-manifest.ts | 2 + .../$resources.asset-query-runtime.ts | 7 ++ .../app/routes/[another-page]._index.tsx | 11 ++- .../app/routes/_index.tsx | 11 ++- .../package.json | 3 +- .../webstudio-features/.template/package.json | 1 + .../$resources.asset-query-manifest.ts | 2 + .../$resources.asset-query-runtime.ts | 7 ++ .../routes/[_route_with_symbols_]._index.tsx | 11 ++- .../app/routes/[animations]._index.tsx | 11 ++- .../app/routes/[assets1]._index.tsx | 11 ++- .../app/routes/[class-names]._index.tsx | 11 ++- .../app/routes/[content-block]._index.tsx | 11 ++- .../app/routes/[duration]._index.tsx | 11 ++- .../app/routes/[expressions]._index.tsx | 11 ++- .../app/routes/[form]._index.tsx | 11 ++- .../app/routes/[head-tag]._index.tsx | 11 ++- .../app/routes/[heading-with-id]._index.tsx | 11 ++- .../routes/[nested].[nested-page]._index.tsx | 11 ++- .../app/routes/[radix]._index.tsx | 11 ++- .../app/routes/[resources]._index.tsx | 11 ++- .../app/routes/[sitemap.xml]._index.tsx | 11 ++- .../app/routes/[text-duration]._index.tsx | 11 ++- .../webstudio-features/app/routes/_index.tsx | 11 ++- fixtures/webstudio-features/package.json | 3 +- .../scripts/benchmark-scale.mjs | 17 ++-- .../src/candidate-selection.test.ts | 4 +- packages/cli/templates/internal/package.json | 1 + pnpm-lock.yaml | 24 +++++ 67 files changed, 631 insertions(+), 90 deletions(-) create mode 100644 fixtures/react-router-cloudflare/app/__generated__/$resources.asset-query-manifest.ts create mode 100644 fixtures/react-router-cloudflare/app/__generated__/$resources.asset-query-runtime.ts create mode 100644 fixtures/react-router-docker/app/__generated__/$resources.asset-query-manifest.ts create mode 100644 fixtures/react-router-docker/app/__generated__/$resources.asset-query-runtime.ts create mode 100644 fixtures/react-router-netlify/app/__generated__/$resources.asset-query-manifest.ts create mode 100644 fixtures/react-router-netlify/app/__generated__/$resources.asset-query-runtime.ts create mode 100644 fixtures/react-router-vercel/app/__generated__/$resources.asset-query-manifest.ts create mode 100644 fixtures/react-router-vercel/app/__generated__/$resources.asset-query-runtime.ts create mode 100644 fixtures/ssg-cloudflare-pages/app/__generated__/$resources.asset-query-manifest.ts create mode 100644 fixtures/ssg-cloudflare-pages/app/__generated__/$resources.asset-query-runtime.ts create mode 100644 fixtures/ssg-cloudflare-pages/app/asset-resource-fetch.ts create mode 100644 fixtures/ssg-netlify-by-project-id/app/__generated__/$resources.asset-query-manifest.ts create mode 100644 fixtures/ssg-netlify-by-project-id/app/__generated__/$resources.asset-query-runtime.ts create mode 100644 fixtures/ssg-netlify-by-project-id/app/asset-resource-fetch.ts create mode 100644 fixtures/webstudio-cloudflare-template/app/__generated__/$resources.asset-query-manifest.ts create mode 100644 fixtures/webstudio-cloudflare-template/app/__generated__/$resources.asset-query-runtime.ts create mode 100644 fixtures/webstudio-features/app/__generated__/$resources.asset-query-manifest.ts create mode 100644 fixtures/webstudio-features/app/__generated__/$resources.asset-query-runtime.ts diff --git a/fixtures/react-router-cloudflare/.template/package.json b/fixtures/react-router-cloudflare/.template/package.json index 8b6d3adc73..1c9aa4ba3a 100644 --- a/fixtures/react-router-cloudflare/.template/package.json +++ b/fixtures/react-router-cloudflare/.template/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "@webstudio-is/asset-resource": "workspace:*", "@webstudio-is/image": "workspace:*", "@webstudio-is/react-sdk": "workspace:*", "@webstudio-is/sdk": "workspace:*", diff --git a/fixtures/react-router-cloudflare/app/__generated__/$resources.asset-query-manifest.ts b/fixtures/react-router-cloudflare/app/__generated__/$resources.asset-query-manifest.ts new file mode 100644 index 0000000000..d9a4469a03 --- /dev/null +++ b/fixtures/react-router-cloudflare/app/__generated__/$resources.asset-query-manifest.ts @@ -0,0 +1,2 @@ +export const assetQueryDeploymentId = "f565d527-32e7-4731-bc71-aca9e9574587"; +export const assetQueryManifest = []; diff --git a/fixtures/react-router-cloudflare/app/__generated__/$resources.asset-query-runtime.ts b/fixtures/react-router-cloudflare/app/__generated__/$resources.asset-query-runtime.ts new file mode 100644 index 0000000000..df58a6ea19 --- /dev/null +++ b/fixtures/react-router-cloudflare/app/__generated__/$resources.asset-query-runtime.ts @@ -0,0 +1,7 @@ +export const createGeneratedAssetResourceFetch = async ({ + fallback, +}: { + request: Request; + context: unknown; + fallback: typeof fetch; +}): Promise => fallback; diff --git a/fixtures/react-router-cloudflare/app/routes/[another-page]._index.tsx b/fixtures/react-router-cloudflare/app/routes/[another-page]._index.tsx index b4af7cc103..12b520dfe0 100644 --- a/fixtures/react-router-cloudflare/app/routes/[another-page]._index.tsx +++ b/fixtures/react-router-cloudflare/app/routes/[another-page]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/react-router-cloudflare/app/routes/_index.tsx b/fixtures/react-router-cloudflare/app/routes/_index.tsx index 867d53e46b..0048674946 100644 --- a/fixtures/react-router-cloudflare/app/routes/_index.tsx +++ b/fixtures/react-router-cloudflare/app/routes/_index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/react-router-cloudflare/package.json b/fixtures/react-router-cloudflare/package.json index 81f3714831..64dafca0cf 100644 --- a/fixtures/react-router-cloudflare/package.json +++ b/fixtures/react-router-cloudflare/package.json @@ -34,7 +34,8 @@ "wrangler": "^4.14.1", "@webstudio-is/wsauth": "workspace:*", "@react-router/node": "^7.5.3", - "@react-router/serve": "^7.5.3" + "@react-router/serve": "^7.5.3", + "@webstudio-is/asset-resource": "workspace:*" }, "type": "module", "private": true, diff --git a/fixtures/react-router-docker/.template/package.json b/fixtures/react-router-docker/.template/package.json index 8b6d3adc73..1c9aa4ba3a 100644 --- a/fixtures/react-router-docker/.template/package.json +++ b/fixtures/react-router-docker/.template/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "@webstudio-is/asset-resource": "workspace:*", "@webstudio-is/image": "workspace:*", "@webstudio-is/react-sdk": "workspace:*", "@webstudio-is/sdk": "workspace:*", diff --git a/fixtures/react-router-docker/app/__generated__/$resources.asset-query-manifest.ts b/fixtures/react-router-docker/app/__generated__/$resources.asset-query-manifest.ts new file mode 100644 index 0000000000..d9a4469a03 --- /dev/null +++ b/fixtures/react-router-docker/app/__generated__/$resources.asset-query-manifest.ts @@ -0,0 +1,2 @@ +export const assetQueryDeploymentId = "f565d527-32e7-4731-bc71-aca9e9574587"; +export const assetQueryManifest = []; diff --git a/fixtures/react-router-docker/app/__generated__/$resources.asset-query-runtime.ts b/fixtures/react-router-docker/app/__generated__/$resources.asset-query-runtime.ts new file mode 100644 index 0000000000..df58a6ea19 --- /dev/null +++ b/fixtures/react-router-docker/app/__generated__/$resources.asset-query-runtime.ts @@ -0,0 +1,7 @@ +export const createGeneratedAssetResourceFetch = async ({ + fallback, +}: { + request: Request; + context: unknown; + fallback: typeof fetch; +}): Promise => fallback; diff --git a/fixtures/react-router-docker/app/routes/[another-page]._index.tsx b/fixtures/react-router-docker/app/routes/[another-page]._index.tsx index b4af7cc103..12b520dfe0 100644 --- a/fixtures/react-router-docker/app/routes/[another-page]._index.tsx +++ b/fixtures/react-router-docker/app/routes/[another-page]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/react-router-docker/app/routes/_index.tsx b/fixtures/react-router-docker/app/routes/_index.tsx index 867d53e46b..0048674946 100644 --- a/fixtures/react-router-docker/app/routes/_index.tsx +++ b/fixtures/react-router-docker/app/routes/_index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/react-router-docker/package.json b/fixtures/react-router-docker/package.json index 2ebb1dc003..dba72a5daa 100644 --- a/fixtures/react-router-docker/package.json +++ b/fixtures/react-router-docker/package.json @@ -30,7 +30,8 @@ "react-router": "^7.5.3", "vite": "^6.3.4", "webstudio": "workspace:*", - "@webstudio-is/wsauth": "workspace:*" + "@webstudio-is/wsauth": "workspace:*", + "@webstudio-is/asset-resource": "workspace:*" }, "private": true, "sideEffects": false, diff --git a/fixtures/react-router-netlify/.template/package.json b/fixtures/react-router-netlify/.template/package.json index 8b6d3adc73..1c9aa4ba3a 100644 --- a/fixtures/react-router-netlify/.template/package.json +++ b/fixtures/react-router-netlify/.template/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "@webstudio-is/asset-resource": "workspace:*", "@webstudio-is/image": "workspace:*", "@webstudio-is/react-sdk": "workspace:*", "@webstudio-is/sdk": "workspace:*", diff --git a/fixtures/react-router-netlify/app/__generated__/$resources.asset-query-manifest.ts b/fixtures/react-router-netlify/app/__generated__/$resources.asset-query-manifest.ts new file mode 100644 index 0000000000..d9a4469a03 --- /dev/null +++ b/fixtures/react-router-netlify/app/__generated__/$resources.asset-query-manifest.ts @@ -0,0 +1,2 @@ +export const assetQueryDeploymentId = "f565d527-32e7-4731-bc71-aca9e9574587"; +export const assetQueryManifest = []; diff --git a/fixtures/react-router-netlify/app/__generated__/$resources.asset-query-runtime.ts b/fixtures/react-router-netlify/app/__generated__/$resources.asset-query-runtime.ts new file mode 100644 index 0000000000..df58a6ea19 --- /dev/null +++ b/fixtures/react-router-netlify/app/__generated__/$resources.asset-query-runtime.ts @@ -0,0 +1,7 @@ +export const createGeneratedAssetResourceFetch = async ({ + fallback, +}: { + request: Request; + context: unknown; + fallback: typeof fetch; +}): Promise => fallback; diff --git a/fixtures/react-router-netlify/app/routes/[another-page]._index.tsx b/fixtures/react-router-netlify/app/routes/[another-page]._index.tsx index b4af7cc103..12b520dfe0 100644 --- a/fixtures/react-router-netlify/app/routes/[another-page]._index.tsx +++ b/fixtures/react-router-netlify/app/routes/[another-page]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/react-router-netlify/app/routes/_index.tsx b/fixtures/react-router-netlify/app/routes/_index.tsx index 867d53e46b..0048674946 100644 --- a/fixtures/react-router-netlify/app/routes/_index.tsx +++ b/fixtures/react-router-netlify/app/routes/_index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/react-router-netlify/package.json b/fixtures/react-router-netlify/package.json index ec470c398f..f18944c38c 100644 --- a/fixtures/react-router-netlify/package.json +++ b/fixtures/react-router-netlify/package.json @@ -31,7 +31,8 @@ "vite": "^6.3.4", "webstudio": "workspace:*", "@webstudio-is/wsauth": "workspace:*", - "@react-router/serve": "^7.5.3" + "@react-router/serve": "^7.5.3", + "@webstudio-is/asset-resource": "workspace:*" }, "type": "module", "private": true, diff --git a/fixtures/react-router-vercel/.template/package.json b/fixtures/react-router-vercel/.template/package.json index 8b6d3adc73..1c9aa4ba3a 100644 --- a/fixtures/react-router-vercel/.template/package.json +++ b/fixtures/react-router-vercel/.template/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "@webstudio-is/asset-resource": "workspace:*", "@webstudio-is/image": "workspace:*", "@webstudio-is/react-sdk": "workspace:*", "@webstudio-is/sdk": "workspace:*", diff --git a/fixtures/react-router-vercel/app/__generated__/$resources.asset-query-manifest.ts b/fixtures/react-router-vercel/app/__generated__/$resources.asset-query-manifest.ts new file mode 100644 index 0000000000..d9a4469a03 --- /dev/null +++ b/fixtures/react-router-vercel/app/__generated__/$resources.asset-query-manifest.ts @@ -0,0 +1,2 @@ +export const assetQueryDeploymentId = "f565d527-32e7-4731-bc71-aca9e9574587"; +export const assetQueryManifest = []; diff --git a/fixtures/react-router-vercel/app/__generated__/$resources.asset-query-runtime.ts b/fixtures/react-router-vercel/app/__generated__/$resources.asset-query-runtime.ts new file mode 100644 index 0000000000..df58a6ea19 --- /dev/null +++ b/fixtures/react-router-vercel/app/__generated__/$resources.asset-query-runtime.ts @@ -0,0 +1,7 @@ +export const createGeneratedAssetResourceFetch = async ({ + fallback, +}: { + request: Request; + context: unknown; + fallback: typeof fetch; +}): Promise => fallback; diff --git a/fixtures/react-router-vercel/app/routes/[another-page]._index.tsx b/fixtures/react-router-vercel/app/routes/[another-page]._index.tsx index b4af7cc103..12b520dfe0 100644 --- a/fixtures/react-router-vercel/app/routes/[another-page]._index.tsx +++ b/fixtures/react-router-vercel/app/routes/[another-page]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/react-router-vercel/app/routes/_index.tsx b/fixtures/react-router-vercel/app/routes/_index.tsx index 867d53e46b..0048674946 100644 --- a/fixtures/react-router-vercel/app/routes/_index.tsx +++ b/fixtures/react-router-vercel/app/routes/_index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/react-router-vercel/package.json b/fixtures/react-router-vercel/package.json index 3a3b6cade0..137911b156 100644 --- a/fixtures/react-router-vercel/package.json +++ b/fixtures/react-router-vercel/package.json @@ -31,7 +31,8 @@ "vite": "^6.3.4", "webstudio": "workspace:*", "@webstudio-is/wsauth": "workspace:*", - "@react-router/serve": "^7.5.3" + "@react-router/serve": "^7.5.3", + "@webstudio-is/asset-resource": "workspace:*" }, "private": true, "type": "module", diff --git a/fixtures/ssg-cloudflare-pages/app/__generated__/$resources.asset-query-manifest.ts b/fixtures/ssg-cloudflare-pages/app/__generated__/$resources.asset-query-manifest.ts new file mode 100644 index 0000000000..e486f6d38f --- /dev/null +++ b/fixtures/ssg-cloudflare-pages/app/__generated__/$resources.asset-query-manifest.ts @@ -0,0 +1,2 @@ +export const assetQueryDeploymentId = "a2e8de30-03d5-4514-a3a6-406b3266a3af"; +export const assetQueryManifest = []; diff --git a/fixtures/ssg-cloudflare-pages/app/__generated__/$resources.asset-query-runtime.ts b/fixtures/ssg-cloudflare-pages/app/__generated__/$resources.asset-query-runtime.ts new file mode 100644 index 0000000000..df58a6ea19 --- /dev/null +++ b/fixtures/ssg-cloudflare-pages/app/__generated__/$resources.asset-query-runtime.ts @@ -0,0 +1,7 @@ +export const createGeneratedAssetResourceFetch = async ({ + fallback, +}: { + request: Request; + context: unknown; + fallback: typeof fetch; +}): Promise => fallback; diff --git a/fixtures/ssg-cloudflare-pages/app/asset-resource-fetch.ts b/fixtures/ssg-cloudflare-pages/app/asset-resource-fetch.ts new file mode 100644 index 0000000000..c058910b81 --- /dev/null +++ b/fixtures/ssg-cloudflare-pages/app/asset-resource-fetch.ts @@ -0,0 +1,91 @@ +import { open } from "node:fs/promises"; +import { resolve, sep } from "node:path"; +import { createPublishedAssetResourceFetch } from "@webstudio-is/asset-resource"; + +const resolvePublicAsset = (path: string) => { + const publicDirectory = resolve("public"); + const pathname = new URL(path, "https://webstudio.local").pathname; + const filePath = resolve(publicDirectory, `.${pathname}`); + if (filePath.startsWith(`${publicDirectory}${sep}`) === false) { + throw new Error("Static asset path is outside the public directory"); + } + return filePath; +}; + +const getByteRange = (header: string | null, size: number) => { + if (header?.startsWith("bytes=") !== true) { + return { offset: 0, length: size, partial: false }; + } + const values = header.slice("bytes=".length).split("-"); + const offset = Number(values[0]); + const requestedEnd = Number(values[1]); + if ( + values.length !== 2 || + Number.isSafeInteger(offset) === false || + Number.isSafeInteger(requestedEnd) === false || + offset < 0 || + requestedEnd < offset || + offset >= size + ) { + return; + } + const end = Math.min(requestedEnd, size - 1); + return { offset, length: end - offset + 1, partial: true }; +}; + +export const fetchSsgPublicAsset = async (path: string, init?: RequestInit) => { + let file; + try { + file = await open(resolvePublicAsset(path), "r"); + } catch (error) { + if ( + typeof error === "object" && + error !== null && + Reflect.get(error, "code") === "ENOENT" + ) { + return new Response("Not found", { status: 404 }); + } + throw error; + } + try { + const { size } = await file.stat(); + const range = getByteRange(new Headers(init?.headers).get("range"), size); + if (range === undefined) { + return new Response("Range not satisfiable", { + status: 416, + headers: { "content-range": `bytes */${size}` }, + }); + } + const body = range.partial + ? await file + .read(new Uint8Array(range.length), 0, range.length, range.offset) + .then(({ buffer, bytesRead }) => buffer.subarray(0, bytesRead)) + : await file.readFile(); + const headers = new Headers({ "content-length": String(body.length) }); + if (range.partial) { + headers.set( + "content-range", + `bytes ${range.offset}-${range.offset + body.length - 1}/${size}` + ); + } + return new Response(Uint8Array.from(body).buffer, { + status: range.partial ? 206 : 200, + headers, + }); + } finally { + await file.close(); + } +}; + +export const createSsgAssetResourceFetch = ({ + deploymentId, + manifest, +}: { + deploymentId: string; + manifest: Parameters[0]["manifest"]; +}) => + createPublishedAssetResourceFetch({ + deploymentId, + manifest, + fetchAsset: fetchSsgPublicAsset, + }); diff --git a/fixtures/ssg-cloudflare-pages/package.json b/fixtures/ssg-cloudflare-pages/package.json index b87cb403bf..51230fb1bc 100644 --- a/fixtures/ssg-cloudflare-pages/package.json +++ b/fixtures/ssg-cloudflare-pages/package.json @@ -42,6 +42,7 @@ "react": "18.3.0-canary-14898b6a9-20240318", "react-dom": "18.3.0-canary-14898b6a9-20240318", "vike": "^0.4.229", - "@webstudio-is/wsauth": "workspace:*" + "@webstudio-is/wsauth": "workspace:*", + "@webstudio-is/asset-resource": "workspace:*" } } diff --git a/fixtures/ssg-cloudflare-pages/pages/another-page/+data.ts b/fixtures/ssg-cloudflare-pages/pages/another-page/+data.ts index 35c8bd18f6..86707ed562 100644 --- a/fixtures/ssg-cloudflare-pages/pages/another-page/+data.ts +++ b/fixtures/ssg-cloudflare-pages/pages/another-page/+data.ts @@ -5,8 +5,22 @@ import { getResources, } from "../../app/__generated__/[another-page]._index.server"; import { assets } from "../../app/__generated__/$resources.assets"; +import { + assetQueryDeploymentId, + assetQueryManifest, +} from "../../app/__generated__/$resources.asset-query-manifest"; +import { createSsgAssetResourceFetch } from "../../app/asset-resource-fetch"; -const customFetch: typeof fetch = (input, init) => { +const fetchAssetResource = createSsgAssetResourceFetch({ + deploymentId: assetQueryDeploymentId, + manifest: assetQueryManifest, +}); + +const customFetch: typeof fetch = async (input, init) => { + const assetResourceResponse = await fetchAssetResource(input, init); + if (assetResourceResponse !== undefined) { + return assetResourceResponse; + } if (typeof input !== "string") { return fetch(input, init); } @@ -26,13 +40,13 @@ const customFetch: typeof fetch = (input, init) => { }; const response = new Response(JSON.stringify(data)); response.headers.set("content-type", "application/json; charset=utf-8"); - return Promise.resolve(response); + return response; } if (isLocalResource(input, "assets")) { const response = new Response(JSON.stringify(assets)); response.headers.set("content-type", "application/json; charset=utf-8"); - return Promise.resolve(response); + return response; } return fetch(input, init); @@ -55,7 +69,8 @@ export const data = async (pageContext: PageContextServer) => { const resources = await loadResources( customFetch, - getResources({ system }).data + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/ssg-cloudflare-pages/pages/index/+data.ts b/fixtures/ssg-cloudflare-pages/pages/index/+data.ts index 8f86daf8a5..2277f7c53a 100644 --- a/fixtures/ssg-cloudflare-pages/pages/index/+data.ts +++ b/fixtures/ssg-cloudflare-pages/pages/index/+data.ts @@ -5,8 +5,22 @@ import { getResources, } from "../../app/__generated__/_index.server"; import { assets } from "../../app/__generated__/$resources.assets"; +import { + assetQueryDeploymentId, + assetQueryManifest, +} from "../../app/__generated__/$resources.asset-query-manifest"; +import { createSsgAssetResourceFetch } from "../../app/asset-resource-fetch"; -const customFetch: typeof fetch = (input, init) => { +const fetchAssetResource = createSsgAssetResourceFetch({ + deploymentId: assetQueryDeploymentId, + manifest: assetQueryManifest, +}); + +const customFetch: typeof fetch = async (input, init) => { + const assetResourceResponse = await fetchAssetResource(input, init); + if (assetResourceResponse !== undefined) { + return assetResourceResponse; + } if (typeof input !== "string") { return fetch(input, init); } @@ -26,13 +40,13 @@ const customFetch: typeof fetch = (input, init) => { }; const response = new Response(JSON.stringify(data)); response.headers.set("content-type", "application/json; charset=utf-8"); - return Promise.resolve(response); + return response; } if (isLocalResource(input, "assets")) { const response = new Response(JSON.stringify(assets)); response.headers.set("content-type", "application/json; charset=utf-8"); - return Promise.resolve(response); + return response; } return fetch(input, init); @@ -55,7 +69,8 @@ export const data = async (pageContext: PageContextServer) => { const resources = await loadResources( customFetch, - getResources({ system }).data + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/ssg-cloudflare-pages/vite.config.ts b/fixtures/ssg-cloudflare-pages/vite.config.ts index 8e2bf4e3d6..83d1624d67 100644 --- a/fixtures/ssg-cloudflare-pages/vite.config.ts +++ b/fixtures/ssg-cloudflare-pages/vite.config.ts @@ -2,14 +2,17 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import vike from "vike/plugin"; +const sourceConditions = + process.env.WEBSTUDIO_LOCAL_CLI_BOOTSTRAPPED === "1" ? ["webstudio"] : []; + export default defineConfig({ plugins: [react(), vike()], resolve: { - conditions: ["browser", "development|production"], + conditions: [...sourceConditions, "browser", "development|production"], }, ssr: { resolve: { - conditions: ["node", "development|production"], + conditions: [...sourceConditions, "node", "development|production"], }, }, }); diff --git a/fixtures/ssg-netlify-by-project-id/app/__generated__/$resources.asset-query-manifest.ts b/fixtures/ssg-netlify-by-project-id/app/__generated__/$resources.asset-query-manifest.ts new file mode 100644 index 0000000000..d89d0845fa --- /dev/null +++ b/fixtures/ssg-netlify-by-project-id/app/__generated__/$resources.asset-query-manifest.ts @@ -0,0 +1,2 @@ +export const assetQueryDeploymentId = "8f0fdff2-e76b-4f86-9203-ea7df5f1143c"; +export const assetQueryManifest = []; diff --git a/fixtures/ssg-netlify-by-project-id/app/__generated__/$resources.asset-query-runtime.ts b/fixtures/ssg-netlify-by-project-id/app/__generated__/$resources.asset-query-runtime.ts new file mode 100644 index 0000000000..df58a6ea19 --- /dev/null +++ b/fixtures/ssg-netlify-by-project-id/app/__generated__/$resources.asset-query-runtime.ts @@ -0,0 +1,7 @@ +export const createGeneratedAssetResourceFetch = async ({ + fallback, +}: { + request: Request; + context: unknown; + fallback: typeof fetch; +}): Promise => fallback; diff --git a/fixtures/ssg-netlify-by-project-id/app/asset-resource-fetch.ts b/fixtures/ssg-netlify-by-project-id/app/asset-resource-fetch.ts new file mode 100644 index 0000000000..c058910b81 --- /dev/null +++ b/fixtures/ssg-netlify-by-project-id/app/asset-resource-fetch.ts @@ -0,0 +1,91 @@ +import { open } from "node:fs/promises"; +import { resolve, sep } from "node:path"; +import { createPublishedAssetResourceFetch } from "@webstudio-is/asset-resource"; + +const resolvePublicAsset = (path: string) => { + const publicDirectory = resolve("public"); + const pathname = new URL(path, "https://webstudio.local").pathname; + const filePath = resolve(publicDirectory, `.${pathname}`); + if (filePath.startsWith(`${publicDirectory}${sep}`) === false) { + throw new Error("Static asset path is outside the public directory"); + } + return filePath; +}; + +const getByteRange = (header: string | null, size: number) => { + if (header?.startsWith("bytes=") !== true) { + return { offset: 0, length: size, partial: false }; + } + const values = header.slice("bytes=".length).split("-"); + const offset = Number(values[0]); + const requestedEnd = Number(values[1]); + if ( + values.length !== 2 || + Number.isSafeInteger(offset) === false || + Number.isSafeInteger(requestedEnd) === false || + offset < 0 || + requestedEnd < offset || + offset >= size + ) { + return; + } + const end = Math.min(requestedEnd, size - 1); + return { offset, length: end - offset + 1, partial: true }; +}; + +export const fetchSsgPublicAsset = async (path: string, init?: RequestInit) => { + let file; + try { + file = await open(resolvePublicAsset(path), "r"); + } catch (error) { + if ( + typeof error === "object" && + error !== null && + Reflect.get(error, "code") === "ENOENT" + ) { + return new Response("Not found", { status: 404 }); + } + throw error; + } + try { + const { size } = await file.stat(); + const range = getByteRange(new Headers(init?.headers).get("range"), size); + if (range === undefined) { + return new Response("Range not satisfiable", { + status: 416, + headers: { "content-range": `bytes */${size}` }, + }); + } + const body = range.partial + ? await file + .read(new Uint8Array(range.length), 0, range.length, range.offset) + .then(({ buffer, bytesRead }) => buffer.subarray(0, bytesRead)) + : await file.readFile(); + const headers = new Headers({ "content-length": String(body.length) }); + if (range.partial) { + headers.set( + "content-range", + `bytes ${range.offset}-${range.offset + body.length - 1}/${size}` + ); + } + return new Response(Uint8Array.from(body).buffer, { + status: range.partial ? 206 : 200, + headers, + }); + } finally { + await file.close(); + } +}; + +export const createSsgAssetResourceFetch = ({ + deploymentId, + manifest, +}: { + deploymentId: string; + manifest: Parameters[0]["manifest"]; +}) => + createPublishedAssetResourceFetch({ + deploymentId, + manifest, + fetchAsset: fetchSsgPublicAsset, + }); diff --git a/fixtures/ssg-netlify-by-project-id/package.json b/fixtures/ssg-netlify-by-project-id/package.json index ea76cd0ba8..a339f7d1ab 100644 --- a/fixtures/ssg-netlify-by-project-id/package.json +++ b/fixtures/ssg-netlify-by-project-id/package.json @@ -42,6 +42,7 @@ "react": "18.3.0-canary-14898b6a9-20240318", "react-dom": "18.3.0-canary-14898b6a9-20240318", "vike": "^0.4.229", - "@webstudio-is/wsauth": "workspace:*" + "@webstudio-is/wsauth": "workspace:*", + "@webstudio-is/asset-resource": "workspace:*" } } diff --git a/fixtures/ssg-netlify-by-project-id/pages/index/+data.ts b/fixtures/ssg-netlify-by-project-id/pages/index/+data.ts index 8f86daf8a5..2277f7c53a 100644 --- a/fixtures/ssg-netlify-by-project-id/pages/index/+data.ts +++ b/fixtures/ssg-netlify-by-project-id/pages/index/+data.ts @@ -5,8 +5,22 @@ import { getResources, } from "../../app/__generated__/_index.server"; import { assets } from "../../app/__generated__/$resources.assets"; +import { + assetQueryDeploymentId, + assetQueryManifest, +} from "../../app/__generated__/$resources.asset-query-manifest"; +import { createSsgAssetResourceFetch } from "../../app/asset-resource-fetch"; -const customFetch: typeof fetch = (input, init) => { +const fetchAssetResource = createSsgAssetResourceFetch({ + deploymentId: assetQueryDeploymentId, + manifest: assetQueryManifest, +}); + +const customFetch: typeof fetch = async (input, init) => { + const assetResourceResponse = await fetchAssetResource(input, init); + if (assetResourceResponse !== undefined) { + return assetResourceResponse; + } if (typeof input !== "string") { return fetch(input, init); } @@ -26,13 +40,13 @@ const customFetch: typeof fetch = (input, init) => { }; const response = new Response(JSON.stringify(data)); response.headers.set("content-type", "application/json; charset=utf-8"); - return Promise.resolve(response); + return response; } if (isLocalResource(input, "assets")) { const response = new Response(JSON.stringify(assets)); response.headers.set("content-type", "application/json; charset=utf-8"); - return Promise.resolve(response); + return response; } return fetch(input, init); @@ -55,7 +69,8 @@ export const data = async (pageContext: PageContextServer) => { const resources = await loadResources( customFetch, - getResources({ system }).data + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/ssg-netlify-by-project-id/pages/redirect/+data.ts b/fixtures/ssg-netlify-by-project-id/pages/redirect/+data.ts index 31c7efd090..2944e6e226 100644 --- a/fixtures/ssg-netlify-by-project-id/pages/redirect/+data.ts +++ b/fixtures/ssg-netlify-by-project-id/pages/redirect/+data.ts @@ -5,8 +5,22 @@ import { getResources, } from "../../app/__generated__/[redirect]._index.server"; import { assets } from "../../app/__generated__/$resources.assets"; +import { + assetQueryDeploymentId, + assetQueryManifest, +} from "../../app/__generated__/$resources.asset-query-manifest"; +import { createSsgAssetResourceFetch } from "../../app/asset-resource-fetch"; -const customFetch: typeof fetch = (input, init) => { +const fetchAssetResource = createSsgAssetResourceFetch({ + deploymentId: assetQueryDeploymentId, + manifest: assetQueryManifest, +}); + +const customFetch: typeof fetch = async (input, init) => { + const assetResourceResponse = await fetchAssetResource(input, init); + if (assetResourceResponse !== undefined) { + return assetResourceResponse; + } if (typeof input !== "string") { return fetch(input, init); } @@ -26,13 +40,13 @@ const customFetch: typeof fetch = (input, init) => { }; const response = new Response(JSON.stringify(data)); response.headers.set("content-type", "application/json; charset=utf-8"); - return Promise.resolve(response); + return response; } if (isLocalResource(input, "assets")) { const response = new Response(JSON.stringify(assets)); response.headers.set("content-type", "application/json; charset=utf-8"); - return Promise.resolve(response); + return response; } return fetch(input, init); @@ -55,7 +69,8 @@ export const data = async (pageContext: PageContextServer) => { const resources = await loadResources( customFetch, - getResources({ system }).data + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/ssg-netlify-by-project-id/vite.config.ts b/fixtures/ssg-netlify-by-project-id/vite.config.ts index 8e2bf4e3d6..83d1624d67 100644 --- a/fixtures/ssg-netlify-by-project-id/vite.config.ts +++ b/fixtures/ssg-netlify-by-project-id/vite.config.ts @@ -2,14 +2,17 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import vike from "vike/plugin"; +const sourceConditions = + process.env.WEBSTUDIO_LOCAL_CLI_BOOTSTRAPPED === "1" ? ["webstudio"] : []; + export default defineConfig({ plugins: [react(), vike()], resolve: { - conditions: ["browser", "development|production"], + conditions: [...sourceConditions, "browser", "development|production"], }, ssr: { resolve: { - conditions: ["node", "development|production"], + conditions: [...sourceConditions, "node", "development|production"], }, }, }); diff --git a/fixtures/webstudio-cloudflare-template/app/__generated__/$resources.asset-query-manifest.ts b/fixtures/webstudio-cloudflare-template/app/__generated__/$resources.asset-query-manifest.ts new file mode 100644 index 0000000000..e486f6d38f --- /dev/null +++ b/fixtures/webstudio-cloudflare-template/app/__generated__/$resources.asset-query-manifest.ts @@ -0,0 +1,2 @@ +export const assetQueryDeploymentId = "a2e8de30-03d5-4514-a3a6-406b3266a3af"; +export const assetQueryManifest = []; diff --git a/fixtures/webstudio-cloudflare-template/app/__generated__/$resources.asset-query-runtime.ts b/fixtures/webstudio-cloudflare-template/app/__generated__/$resources.asset-query-runtime.ts new file mode 100644 index 0000000000..df58a6ea19 --- /dev/null +++ b/fixtures/webstudio-cloudflare-template/app/__generated__/$resources.asset-query-runtime.ts @@ -0,0 +1,7 @@ +export const createGeneratedAssetResourceFetch = async ({ + fallback, +}: { + request: Request; + context: unknown; + fallback: typeof fetch; +}): Promise => fallback; diff --git a/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsx b/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsx index a0ca5169c7..e63c611375 100644 --- a/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsx +++ b/fixtures/webstudio-cloudflare-template/app/routes/[another-page]._index.tsx @@ -46,6 +46,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -123,9 +124,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx index cb5d8b908e..53ecfa89b5 100644 --- a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx +++ b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx @@ -46,6 +46,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -123,9 +124,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-cloudflare-template/package.json b/fixtures/webstudio-cloudflare-template/package.json index f8a39ec1ca..b131567e7f 100644 --- a/fixtures/webstudio-cloudflare-template/package.json +++ b/fixtures/webstudio-cloudflare-template/package.json @@ -46,7 +46,8 @@ "react-dom": "18.3.0-canary-14898b6a9-20240318", "webstudio": "workspace:*", "worktop": "0.8.0-next.18", - "zod": "^4.4.3" + "zod": "^4.4.3", + "@webstudio-is/asset-resource": "workspace:*" }, "devDependencies": { "@cloudflare/workers-types": "^4.20240620.0", diff --git a/fixtures/webstudio-features/.template/package.json b/fixtures/webstudio-features/.template/package.json index fddf1bd5d9..2dd9ca28c3 100644 --- a/fixtures/webstudio-features/.template/package.json +++ b/fixtures/webstudio-features/.template/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "@webstudio-is/asset-resource": "workspace:*", "@webstudio-is/image": "workspace:*", "@webstudio-is/react-sdk": "workspace:*", "@webstudio-is/sdk": "workspace:*", diff --git a/fixtures/webstudio-features/app/__generated__/$resources.asset-query-manifest.ts b/fixtures/webstudio-features/app/__generated__/$resources.asset-query-manifest.ts new file mode 100644 index 0000000000..7400fd8a41 --- /dev/null +++ b/fixtures/webstudio-features/app/__generated__/$resources.asset-query-manifest.ts @@ -0,0 +1,2 @@ +export const assetQueryDeploymentId = "1b66ee06-8ea5-4420-9a0e-e0d3a67aca32"; +export const assetQueryManifest = []; diff --git a/fixtures/webstudio-features/app/__generated__/$resources.asset-query-runtime.ts b/fixtures/webstudio-features/app/__generated__/$resources.asset-query-runtime.ts new file mode 100644 index 0000000000..df58a6ea19 --- /dev/null +++ b/fixtures/webstudio-features/app/__generated__/$resources.asset-query-runtime.ts @@ -0,0 +1,7 @@ +export const createGeneratedAssetResourceFetch = async ({ + fallback, +}: { + request: Request; + context: unknown; + fallback: typeof fetch; +}): Promise => fallback; diff --git a/fixtures/webstudio-features/app/routes/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-features/app/routes/[_route_with_symbols_]._index.tsx index a23fe4a9fa..691c6b21c4 100644 --- a/fixtures/webstudio-features/app/routes/[_route_with_symbols_]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[_route_with_symbols_]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[animations]._index.tsx b/fixtures/webstudio-features/app/routes/[animations]._index.tsx index ac5591b6e9..f4366e95c3 100644 --- a/fixtures/webstudio-features/app/routes/[animations]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[animations]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[assets1]._index.tsx b/fixtures/webstudio-features/app/routes/[assets1]._index.tsx index 357aadb289..c81a9f6d22 100644 --- a/fixtures/webstudio-features/app/routes/[assets1]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[assets1]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[class-names]._index.tsx b/fixtures/webstudio-features/app/routes/[class-names]._index.tsx index b56fc4e83f..c8211d351e 100644 --- a/fixtures/webstudio-features/app/routes/[class-names]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[class-names]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[content-block]._index.tsx b/fixtures/webstudio-features/app/routes/[content-block]._index.tsx index 9888b1b046..f1cb2b20e5 100644 --- a/fixtures/webstudio-features/app/routes/[content-block]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[content-block]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[duration]._index.tsx b/fixtures/webstudio-features/app/routes/[duration]._index.tsx index be87b8ace5..9de93512e6 100644 --- a/fixtures/webstudio-features/app/routes/[duration]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[duration]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[expressions]._index.tsx b/fixtures/webstudio-features/app/routes/[expressions]._index.tsx index e32498f9d7..7222a0fa04 100644 --- a/fixtures/webstudio-features/app/routes/[expressions]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[expressions]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[form]._index.tsx b/fixtures/webstudio-features/app/routes/[form]._index.tsx index 16684fdc4f..a132ca4e7d 100644 --- a/fixtures/webstudio-features/app/routes/[form]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[form]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[head-tag]._index.tsx b/fixtures/webstudio-features/app/routes/[head-tag]._index.tsx index f2c9620fff..c753a0fdca 100644 --- a/fixtures/webstudio-features/app/routes/[head-tag]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[head-tag]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[heading-with-id]._index.tsx b/fixtures/webstudio-features/app/routes/[heading-with-id]._index.tsx index cc76334f28..81a0c7dbad 100644 --- a/fixtures/webstudio-features/app/routes/[heading-with-id]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[heading-with-id]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[nested].[nested-page]._index.tsx b/fixtures/webstudio-features/app/routes/[nested].[nested-page]._index.tsx index e747d8b617..a8188d2991 100644 --- a/fixtures/webstudio-features/app/routes/[nested].[nested-page]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[nested].[nested-page]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[radix]._index.tsx b/fixtures/webstudio-features/app/routes/[radix]._index.tsx index f4070bb89e..76c413ddb7 100644 --- a/fixtures/webstudio-features/app/routes/[radix]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[radix]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[resources]._index.tsx b/fixtures/webstudio-features/app/routes/[resources]._index.tsx index 31d4962a81..323add31b5 100644 --- a/fixtures/webstudio-features/app/routes/[resources]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[resources]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[sitemap.xml]._index.tsx b/fixtures/webstudio-features/app/routes/[sitemap.xml]._index.tsx index 14ef8fba33..5eb53ed83d 100644 --- a/fixtures/webstudio-features/app/routes/[sitemap.xml]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[sitemap.xml]._index.tsx @@ -20,6 +20,7 @@ import { assetBaseUrl, imageLoader } from "../constants.mjs"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -98,9 +99,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/[text-duration]._index.tsx b/fixtures/webstudio-features/app/routes/[text-duration]._index.tsx index d842f7f7d8..a3fbc35393 100644 --- a/fixtures/webstudio-features/app/routes/[text-duration]._index.tsx +++ b/fixtures/webstudio-features/app/routes/[text-duration]._index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/app/routes/_index.tsx b/fixtures/webstudio-features/app/routes/_index.tsx index 867d53e46b..0048674946 100644 --- a/fixtures/webstudio-features/app/routes/_index.tsx +++ b/fixtures/webstudio-features/app/routes/_index.tsx @@ -45,6 +45,7 @@ import css from "../__generated__/index.css?url"; import { sitemap } from "../__generated__/$resources.sitemap.xml"; import { assets } from "../__generated__/$resources.assets"; import { authRoutes } from "../__generated__/$resources.wsauth.server"; +import { createGeneratedAssetResourceFetch } from "../__generated__/$resources.asset-query-runtime"; const authenticateProductionRequest = (request: Request) => { const host = @@ -122,9 +123,15 @@ export const loader = async (arg: LoaderFunctionArgs) => { pathname: url.pathname, }; + const generatedFetch = await createGeneratedAssetResourceFetch({ + request: arg.request, + context: arg.context, + fallback: customFetch, + }); const resources = await loadResources( - customFetch, - getResources({ system }).data + generatedFetch, + getResources({ system }).data, + url ); const pageMeta = getPageMeta({ system, resources }); diff --git a/fixtures/webstudio-features/package.json b/fixtures/webstudio-features/package.json index e9a01b8d78..a0fb4c9bdc 100644 --- a/fixtures/webstudio-features/package.json +++ b/fixtures/webstudio-features/package.json @@ -32,7 +32,8 @@ "vite": "^6.3.4", "webstudio": "workspace:*", "@webstudio-is/wsauth": "workspace:*", - "@react-router/serve": "^7.5.3" + "@react-router/serve": "^7.5.3", + "@webstudio-is/asset-resource": "workspace:*" }, "devDependencies": { "@types/react": "^18.2.70", diff --git a/packages/asset-resource/scripts/benchmark-scale.mjs b/packages/asset-resource/scripts/benchmark-scale.mjs index 4f6a9d6c69..5c9292213b 100644 --- a/packages/asset-resource/scripts/benchmark-scale.mjs +++ b/packages/asset-resource/scripts/benchmark-scale.mjs @@ -79,8 +79,7 @@ const listingQuery = `*[ "slug": properties.slug, excerpt }`; -const detailQuery = - `*[properties.slug == $slug][0]{_id, revision, contentRef, "title": properties.title}`; +const detailQuery = `*[properties.slug == $slug][0]{_id, revision, contentRef, "title": properties.title}`; const buildIndex = (query = listingQuery) => buildAssetResourceIndex({ projectId, resourceId, query, entries }); @@ -173,10 +172,12 @@ const detailAndHydration = await measure(50, async () => { if (file === undefined) { throw new Error("Scale fixture content is missing"); } - const bytes = encoder.encode(file.source).subarray( - range?.offset ?? 0, - range === undefined ? undefined : range.offset + range.length - ); + const bytes = encoder + .encode(file.source) + .subarray( + range?.offset ?? 0, + range === undefined ? undefined : range.offset + range.length + ); return { data: { async *[Symbol.asyncIterator]() { @@ -189,7 +190,9 @@ const detailAndHydration = await measure(50, async () => { }); const workerBundle = await bundle({ - entryPoints: [new URL("../src/published-runtime.ts", import.meta.url).pathname], + entryPoints: [ + new URL("../src/published-runtime.ts", import.meta.url).pathname, + ], bundle: true, format: "esm", minify: true, diff --git a/packages/asset-resource/src/candidate-selection.test.ts b/packages/asset-resource/src/candidate-selection.test.ts index aad992ec9c..7457c1fafb 100644 --- a/packages/asset-resource/src/candidate-selection.test.ts +++ b/packages/asset-resource/src/candidate-selection.test.ts @@ -68,9 +68,7 @@ describe("asset resource candidate selection", () => { test("does not split a parameter-dependent disjunction", async () => { const selection = await selectAssetResourceCandidates({ - tree: parse( - `*[properties.locale == "en" || properties.slug == $slug]` - ), + tree: parse(`*[properties.locale == "en" || properties.slug == $slug]`), documents, }); diff --git a/packages/cli/templates/internal/package.json b/packages/cli/templates/internal/package.json index 0647aeb838..853f67d9c1 100644 --- a/packages/cli/templates/internal/package.json +++ b/packages/cli/templates/internal/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "@webstudio-is/asset-resource": "workspace:*", "@webstudio-is/image": "workspace:*", "@webstudio-is/react-sdk": "workspace:*", "@webstudio-is/sdk": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 43d89e9a29..93c1a4ee9e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -528,6 +528,9 @@ importers: '@react-router/serve': specifier: ^7.5.3 version: 7.5.3(react-router@7.5.3(react-dom@18.3.0-canary-14898b6a9-20240318(react@18.3.0-canary-14898b6a9-20240318))(react@18.3.0-canary-14898b6a9-20240318))(typescript@7.0.2) + '@webstudio-is/asset-resource': + specifier: workspace:* + version: link:../../packages/asset-resource '@webstudio-is/image': specifier: workspace:* version: link:../../packages/image @@ -598,6 +601,9 @@ importers: '@react-router/serve': specifier: ^7.5.3 version: 7.5.3(react-router@7.5.3(react-dom@18.3.0-canary-14898b6a9-20240318(react@18.3.0-canary-14898b6a9-20240318))(react@18.3.0-canary-14898b6a9-20240318))(typescript@7.0.2) + '@webstudio-is/asset-resource': + specifier: workspace:* + version: link:../../packages/asset-resource '@webstudio-is/image': specifier: workspace:* version: link:../../packages/image @@ -674,6 +680,9 @@ importers: '@react-router/serve': specifier: ^7.5.3 version: 7.5.3(react-router@7.5.3(react-dom@18.3.0-canary-14898b6a9-20240318(react@18.3.0-canary-14898b6a9-20240318))(react@18.3.0-canary-14898b6a9-20240318))(typescript@7.0.2) + '@webstudio-is/asset-resource': + specifier: workspace:* + version: link:../../packages/asset-resource '@webstudio-is/image': specifier: workspace:* version: link:../../packages/image @@ -744,6 +753,9 @@ importers: '@vercel/react-router': specifier: ^1.1.0 version: 1.1.0(@react-router/dev@7.5.3(@react-router/serve@7.5.3(react-router@7.5.3(react-dom@18.3.0-canary-14898b6a9-20240318(react@18.3.0-canary-14898b6a9-20240318))(react@18.3.0-canary-14898b6a9-20240318))(typescript@7.0.2))(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.31.1)(react-router@7.5.3(react-dom@18.3.0-canary-14898b6a9-20240318(react@18.3.0-canary-14898b6a9-20240318))(react@18.3.0-canary-14898b6a9-20240318))(tsx@4.19.3)(typescript@7.0.2)(vite@6.3.4(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.31.1)(tsx@4.19.3)(yaml@2.9.0))(wrangler@4.14.1)(yaml@2.9.0))(@react-router/node@7.5.3(react-router@7.5.3(react-dom@18.3.0-canary-14898b6a9-20240318(react@18.3.0-canary-14898b6a9-20240318))(react@18.3.0-canary-14898b6a9-20240318))(typescript@7.0.2))(isbot@5.1.25)(react-dom@18.3.0-canary-14898b6a9-20240318(react@18.3.0-canary-14898b6a9-20240318))(react@18.3.0-canary-14898b6a9-20240318) + '@webstudio-is/asset-resource': + specifier: workspace:* + version: link:../../packages/asset-resource '@webstudio-is/image': specifier: workspace:* version: link:../../packages/image @@ -799,6 +811,9 @@ importers: fixtures/ssg-cloudflare-pages: dependencies: + '@webstudio-is/asset-resource': + specifier: workspace:* + version: link:../../packages/asset-resource '@webstudio-is/image': specifier: workspace:* version: link:../../packages/image @@ -854,6 +869,9 @@ importers: fixtures/ssg-netlify-by-project-id: dependencies: + '@webstudio-is/asset-resource': + specifier: workspace:* + version: link:../../packages/asset-resource '@webstudio-is/image': specifier: workspace:* version: link:../../packages/image @@ -924,6 +942,9 @@ importers: '@remix-run/server-runtime': specifier: 2.16.5 version: 2.16.5(typescript@7.0.2) + '@webstudio-is/asset-resource': + specifier: workspace:* + version: link:../../packages/asset-resource '@webstudio-is/image': specifier: workspace:* version: link:../../packages/image @@ -1009,6 +1030,9 @@ importers: '@react-router/serve': specifier: ^7.5.3 version: 7.5.3(react-router@7.5.3(react-dom@18.3.0-canary-14898b6a9-20240318(react@18.3.0-canary-14898b6a9-20240318))(react@18.3.0-canary-14898b6a9-20240318))(typescript@7.0.2) + '@webstudio-is/asset-resource': + specifier: workspace:* + version: link:../../packages/asset-resource '@webstudio-is/image': specifier: workspace:* version: link:../../packages/image