Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
refactor: move social asset into page meta (#3764)
Bogdan Chadkin4977e82031c8
diff --git a/fixtures/webstudio-cloudflare-template/app/__generated__/_index.server.tsx b/fixtures/webstudio-cloudflare-template/app/__generated__/_index.server.tsxindex 70fd9e49dd..38333a7aa9 100644--- a/fixtures/webstudio-cloudflare-template/app/__generated__/_index.server.tsx+++ b/fixtures/webstudio-cloudflare-template/app/__generated__/_index.server.tsx@@ -19,7 +19,7 @@ export const getPageMeta = ({description: undefined,excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-cloudflare-template/app/__generated__/_index.tsx b/fixtures/webstudio-cloudflare-template/app/__generated__/_index.tsxindex 7952994eda..f8d7aae4e1 100644--- a/fixtures/webstudio-cloudflare-template/app/__generated__/_index.tsx+++ b/fixtures/webstudio-cloudflare-template/app/__generated__/_index.tsx@@ -14,8 +14,6 @@ export const siteName = "";export const favIconAsset: ImageAsset | undefined = undefined;-export const socialImageAsset: ImageAsset | undefined = undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsxindex 103d1f31a3..ea8c7443e6 100644--- a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx+++ b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/_index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.server.tsx b/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.server.tsxindex f8f2d700f1..a87bc29fd2 100644--- a/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.server.tsx+++ b/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.server.tsx@@ -19,7 +19,7 @@ export const getPageMeta = ({description: "",excludePageFromSearch: false,language: undefined,- socialImageAssetId: "",+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsx b/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsxindex 8badc8e422..f9ba511f01 100644--- a/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsx+++ b/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsx@@ -27,8 +27,6 @@ export const favIconAsset: ImageAsset | undefined = {meta: { width: 16, height: 16 },};-export const socialImageAsset: ImageAsset | undefined = undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-custom-template/app/__generated__/[sitemap.xml]._index.server.tsx b/fixtures/webstudio-custom-template/app/__generated__/[sitemap.xml]._index.server.tsxindex 31e4f0b8a4..e718bfb1de 100644--- a/fixtures/webstudio-custom-template/app/__generated__/[sitemap.xml]._index.server.tsx+++ b/fixtures/webstudio-custom-template/app/__generated__/[sitemap.xml]._index.server.tsx@@ -45,7 +45,7 @@ export const getPageMeta = ({description: "",excludePageFromSearch: false,language: "",- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: "",status: 200,redirect: "",diff --git a/fixtures/webstudio-custom-template/app/__generated__/[sitemap.xml]._index.tsx b/fixtures/webstudio-custom-template/app/__generated__/[sitemap.xml]._index.tsxindex caf94e2bbf..c372f7c724 100644--- a/fixtures/webstudio-custom-template/app/__generated__/[sitemap.xml]._index.tsx+++ b/fixtures/webstudio-custom-template/app/__generated__/[sitemap.xml]._index.tsx@@ -20,8 +20,6 @@ export const favIconAsset: ImageAsset | undefined = {meta: { width: 16, height: 16 },};-export const socialImageAsset: ImageAsset | undefined = undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-custom-template/app/__generated__/[world]._index.server.tsx b/fixtures/webstudio-custom-template/app/__generated__/[world]._index.server.tsxindex 2c9793258f..a193777283 100644--- a/fixtures/webstudio-custom-template/app/__generated__/[world]._index.server.tsx+++ b/fixtures/webstudio-custom-template/app/__generated__/[world]._index.server.tsx@@ -19,7 +19,7 @@ export const getPageMeta = ({description: "",excludePageFromSearch: false,language: "ru",- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: "",status: 200,redirect: "",diff --git a/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsx b/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsxindex 673b0c5120..1bd78eb979 100644--- a/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsx+++ b/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsx@@ -21,8 +21,6 @@ export const favIconAsset: ImageAsset | undefined = {meta: { width: 16, height: 16 },};-export const socialImageAsset: ImageAsset | undefined = undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-custom-template/app/__generated__/_index.server.tsx b/fixtures/webstudio-custom-template/app/__generated__/_index.server.tsxindex 70de49cb3b..013ccb1c9b 100644--- a/fixtures/webstudio-custom-template/app/__generated__/_index.server.tsx+++ b/fixtures/webstudio-custom-template/app/__generated__/_index.server.tsx@@ -19,7 +19,8 @@ export const getPageMeta = ({description: "Page description f511c297-b44f-4e4b-96bd-d013da06bada",excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: "ff546bd2-9bb1-4717-a180-1a1fc05565dd",+ socialImageAssetName:+ "_937084ed-a798-49fe-8664-df93a2af605e_1JqSy_0Wy9fY5mXNZSLJ0.jpeg",socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-custom-template/app/__generated__/_index.tsx b/fixtures/webstudio-custom-template/app/__generated__/_index.tsxindex 67c755a845..d2b66726a4 100644--- a/fixtures/webstudio-custom-template/app/__generated__/_index.tsx+++ b/fixtures/webstudio-custom-template/app/__generated__/_index.tsx@@ -33,18 +33,6 @@ export const favIconAsset: ImageAsset | undefined = {meta: { width: 16, height: 16 },};-export const socialImageAsset: ImageAsset | undefined = {- id: "ff546bd2-9bb1-4717-a180-1a1fc05565dd",- name: "_937084ed-a798-49fe-8664-df93a2af605e_1JqSy_0Wy9fY5mXNZSLJ0.jpeg",- description: null,- projectId: "0d856812-61d8-4014-a20a-82e01c0eb8ee",- size: 210614,- type: "image",- format: "jpg",- createdAt: "2024-03-26T18:31:04.086Z",- meta: { width: 1024, height: 1024 },-};-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [{diff --git a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsxindex 05fc14993b..270e61a673 100644--- a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx+++ b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/[script-test]._index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsxindex 6c053d42bd..e191181261 100644--- a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx+++ b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/[world]._index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-custom-template/app/routes/_index.tsx b/fixtures/webstudio-custom-template/app/routes/_index.tsxindex 103d1f31a3..ea8c7443e6 100644--- a/fixtures/webstudio-custom-template/app/routes/_index.tsx+++ b/fixtures/webstudio-custom-template/app/routes/_index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/_index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.server.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.server.tsxindex 70fd9e49dd..38333a7aa9 100644--- a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.server.tsx+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.server.tsx@@ -19,7 +19,7 @@ export const getPageMeta = ({description: undefined,excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsxindex 7952994eda..f8d7aae4e1 100644--- a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx@@ -14,8 +14,6 @@ export const siteName = "";export const favIconAsset: ImageAsset | undefined = undefined;-export const socialImageAsset: ImageAsset | undefined = undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsxindex 103d1f31a3..ea8c7443e6 100644--- a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/_index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.server.tsx b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.server.tsxindex 70fd9e49dd..38333a7aa9 100644--- a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.server.tsx+++ b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.server.tsx@@ -19,7 +19,7 @@ export const getPageMeta = ({description: undefined,excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsxindex 7952994eda..f8d7aae4e1 100644--- a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx+++ b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx@@ -14,8 +14,6 @@ export const siteName = "";export const favIconAsset: ImageAsset | undefined = undefined;-export const socialImageAsset: ImageAsset | undefined = undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsxindex 103d1f31a3..ea8c7443e6 100644--- a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx+++ b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/_index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.server.tsxindex 05f49bc58e..5a67dcfe3f 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.server.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.server.tsx@@ -19,7 +19,7 @@ export const getPageMeta = ({description: "",excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsxindex 4774f4af74..713e384dcc 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsx@@ -21,8 +21,6 @@ export const favIconAsset: ImageAsset | undefined = {meta: { width: 790, height: 786 },};-export const socialImageAsset: ImageAsset | undefined = undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.server.tsxindex 8639701a32..792b640473 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.server.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.server.tsx@@ -19,7 +19,7 @@ export const getPageMeta = ({description: "",excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsxindex c094a84f06..81714a7409 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx@@ -30,8 +30,6 @@ export const favIconAsset: ImageAsset | undefined = {meta: { width: 790, height: 786 },};-export const socialImageAsset: ImageAsset | undefined = undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.server.tsxindex 5dcc54b264..53c83f3bae 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.server.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.server.tsx@@ -19,7 +19,7 @@ export const getPageMeta = ({description: "",excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsxindex 1484f8e1a1..4519fdb85a 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsx@@ -21,8 +21,6 @@ export const favIconAsset: ImageAsset | undefined = {meta: { width: 790, height: 786 },};-export const socialImageAsset: ImageAsset | undefined = undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.server.tsxindex 81aba09dff..07df7a9ec3 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.server.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.server.tsx@@ -19,7 +19,7 @@ export const getPageMeta = ({description: "",excludePageFromSearch: false,language: undefined,- socialImageAssetId: "",+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsxindex d551eb77c4..d1f42fe479 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsx@@ -21,8 +21,6 @@ export const favIconAsset: ImageAsset | undefined = {meta: { width: 790, height: 786 },};-export const socialImageAsset: ImageAsset | undefined = undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.server.tsxindex b3b3ab75ff..c7bf405086 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.server.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.server.tsx@@ -20,7 +20,8 @@ export const getPageMeta = ({"Delve deep into the radix roots of feline behaviors. At KittyNoTouchy, we dissect the core essence, or 'radix', of what makes cats the enigmatic creatures they are. Join us as we explore the radix of their instincts, habits, and quirks.",excludePageFromSearch: true,language: undefined,- socialImageAssetId: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",+ socialImageAssetName:+ "DALL_E_2023-10-30_12.39.46_-_Photo_logo_with_a_bold_cat_silhouette_centered_on_a_contrasting_background_designed_for_clarity_at_small_32x32_favicon_resolution_00h6cEA8u2pJRvVJv7hRe.png",socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsxindex 81d362dcdf..a275e329aa 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx@@ -32,18 +32,6 @@ export const favIconAsset: ImageAsset | undefined = {meta: { width: 790, height: 786 },};-export const socialImageAsset: ImageAsset | undefined = {- id: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",- name: "DALL_E_2023-10-30_12.39.46_-_Photo_logo_with_a_bold_cat_silhouette_centered_on_a_contrasting_background_designed_for_clarity_at_small_32x32_favicon_resolution_00h6cEA8u2pJRvVJv7hRe.png",- description: null,- projectId: "cddc1d44-af37-4cb6-a430-d300cf6f932d",- size: 268326,- type: "image",- format: "png",- createdAt: "2023-10-30T13:51:08.416Z",- meta: { width: 790, height: 786 },-};-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.server.tsxindex 5fdc4dfb18..5a710194bf 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.server.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.server.tsx@@ -45,7 +45,7 @@ export const getPageMeta = ({description: "",excludePageFromSearch: false,language: undefined,- socialImageAssetId: "",+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsxindex b5970009ed..7110813931 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsx@@ -24,8 +24,6 @@ export const favIconAsset: ImageAsset | undefined = {meta: { width: 790, height: 786 },};-export const socialImageAsset: ImageAsset | undefined = undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/_index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/_index.server.tsxindex 3348742d7a..138d41df94 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/_index.server.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/_index.server.tsx@@ -20,7 +20,8 @@ export const getPageMeta = ({"Dive into the world of felines and discover why some whiskers are best left untouched. From intriguing cat behaviors to protective measures, \nKittyGuardedZone is your go-to hub for all things 'hands-off' in the cat realm.",excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: "cd939c56-bcdd-4e64-bd9c-567a9bccd3da",+ socialImageAssetName:+ "_937084ed-a798-49fe-8664-df93a2af605e_uiBk3o6UWdqolyakMvQJ9.jpeg",socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsxindex e7ac20b7de..e76ad9d2b3 100644--- a/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx+++ b/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx@@ -30,18 +30,6 @@ export const favIconAsset: ImageAsset | undefined = {meta: { width: 790, height: 786 },};-export const socialImageAsset: ImageAsset | undefined = {- id: "cd939c56-bcdd-4e64-bd9c-567a9bccd3da",- name: "_937084ed-a798-49fe-8664-df93a2af605e_uiBk3o6UWdqolyakMvQJ9.jpeg",- description: null,- projectId: "cddc1d44-af37-4cb6-a430-d300cf6f932d",- size: 210614,- type: "image",- format: "jpeg",- createdAt: "2023-09-06T11:28:43.031Z",- meta: { width: 1024, height: 1024 },-};-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] = [];diff --git a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsxindex aa56e62e4f..0172e0534d 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/[_route_with_symbols_]._index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsxindex 661f95ab10..b58046d4f3 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/[form]._index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsxindex 7afa37f72c..d91b50ccbc 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/[heading-with-id]._index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsxindex eadcb7f4a0..426b367a98 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/[nested].[nested-page]._index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsxindex 92ec6a4cfe..7b891cbe64 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/[radix]._index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsxindex e660712c2e..1c09cd463b 100644--- a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/[resources]._index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx b/fixtures/webstudio-remix-vercel/app/routes/_index.tsxindex 103d1f31a3..ea8c7443e6 100644--- a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx+++ b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "../__generated__/_index";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/packages/cli/src/prebuild.ts b/packages/cli/src/prebuild.tsindex 6c623d7470..cd7d83a170 100644--- a/packages/cli/src/prebuild.ts+++ b/packages/cli/src/prebuild.ts@@ -590,9 +590,7 @@ export const prebuild = async (options: {const contactEmail: undefined | string =// fallback to user email when contact email is empty stringprojectMeta?.contactEmail || siteData.user?.email || undefined;- const pageMeta = pageData.page.meta;const favIconAsset = assets.get(projectMeta?.faviconAssetId ?? "");- const socialImageAsset = assets.get(pageMeta.socialImageAssetId ?? "");const pagePath = getPagePath(pageData.page.id, siteData.build.pages);@@ -610,9 +608,6 @@ export const prebuild = async (options: {export const favIconAsset: ImageAsset | undefined =${JSON.stringify(favIconAsset)};- export const socialImageAsset: ImageAsset | undefined =- ${JSON.stringify(socialImageAsset)};-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[] =${JSON.stringify(pageFontAssets)}@@ -673,6 +668,7 @@ export const prebuild = async (options: {globalScope: scope,page: pageData.page,dataSources,+ assets,})}${generateFormsProperties(props)}diff --git a/packages/cli/templates/defaults/app/route-templates/html.tsx b/packages/cli/templates/defaults/app/route-templates/html.tsxindex 2d7dab2fc2..f9fcd888dc 100644--- a/packages/cli/templates/defaults/app/route-templates/html.tsx+++ b/packages/cli/templates/defaults/app/route-templates/html.tsx@@ -20,7 +20,6 @@ import {Page,siteName,favIconAsset,- socialImageAsset,pageFontAssets,pageBackgroundImageAssets,} from "__CLIENT__";@@ -152,11 +151,11 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {});}- if (socialImageAsset) {+ if (pageMeta.socialImageAssetName) {metas.push({property: "og:image",content: `https://${data.host}${imageLoader({- src: socialImageAsset.name,+ src: pageMeta.socialImageAssetName,// Do not transform social image (not enough information do we need to do this)format: "raw",})}`,diff --git a/packages/react-sdk/placeholder.d.ts b/packages/react-sdk/placeholder.d.tsindex 6c06e11342..3cd2b9a264 100644--- a/packages/react-sdk/placeholder.d.ts+++ b/packages/react-sdk/placeholder.d.ts@@ -5,8 +5,6 @@ declare module "__CLIENT__" {export const favIconAsset: ImageAsset | undefined;- export const socialImageAsset: ImageAsset | undefined;-// Font assets on current page (can be preloaded)export const pageFontAssets: FontAsset[];diff --git a/packages/sdk/src/page-meta-generator.test.ts b/packages/sdk/src/page-meta-generator.test.tsindex 018d4a02f4..9436a6ee32 100644--- a/packages/sdk/src/page-meta-generator.test.ts+++ b/packages/sdk/src/page-meta-generator.test.ts@@ -1,6 +1,7 @@import { expect, test } from "@jest/globals";import { createScope } from "./scope";import { generatePageMeta } from "./page-meta-generator";+import type { Asset } from "./schema/assets";const toMap = <T extends { id: string }>(list: T[]) =>new Map(list.map((item) => [item.id, item] as const));@@ -19,6 +20,7 @@ test("generate minimal static page meta factory", () => {meta: {},},dataSources: new Map(),+ assets: new Map(),})).toMatchInlineSnapshot(`"export const getPageMeta = ({@@ -33,7 +35,7 @@ test("generate minimal static page meta factory", () => {description: undefined,excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,@@ -60,7 +62,7 @@ test("generate complete static page meta factory", () => {description: `"Page description"`,excludePageFromSearch: "true",language: `"en-US"`,- socialImageAssetId: "social-image-name",+ socialImageAssetId: "social-image-id",status: `302`,redirect: `"/new-path"`,custom: [@@ -70,6 +72,22 @@ test("generate complete static page meta factory", () => {},},dataSources: new Map(),+ assets: new Map([+ [+ "social-image-id",+ {+ id: "social-image-id",+ type: "image",+ format: "",+ projectId: "",+ size: 0,+ name: "social-image-name",+ description: null,+ createdAt: "",+ meta: { width: 0, height: 0 },+ } satisfies Asset,+ ],+ ]),})).toMatchInlineSnapshot(`"export const getPageMeta = ({@@ -84,7 +102,7 @@ test("generate complete static page meta factory", () => {description: "Page description",excludePageFromSearch: true,language: "en-US",- socialImageAssetId: "social-image-name",+ socialImageAssetName: "social-image-name",socialImageUrl: undefined,status: 302,redirect: "/new-path",@@ -120,6 +138,7 @@ test("generate asset url instead of id", () => {},},dataSources: new Map(),+ assets: new Map(),})).toMatchInlineSnapshot(`"export const getPageMeta = ({@@ -134,7 +153,7 @@ test("generate asset url instead of id", () => {description: undefined,excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: "https://my-image",status: undefined,redirect: undefined,@@ -165,6 +184,7 @@ test("generate custom meta ignoring empty property name", () => {},},dataSources: new Map(),+ assets: new Map(),})).toMatchInlineSnapshot(`"export const getPageMeta = ({@@ -179,7 +199,7 @@ test("generate custom meta ignoring empty property name", () => {description: undefined,excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,@@ -217,6 +237,7 @@ test("generate page meta factory with variables", () => {value: { type: "string", value: "" },},]),+ assets: new Map(),})).toMatchInlineSnapshot(`"export const getPageMeta = ({@@ -232,7 +253,7 @@ test("generate page meta factory with variables", () => {description: undefined,excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,@@ -265,6 +286,7 @@ test("generate page meta factory with system", () => {type: "parameter",},]),+ assets: new Map(),})).toMatchInlineSnapshot(`"export const getPageMeta = ({@@ -280,7 +302,7 @@ test("generate page meta factory with system", () => {description: undefined,excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,@@ -314,6 +336,7 @@ test("generate page meta factory with resources", () => {resourceId: "resourceId",},]),+ assets: new Map(),})).toMatchInlineSnapshot(`"export const getPageMeta = ({@@ -329,7 +352,7 @@ test("generate page meta factory with resources", () => {description: undefined,excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,@@ -383,6 +406,7 @@ test("generate page meta factory without unused variables", () => {resourceId: "resourceId",},]),+ assets: new Map(),})).toMatchInlineSnapshot(`"export const getPageMeta = ({@@ -398,7 +422,7 @@ test("generate page meta factory without unused variables", () => {description: undefined,excludePageFromSearch: undefined,language: undefined,- socialImageAssetId: undefined,+ socialImageAssetName: undefined,socialImageUrl: undefined,status: undefined,redirect: undefined,diff --git a/packages/sdk/src/page-meta-generator.ts b/packages/sdk/src/page-meta-generator.tsindex c1593c9897..b7e3c44e91 100644--- a/packages/sdk/src/page-meta-generator.ts+++ b/packages/sdk/src/page-meta-generator.ts@@ -1,4 +1,4 @@-import type { Asset } from "./schema/assets";+import type { Asset, Assets } from "./schema/assets";import type { DataSources } from "./schema/data-sources";import type { Page } from "./schema/pages";import { type Scope, createScope } from "./scope";@@ -9,7 +9,7 @@ export type PageMeta = {description?: string;excludePageFromSearch?: boolean;language?: string;- socialImageAssetId?: Asset["id"];+ socialImageAssetName?: Asset["name"];socialImageUrl?: string;status?: number;redirect?: string;@@ -20,10 +20,12 @@ export const generatePageMeta = ({globalScope,page,dataSources,+ assets,}: {globalScope: Scope;page: Page;dataSources: DataSources;+ assets: Assets;}) => {// reserve parameter names passed to generated functionconst localScope = createScope(["system", "resources"]);@@ -52,8 +54,10 @@ export const generatePageMeta = ({usedDataSources,scope: localScope,});- const socialImageAssetIdExpression = JSON.stringify(+ const socialImageAssetNameExpression = JSON.stringify(page.meta.socialImageAssetId+ ? assets.get(page.meta.socialImageAssetId)?.name+ : undefined);const socialImageUrlExpression = generateExpression({expression: page.meta.socialImageUrl ?? "undefined",@@ -130,7 +134,7 @@ export const generatePageMeta = ({generated += ` description: ${descriptionExpression},\n`;generated += ` excludePageFromSearch: ${excludePageFromSearchExpression},\n`;generated += ` language: ${languageExpression},\n`;- generated += ` socialImageAssetId: ${socialImageAssetIdExpression},\n`;+ generated += ` socialImageAssetName: ${socialImageAssetNameExpression},\n`;generated += ` socialImageUrl: ${socialImageUrlExpression},\n`;generated += ` status: ${statusExpression},\n`;generated += ` redirect: ${redirectExpression},\n`;