Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion apps/builder/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// Our root outlet doesn't contain a layout because we have 2 types of documents: canvas and builder and we need to decide down the line which one to render, thre is no single root document.
import { Outlet, json, useLoaderData } from "@remix-run/react";
import {
Outlet,
json,
useLoaderData,
type ShouldRevalidateFunction,
} from "@remix-run/react";
import { setEnv } from "@webstudio-is/feature-flags";
import env from "./env/env.server";
import { useSetFeatures } from "./shared/use-set-features";
Expand All @@ -17,3 +22,7 @@ export default function App() {

return <Outlet />;
}

export const shouldRevalidate: ShouldRevalidateFunction = () => {
return false;
};
5 changes: 5 additions & 0 deletions apps/builder/app/routes/_ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Scripts,
ScrollRestoration,
type ClientLoaderFunctionArgs,
type ShouldRevalidateFunction,
} from "@remix-run/react";
import interFont from "@fontsource-variable/inter/index.css?url";
import manropeVariableFont from "@fontsource-variable/manrope/index.css?url";
Expand Down Expand Up @@ -106,3 +107,7 @@ export default function Layout() {
</Document>
);
}

export const shouldRevalidate: ShouldRevalidateFunction = () => {
return false;
};
7 changes: 6 additions & 1 deletion apps/builder/app/shared/nano-states/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,12 @@ export const subscribeResources = () => {
cacheByKeys.set(cacheKey, undefined);
}

const result = await loadResources(Array.from(missing.values()));
const missingValues = Array.from(missing.values());
if (missingValues.length === 0) {
return;
}

const result = await loadResources(missingValues);
const newResourceValues = new Map();
for (const request of computedResources) {
const cacheKey = JSON.stringify(request);
Expand Down
Loading