Skip to content

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.

perf: drop internal data from generated sites (#2362)

Bogdan Chadkin5482ec414a0a
diff --git a/apps/builder/app/canvas/canvas.tsx b/apps/builder/app/canvas/canvas.tsx
index 22fe7e66ef..4506d347aa 100644
--- a/apps/builder/app/canvas/canvas.tsx
+++ b/apps/builder/app/canvas/canvas.tsx
@@ -7,7 +7,6 @@ import {
type Params,
type Components,
createElementsTree,
- getIndexesWithinAncestors,
normalizeProps,
getPropsByInstanceId,
} from "@webstudio-is/react-sdk";
@@ -42,9 +41,7 @@ import {
selectedPageStore,
registerComponentLibrary,
registeredComponentsStore,
- registeredComponentMetasStore,
subscribeComponentHooks,
- dataSourcesLogicStore,
propsStore,
$isPreviewMode,
} from "~/shared/nano-states";
@@ -68,7 +65,6 @@ const useElementsTree = (
params: Params,
imageLoader: ImageLoader
) => {
- const metas = useStore(registeredComponentMetasStore);
const page = useStore(selectedPageStore);
const isPreviewMode = useStore($isPreviewMode);
const rootInstanceId = page?.rootInstanceId ?? "";
@@ -96,14 +92,6 @@ const useElementsTree = (
[]
);
- const indexesWithinAncestors = useMemo(() => {
- return getIndexesWithinAncestors(
- metas,
- instances,
- page ? [page.rootInstanceId] : []
- );
- }, [metas, instances, page]);
-
const propsByInstanceIdStore = useMemo(() => {
return computed(
[propsStore, assetsStore, pagesMapStore],
@@ -134,10 +122,6 @@ const useElementsTree = (
imageLoader,
instances,
rootInstanceId,
- indexesWithinAncestors,
- propsByInstanceIdStore,
- assetsStore,
- dataSourcesLogicStore,
Component: isPreviewMode
? WebstudioComponentPreview
: WebstudioComponentCanvas,
@@ -158,7 +142,6 @@ const useElementsTree = (
components,
propsByInstanceIdStore,
isPreviewMode,
- indexesWithinAncestors,
imageLoader,
]);
};
diff --git a/fixtures/webstudio-custom-template/app/__generated__/_index.tsx b/fixtures/webstudio-custom-template/app/__generated__/_index.tsx
index 8db402b7a1..edc30d03ea 100644
--- a/fixtures/webstudio-custom-template/app/__generated__/_index.tsx
+++ b/fixtures/webstudio-custom-template/app/__generated__/_index.tsx
@@ -11,19 +11,6 @@ import {
export const fontAssets: Asset[] = [];
export const pageData: PageData = {
- build: { props: [] },
- pages: [
- {
- id: "nfzls_SkTc9jKYyxcZ8Lw",
- name: "Home",
- title: "Home",
- meta: {
- description: "Page description f511c297-b44f-4e4b-96bd-d013da06bada",
- },
- rootInstanceId: "ibXgMoi9_ipHx1gVrvii0",
- path: "",
- },
- ],
page: {
id: "nfzls_SkTc9jKYyxcZ8Lw",
name: "Home",
@@ -34,7 +21,6 @@ export const pageData: PageData = {
rootInstanceId: "ibXgMoi9_ipHx1gVrvii0",
path: "",
},
- assets: [],
};
export const user: { email: string | null } | undefined = {
diff --git a/fixtures/webstudio-custom-template/app/routes/_index.tsx b/fixtures/webstudio-custom-template/app/routes/_index.tsx
index 208ca1cd85..29e9cc7e27 100644
--- a/fixtures/webstudio-custom-template/app/routes/_index.tsx
+++ b/fixtures/webstudio-custom-template/app/routes/_index.tsx
@@ -6,8 +6,8 @@ import {
type ActionArgs,
json,
} from "@remix-run/server-runtime";
-import { atom } from "nanostores";
-import { ReactSdkContext, getPropsByInstanceId } from "@webstudio-is/react-sdk";
+import type { Page as PageType } from "@webstudio-is/sdk";
+import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import { Scripts, ScrollRestoration } from "@remix-run/react";
import {
@@ -20,11 +20,10 @@ import {
Page,
} from "../__generated__/_index.tsx";
import css from "../__generated__/index.css";
-import type { Data } from "@webstudio-is/http-client";
import { assetBaseUrl, imageBaseUrl, imageLoader } from "~/constants.mjs";
-export type PageData = Omit<Data, "build"> & {
- build: Pick<Data["build"], "props">;
+export type PageData = {
+ page: PageType;
};
export const meta: V2_ServerRuntimeMetaFunction = () => {
@@ -155,29 +154,13 @@ export const action = async ({ request, context }: ActionArgs) => {
};
const Outlet = () => {
- const page = pageData.page;
-
- if (page === undefined) {
- throw json("Page not found", {
- status: 404,
- });
- }
-
return (
<ReactSdkContext.Provider
value={{
- propsByInstanceIdStore: atom(
- getPropsByInstanceId(new Map(pageData.build.props))
- ),
- assetsStore: atom(
- new Map(pageData.assets.map((asset) => [asset.id, asset]))
- ),
- dataSourcesLogicStore: atom(new Map()),
imageLoader,
assetBaseUrl,
imageBaseUrl,
pagesPaths,
- indexesWithinAncestors: new Map(),
}}
>
<Page
diff --git a/fixtures/webstudio-custom-template/package.json b/fixtures/webstudio-custom-template/package.json
index a707588a69..ccc166baf8 100644
--- a/fixtures/webstudio-custom-template/package.json
+++ b/fixtures/webstudio-custom-template/package.json
@@ -35,7 +35,6 @@
"@remix-run/dev": "^1.19.2",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/http-client": "workspace:*",
"typescript": "5.2.2",
"webstudio-cli": "workspace:*"
},
diff --git a/fixtures/webstudio-custom-template/remix.config.js b/fixtures/webstudio-custom-template/remix.config.js
index 1499566045..27ccfeb986 100644
--- a/fixtures/webstudio-custom-template/remix.config.js
+++ b/fixtures/webstudio-custom-template/remix.config.js
@@ -5,8 +5,6 @@ module.exports = {
serverDependenciesToBundle: [
/@webstudio-is\//,
"nanoid",
- "nanostores",
- "@nanostores/react",
"@jsep-plugin/assignment",
],
future: {
diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx
index e4d1286da2..35585adaa7 100644
--- a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx
+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx
@@ -12,17 +12,6 @@ import {
export const fontAssets: Asset[] = [];
export const pageData: PageData = {
- build: { props: [] },
- pages: [
- {
- id: "9di_L14CzctvSruIoKVvE",
- name: "Home",
- title: "Home",
- meta: {},
- rootInstanceId: "MMimeobf_zi4ZkRGXapju",
- path: "",
- },
- ],
page: {
id: "9di_L14CzctvSruIoKVvE",
name: "Home",
@@ -31,7 +20,6 @@ export const pageData: PageData = {
rootInstanceId: "MMimeobf_zi4ZkRGXapju",
path: "",
},
- assets: [],
};
export const user: { email: string | null } | undefined = {
diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx
index 208ca1cd85..29e9cc7e27 100644
--- a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx
+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx
@@ -6,8 +6,8 @@ import {
type ActionArgs,
json,
} from "@remix-run/server-runtime";
-import { atom } from "nanostores";
-import { ReactSdkContext, getPropsByInstanceId } from "@webstudio-is/react-sdk";
+import type { Page as PageType } from "@webstudio-is/sdk";
+import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import { Scripts, ScrollRestoration } from "@remix-run/react";
import {
@@ -20,11 +20,10 @@ import {
Page,
} from "../__generated__/_index.tsx";
import css from "../__generated__/index.css";
-import type { Data } from "@webstudio-is/http-client";
import { assetBaseUrl, imageBaseUrl, imageLoader } from "~/constants.mjs";
-export type PageData = Omit<Data, "build"> & {
- build: Pick<Data["build"], "props">;
+export type PageData = {
+ page: PageType;
};
export const meta: V2_ServerRuntimeMetaFunction = () => {
@@ -155,29 +154,13 @@ export const action = async ({ request, context }: ActionArgs) => {
};
const Outlet = () => {
- const page = pageData.page;
-
- if (page === undefined) {
- throw json("Page not found", {
- status: 404,
- });
- }
-
return (
<ReactSdkContext.Provider
value={{
- propsByInstanceIdStore: atom(
- getPropsByInstanceId(new Map(pageData.build.props))
- ),
- assetsStore: atom(
- new Map(pageData.assets.map((asset) => [asset.id, asset]))
- ),
- dataSourcesLogicStore: atom(new Map()),
imageLoader,
assetBaseUrl,
imageBaseUrl,
pagesPaths,
- indexesWithinAncestors: new Map(),
}}
>
<Page
diff --git a/fixtures/webstudio-remix-netlify-edge-functions/package.json b/fixtures/webstudio-remix-netlify-edge-functions/package.json
index fc613620bb..eef32cbc16 100644
--- a/fixtures/webstudio-remix-netlify-edge-functions/package.json
+++ b/fixtures/webstudio-remix-netlify-edge-functions/package.json
@@ -34,7 +34,6 @@
"@remix-run/dev": "^1.19.2",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/http-client": "workspace:*",
"typescript": "5.2.2",
"webstudio-cli": "workspace:*"
},
diff --git a/fixtures/webstudio-remix-netlify-edge-functions/remix.config.js b/fixtures/webstudio-remix-netlify-edge-functions/remix.config.js
index 229cbb951b..a9b0a97c78 100644
--- a/fixtures/webstudio-remix-netlify-edge-functions/remix.config.js
+++ b/fixtures/webstudio-remix-netlify-edge-functions/remix.config.js
@@ -8,8 +8,6 @@ const baseConfig =
serverDependenciesToBundle: [
/@webstudio-is\//,
"nanoid",
- "nanostores",
- "@nanostores/react",
"@jsep-plugin/assignment",
],
};
diff --git a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx
index e4d1286da2..35585adaa7 100644
--- a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx
+++ b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx
@@ -12,17 +12,6 @@ import {
export const fontAssets: Asset[] = [];
export const pageData: PageData = {
- build: { props: [] },
- pages: [
- {
- id: "9di_L14CzctvSruIoKVvE",
- name: "Home",
- title: "Home",
- meta: {},
- rootInstanceId: "MMimeobf_zi4ZkRGXapju",
- path: "",
- },
- ],
page: {
id: "9di_L14CzctvSruIoKVvE",
name: "Home",
@@ -31,7 +20,6 @@ export const pageData: PageData = {
rootInstanceId: "MMimeobf_zi4ZkRGXapju",
path: "",
},
- assets: [],
};
export const user: { email: string | null } | undefined = {
diff --git a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx
index 208ca1cd85..29e9cc7e27 100644
--- a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx
+++ b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx
@@ -6,8 +6,8 @@ import {
type ActionArgs,
json,
} from "@remix-run/server-runtime";
-import { atom } from "nanostores";
-import { ReactSdkContext, getPropsByInstanceId } from "@webstudio-is/react-sdk";
+import type { Page as PageType } from "@webstudio-is/sdk";
+import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import { Scripts, ScrollRestoration } from "@remix-run/react";
import {
@@ -20,11 +20,10 @@ import {
Page,
} from "../__generated__/_index.tsx";
import css from "../__generated__/index.css";
-import type { Data } from "@webstudio-is/http-client";
import { assetBaseUrl, imageBaseUrl, imageLoader } from "~/constants.mjs";
-export type PageData = Omit<Data, "build"> & {
- build: Pick<Data["build"], "props">;
+export type PageData = {
+ page: PageType;
};
export const meta: V2_ServerRuntimeMetaFunction = () => {
@@ -155,29 +154,13 @@ export const action = async ({ request, context }: ActionArgs) => {
};
const Outlet = () => {
- const page = pageData.page;
-
- if (page === undefined) {
- throw json("Page not found", {
- status: 404,
- });
- }
-
return (
<ReactSdkContext.Provider
value={{
- propsByInstanceIdStore: atom(
- getPropsByInstanceId(new Map(pageData.build.props))
- ),
- assetsStore: atom(
- new Map(pageData.assets.map((asset) => [asset.id, asset]))
- ),
- dataSourcesLogicStore: atom(new Map()),
imageLoader,
assetBaseUrl,
imageBaseUrl,
pagesPaths,
- indexesWithinAncestors: new Map(),
}}
>
<Page
diff --git a/fixtures/webstudio-remix-netlify-functions/package.json b/fixtures/webstudio-remix-netlify-functions/package.json
index 265c6f8534..7d270c1644 100644
--- a/fixtures/webstudio-remix-netlify-functions/package.json
+++ b/fixtures/webstudio-remix-netlify-functions/package.json
@@ -33,7 +33,6 @@
"@remix-run/dev": "^1.19.2",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/http-client": "workspace:*",
"typescript": "5.2.2",
"webstudio-cli": "workspace:*"
},
diff --git a/fixtures/webstudio-remix-netlify-functions/remix.config.js b/fixtures/webstudio-remix-netlify-functions/remix.config.js
index 7638e31da8..e1e4801450 100644
--- a/fixtures/webstudio-remix-netlify-functions/remix.config.js
+++ b/fixtures/webstudio-remix-netlify-functions/remix.config.js
@@ -16,8 +16,6 @@ module.exports = {
serverDependenciesToBundle: [
/@webstudio-is\//,
"nanoid",
- "nanostores",
- "@nanostores/react",
"@jsep-plugin/assignment",
],
future: {
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.tsx
index 666d8a6a38..7e7df038e6 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
@@ -11,62 +11,6 @@ import {
export const fontAssets: Asset[] = [];
export const pageData: PageData = {
- build: {
- props: [
- [
- "HNaXZUvlg14jFvxc29n9T",
- {
- id: "HNaXZUvlg14jFvxc29n9T",
- name: "src",
- instanceId: "AdXSAYCx4QDo5QN6nLoGs",
- type: "string",
- value: "/assets/small-avif-kitty_FnabJsioMWpBtXZSGf4DR.webp",
- },
- ],
- ],
- },
- pages: [
- {
- id: "7Db64ZXgYiRqKSQNR-qTQ",
- name: "Home",
- title: "Home",
- meta: {},
- rootInstanceId: "On9cvWCxr5rdZtY9O1Bv0",
- path: "",
- },
- {
- id: "xfvB4UThQXmQ_OubPYrkg",
- name: "radix",
- title: "radix",
- meta: { description: "" },
- rootInstanceId: "uKWGyE9JY3cPwY-xI9vk6",
- path: "/radix",
- },
- {
- id: "szYLvBduHPmbtqQKCDY0b",
- name: "RouteWithSymbols",
- title: "RouteWithSymbols",
- meta: { description: "" },
- rootInstanceId: "EDEfpMPRqDejthtwkH7ws",
- path: "/_route_with_symbols_",
- },
- {
- id: "U1tRJl2ERr8_OFe0g9cN_",
- name: "form",
- title: "form",
- meta: { description: "" },
- rootInstanceId: "a-4nDFkaWy4px1fn38XWJ",
- path: "/form",
- },
- {
- id: "-J9I4Oo6mONfQlf_3-OqG",
- name: "heading-with-id",
- title: "heading-with-id",
- meta: { description: "" },
- rootInstanceId: "O-ljaGZQ0iRNTlEshMkgE",
- path: "/heading-with-id",
- },
- ],
page: {
id: "szYLvBduHPmbtqQKCDY0b",
name: "RouteWithSymbols",
@@ -75,30 +19,6 @@ export const pageData: PageData = {
rootInstanceId: "EDEfpMPRqDejthtwkH7ws",
path: "/_route_with_symbols_",
},
- assets: [
- {
- id: "9a8bc926-7804-4d3f-af81-69196b1d2ed8",
- name: "small-avif-kitty_FnabJsioMWpBtXZSGf4DR.webp",
- description: null,
- projectId: "cddc1d44-af37-4cb6-a430-d300cf6f932d",
- size: 2906,
- type: "image",
- format: "webp",
- createdAt: "2023-09-12T09:44:22.120Z",
- meta: { width: 100, height: 100 },
- },
- {
- 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 },
- },
- ],
};
export const user: { email: string | null } | undefined = {
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx
index 441b83b7c3..905543ce4f 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx
@@ -16,244 +16,6 @@ import { Form as Form } from "@webstudio-is/sdk-components-react-remix";
export const fontAssets: Asset[] = [];
export const pageData: PageData = {
- build: {
- props: [
- [
- "OER1GvKVEE4CdEX1yrNe3",
- {
- id: "OER1GvKVEE4CdEX1yrNe3",
- instanceId: "isNSM3wXcnHFikwNPlEOL",
- name: "state",
- type: "dataSource",
- value: "KvfuNNCNslj7nAGsD69Fl",
- },
- ],
- [
- "RHHw5ACTgdDO751J8CgWB",
- {
- id: "RHHw5ACTgdDO751J8CgWB",
- instanceId: "isNSM3wXcnHFikwNPlEOL",
- name: "onStateChange",
- type: "action",
- value: [
- {
- type: "execute",
- args: ["state"],
- code: "$ws$dataSource$KvfuNNCNslj7nAGsD69Fl = state",
- },
- ],
- },
- ],
- [
- "Nyxr4ohgm_MNVtGpsGUn3",
- {
- id: "Nyxr4ohgm_MNVtGpsGUn3",
- instanceId: "a5YPRc19IJyhTrjjasA_R",
- name: "data-ws-show",
- type: "dataSource",
- value: "ezyBm7JGcDokMP8DZVzrD",
- },
- ],
- [
- "3tFb2mZpmJXG5txK78S9g",
- {
- id: "3tFb2mZpmJXG5txK78S9g",
- instanceId: "ydR5B_9uMS4PXFS76TmBh",
- name: "name",
- type: "string",
- value: "name",
- },
- ],
- [
- "7L7d7raf6WNI4_velVRy3",
- {
- id: "7L7d7raf6WNI4_velVRy3",
- instanceId: "TsqGP49hjgEW41ReCwrpZ",
- name: "name",
- type: "string",
- value: "email",
- },
- ],
- [
- "mtOiOi1u0WbNI09rVIS6T",
- {
- id: "mtOiOi1u0WbNI09rVIS6T",
- instanceId: "Gw-ta0R4FNFAGBTVRWKep",
- name: "data-ws-show",
- type: "dataSource",
- value: "_NmOL-v4PZhCcmj2vaDy_",
- },
- ],
- [
- "FTd65V4oEibesTqvAjKp0",
- {
- id: "FTd65V4oEibesTqvAjKp0",
- instanceId: "ewk_WKpu4syHLPABMmvUz",
- name: "data-ws-show",
- type: "dataSource",
- value: "VeQ-Tiya3whVhWHbJVHID",
- },
- ],
- [
- "vtsKrdjJH3YT89prj2K5T",
- {
- id: "vtsKrdjJH3YT89prj2K5T",
- instanceId: "-1RvizaBcVpHsjvnYxn1c",
- name: "state",
- type: "dataSource",
- value: "Ip0FRY7L24QrIMdtuMN5j",
- },
- ],
- [
- "E2n44qWixMBKO6m8kg1wp",
- {
- id: "E2n44qWixMBKO6m8kg1wp",
- instanceId: "-1RvizaBcVpHsjvnYxn1c",
- name: "onStateChange",
- type: "action",
- value: [
- {
- type: "execute",
- args: ["state"],
- code: "$ws$dataSource$Ip0FRY7L24QrIMdtuMN5j = state",
- },
- ],
- },
- ],
- [
- "K6DEgf4WkIDqdiuiwAS5E",
- {
- id: "K6DEgf4WkIDqdiuiwAS5E",
- instanceId: "qhnVrmYGlyrMZi3UzqSQA",
- name: "data-ws-show",
- type: "dataSource",
- value: "DUDDZM-QmYH_zBgbIODiu",
- },
- ],
- [
- "kWwLbf7GOo7-n4xOi8nZi",
- {
- id: "kWwLbf7GOo7-n4xOi8nZi",
- instanceId: "e035xi9fcwYtrn9La49Eh",
- name: "name",
- type: "string",
- value: "name",
- },
- ],
- [
- "dnX31oCvPdAPBQ1JqbnXr",
- {
- id: "dnX31oCvPdAPBQ1JqbnXr",
- instanceId: "dcHjdeW_HXPkyQlx3ZiL7",
- name: "name",
- type: "string",
- value: "email",
- },
- ],
- [
- "JbdIh72OZ8RnHXvYTsLRd",
- {
- id: "JbdIh72OZ8RnHXvYTsLRd",
- instanceId: "966cjxuqP_T99N27-mqWE",
- name: "data-ws-show",
- type: "dataSource",
- value: "F72Gu_6DnbW9CGp_747xa",
- },
- ],
- [
- "6UMH0WLK_fORElv3ffHCg",
- {
- id: "6UMH0WLK_fORElv3ffHCg",
- instanceId: "SYG5hhOz31xFJUN_v9zq6",
- name: "data-ws-show",
- type: "dataSource",
- value: "XhDObB85P8I_uDZ_CzGDt",
- },
- ],
- [
- "cpfLtqW20MR6y68u70Ta2",
- {
- id: "cpfLtqW20MR6y68u70Ta2",
- instanceId: "isNSM3wXcnHFikwNPlEOL",
- name: "method",
- type: "string",
- value: "get",
- },
- ],
- [
- "d5fWTvwp-dtCYQ0rleaQ0",
- {
- id: "d5fWTvwp-dtCYQ0rleaQ0",
- instanceId: "isNSM3wXcnHFikwNPlEOL",
- name: "action",
- type: "string",
- value: "/custom",
- },
- ],
- [
- "Oe1u15XWPgU6oBGnrmT5E",
- {
- id: "Oe1u15XWPgU6oBGnrmT5E",
- instanceId: "y4pceTmziuBRIDgUBQNLD",
- name: "tag",
- type: "string",
- value: "h3",
- },
- ],
- [
- "-QA9iF6dEVIibtNCO1EQp",
- {
- id: "-QA9iF6dEVIibtNCO1EQp",
- instanceId: "YdHHf4u3jrdbRIWpB_VfH",
- name: "tag",
- type: "string",
- value: "h3",
- },
- ],
- ],
- },
- pages: [
- {
- id: "7Db64ZXgYiRqKSQNR-qTQ",
- name: "Home",
- title: "Home",
- meta: {},
- rootInstanceId: "On9cvWCxr5rdZtY9O1Bv0",
- path: "",
- },
- {
- id: "xfvB4UThQXmQ_OubPYrkg",
- name: "radix",
- title: "radix",
- meta: { description: "" },
- rootInstanceId: "uKWGyE9JY3cPwY-xI9vk6",
- path: "/radix",
- },
- {
- id: "szYLvBduHPmbtqQKCDY0b",
- name: "RouteWithSymbols",
- title: "RouteWithSymbols",
- meta: { description: "" },
- rootInstanceId: "EDEfpMPRqDejthtwkH7ws",
- path: "/_route_with_symbols_",
- },
- {
- id: "U1tRJl2ERr8_OFe0g9cN_",
- name: "form",
- title: "form",
- meta: { description: "" },
- rootInstanceId: "a-4nDFkaWy4px1fn38XWJ",
- path: "/form",
- },
- {
- id: "-J9I4Oo6mONfQlf_3-OqG",
- name: "heading-with-id",
- title: "heading-with-id",
- meta: { description: "" },
- rootInstanceId: "O-ljaGZQ0iRNTlEshMkgE",
- path: "/heading-with-id",
- },
- ],
page: {
id: "U1tRJl2ERr8_OFe0g9cN_",
name: "form",
@@ -262,30 +24,6 @@ export const pageData: PageData = {
rootInstanceId: "a-4nDFkaWy4px1fn38XWJ",
path: "/form",
},
- assets: [
- {
- id: "9a8bc926-7804-4d3f-af81-69196b1d2ed8",
- name: "small-avif-kitty_FnabJsioMWpBtXZSGf4DR.webp",
- description: null,
- projectId: "cddc1d44-af37-4cb6-a430-d300cf6f932d",
- size: 2906,
- type: "image",
- format: "webp",
- createdAt: "2023-09-12T09:44:22.120Z",
- meta: { width: 100, height: 100 },
- },
- {
- 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 },
- },
- ],
};
export const user: { email: string | null } | 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.tsx
index db4434dc06..6db32677bb 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
@@ -11,62 +11,6 @@ import {
export const fontAssets: Asset[] = [];
export const pageData: PageData = {
- build: {
- props: [
- [
- "bCTT4ssGpfxQfmKk3mONc",
- {
- id: "bCTT4ssGpfxQfmKk3mONc",
- instanceId: "qmxnOlSxUGpuhuonVArWJ",
- name: "id",
- type: "string",
- value: "my-heading",
- },
- ],
- ],
- },
- pages: [
- {
- id: "7Db64ZXgYiRqKSQNR-qTQ",
- name: "Home",
- title: "Home",
- meta: {},
- rootInstanceId: "On9cvWCxr5rdZtY9O1Bv0",
- path: "",
- },
- {
- id: "xfvB4UThQXmQ_OubPYrkg",
- name: "radix",
- title: "radix",
- meta: { description: "" },
- rootInstanceId: "uKWGyE9JY3cPwY-xI9vk6",
- path: "/radix",
- },
- {
- id: "szYLvBduHPmbtqQKCDY0b",
- name: "RouteWithSymbols",
- title: "RouteWithSymbols",
- meta: { description: "" },
- rootInstanceId: "EDEfpMPRqDejthtwkH7ws",
- path: "/_route_with_symbols_",
- },
- {
- id: "U1tRJl2ERr8_OFe0g9cN_",
- name: "form",
- title: "form",
- meta: { description: "" },
- rootInstanceId: "a-4nDFkaWy4px1fn38XWJ",
- path: "/form",
- },
- {
- id: "-J9I4Oo6mONfQlf_3-OqG",
- name: "heading-with-id",
- title: "heading-with-id",
- meta: { description: "" },
- rootInstanceId: "O-ljaGZQ0iRNTlEshMkgE",
- path: "/heading-with-id",
- },
- ],
page: {
id: "-J9I4Oo6mONfQlf_3-OqG",
name: "heading-with-id",
@@ -75,30 +19,6 @@ export const pageData: PageData = {
rootInstanceId: "O-ljaGZQ0iRNTlEshMkgE",
path: "/heading-with-id",
},
- assets: [
- {
- id: "9a8bc926-7804-4d3f-af81-69196b1d2ed8",
- name: "small-avif-kitty_FnabJsioMWpBtXZSGf4DR.webp",
- description: null,
- projectId: "cddc1d44-af37-4cb6-a430-d300cf6f932d",
- size: 2906,
- type: "image",
- format: "webp",
- createdAt: "2023-09-12T09:44:22.120Z",
- meta: { width: 100, height: 100 },
- },
- {
- 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 },
- },
- ],
};
export const user: { email: string | null } | undefined = {
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx
index bba0900085..0d0974d827 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx
@@ -20,121 +20,6 @@ import {
export const fontAssets: Asset[] = [];
export const pageData: PageData = {
- build: {
- props: [
- [
- "_x-dxwbTQ-XBLRuYQE9Pm",
- {
- id: "_x-dxwbTQ-XBLRuYQE9Pm",
- instanceId: "AM9fD6dv2Ftc3Xjcsd7Uc",
- name: "collapsible",
- type: "boolean",
- value: true,
- },
- ],
- [
- "XDeoQFsXw3NhVjns6I5HM",
- {
- id: "XDeoQFsXw3NhVjns6I5HM",
- instanceId: "AM9fD6dv2Ftc3Xjcsd7Uc",
- name: "value",
- type: "dataSource",
- value: "RR_FthRebEUcAKUJIXl0j",
- },
- ],
- [
- "UZg-1PcrNODgUo94IvnGC",
- {
- id: "UZg-1PcrNODgUo94IvnGC",
- instanceId: "AM9fD6dv2Ftc3Xjcsd7Uc",
- name: "onValueChange",
- type: "action",
- value: [
- {
- type: "execute",
- args: ["value"],
- code: "$ws$dataSource$RR_FthRebEUcAKUJIXl0j = value",
- },
- ],
- },
- ],
- [
- "XxpufvbtZ9iuhkPDDigde",
- {
- id: "XxpufvbtZ9iuhkPDDigde",
- instanceId: "d0sd_G-kHirxgjq6s6Uq1",
- name: "code",
- type: "string",
- value:
- '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M4.04 6.284a.65.65 0 0 1 .92.001L8 9.335l3.04-3.05a.65.65 0 1 1 .921.918l-3.5 3.512a.65.65 0 0 1-.921 0L4.039 7.203a.65.65 0 0 1 .001-.92Z"/></svg>',
- },
- ],
- [
- "d26zsuAR2XZt1RRN6oJXk",
- {
- id: "d26zsuAR2XZt1RRN6oJXk",
- instanceId: "StPslEr81nfBISqBE2R-Y",
- name: "code",
- type: "string",
- value:
- '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M4.04 6.284a.65.65 0 0 1 .92.001L8 9.335l3.04-3.05a.65.65 0 1 1 .921.918l-3.5 3.512a.65.65 0 0 1-.921 0L4.039 7.203a.65.65 0 0 1 .001-.92Z"/></svg>',
- },
- ],
- [
- "8Ar0H_oY5LOeyp2mMksps",
- {
- id: "8Ar0H_oY5LOeyp2mMksps",
- instanceId: "sO80m5u4f87jVGG91t6u8",
- name: "code",
- type: "string",
- value:
- '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M4.04 6.284a.65.65 0 0 1 .92.001L8 9.335l3.04-3.05a.65.65 0 1 1 .921.918l-3.5 3.512a.65.65 0 0 1-.921 0L4.039 7.203a.65.65 0 0 1 .001-.92Z"/></svg>',
- },
- ],
- ],
- },
- pages: [
- {
- id: "7Db64ZXgYiRqKSQNR-qTQ",
- name: "Home",
- title: "Home",
- meta: {},
- rootInstanceId: "On9cvWCxr5rdZtY9O1Bv0",
- path: "",
- },
- {
- id: "xfvB4UThQXmQ_OubPYrkg",
- name: "radix",
- title: "radix",
- meta: { description: "" },
- rootInstanceId: "uKWGyE9JY3cPwY-xI9vk6",
- path: "/radix",
- },
- {
- id: "szYLvBduHPmbtqQKCDY0b",
- name: "RouteWithSymbols",
- title: "RouteWithSymbols",
- meta: { description: "" },
- rootInstanceId: "EDEfpMPRqDejthtwkH7ws",
- path: "/_route_with_symbols_",
- },
- {
- id: "U1tRJl2ERr8_OFe0g9cN_",
- name: "form",
- title: "form",
- meta: { description: "" },
- rootInstanceId: "a-4nDFkaWy4px1fn38XWJ",
- path: "/form",
- },
- {
- id: "-J9I4Oo6mONfQlf_3-OqG",
- name: "heading-with-id",
- title: "heading-with-id",
- meta: { description: "" },
- rootInstanceId: "O-ljaGZQ0iRNTlEshMkgE",
- path: "/heading-with-id",
- },
- ],
page: {
id: "xfvB4UThQXmQ_OubPYrkg",
name: "radix",
@@ -143,30 +28,6 @@ export const pageData: PageData = {
rootInstanceId: "uKWGyE9JY3cPwY-xI9vk6",
path: "/radix",
},
- assets: [
- {
- id: "9a8bc926-7804-4d3f-af81-69196b1d2ed8",
- name: "small-avif-kitty_FnabJsioMWpBtXZSGf4DR.webp",
- description: null,
- projectId: "cddc1d44-af37-4cb6-a430-d300cf6f932d",
- size: 2906,
- type: "image",
- format: "webp",
- createdAt: "2023-09-12T09:44:22.120Z",
- meta: { width: 100, height: 100 },
- },
- {
- 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 },
- },
- ],
};
export const user: { email: string | null } | undefined = {
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx
index ae96ecf77a..662143e3f9 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx
@@ -16,113 +16,6 @@ import { Link as Link } from "@webstudio-is/sdk-components-react-remix";
export const fontAssets: Asset[] = [];
export const pageData: PageData = {
- build: {
- props: [
- [
- "rTRZFZEd03RBH4gUWj9LW",
- {
- id: "rTRZFZEd03RBH4gUWj9LW",
- name: "src",
- instanceId: "pX1ovPI7NdC0HRjkw6Kpw",
- type: "string",
- value:
- "/assets/_937084ed-a798-49fe-8664-df93a2af605e_uiBk3o6UWdqolyakMvQJ9.jpeg",
- },
- ],
- [
- "SYK4hpLQ9tHnESKDtPvI9",
- {
- id: "SYK4hpLQ9tHnESKDtPvI9",
- instanceId: "l9AI_pShC-BH4ibxK6kNT",
- name: "href",
- type: "string",
- value: "https://github.com/",
- },
- ],
- [
- "tUn-hTQ0dKjsaRZ4q3m21",
- {
- id: "tUn-hTQ0dKjsaRZ4q3m21",
- name: "href",
- instanceId: "9I4GRU1sev48hREkQcKQ-",
- type: "string",
- value: "/_route_with_symbols_",
- },
- ],
- [
- "qk_m-CJJD4kY_F07wADHU",
- {
- id: "qk_m-CJJD4kY_F07wADHU",
- instanceId: "D8wLZzLWQfxH9uaKsn-0L",
- name: "tag",
- type: "string",
- value: "span",
- },
- ],
- [
- "GmWaLJTu_cVzrs8-chvQ4",
- {
- id: "GmWaLJTu_cVzrs8-chvQ4",
- name: "href",
- instanceId: "8AXawjUE3fJoOH_1qOAoq",
- type: "string",
- value: "/assets/small-avif-kitty_FnabJsioMWpBtXZSGf4DR.webp",
- },
- ],
- [
- "z8GMy7HFi_j_felIKxGP5",
- {
- id: "z8GMy7HFi_j_felIKxGP5",
- name: "href",
- instanceId: "81ejLVXyFEV1SxiJrWhyw",
- type: "string",
- value: "/heading-with-id#my-heading",
- },
- ],
- ],
- },
- pages: [
- {
- id: "7Db64ZXgYiRqKSQNR-qTQ",
- name: "Home",
- title: "Home",
- meta: {},
- rootInstanceId: "On9cvWCxr5rdZtY9O1Bv0",
- path: "",
- },
- {
- id: "xfvB4UThQXmQ_OubPYrkg",
- name: "radix",
- title: "radix",
- meta: { description: "" },
- rootInstanceId: "uKWGyE9JY3cPwY-xI9vk6",
- path: "/radix",
- },
- {
- id: "szYLvBduHPmbtqQKCDY0b",
- name: "RouteWithSymbols",
- title: "RouteWithSymbols",
- meta: { description: "" },
- rootInstanceId: "EDEfpMPRqDejthtwkH7ws",
- path: "/_route_with_symbols_",
- },
- {
- id: "U1tRJl2ERr8_OFe0g9cN_",
- name: "form",
- title: "form",
- meta: { description: "" },
- rootInstanceId: "a-4nDFkaWy4px1fn38XWJ",
- path: "/form",
- },
- {
- id: "-J9I4Oo6mONfQlf_3-OqG",
- name: "heading-with-id",
- title: "heading-with-id",
- meta: { description: "" },
- rootInstanceId: "O-ljaGZQ0iRNTlEshMkgE",
- path: "/heading-with-id",
- },
- ],
page: {
id: "7Db64ZXgYiRqKSQNR-qTQ",
name: "Home",
@@ -131,30 +24,6 @@ export const pageData: PageData = {
rootInstanceId: "On9cvWCxr5rdZtY9O1Bv0",
path: "",
},
- assets: [
- {
- id: "9a8bc926-7804-4d3f-af81-69196b1d2ed8",
- name: "small-avif-kitty_FnabJsioMWpBtXZSGf4DR.webp",
- description: null,
- projectId: "cddc1d44-af37-4cb6-a430-d300cf6f932d",
- size: 2906,
- type: "image",
- format: "webp",
- createdAt: "2023-09-12T09:44:22.120Z",
- meta: { width: 100, height: 100 },
- },
- {
- 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 },
- },
- ],
};
export const user: { email: string | null } | undefined = {
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.tsx
index 317a5d3bf2..279261367e 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
@@ -6,8 +6,8 @@ import {
type ActionArgs,
json,
} from "@remix-run/server-runtime";
-import { atom } from "nanostores";
-import { ReactSdkContext, getPropsByInstanceId } from "@webstudio-is/react-sdk";
+import type { Page as PageType } from "@webstudio-is/sdk";
+import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import { Scripts, ScrollRestoration } from "@remix-run/react";
import {
@@ -20,11 +20,10 @@ import {
Page,
} from "../__generated__/[_route_with_symbols_]._index.tsx";
import css from "../__generated__/index.css";
-import type { Data } from "@webstudio-is/http-client";
import { assetBaseUrl, imageBaseUrl, imageLoader } from "~/constants.mjs";
-export type PageData = Omit<Data, "build"> & {
- build: Pick<Data["build"], "props">;
+export type PageData = {
+ page: PageType;
};
export const meta: V2_ServerRuntimeMetaFunction = () => {
@@ -155,29 +154,13 @@ export const action = async ({ request, context }: ActionArgs) => {
};
const Outlet = () => {
- const page = pageData.page;
-
- if (page === undefined) {
- throw json("Page not found", {
- status: 404,
- });
- }
-
return (
<ReactSdkContext.Provider
value={{
- propsByInstanceIdStore: atom(
- getPropsByInstanceId(new Map(pageData.build.props))
- ),
- assetsStore: atom(
- new Map(pageData.assets.map((asset) => [asset.id, asset]))
- ),
- dataSourcesLogicStore: atom(new Map()),
imageLoader,
assetBaseUrl,
imageBaseUrl,
pagesPaths,
- indexesWithinAncestors: new Map(),
}}
>
<Page
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
index 84b7b65f20..5f29aac026 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
@@ -6,8 +6,8 @@ import {
type ActionArgs,
json,
} from "@remix-run/server-runtime";
-import { atom } from "nanostores";
-import { ReactSdkContext, getPropsByInstanceId } from "@webstudio-is/react-sdk";
+import type { Page as PageType } from "@webstudio-is/sdk";
+import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import { Scripts, ScrollRestoration } from "@remix-run/react";
import {
@@ -20,11 +20,10 @@ import {
Page,
} from "../__generated__/[form]._index.tsx";
import css from "../__generated__/index.css";
-import type { Data } from "@webstudio-is/http-client";
import { assetBaseUrl, imageBaseUrl, imageLoader } from "~/constants.mjs";
-export type PageData = Omit<Data, "build"> & {
- build: Pick<Data["build"], "props">;
+export type PageData = {
+ page: PageType;
};
export const meta: V2_ServerRuntimeMetaFunction = () => {
@@ -155,29 +154,13 @@ export const action = async ({ request, context }: ActionArgs) => {
};
const Outlet = () => {
- const page = pageData.page;
-
- if (page === undefined) {
- throw json("Page not found", {
- status: 404,
- });
- }
-
return (
<ReactSdkContext.Provider
value={{
- propsByInstanceIdStore: atom(
- getPropsByInstanceId(new Map(pageData.build.props))
- ),
- assetsStore: atom(
- new Map(pageData.assets.map((asset) => [asset.id, asset]))
- ),
- dataSourcesLogicStore: atom(new Map()),
imageLoader,
assetBaseUrl,
imageBaseUrl,
pagesPaths,
- indexesWithinAncestors: new Map(),
}}
>
<Page
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.tsx
index 683b40ee67..b60a66faee 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
@@ -6,8 +6,8 @@ import {
type ActionArgs,
json,
} from "@remix-run/server-runtime";
-import { atom } from "nanostores";
-import { ReactSdkContext, getPropsByInstanceId } from "@webstudio-is/react-sdk";
+import type { Page as PageType } from "@webstudio-is/sdk";
+import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import { Scripts, ScrollRestoration } from "@remix-run/react";
import {
@@ -20,11 +20,10 @@ import {
Page,
} from "../__generated__/[heading-with-id]._index.tsx";
import css from "../__generated__/index.css";
-import type { Data } from "@webstudio-is/http-client";
import { assetBaseUrl, imageBaseUrl, imageLoader } from "~/constants.mjs";
-export type PageData = Omit<Data, "build"> & {
- build: Pick<Data["build"], "props">;
+export type PageData = {
+ page: PageType;
};
export const meta: V2_ServerRuntimeMetaFunction = () => {
@@ -155,29 +154,13 @@ export const action = async ({ request, context }: ActionArgs) => {
};
const Outlet = () => {
- const page = pageData.page;
-
- if (page === undefined) {
- throw json("Page not found", {
- status: 404,
- });
- }
-
return (
<ReactSdkContext.Provider
value={{
- propsByInstanceIdStore: atom(
- getPropsByInstanceId(new Map(pageData.build.props))
- ),
- assetsStore: atom(
- new Map(pageData.assets.map((asset) => [asset.id, asset]))
- ),
- dataSourcesLogicStore: atom(new Map()),
imageLoader,
assetBaseUrl,
imageBaseUrl,
pagesPaths,
- indexesWithinAncestors: new Map(),
}}
>
<Page
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
index c99270b379..2cd4a22e82 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
@@ -6,8 +6,8 @@ import {
type ActionArgs,
json,
} from "@remix-run/server-runtime";
-import { atom } from "nanostores";
-import { ReactSdkContext, getPropsByInstanceId } from "@webstudio-is/react-sdk";
+import type { Page as PageType } from "@webstudio-is/sdk";
+import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import { Scripts, ScrollRestoration } from "@remix-run/react";
import {
@@ -20,11 +20,10 @@ import {
Page,
} from "../__generated__/[radix]._index.tsx";
import css from "../__generated__/index.css";
-import type { Data } from "@webstudio-is/http-client";
import { assetBaseUrl, imageBaseUrl, imageLoader } from "~/constants.mjs";
-export type PageData = Omit<Data, "build"> & {
- build: Pick<Data["build"], "props">;
+export type PageData = {
+ page: PageType;
};
export const meta: V2_ServerRuntimeMetaFunction = () => {
@@ -155,29 +154,13 @@ export const action = async ({ request, context }: ActionArgs) => {
};
const Outlet = () => {
- const page = pageData.page;
-
- if (page === undefined) {
- throw json("Page not found", {
- status: 404,
- });
- }
-
return (
<ReactSdkContext.Provider
value={{
- propsByInstanceIdStore: atom(
- getPropsByInstanceId(new Map(pageData.build.props))
- ),
- assetsStore: atom(
- new Map(pageData.assets.map((asset) => [asset.id, asset]))
- ),
- dataSourcesLogicStore: atom(new Map()),
imageLoader,
assetBaseUrl,
imageBaseUrl,
pagesPaths,
- indexesWithinAncestors: new Map(),
}}
>
<Page
diff --git a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
index 208ca1cd85..29e9cc7e27 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
@@ -6,8 +6,8 @@ import {
type ActionArgs,
json,
} from "@remix-run/server-runtime";
-import { atom } from "nanostores";
-import { ReactSdkContext, getPropsByInstanceId } from "@webstudio-is/react-sdk";
+import type { Page as PageType } from "@webstudio-is/sdk";
+import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import { Scripts, ScrollRestoration } from "@remix-run/react";
import {
@@ -20,11 +20,10 @@ import {
Page,
} from "../__generated__/_index.tsx";
import css from "../__generated__/index.css";
-import type { Data } from "@webstudio-is/http-client";
import { assetBaseUrl, imageBaseUrl, imageLoader } from "~/constants.mjs";
-export type PageData = Omit<Data, "build"> & {
- build: Pick<Data["build"], "props">;
+export type PageData = {
+ page: PageType;
};
export const meta: V2_ServerRuntimeMetaFunction = () => {
@@ -155,29 +154,13 @@ export const action = async ({ request, context }: ActionArgs) => {
};
const Outlet = () => {
- const page = pageData.page;
-
- if (page === undefined) {
- throw json("Page not found", {
- status: 404,
- });
- }
-
return (
<ReactSdkContext.Provider
value={{
- propsByInstanceIdStore: atom(
- getPropsByInstanceId(new Map(pageData.build.props))
- ),
- assetsStore: atom(
- new Map(pageData.assets.map((asset) => [asset.id, asset]))
- ),
- dataSourcesLogicStore: atom(new Map()),
imageLoader,
assetBaseUrl,
imageBaseUrl,
pagesPaths,
- indexesWithinAncestors: new Map(),
}}
>
<Page
diff --git a/fixtures/webstudio-remix-vercel/package.json b/fixtures/webstudio-remix-vercel/package.json
index 016a6be973..95a87dc6b2 100644
--- a/fixtures/webstudio-remix-vercel/package.json
+++ b/fixtures/webstudio-remix-vercel/package.json
@@ -30,7 +30,6 @@
"@remix-run/dev": "^1.19.2",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/http-client": "workspace:*",
"typescript": "5.2.2",
"webstudio-cli": "workspace:*"
},
diff --git a/fixtures/webstudio-remix-vercel/remix.config.js b/fixtures/webstudio-remix-vercel/remix.config.js
index 1499566045..27ccfeb986 100644
--- a/fixtures/webstudio-remix-vercel/remix.config.js
+++ b/fixtures/webstudio-remix-vercel/remix.config.js
@@ -5,8 +5,6 @@ module.exports = {
serverDependenciesToBundle: [
/@webstudio-is\//,
"nanoid",
- "nanostores",
- "@nanostores/react",
"@jsep-plugin/assignment",
],
future: {
diff --git a/packages/cli/__generated__/index.tsx b/packages/cli/__generated__/index.tsx
index 828ca4fcb9..da6a943af3 100644
--- a/packages/cli/__generated__/index.tsx
+++ b/packages/cli/__generated__/index.tsx
@@ -8,11 +8,6 @@ import type { Asset } from "@webstudio-is/sdk";
export const fontAssets: Asset[] = [];
export const pageData: PageData = {
- build: {
- props: [],
- },
- pages: [],
-
page: {
id: "",
name: "",
@@ -21,7 +16,6 @@ export const pageData: PageData = {
rootInstanceId: "",
path: "",
},
- assets: [],
};
export const user: { email: string | null } | undefined = {
diff --git a/packages/cli/src/prebuild.ts b/packages/cli/src/prebuild.ts
index 3356a32d2a..77b52d26d8 100644
--- a/packages/cli/src/prebuild.ts
+++ b/packages/cli/src/prebuild.ts
@@ -463,12 +463,7 @@ export const prebuild = async (options: {
const pageData = siteDataByPage[pathName];
// serialize data only used in runtime
const renderedPageData: PageData = {
- build: {
- props: pageData.build.props,
- },
- pages: pageData.pages,
page: pageData.page,
- assets: pageData.assets,
};
const rootInstanceId = pageData.page.rootInstanceId;
diff --git a/packages/cli/templates/defaults/package.json b/packages/cli/templates/defaults/package.json
index d48557f95c..87b62ac64d 100644
--- a/packages/cli/templates/defaults/package.json
+++ b/packages/cli/templates/defaults/package.json
@@ -26,7 +26,6 @@
"@remix-run/dev": "^1.19.2",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/http-client": "^0.102.0",
"typescript": "5.2.2"
},
"engines": {
diff --git a/packages/cli/templates/defaults/remix.config.js b/packages/cli/templates/defaults/remix.config.js
index 1499566045..27ccfeb986 100644
--- a/packages/cli/templates/defaults/remix.config.js
+++ b/packages/cli/templates/defaults/remix.config.js
@@ -5,8 +5,6 @@ module.exports = {
serverDependenciesToBundle: [
/@webstudio-is\//,
"nanoid",
- "nanostores",
- "@nanostores/react",
"@jsep-plugin/assignment",
],
future: {
diff --git a/packages/cli/templates/netlify-edge-functions/remix.config.js b/packages/cli/templates/netlify-edge-functions/remix.config.js
index 229cbb951b..a9b0a97c78 100644
--- a/packages/cli/templates/netlify-edge-functions/remix.config.js
+++ b/packages/cli/templates/netlify-edge-functions/remix.config.js
@@ -8,8 +8,6 @@ const baseConfig =
serverDependenciesToBundle: [
/@webstudio-is\//,
"nanoid",
- "nanostores",
- "@nanostores/react",
"@jsep-plugin/assignment",
],
};
diff --git a/packages/cli/templates/netlify-functions/remix.config.js b/packages/cli/templates/netlify-functions/remix.config.js
index 7638e31da8..e1e4801450 100644
--- a/packages/cli/templates/netlify-functions/remix.config.js
+++ b/packages/cli/templates/netlify-functions/remix.config.js
@@ -16,8 +16,6 @@ module.exports = {
serverDependenciesToBundle: [
/@webstudio-is\//,
"nanoid",
- "nanostores",
- "@nanostores/react",
"@jsep-plugin/assignment",
],
future: {
diff --git a/packages/cli/templates/route-template.tsx b/packages/cli/templates/route-template.tsx
index 3d1d7b9d45..4df0c256c2 100644
--- a/packages/cli/templates/route-template.tsx
+++ b/packages/cli/templates/route-template.tsx
@@ -6,8 +6,8 @@ import {
type ActionArgs,
json,
} from "@remix-run/server-runtime";
-import { atom } from "nanostores";
-import { ReactSdkContext, getPropsByInstanceId } from "@webstudio-is/react-sdk";
+import type { Page as PageType } from "@webstudio-is/sdk";
+import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import { Scripts, ScrollRestoration } from "@remix-run/react";
import {
@@ -20,11 +20,10 @@ import {
Page,
} from "../__generated__/index";
import css from "../__generated__/index.css";
-import type { Data } from "@webstudio-is/http-client";
import { assetBaseUrl, imageBaseUrl, imageLoader } from "~/constants.mjs";
-export type PageData = Omit<Data, "build"> & {
- build: Pick<Data["build"], "props">;
+export type PageData = {
+ page: PageType;
};
export const meta: V2_ServerRuntimeMetaFunction = () => {
@@ -155,29 +154,13 @@ export const action = async ({ request, context }: ActionArgs) => {
};
const Outlet = () => {
- const page = pageData.page;
-
- if (page === undefined) {
- throw json("Page not found", {
- status: 404,
- });
- }
-
return (
<ReactSdkContext.Provider
value={{
- propsByInstanceIdStore: atom(
- getPropsByInstanceId(new Map(pageData.build.props))
- ),
- assetsStore: atom(
- new Map(pageData.assets.map((asset) => [asset.id, asset]))
- ),
- dataSourcesLogicStore: atom(new Map()),
imageLoader,
assetBaseUrl,
imageBaseUrl,
pagesPaths,
- indexesWithinAncestors: new Map(),
}}
>
<Page
diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json
index f67262f6c7..ee91c3e586 100644
--- a/packages/react-sdk/package.json
+++ b/packages/react-sdk/package.json
@@ -36,7 +36,6 @@
},
"dependencies": {
"@jsep-plugin/assignment": "^1.2.1",
- "@nanostores/react": "^0.7.1",
"@webstudio-is/css-engine": "workspace:*",
"@webstudio-is/fonts": "workspace:*",
"@webstudio-is/image": "workspace:*",
@@ -44,7 +43,6 @@
"html-tags": "^3.3.1",
"jsep": "^1.3.8",
"nanoid": "^4.0.2",
- "nanostores": "^0.9.3",
"no-case": "^3.0.4",
"title-case": "^3.0.3"
},
diff --git a/packages/react-sdk/src/context.tsx b/packages/react-sdk/src/context.tsx
index a58fc0e1a8..a41721d48a 100644
--- a/packages/react-sdk/src/context.tsx
+++ b/packages/react-sdk/src/context.tsx
@@ -1,8 +1,5 @@
-import { type ReadableAtom, atom } from "nanostores";
import { createContext } from "react";
-import type { Assets, Page } from "@webstudio-is/sdk";
-import type { PropsByInstanceId } from "./props";
-import type { IndexesWithinAncestors } from "./instance-utils";
+import type { Page } from "@webstudio-is/sdk";
import type { ImageLoader } from "@webstudio-is/image";
export type Params = {
@@ -41,18 +38,10 @@ export const ReactSdkContext = createContext<
* always empty for builder which handle anchor clicks globally
*/
pagesPaths: Set<Page["path"]>;
- propsByInstanceIdStore: ReadableAtom<PropsByInstanceId>;
- assetsStore: ReadableAtom<Assets>;
- dataSourcesLogicStore: ReadableAtom<Map<string, unknown>>;
- indexesWithinAncestors: IndexesWithinAncestors;
}
>({
assetBaseUrl: "/",
imageBaseUrl: "/",
imageLoader: ({ src }) => src,
pagesPaths: new Set(),
- propsByInstanceIdStore: atom(new Map()),
- assetsStore: atom(new Map()),
- dataSourcesLogicStore: atom(new Map()),
- indexesWithinAncestors: new Map(),
});
diff --git a/packages/react-sdk/src/tree/create-elements-tree.tsx b/packages/react-sdk/src/tree/create-elements-tree.tsx
index 7ae6376a66..7694a5f6e0 100644
--- a/packages/react-sdk/src/tree/create-elements-tree.tsx
+++ b/packages/react-sdk/src/tree/create-elements-tree.tsx
@@ -4,13 +4,10 @@ import {
type RefAttributes,
type ReactNode,
} from "react";
-import type { ReadableAtom } from "nanostores";
-import type { Instance, Instances, Assets } from "@webstudio-is/sdk";
+import type { Instance, Instances } from "@webstudio-is/sdk";
import type { Components } from "../components/components-utils";
import { type Params, ReactSdkContext } from "../context";
-import type { PropsByInstanceId } from "../props";
import type { WebstudioComponentProps } from "./webstudio-component";
-import type { IndexesWithinAncestors } from "../instance-utils";
import type { ImageLoader } from "@webstudio-is/image";
type InstanceSelector = Instance["id"][];
@@ -22,10 +19,6 @@ export const createElementsTree = ({
imageLoader,
instances,
rootInstanceId,
- propsByInstanceIdStore,
- assetsStore,
- dataSourcesLogicStore,
- indexesWithinAncestors,
Component,
components,
scripts,
@@ -33,10 +26,6 @@ export const createElementsTree = ({
instances: Instances;
imageLoader: ImageLoader;
rootInstanceId: Instance["id"];
- propsByInstanceIdStore: ReadableAtom<PropsByInstanceId>;
- assetsStore: ReadableAtom<Assets>;
- dataSourcesLogicStore: ReadableAtom<Map<string, unknown>>;
- indexesWithinAncestors: IndexesWithinAncestors;
Component: ForwardRefExoticComponent<
WebstudioComponentProps & RefAttributes<HTMLElement>
@@ -72,15 +61,11 @@ export const createElementsTree = ({
return (
<ReactSdkContext.Provider
value={{
- propsByInstanceIdStore,
- assetsStore,
- dataSourcesLogicStore,
renderer,
imageLoader,
pagesPaths: new Set(),
assetBaseUrl,
imageBaseUrl,
- indexesWithinAncestors,
}}
>
{root}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d6c54c6126..d993f021f9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -431,9 +431,6 @@ importers:
'@types/react-dom':
specifier: ^18.2.7
version: 18.2.7
- '@webstudio-is/http-client':
- specifier: workspace:*
- version: link:../../packages/http-client
typescript:
specifier: 5.2.2
version: 5.2.2
@@ -504,9 +501,6 @@ importers:
'@types/react-dom':
specifier: ^18.2.7
version: 18.2.7
- '@webstudio-is/http-client':
- specifier: workspace:*
- version: link:../../packages/http-client
typescript:
specifier: 5.2.2
version: 5.2.2
@@ -574,9 +568,6 @@ importers:
'@types/react-dom':
specifier: ^18.2.7
version: 18.2.7
- '@webstudio-is/http-client':
- specifier: workspace:*
- version: link:../../packages/http-client
typescript:
specifier: 5.2.2
version: 5.2.2
@@ -638,9 +629,6 @@ importers:
'@types/react-dom':
specifier: ^18.2.7
version: 18.2.7
- '@webstudio-is/http-client':
- specifier: workspace:*
- version: link:../../packages/http-client
typescript:
specifier: 5.2.2
version: 5.2.2
@@ -1519,9 +1507,6 @@ importers:
'@jsep-plugin/assignment':
specifier: ^1.2.1
version: 1.2.1([email protected])
- '@nanostores/react':
- specifier: ^0.7.1
'@webstudio-is/css-engine':
specifier: workspace:*
version: link:../css-engine
@@ -1543,9 +1528,6 @@ importers:
nanoid:
specifier: ^4.0.2
version: 4.0.2
- nanostores:
- specifier: ^0.9.3
- version: 0.9.3
no-case:
specifier: ^3.0.4
version: 3.0.4