From b0925f0d0be8c309e8cedbec6570d50c9219027a Mon Sep 17 00:00:00 2001 From: Pedro Cattori Date: Wed, 21 Feb 2024 11:25:15 -0600 Subject: [PATCH 01/31] fix hydration errors by reverting `Layout` in non-Vite templates (#8839) --- templates/arc/app/root.tsx | 8 ++------ templates/cloudflare-pages/app/root.tsx | 8 ++------ templates/cloudflare-workers/app/root.tsx | 8 ++------ templates/deno/app/root.tsx | 8 ++------ templates/express/app/root.tsx | 8 ++------ templates/fly/app/root.tsx | 8 ++------ templates/remix-javascript/app/root.jsx | 9 ++------- templates/remix/app/root.tsx | 8 ++------ 8 files changed, 16 insertions(+), 49 deletions(-) diff --git a/templates/arc/app/root.tsx b/templates/arc/app/root.tsx index 4a3b08a8d0e..65d89ed3100 100644 --- a/templates/arc/app/root.tsx +++ b/templates/arc/app/root.tsx @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []), ]; -export function Layout({ children }: { children: React.ReactNode }) { +export default function App() { return ( @@ -24,7 +24,7 @@ export function Layout({ children }: { children: React.ReactNode }) { - {children} + @@ -32,7 +32,3 @@ export function Layout({ children }: { children: React.ReactNode }) { ); } - -export default function App() { - return ; -} diff --git a/templates/cloudflare-pages/app/root.tsx b/templates/cloudflare-pages/app/root.tsx index 88c1bf8aa07..68397b09d47 100644 --- a/templates/cloudflare-pages/app/root.tsx +++ b/templates/cloudflare-pages/app/root.tsx @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []), ]; -export function Layout({ children }: { children: React.ReactNode }) { +export default function App() { return ( @@ -23,7 +23,7 @@ export function Layout({ children }: { children: React.ReactNode }) { - {children} + @@ -31,7 +31,3 @@ export function Layout({ children }: { children: React.ReactNode }) { ); } - -export default function App() { - return ; -} diff --git a/templates/cloudflare-workers/app/root.tsx b/templates/cloudflare-workers/app/root.tsx index 88c1bf8aa07..68397b09d47 100644 --- a/templates/cloudflare-workers/app/root.tsx +++ b/templates/cloudflare-workers/app/root.tsx @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []), ]; -export function Layout({ children }: { children: React.ReactNode }) { +export default function App() { return ( @@ -23,7 +23,7 @@ export function Layout({ children }: { children: React.ReactNode }) { - {children} + @@ -31,7 +31,3 @@ export function Layout({ children }: { children: React.ReactNode }) { ); } - -export default function App() { - return ; -} diff --git a/templates/deno/app/root.tsx b/templates/deno/app/root.tsx index dcc040c13d0..60ddcdf8f82 100644 --- a/templates/deno/app/root.tsx +++ b/templates/deno/app/root.tsx @@ -14,7 +14,7 @@ export const links: LinksFunction = () => [ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []), ]; -export function Layout({ children }: { children: React.ReactNode }) { +export default function App() { return ( @@ -24,7 +24,7 @@ export function Layout({ children }: { children: React.ReactNode }) { - {children} + @@ -32,7 +32,3 @@ export function Layout({ children }: { children: React.ReactNode }) { ); } - -export default function App() { - return ; -} diff --git a/templates/express/app/root.tsx b/templates/express/app/root.tsx index ce47ad99ed3..b46b8fb15bc 100644 --- a/templates/express/app/root.tsx +++ b/templates/express/app/root.tsx @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []), ]; -export function Layout({ children }: { children: React.ReactNode }) { +export default function App() { return ( @@ -23,7 +23,7 @@ export function Layout({ children }: { children: React.ReactNode }) { - {children} + @@ -31,7 +31,3 @@ export function Layout({ children }: { children: React.ReactNode }) { ); } - -export default function App() { - return ; -} diff --git a/templates/fly/app/root.tsx b/templates/fly/app/root.tsx index ce47ad99ed3..b46b8fb15bc 100644 --- a/templates/fly/app/root.tsx +++ b/templates/fly/app/root.tsx @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []), ]; -export function Layout({ children }: { children: React.ReactNode }) { +export default function App() { return ( @@ -23,7 +23,7 @@ export function Layout({ children }: { children: React.ReactNode }) { - {children} + @@ -31,7 +31,3 @@ export function Layout({ children }: { children: React.ReactNode }) { ); } - -export default function App() { - return ; -} diff --git a/templates/remix-javascript/app/root.jsx b/templates/remix-javascript/app/root.jsx index 86228f2a719..b2badce9519 100644 --- a/templates/remix-javascript/app/root.jsx +++ b/templates/remix-javascript/app/root.jsx @@ -12,8 +12,7 @@ export const links = () => [ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []), ]; -// eslint-disable-next-line react/prop-types -export function Layout({ children }) { +export default function App() { return ( @@ -23,7 +22,7 @@ export function Layout({ children }) { - {children} + @@ -31,7 +30,3 @@ export function Layout({ children }) { ); } - -export default function App() { - return ; -} diff --git a/templates/remix/app/root.tsx b/templates/remix/app/root.tsx index ce47ad99ed3..b46b8fb15bc 100644 --- a/templates/remix/app/root.tsx +++ b/templates/remix/app/root.tsx @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [ ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []), ]; -export function Layout({ children }: { children: React.ReactNode }) { +export default function App() { return ( @@ -23,7 +23,7 @@ export function Layout({ children }: { children: React.ReactNode }) { - {children} + @@ -31,7 +31,3 @@ export function Layout({ children }: { children: React.ReactNode }) { ); } - -export default function App() { - return ; -} From c7fe8978d66edbea089c797970c8cba1c1e6195c Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Thu, 22 Feb 2024 00:32:14 +0000 Subject: [PATCH 02/31] simplify the `vite-cloudflare` template (#8808) Co-authored-by: Pedro Cattori --- templates/vite-cloudflare/README.md | 3 +- .../vite-cloudflare/app/routes/_index.tsx | 81 ++++++------------- templates/vite-cloudflare/load-context.ts | 8 ++ templates/vite-cloudflare/package.json | 1 - templates/vite-cloudflare/wrangler.toml | 3 - 5 files changed, 35 insertions(+), 61 deletions(-) delete mode 100644 templates/vite-cloudflare/wrangler.toml diff --git a/templates/vite-cloudflare/README.md b/templates/vite-cloudflare/README.md index 1784caae4e3..22cba04fe8f 100644 --- a/templates/vite-cloudflare/README.md +++ b/templates/vite-cloudflare/README.md @@ -10,8 +10,7 @@ Generate types for your Cloudflare bindings in `wrangler.toml`: npm run typegen ``` -This should have been done for you initially via the `postinstall` script, -but you will need to rerun typegen whenever you make changes to `wrangler.toml`. +You will need to rerun typegen whenever you make changes to `wrangler.toml`. ## Development diff --git a/templates/vite-cloudflare/app/routes/_index.tsx b/templates/vite-cloudflare/app/routes/_index.tsx index fe86669b534..edb05f943a3 100644 --- a/templates/vite-cloudflare/app/routes/_index.tsx +++ b/templates/vite-cloudflare/app/routes/_index.tsx @@ -1,59 +1,30 @@ -import { - json, - type LoaderFunctionArgs, - type ActionFunctionArgs, -} from "@remix-run/cloudflare"; -import { Form, useLoaderData } from "@remix-run/react"; +import type { MetaFunction } from "@remix-run/node"; -const key = "__my-key__"; - -export async function loader({ context }: LoaderFunctionArgs) { - const { MY_KV } = context.cloudflare.env; - const value = await MY_KV.get(key); - return json({ value }); -} - -export async function action({ request, context }: ActionFunctionArgs) { - const { MY_KV: myKv } = context.cloudflare.env; - - if (request.method === "POST") { - const formData = await request.formData(); - const value = formData.get("value") as string; - await myKv.put(key, value); - return null; - } - - if (request.method === "DELETE") { - await myKv.delete(key); - return null; - } - - throw new Error(`Method not supported: "${request.method}"`); -} +export const meta: MetaFunction = () => { + return [ + { title: "New Remix App" }, + { name: "description", content: "Welcome to Remix! Using Vite and Cloudflare!" }, + ]; +}; export default function Index() { - const { value } = useLoaderData(); - return ( -
-

Welcome to Remix

- {value ? ( - <> -

Value: {value}

-
- -
- - ) : ( - <> -

No value

-
- - -
- -
- - )} -
- ); + return (
+

Welcome to Remix (with Vite and Cloudflare)

+ +
); } diff --git a/templates/vite-cloudflare/load-context.ts b/templates/vite-cloudflare/load-context.ts index fcf3a3ce659..2777ca18c05 100644 --- a/templates/vite-cloudflare/load-context.ts +++ b/templates/vite-cloudflare/load-context.ts @@ -1,5 +1,13 @@ import { type PlatformProxy } from "wrangler"; +// When using `wrangler.toml` to configure bindings, +// `wrangler types` will generate types for those bindings +// into the global `Env` interface. +// Need this empty interface so that typechecking passes +// even if no `wrangler.toml` exists. +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface Env {} + type Cloudflare = Omit, "dispose">; declare module "@remix-run/cloudflare" { diff --git a/templates/vite-cloudflare/package.json b/templates/vite-cloudflare/package.json index 884e35d804c..55ccefc8ae2 100644 --- a/templates/vite-cloudflare/package.json +++ b/templates/vite-cloudflare/package.json @@ -3,7 +3,6 @@ "sideEffects": false, "type": "module", "scripts": { - "postinstall": "npm run typegen", "dev": "remix vite:dev", "build": "remix vite:build", "start": "wrangler pages dev ./build/client", diff --git a/templates/vite-cloudflare/wrangler.toml b/templates/vite-cloudflare/wrangler.toml deleted file mode 100644 index 83dfc02cf88..00000000000 --- a/templates/vite-cloudflare/wrangler.toml +++ /dev/null @@ -1,3 +0,0 @@ -kv_namespaces = [ - { id = "MY_KV", binding="MY_KV" } -] From df0a668d416014f19313419dc7701ddcbe4ee312 Mon Sep 17 00:00:00 2001 From: Remix Run Bot Date: Thu, 22 Feb 2024 00:33:54 +0000 Subject: [PATCH 03/31] chore: format --- .../vite-cloudflare/app/routes/_index.tsx | 45 ++++++++++--------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/templates/vite-cloudflare/app/routes/_index.tsx b/templates/vite-cloudflare/app/routes/_index.tsx index edb05f943a3..828fdf19bbc 100644 --- a/templates/vite-cloudflare/app/routes/_index.tsx +++ b/templates/vite-cloudflare/app/routes/_index.tsx @@ -3,28 +3,33 @@ import type { MetaFunction } from "@remix-run/node"; export const meta: MetaFunction = () => { return [ { title: "New Remix App" }, - { name: "description", content: "Welcome to Remix! Using Vite and Cloudflare!" }, + { + name: "description", + content: "Welcome to Remix! Using Vite and Cloudflare!", + }, ]; }; export default function Index() { - return (
-

Welcome to Remix (with Vite and Cloudflare)

- -
); + return ( +
+

Welcome to Remix (with Vite and Cloudflare)

+ +
+ ); } From 4c701b7830cc692cae57a69ed5d2de9f1dfd513b Mon Sep 17 00:00:00 2001 From: Jonathan Waltz Date: Wed, 21 Feb 2024 23:44:08 -1000 Subject: [PATCH 04/31] docs(future/vite): bring in line with template (#8851) --- contributors.yml | 1 + docs/future/vite.md | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/contributors.yml b/contributors.yml index a558c012523..3b0b17c73c9 100644 --- a/contributors.yml +++ b/contributors.yml @@ -315,6 +315,7 @@ - juwiragiye - jveldridge - jvnm-dev +- jwaltz - jwnx - kalch - kamtugeza diff --git a/docs/future/vite.md b/docs/future/vite.md index cf05a57050d..18621be65bc 100644 --- a/docs/future/vite.md +++ b/docs/future/vite.md @@ -168,6 +168,14 @@ you should export a `getLoadContext` function from a shared module so that **loa import { type AppLoadContext } from "@remix-run/cloudflare"; import { type PlatformProxy } from "wrangler"; +// When using `wrangler.toml` to configure bindings, +// `wrangler types` will generate types for those bindings +// into the global `Env` interface. +// Need this empty interface so that typechecking passes +// even if no `wrangler.toml` exists. +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface Env {} + type Cloudflare = Omit, "dispose">; declare module "@remix-run/cloudflare" { From fb04f9566f426293bb8d7d2e235210bec20e2618 Mon Sep 17 00:00:00 2001 From: Remix Run Bot Date: Thu, 22 Feb 2024 09:45:48 +0000 Subject: [PATCH 05/31] chore: format --- docs/future/vite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/future/vite.md b/docs/future/vite.md index 18621be65bc..c2d7edbc017 100644 --- a/docs/future/vite.md +++ b/docs/future/vite.md @@ -173,7 +173,7 @@ import { type PlatformProxy } from "wrangler"; // into the global `Env` interface. // Need this empty interface so that typechecking passes // even if no `wrangler.toml` exists. -// eslint-disable-next-line @typescript-eslint/no-empty-interface + interface Env {} type Cloudflare = Omit, "dispose">; From df5b393463138f9ae4b30ded13c36199de275070 Mon Sep 17 00:00:00 2001 From: Remix Run Bot Date: Thu, 22 Feb 2024 09:47:18 +0000 Subject: [PATCH 06/31] chore: format --- docs/future/vite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/future/vite.md b/docs/future/vite.md index c2d7edbc017..913dc85b356 100644 --- a/docs/future/vite.md +++ b/docs/future/vite.md @@ -173,7 +173,7 @@ import { type PlatformProxy } from "wrangler"; // into the global `Env` interface. // Need this empty interface so that typechecking passes // even if no `wrangler.toml` exists. - + interface Env {} type Cloudflare = Omit, "dispose">; From 1705b6ce22107451a90dbf669421abe041c83ddf Mon Sep 17 00:00:00 2001 From: Simon Depelchin Date: Thu, 22 Feb 2024 16:38:23 +0100 Subject: [PATCH 07/31] docs(vite): update `vite.config.ts` example for Vitest (#8854) --- contributors.yml | 1 + docs/future/vite.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/contributors.yml b/contributors.yml index 3b0b17c73c9..9f5aac8f593 100644 --- a/contributors.yml +++ b/contributors.yml @@ -132,6 +132,7 @@ - Deanmv - defjosiah - denissb +- depsimon - derekr - derenge - devcamke diff --git a/docs/future/vite.md b/docs/future/vite.md index 913dc85b356..b6a64313518 100644 --- a/docs/future/vite.md +++ b/docs/future/vite.md @@ -1069,7 +1069,7 @@ We currently recommend excluding the plugin when used with other Vite-based tool For Vitest: -```ts filename=vite.config.ts lines=[7,12-13] +```ts filename=vite.config.ts lines=[5] import { vitePlugin as remix } from "@remix-run/dev"; import { defineConfig, loadEnv } from "vite"; From bb19e8bf8fb30190ef1af6b90539bba80d63a004 Mon Sep 17 00:00:00 2001 From: Kio Yoshimatsu <69349613+yoshimatsu567@users.noreply.github.com> Date: Fri, 23 Feb 2024 02:06:14 +0900 Subject: [PATCH 08/31] templates: fix typos in `eslintrc.cjs` (#8857) --- contributors.yml | 1 + templates/arc/.eslintrc.cjs | 2 +- templates/cloudflare-pages/.eslintrc.cjs | 2 +- templates/cloudflare-workers/.eslintrc.cjs | 2 +- templates/fly/.eslintrc.cjs | 2 +- templates/remix-javascript/.eslintrc.cjs | 2 +- templates/remix/.eslintrc.cjs | 2 +- templates/spa/.eslintrc.cjs | 2 +- templates/vite-cloudflare/.eslintrc.cjs | 2 +- templates/vite/.eslintrc.cjs | 2 +- 10 files changed, 10 insertions(+), 9 deletions(-) diff --git a/contributors.yml b/contributors.yml index 9f5aac8f593..33c4010a277 100644 --- a/contributors.yml +++ b/contributors.yml @@ -643,6 +643,7 @@ - yauri-io - yesmeck - yomeshgupta +- yoshimatsu567 - youbicode - youngvform - yudai-nkt diff --git a/templates/arc/.eslintrc.cjs b/templates/arc/.eslintrc.cjs index 55667cee506..df9f85fe017 100644 --- a/templates/arc/.eslintrc.cjs +++ b/templates/arc/.eslintrc.cjs @@ -74,7 +74,7 @@ module.exports = { // Node { - files: [".eslintrc.js", "plugin-remix.js"], + files: [".eslintrc.cjs", "plugin-remix.js"], env: { node: true, }, diff --git a/templates/cloudflare-pages/.eslintrc.cjs b/templates/cloudflare-pages/.eslintrc.cjs index 8f2bbcd8af9..c3128a897c8 100644 --- a/templates/cloudflare-pages/.eslintrc.cjs +++ b/templates/cloudflare-pages/.eslintrc.cjs @@ -74,7 +74,7 @@ module.exports = { // Node { - files: [".eslintrc.js"], + files: [".eslintrc.cjs"], env: { node: true, }, diff --git a/templates/cloudflare-workers/.eslintrc.cjs b/templates/cloudflare-workers/.eslintrc.cjs index 8f2bbcd8af9..c3128a897c8 100644 --- a/templates/cloudflare-workers/.eslintrc.cjs +++ b/templates/cloudflare-workers/.eslintrc.cjs @@ -74,7 +74,7 @@ module.exports = { // Node { - files: [".eslintrc.js"], + files: [".eslintrc.cjs"], env: { node: true, }, diff --git a/templates/fly/.eslintrc.cjs b/templates/fly/.eslintrc.cjs index 8f2bbcd8af9..c3128a897c8 100644 --- a/templates/fly/.eslintrc.cjs +++ b/templates/fly/.eslintrc.cjs @@ -74,7 +74,7 @@ module.exports = { // Node { - files: [".eslintrc.js"], + files: [".eslintrc.cjs"], env: { node: true, }, diff --git a/templates/remix-javascript/.eslintrc.cjs b/templates/remix-javascript/.eslintrc.cjs index 777bae21d87..7c254f1ca5d 100644 --- a/templates/remix-javascript/.eslintrc.cjs +++ b/templates/remix-javascript/.eslintrc.cjs @@ -47,7 +47,7 @@ module.exports = { // Node { - files: [".eslintrc.js"], + files: [".eslintrc.cjs"], env: { node: true, }, diff --git a/templates/remix/.eslintrc.cjs b/templates/remix/.eslintrc.cjs index 8f2bbcd8af9..c3128a897c8 100644 --- a/templates/remix/.eslintrc.cjs +++ b/templates/remix/.eslintrc.cjs @@ -74,7 +74,7 @@ module.exports = { // Node { - files: [".eslintrc.js"], + files: [".eslintrc.cjs"], env: { node: true, }, diff --git a/templates/spa/.eslintrc.cjs b/templates/spa/.eslintrc.cjs index 8f2bbcd8af9..c3128a897c8 100644 --- a/templates/spa/.eslintrc.cjs +++ b/templates/spa/.eslintrc.cjs @@ -74,7 +74,7 @@ module.exports = { // Node { - files: [".eslintrc.js"], + files: [".eslintrc.cjs"], env: { node: true, }, diff --git a/templates/vite-cloudflare/.eslintrc.cjs b/templates/vite-cloudflare/.eslintrc.cjs index 8f2bbcd8af9..c3128a897c8 100644 --- a/templates/vite-cloudflare/.eslintrc.cjs +++ b/templates/vite-cloudflare/.eslintrc.cjs @@ -74,7 +74,7 @@ module.exports = { // Node { - files: [".eslintrc.js"], + files: [".eslintrc.cjs"], env: { node: true, }, diff --git a/templates/vite/.eslintrc.cjs b/templates/vite/.eslintrc.cjs index 8f2bbcd8af9..c3128a897c8 100644 --- a/templates/vite/.eslintrc.cjs +++ b/templates/vite/.eslintrc.cjs @@ -74,7 +74,7 @@ module.exports = { // Node { - files: [".eslintrc.js"], + files: [".eslintrc.cjs"], env: { node: true, }, From 471b74b81eed3112e9d28a0b321c4e701cb69a56 Mon Sep 17 00:00:00 2001 From: Jonathan Waltz Date: Thu, 22 Feb 2024 07:16:06 -1000 Subject: [PATCH 09/31] docs(future/vite): update code highlighting (#8853) --- docs/future/vite.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/future/vite.md b/docs/future/vite.md index b6a64313518..0b28e47b700 100644 --- a/docs/future/vite.md +++ b/docs/future/vite.md @@ -164,7 +164,7 @@ export async function loader({ If you'd like to add additional properties to the load context, you should export a `getLoadContext` function from a shared module so that **load context in Vite, Wrangler, and Cloudflare Pages are all augmented in the same way**: -```ts filename=load-context.ts lines=[1,9,13-26] +```ts filename=load-context.ts lines=[1,4-9,20-33] import { type AppLoadContext } from "@remix-run/cloudflare"; import { type PlatformProxy } from "wrangler"; @@ -173,7 +173,6 @@ import { type PlatformProxy } from "wrangler"; // into the global `Env` interface. // Need this empty interface so that typechecking passes // even if no `wrangler.toml` exists. - interface Env {} type Cloudflare = Omit, "dispose">; From c2586640d056a0ddf19ebb51a8f86ec81e171719 Mon Sep 17 00:00:00 2001 From: Jacob Ebey Date: Thu, 22 Feb 2024 16:34:05 -0800 Subject: [PATCH 10/31] chore: remove .d.ts files from templates in favor of tsconfig.json types (#8863) --- templates/vite-cloudflare/env.d.ts | 2 -- templates/vite-cloudflare/tsconfig.json | 3 ++- templates/vite-express/env.d.ts | 2 -- templates/vite-express/tsconfig.json | 3 ++- templates/vite/env.d.ts | 2 -- templates/vite/tsconfig.json | 3 ++- 6 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 templates/vite-cloudflare/env.d.ts delete mode 100644 templates/vite-express/env.d.ts delete mode 100644 templates/vite/env.d.ts diff --git a/templates/vite-cloudflare/env.d.ts b/templates/vite-cloudflare/env.d.ts deleted file mode 100644 index 77f3942249b..00000000000 --- a/templates/vite-cloudflare/env.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/// -/// diff --git a/templates/vite-cloudflare/tsconfig.json b/templates/vite-cloudflare/tsconfig.json index 77291a91091..7e1ead6353b 100644 --- a/templates/vite-cloudflare/tsconfig.json +++ b/templates/vite-cloudflare/tsconfig.json @@ -1,7 +1,8 @@ { - "include": ["env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["**/*.ts", "**/*.tsx"], "compilerOptions": { "lib": ["DOM", "DOM.Iterable", "ES2022"], + "types": ["@remix-run/cloudflare", "vite/client"], "isolatedModules": true, "esModuleInterop": true, "jsx": "react-jsx", diff --git a/templates/vite-express/env.d.ts b/templates/vite-express/env.d.ts deleted file mode 100644 index 78ed2345c6e..00000000000 --- a/templates/vite-express/env.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/// -/// diff --git a/templates/vite-express/tsconfig.json b/templates/vite-express/tsconfig.json index 77291a91091..b35e152455c 100644 --- a/templates/vite-express/tsconfig.json +++ b/templates/vite-express/tsconfig.json @@ -1,7 +1,8 @@ { - "include": ["env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["**/*.ts", "**/*.tsx"], "compilerOptions": { "lib": ["DOM", "DOM.Iterable", "ES2022"], + "types": ["@remix-run/node", "node", "vite/client"], "isolatedModules": true, "esModuleInterop": true, "jsx": "react-jsx", diff --git a/templates/vite/env.d.ts b/templates/vite/env.d.ts deleted file mode 100644 index 78ed2345c6e..00000000000 --- a/templates/vite/env.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/// -/// diff --git a/templates/vite/tsconfig.json b/templates/vite/tsconfig.json index 77291a91091..b35e152455c 100644 --- a/templates/vite/tsconfig.json +++ b/templates/vite/tsconfig.json @@ -1,7 +1,8 @@ { - "include": ["env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["**/*.ts", "**/*.tsx"], "compilerOptions": { "lib": ["DOM", "DOM.Iterable", "ES2022"], + "types": ["@remix-run/node", "node", "vite/client"], "isolatedModules": true, "esModuleInterop": true, "jsx": "react-jsx", From 496a0a379116dcd0b82483435ddb4e1b17f2ebf5 Mon Sep 17 00:00:00 2001 From: tombohub Date: Sun, 25 Feb 2024 15:20:33 -0500 Subject: [PATCH 11/31] Docs: Add Vite templates to official templates list (#8870) --- contributors.yml | 1 + docs/guides/templates.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/contributors.yml b/contributors.yml index 33c4010a277..8530aa60b76 100644 --- a/contributors.yml +++ b/contributors.yml @@ -652,3 +652,4 @@ - zainfathoni - zayenz - zhe +- tombohub diff --git a/docs/guides/templates.md b/docs/guides/templates.md index 7db4b929286..ef0314c86b8 100644 --- a/docs/guides/templates.md +++ b/docs/guides/templates.md @@ -35,6 +35,9 @@ npx create-remix@latest --template remix-run/remix/templates/cloudflare-workers npx create-remix@latest --template remix-run/remix/templates/deno npx create-remix@latest --template remix-run/remix/templates/express npx create-remix@latest --template remix-run/remix/templates/fly +npx create-remix@latest --template remix-run/remix/templates/vite-cloudflare +npx create-remix@latest --template remix-run/remix/templates/vite-express +npx create-remix@latest --template remix-run/remix/templates/vite ## SPA Mode npx create-remix@latest --template remix-run/remix/templates/spa From 7238825857ebb760a80073341a644a23721d35aa Mon Sep 17 00:00:00 2001 From: Remix Run Bot Date: Sun, 25 Feb 2024 20:22:09 +0000 Subject: [PATCH 12/31] chore: format --- contributors.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributors.yml b/contributors.yml index 8530aa60b76..9b1ebf51dd5 100644 --- a/contributors.yml +++ b/contributors.yml @@ -595,6 +595,7 @@ - tjefferson08 - tmcw - tombiju +- tombohub - tombyrer - tomer-yechiel - TomerAberbach @@ -652,4 +653,3 @@ - zainfathoni - zayenz - zhe -- tombohub From a2f2e68b520ffad91112bc0967470b2ad9ccf80c Mon Sep 17 00:00:00 2001 From: alcpereira <48070464+alcpereira@users.noreply.github.com> Date: Mon, 26 Feb 2024 02:54:32 +0000 Subject: [PATCH 13/31] docs: update `*.server.tsx` to `*.server.ts` (#8789) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michaël De Boey --- docs/discussion/server-vs-client.md | 6 +++--- docs/file-conventions/routes.md | 6 +++--- docs/guides/file-uploads.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/discussion/server-vs-client.md b/docs/discussion/server-vs-client.md index d1700db8464..22fd6d73b60 100644 --- a/docs/discussion/server-vs-client.md +++ b/docs/discussion/server-vs-client.md @@ -99,13 +99,13 @@ export default function Component() { ## Forcing Code Out of the Browser or Server Builds -You can force code out of either the client or the server with the [`*.client.tsx`][file_convention_client] and [`*.server.tsx`][file_convention_server] conventions. +You can force code out of either the client or the server with the [`*.client.ts`][file_convention_client] and [`*.server.ts`][file_convention_server] conventions. -While rare, sometimes server code makes it to client bundles because of how the compiler determines the dependencies of a route module, or because you accidentally try to use it in code that needs to ship to the client. You can force it out by adding `*.server.tsx` on the end of the file name. +While rare, sometimes server code makes it to client bundles because of how the compiler determines the dependencies of a route module, or because you accidentally try to use it in code that needs to ship to the client. You can force it out by adding `*.server.ts` on the end of the file name. For example, we could name a module `app/user.server.ts` instead of `app/user.ts` to ensure that the code in that module is never bundled into the client — even if you try to use it in the component. -Additionally, you may depend on client libraries that are unsafe to even bundle on the server — maybe it tries to access [`window`][window_global] by simply being imported. You can likewise remove these modules from the server build by appending `*.client.tsx` to the file name. +Additionally, you may depend on client libraries that are unsafe to even bundle on the server — maybe it tries to access [`window`][window_global] by simply being imported. You can likewise remove these modules from the server build by appending `*.client.ts` to the file name. [action]: ../route/action [headers]: ../route/headers diff --git a/docs/file-conventions/routes.md b/docs/file-conventions/routes.md index 5f62e943617..f695323e82d 100644 --- a/docs/file-conventions/routes.md +++ b/docs/file-conventions/routes.md @@ -333,7 +333,7 @@ app/ │ │ └── scroll-experience.tsx │ ├── _landing.about/ │ │ ├── employee-profile-card.tsx -│ │ ├── get-employee-data.server.tsx +│ │ ├── get-employee-data.server.ts │ │ ├── route.tsx │ │ └── team-photo.jpg │ ├── _landing/ @@ -344,7 +344,7 @@ app/ │ │ ├── route.tsx │ │ └── stats.tsx │ ├── app.projects/ -│ │ ├── get-projects.server.tsx +│ │ ├── get-projects.server.ts │ │ ├── project-buttons.tsx │ │ ├── project-card.tsx │ │ └── route.tsx @@ -355,7 +355,7 @@ app/ │ ├── app_.projects.$id.roadmap/ │ │ ├── chart.tsx │ │ ├── route.tsx -│ │ └── update-timeline.server.tsx +│ │ └── update-timeline.server.ts │ └── contact-us.tsx └── root.tsx ``` diff --git a/docs/guides/file-uploads.md b/docs/guides/file-uploads.md index df8215b6764..c2c1bcfbeba 100644 --- a/docs/guides/file-uploads.md +++ b/docs/guides/file-uploads.md @@ -101,7 +101,7 @@ Your job is to do whatever you need with the `data` and return a value that's a We have the built-in `unstable_createFileUploadHandler` and `unstable_createMemoryUploadHandler` and we also expect more upload handler utilities to be developed in the future. If you have a form that needs to use different upload handlers, you can compose them together with a custom handler, here's a theoretical example: -```tsx filename=file-upload-handler.server.tsx +```ts filename=file-upload-handler.server.ts import type { UploadHandler } from "@remix-run/node"; // or cloudflare/deno import { unstable_createFileUploadHandler } from "@remix-run/node"; // or cloudflare/deno import { createCloudinaryUploadHandler } from "some-handy-remix-util"; From 1d31ee200f5056bc94afcf97e283d5244c07c2e1 Mon Sep 17 00:00:00 2001 From: Naoki Ainoya <2300438+ainoya@users.noreply.github.com> Date: Tue, 27 Feb 2024 02:33:53 +0900 Subject: [PATCH 14/31] remix/templates/cloudflare-pages: ignore .wrangler directory on .gitignore (#8778) --- contributors.yml | 1 + templates/cloudflare-pages/.gitignore | 1 + 2 files changed, 2 insertions(+) diff --git a/contributors.yml b/contributors.yml index 9b1ebf51dd5..7769a9f9e97 100644 --- a/contributors.yml +++ b/contributors.yml @@ -12,6 +12,7 @@ - ahmedeldessouki - ahuth - aiji42 +- ainoya - airjp73 - airondumael - aissa-bouguern diff --git a/templates/cloudflare-pages/.gitignore b/templates/cloudflare-pages/.gitignore index d8bcf95e33c..178bc40f30c 100644 --- a/templates/cloudflare-pages/.gitignore +++ b/templates/cloudflare-pages/.gitignore @@ -7,3 +7,4 @@ node_modules /functions/version.txt /public/build .dev.vars +.wrangler From 2ee3f6977025f347ded02b27fc014e199bacd8d7 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Mon, 26 Feb 2024 12:37:52 -0500 Subject: [PATCH 15/31] Update TOC in release notes --- CHANGELOG.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d973bb1101..243e9b396dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ We manage release notes in this file instead of the paginated Github Releases Pa Table of Contents - [Remix Releases](#remix-releases) + - [2.7.2](#272) + - [Patch Changes](#patch-changes) + - [2.7.1](#271) + - [Patch Changes](#patch-changes-1) - [v2.7.0](#v270) - [What's Changed](#whats-changed) - [Stabilized Vite Plugin](#stabilized-vite-plugin) @@ -20,18 +24,18 @@ We manage release notes in this file instead of the paginated Github Releases Pa - [Basename support](#basename-support) - [Cloudflare Proxy as a Vite Plugin](#cloudflare-proxy-as-a-vite-plugin) - [Minor Changes](#minor-changes) - - [Patch Changes](#patch-changes) + - [Patch Changes](#patch-changes-2) - [Updated Dependencies](#updated-dependencies) - [Changes by Package](#changes-by-package) - [v2.6.0](#v260) - [What's Changed](#whats-changed-1) - [Unstable Vite Plugin updates](#unstable-vite-plugin-updates) - [Minor Changes](#minor-changes-1) - - [Patch Changes](#patch-changes-1) + - [Patch Changes](#patch-changes-3) - [Updated Dependencies](#updated-dependencies-1) - [Changes by Package](#changes-by-package-1) - [v2.5.1](#v251) - - [Patch Changes](#patch-changes-2) + - [Patch Changes](#patch-changes-4) - [Updated Dependencies](#updated-dependencies-2) - [Changes by Package](#changes-by-package-2) - [v2.5.0](#v250) @@ -39,11 +43,11 @@ We manage release notes in this file instead of the paginated Github Releases Pa - [SPA Mode (unstable)](#spa-mode-unstable) - [Server Bundles (unstable)](#server-bundles-unstable) - [Minor Changes](#minor-changes-2) - - [Patch Changes](#patch-changes-3) + - [Patch Changes](#patch-changes-5) - [Updated Dependencies](#updated-dependencies-3) - [Changes by Package](#changes-by-package-3) - [v2.4.1](#v241) - - [Patch Changes](#patch-changes-4) + - [Patch Changes](#patch-changes-6) - [Updated Dependencies](#updated-dependencies-4) - [Changes by Package](#changes-by-package-4) - [v2.4.0](#v240) @@ -52,11 +56,11 @@ We manage release notes in this file instead of the paginated Github Releases Pa - [`future.v3_relativeSplatPath`](#futurev3_relativesplatpath) - [Vite Updates (Unstable)](#vite-updates-unstable) - [Minor Changes](#minor-changes-3) - - [Patch Changes](#patch-changes-5) + - [Patch Changes](#patch-changes-7) - [Updated Dependencies](#updated-dependencies-5) - [Changes by Package](#changes-by-package-5) - [v2.3.1](#v231) - - [Patch Changes](#patch-changes-6) + - [Patch Changes](#patch-changes-8) - [Updated Dependencies](#updated-dependencies-6) - [Changes by Package](#changes-by-package-6) - [v2.3.0](#v230) @@ -64,7 +68,7 @@ We manage release notes in this file instead of the paginated Github Releases Pa - [Stabilized `useBlocker`](#stabilized-useblocker) - [`unstable_flushSync` API](#unstable_flushsync-api) - [Minor Changes](#minor-changes-4) - - [Patch Changes](#patch-changes-7) + - [Patch Changes](#patch-changes-9) - [Updated Dependencies](#updated-dependencies-7) - [Changes by Package](#changes-by-package-7) - [v2.2.0](#v220) @@ -73,7 +77,7 @@ We manage release notes in this file instead of the paginated Github Releases Pa - [New Fetcher APIs](#new-fetcher-apis) - [Persistence Future Flag](#persistence-future-flag) - [Minor Changes](#minor-changes-5) - - [Patch Changes](#patch-changes-8) + - [Patch Changes](#patch-changes-10) - [Updated Dependencies](#updated-dependencies-8) - [Changes by Package](#changes-by-package-8) - [v2.1.0](#v210) @@ -81,11 +85,11 @@ We manage release notes in this file instead of the paginated Github Releases Pa - [View Transitions](#view-transitions) - [Stable `createRemixStub`](#stable-createremixstub) - [Minor Changes](#minor-changes-6) - - [Patch Changes](#patch-changes-9) + - [Patch Changes](#patch-changes-11) - [Updated Dependencies](#updated-dependencies-9) - [Changes by Package](#changes-by-package-9) - [v2.0.1](#v201) - - [Patch Changes](#patch-changes-10) + - [Patch Changes](#patch-changes-12) - [Changes by Package 🔗](#changes-by-package-) - [v2.0.0](#v200) - [Breaking Changes](#breaking-changes) From 9159b52cb79141295029d2dd9607363edc5f5dfb Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Mon, 26 Feb 2024 14:39:56 -0500 Subject: [PATCH 16/31] Remove unstable note from SPA template (#8893) --- templates/spa/README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/templates/spa/README.md b/templates/spa/README.md index 3e5f3605f6d..033f096723a 100644 --- a/templates/spa/README.md +++ b/templates/spa/README.md @@ -1,10 +1,6 @@ # templates/spa -This template leverages [Remix SPA Mode](https://remix.run/docs/en/main/future/spa-mode) to build your app as a Single-Page Application using [Client Data](https://remix.run/docs/en/main/guides/client-data) for all of you data loads and mutations. - -⚠️ This is built on top of the Remix Vite template. Remix support for Vite is currently unstable and not recommended for production. - -📖 See the [Remix Vite docs][remix-vite-docs] for details on supported features. +This template leverages [Remix SPA Mode](https://remix.run/docs/en/main/future/spa-mode) and the [Remix Vite Plugin](https://remix.run/docs/en/main/future/vite) to build your app as a Single-Page Application using [Client Data](https://remix.run/docs/en/main/guides/client-data) for all of your data loads and mutations. ## Setup @@ -36,7 +32,9 @@ You can preview the build locally with [vite preview](https://vitejs.dev/guide/c npm run preview ``` -> ![WARNING] `vite preview` is not designed for use as a production server +> [!IMPORTANT] +> +> `vite preview` is not designed for use as a production server ### Deployment @@ -47,5 +45,3 @@ For a simple example, you could use [sirv-cli](https://www.npmjs.com/package/sir ```shellscript npx sirv-cli build/client/ --single ``` - -[remix-vite-docs]: https://remix.run/docs/en/main/future/vite From 9558e1555ab689864be845308956ffc6662d6501 Mon Sep 17 00:00:00 2001 From: Brooks Lybrand Date: Mon, 26 Feb 2024 15:49:58 -0600 Subject: [PATCH 17/31] Switch StackBlitz link to use remix.new (#8873) --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 068e6623a36..246dece0607 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -20,7 +20,7 @@ body: If you'd rather open a GitHub issue, here are other ways to share a reproduction (ordered from most helpful to least): - - 🥇 Link to a [StackBlitz](https://stackblitz.com/?starters=fullstack) environment + - 🥇 Link to a [StackBlitz](https://remix.new) environment - 🥈 Link to a GitHub repository - 🥉 Description of project including template, `remix.config.js`, `package.json` scripts, etc. From fabcad29a9ac0c0b4a7814faa984e21dede2485b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teemu=20Sirki=C3=A4?= Date: Tue, 27 Feb 2024 00:20:21 +0200 Subject: [PATCH 18/31] docs: Update useFetcher to include mention of JSON data (#8787) Co-authored-by: Matt Brophy --- contributors.yml | 1 + docs/hooks/use-fetcher.md | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/contributors.yml b/contributors.yml index 7769a9f9e97..6c1570dbd32 100644 --- a/contributors.yml +++ b/contributors.yml @@ -604,6 +604,7 @@ - toufiqnuur - toyozaki - TrySound +- ttsirkia - turkerdev - tvanantwerp - twhitbeck diff --git a/docs/hooks/use-fetcher.md b/docs/hooks/use-fetcher.md index dce3dd6fa09..6a8364b35d5 100644 --- a/docs/hooks/use-fetcher.md +++ b/docs/hooks/use-fetcher.md @@ -70,21 +70,40 @@ The `formData` can be multiple types: - [`FormData`][form_data] - A `FormData` instance. - [`HTMLFormElement`][html_form_element] - A [`
`][form_element] DOM element. -- `Object` - An object of key/value pairs that will be converted to a `FormData` instance. +- `Object` - An object of key/value pairs that will be converted to a `FormData` instance by default. You can pass a more complex object and serialize it as JSON by specifying `encType: "application/json"`. See [`useSubmit`][use-submit] for more details. If the method is `GET`, then the route [`loader`][loader] is being called and with the `formData` serialized to the url as [`URLSearchParams`][url_search_params]. If `DELETE`, `PATCH`, `POST`, or `PUT`, then the route [`action`][action] is being called with `formData` as the body. ```tsx +// Submit a FormData instance (GET request) +let formData = new FormData(); +fetcher.submit(formData); + +// Submit the HTML form element fetcher.submit(event.currentTarget.form, { method: "POST", }); +// Submit key/value JSON as a FormData instance fetcher.submit( { serialized: "values" }, { method: "POST" } ); -fetcher.submit(formData); +// Submit raw JSON +fetcher.submit( + { + deeply: { + nested: { + json: "values" + } + } + }, + { + method: "POST", + encType: "application/json" + } +); ``` `fetcher.submit` is a wrapper around a [`useSubmit`][use-submit] call for the fetcher instance, so it also accepts the same options as `useSubmit`. From 6c5f84279dc2f3b6745c01d9f68050028107dae5 Mon Sep 17 00:00:00 2001 From: Remix Run Bot Date: Mon, 26 Feb 2024 22:21:52 +0000 Subject: [PATCH 19/31] chore: format --- docs/hooks/use-fetcher.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/hooks/use-fetcher.md b/docs/hooks/use-fetcher.md index 6a8364b35d5..3998ac9ae37 100644 --- a/docs/hooks/use-fetcher.md +++ b/docs/hooks/use-fetcher.md @@ -76,7 +76,7 @@ If the method is `GET`, then the route [`loader`][loader] is being called and wi ```tsx // Submit a FormData instance (GET request) -let formData = new FormData(); +const formData = new FormData(); fetcher.submit(formData); // Submit the HTML form element @@ -92,16 +92,16 @@ fetcher.submit( // Submit raw JSON fetcher.submit( - { - deeply: { - nested: { - json: "values" - } - } + { + deeply: { + nested: { + json: "values", + }, + }, }, - { - method: "POST", - encType: "application/json" + { + method: "POST", + encType: "application/json", } ); ``` From f60bcf4d27e6c5afa965a8e35e7f7b57115385e2 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Tue, 27 Feb 2024 09:20:38 -0500 Subject: [PATCH 20/31] Sync vite templates with others re: entry files and polyfills (#8896) --- .../vite-cloudflare/app/entry.client.tsx | 18 +++ .../vite-cloudflare/app/entry.server.tsx | 43 ++++++ templates/vite-express/app/entry.client.tsx | 18 +++ templates/vite-express/app/entry.server.tsx | 140 ++++++++++++++++++ templates/vite/app/entry.client.tsx | 18 +++ templates/vite/app/entry.server.tsx | 140 ++++++++++++++++++ templates/vite/vite.config.ts | 3 + 7 files changed, 380 insertions(+) create mode 100644 templates/vite-cloudflare/app/entry.client.tsx create mode 100644 templates/vite-cloudflare/app/entry.server.tsx create mode 100644 templates/vite-express/app/entry.client.tsx create mode 100644 templates/vite-express/app/entry.server.tsx create mode 100644 templates/vite/app/entry.client.tsx create mode 100644 templates/vite/app/entry.server.tsx diff --git a/templates/vite-cloudflare/app/entry.client.tsx b/templates/vite-cloudflare/app/entry.client.tsx new file mode 100644 index 00000000000..94d5dc0de0f --- /dev/null +++ b/templates/vite-cloudflare/app/entry.client.tsx @@ -0,0 +1,18 @@ +/** + * By default, Remix will handle hydrating your app on the client for you. + * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ + * For more information, see https://remix.run/file-conventions/entry.client + */ + +import { RemixBrowser } from "@remix-run/react"; +import { startTransition, StrictMode } from "react"; +import { hydrateRoot } from "react-dom/client"; + +startTransition(() => { + hydrateRoot( + document, + + + + ); +}); diff --git a/templates/vite-cloudflare/app/entry.server.tsx b/templates/vite-cloudflare/app/entry.server.tsx new file mode 100644 index 00000000000..0d5c40a755e --- /dev/null +++ b/templates/vite-cloudflare/app/entry.server.tsx @@ -0,0 +1,43 @@ +/** + * By default, Remix will handle generating the HTTP Response for you. + * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ + * For more information, see https://remix.run/file-conventions/entry.server + */ + +import type { AppLoadContext, EntryContext } from "@remix-run/cloudflare"; +import { RemixServer } from "@remix-run/react"; +import { isbot } from "isbot"; +import { renderToReadableStream } from "react-dom/server"; + +export default async function handleRequest( + request: Request, + responseStatusCode: number, + responseHeaders: Headers, + remixContext: EntryContext, + // This is ignored so we can keep it in the template for visibility. Feel + // free to delete this parameter in your app if you're not using it! + // eslint-disable-next-line @typescript-eslint/no-unused-vars + loadContext: AppLoadContext +) { + const body = await renderToReadableStream( + , + { + signal: request.signal, + onError(error: unknown) { + // Log streaming rendering errors from inside the shell + console.error(error); + responseStatusCode = 500; + }, + } + ); + + if (isbot(request.headers.get("user-agent") || "")) { + await body.allReady; + } + + responseHeaders.set("Content-Type", "text/html"); + return new Response(body, { + headers: responseHeaders, + status: responseStatusCode, + }); +} diff --git a/templates/vite-express/app/entry.client.tsx b/templates/vite-express/app/entry.client.tsx new file mode 100644 index 00000000000..94d5dc0de0f --- /dev/null +++ b/templates/vite-express/app/entry.client.tsx @@ -0,0 +1,18 @@ +/** + * By default, Remix will handle hydrating your app on the client for you. + * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ + * For more information, see https://remix.run/file-conventions/entry.client + */ + +import { RemixBrowser } from "@remix-run/react"; +import { startTransition, StrictMode } from "react"; +import { hydrateRoot } from "react-dom/client"; + +startTransition(() => { + hydrateRoot( + document, + + + + ); +}); diff --git a/templates/vite-express/app/entry.server.tsx b/templates/vite-express/app/entry.server.tsx new file mode 100644 index 00000000000..45db3229c68 --- /dev/null +++ b/templates/vite-express/app/entry.server.tsx @@ -0,0 +1,140 @@ +/** + * By default, Remix will handle generating the HTTP Response for you. + * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ + * For more information, see https://remix.run/file-conventions/entry.server + */ + +import { PassThrough } from "node:stream"; + +import type { AppLoadContext, EntryContext } from "@remix-run/node"; +import { createReadableStreamFromReadable } from "@remix-run/node"; +import { RemixServer } from "@remix-run/react"; +import { isbot } from "isbot"; +import { renderToPipeableStream } from "react-dom/server"; + +const ABORT_DELAY = 5_000; + +export default function handleRequest( + request: Request, + responseStatusCode: number, + responseHeaders: Headers, + remixContext: EntryContext, + // This is ignored so we can keep it in the template for visibility. Feel + // free to delete this parameter in your app if you're not using it! + // eslint-disable-next-line @typescript-eslint/no-unused-vars + loadContext: AppLoadContext +) { + return isbot(request.headers.get("user-agent") || "") + ? handleBotRequest( + request, + responseStatusCode, + responseHeaders, + remixContext + ) + : handleBrowserRequest( + request, + responseStatusCode, + responseHeaders, + remixContext + ); +} + +function handleBotRequest( + request: Request, + responseStatusCode: number, + responseHeaders: Headers, + remixContext: EntryContext +) { + return new Promise((resolve, reject) => { + let shellRendered = false; + const { pipe, abort } = renderToPipeableStream( + , + { + onAllReady() { + shellRendered = true; + const body = new PassThrough(); + const stream = createReadableStreamFromReadable(body); + + responseHeaders.set("Content-Type", "text/html"); + + resolve( + new Response(stream, { + headers: responseHeaders, + status: responseStatusCode, + }) + ); + + pipe(body); + }, + onShellError(error: unknown) { + reject(error); + }, + onError(error: unknown) { + responseStatusCode = 500; + // Log streaming rendering errors from inside the shell. Don't log + // errors encountered during initial shell rendering since they'll + // reject and get logged in handleDocumentRequest. + if (shellRendered) { + console.error(error); + } + }, + } + ); + + setTimeout(abort, ABORT_DELAY); + }); +} + +function handleBrowserRequest( + request: Request, + responseStatusCode: number, + responseHeaders: Headers, + remixContext: EntryContext +) { + return new Promise((resolve, reject) => { + let shellRendered = false; + const { pipe, abort } = renderToPipeableStream( + , + { + onShellReady() { + shellRendered = true; + const body = new PassThrough(); + const stream = createReadableStreamFromReadable(body); + + responseHeaders.set("Content-Type", "text/html"); + + resolve( + new Response(stream, { + headers: responseHeaders, + status: responseStatusCode, + }) + ); + + pipe(body); + }, + onShellError(error: unknown) { + reject(error); + }, + onError(error: unknown) { + responseStatusCode = 500; + // Log streaming rendering errors from inside the shell. Don't log + // errors encountered during initial shell rendering since they'll + // reject and get logged in handleDocumentRequest. + if (shellRendered) { + console.error(error); + } + }, + } + ); + + setTimeout(abort, ABORT_DELAY); + }); +} diff --git a/templates/vite/app/entry.client.tsx b/templates/vite/app/entry.client.tsx new file mode 100644 index 00000000000..94d5dc0de0f --- /dev/null +++ b/templates/vite/app/entry.client.tsx @@ -0,0 +1,18 @@ +/** + * By default, Remix will handle hydrating your app on the client for you. + * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ + * For more information, see https://remix.run/file-conventions/entry.client + */ + +import { RemixBrowser } from "@remix-run/react"; +import { startTransition, StrictMode } from "react"; +import { hydrateRoot } from "react-dom/client"; + +startTransition(() => { + hydrateRoot( + document, + + + + ); +}); diff --git a/templates/vite/app/entry.server.tsx b/templates/vite/app/entry.server.tsx new file mode 100644 index 00000000000..45db3229c68 --- /dev/null +++ b/templates/vite/app/entry.server.tsx @@ -0,0 +1,140 @@ +/** + * By default, Remix will handle generating the HTTP Response for you. + * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ + * For more information, see https://remix.run/file-conventions/entry.server + */ + +import { PassThrough } from "node:stream"; + +import type { AppLoadContext, EntryContext } from "@remix-run/node"; +import { createReadableStreamFromReadable } from "@remix-run/node"; +import { RemixServer } from "@remix-run/react"; +import { isbot } from "isbot"; +import { renderToPipeableStream } from "react-dom/server"; + +const ABORT_DELAY = 5_000; + +export default function handleRequest( + request: Request, + responseStatusCode: number, + responseHeaders: Headers, + remixContext: EntryContext, + // This is ignored so we can keep it in the template for visibility. Feel + // free to delete this parameter in your app if you're not using it! + // eslint-disable-next-line @typescript-eslint/no-unused-vars + loadContext: AppLoadContext +) { + return isbot(request.headers.get("user-agent") || "") + ? handleBotRequest( + request, + responseStatusCode, + responseHeaders, + remixContext + ) + : handleBrowserRequest( + request, + responseStatusCode, + responseHeaders, + remixContext + ); +} + +function handleBotRequest( + request: Request, + responseStatusCode: number, + responseHeaders: Headers, + remixContext: EntryContext +) { + return new Promise((resolve, reject) => { + let shellRendered = false; + const { pipe, abort } = renderToPipeableStream( + , + { + onAllReady() { + shellRendered = true; + const body = new PassThrough(); + const stream = createReadableStreamFromReadable(body); + + responseHeaders.set("Content-Type", "text/html"); + + resolve( + new Response(stream, { + headers: responseHeaders, + status: responseStatusCode, + }) + ); + + pipe(body); + }, + onShellError(error: unknown) { + reject(error); + }, + onError(error: unknown) { + responseStatusCode = 500; + // Log streaming rendering errors from inside the shell. Don't log + // errors encountered during initial shell rendering since they'll + // reject and get logged in handleDocumentRequest. + if (shellRendered) { + console.error(error); + } + }, + } + ); + + setTimeout(abort, ABORT_DELAY); + }); +} + +function handleBrowserRequest( + request: Request, + responseStatusCode: number, + responseHeaders: Headers, + remixContext: EntryContext +) { + return new Promise((resolve, reject) => { + let shellRendered = false; + const { pipe, abort } = renderToPipeableStream( + , + { + onShellReady() { + shellRendered = true; + const body = new PassThrough(); + const stream = createReadableStreamFromReadable(body); + + responseHeaders.set("Content-Type", "text/html"); + + resolve( + new Response(stream, { + headers: responseHeaders, + status: responseStatusCode, + }) + ); + + pipe(body); + }, + onShellError(error: unknown) { + reject(error); + }, + onError(error: unknown) { + responseStatusCode = 500; + // Log streaming rendering errors from inside the shell. Don't log + // errors encountered during initial shell rendering since they'll + // reject and get logged in handleDocumentRequest. + if (shellRendered) { + console.error(error); + } + }, + } + ); + + setTimeout(abort, ABORT_DELAY); + }); +} diff --git a/templates/vite/vite.config.ts b/templates/vite/vite.config.ts index a1fcb5a7b79..2b6aff98727 100644 --- a/templates/vite/vite.config.ts +++ b/templates/vite/vite.config.ts @@ -1,7 +1,10 @@ import { vitePlugin as remix } from "@remix-run/dev"; +import { installGlobals } from "@remix-run/node"; import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; +installGlobals(); + export default defineConfig({ plugins: [remix(), tsconfigPaths()], }); From 336e220177f28734292947f0c9489ea3adc36ab1 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Tue, 27 Feb 2024 10:32:09 -0500 Subject: [PATCH 21/31] Enter prerelease mode --- .changeset/pre.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .changeset/pre.json diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 00000000000..1c82d8ee19e --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,24 @@ +{ + "mode": "pre", + "tag": "pre", + "initialVersions": { + "integration-tests": "0.0.0", + "create-remix": "2.7.2", + "remix": "2.7.2", + "@remix-run/architect": "2.7.2", + "@remix-run/cloudflare": "2.7.2", + "@remix-run/cloudflare-pages": "2.7.2", + "@remix-run/cloudflare-workers": "2.7.2", + "@remix-run/css-bundle": "2.7.2", + "@remix-run/deno": "2.7.2", + "@remix-run/dev": "2.7.2", + "@remix-run/eslint-config": "2.7.2", + "@remix-run/express": "2.7.2", + "@remix-run/node": "2.7.2", + "@remix-run/react": "2.7.2", + "@remix-run/serve": "2.7.2", + "@remix-run/server-runtime": "2.7.2", + "@remix-run/testing": "2.7.2" + }, + "changesets": [] +} From fe9979c6765b9e352591c83d03064f1185538cfa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 27 Feb 2024 10:44:21 -0500 Subject: [PATCH 22/31] chore: Update version for release (pre) (#8904) Co-authored-by: github-actions[bot] --- .changeset/pre.json | 10 +++++++++- packages/create-remix/CHANGELOG.md | 2 ++ packages/create-remix/package.json | 2 +- packages/remix-architect/CHANGELOG.md | 7 +++++++ packages/remix-architect/package.json | 4 ++-- packages/remix-cloudflare-pages/CHANGELOG.md | 7 +++++++ packages/remix-cloudflare-pages/package.json | 4 ++-- packages/remix-cloudflare-workers/CHANGELOG.md | 7 +++++++ packages/remix-cloudflare-workers/package.json | 4 ++-- packages/remix-cloudflare/CHANGELOG.md | 7 +++++++ packages/remix-cloudflare/package.json | 4 ++-- packages/remix-css-bundle/CHANGELOG.md | 2 ++ packages/remix-css-bundle/package.json | 2 +- packages/remix-deno/CHANGELOG.md | 7 +++++++ packages/remix-deno/package.json | 4 ++-- packages/remix-dev/CHANGELOG.md | 17 +++++++++++++++++ packages/remix-dev/package.json | 10 +++++----- packages/remix-eslint-config/CHANGELOG.md | 2 ++ packages/remix-eslint-config/package.json | 2 +- packages/remix-express/CHANGELOG.md | 7 +++++++ packages/remix-express/package.json | 4 ++-- packages/remix-node/CHANGELOG.md | 7 +++++++ packages/remix-node/package.json | 4 ++-- packages/remix-react/CHANGELOG.md | 9 +++++++++ packages/remix-react/package.json | 4 ++-- packages/remix-serve/CHANGELOG.md | 8 ++++++++ packages/remix-serve/package.json | 6 +++--- packages/remix-server-runtime/CHANGELOG.md | 2 ++ packages/remix-server-runtime/package.json | 2 +- packages/remix-testing/CHANGELOG.md | 8 ++++++++ packages/remix-testing/package.json | 6 +++--- packages/remix/package.json | 2 +- 32 files changed, 140 insertions(+), 33 deletions(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 1c82d8ee19e..fb9e016d371 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -20,5 +20,13 @@ "@remix-run/server-runtime": "2.7.2", "@remix-run/testing": "2.7.2" }, - "changesets": [] + "changesets": [ + "layout-error-boundary", + "layout-hydrate-fallback", + "many-grapes-confess", + "quick-experts-enjoy", + "shy-fireants-listen", + "silver-years-roll", + "tender-keys-develop" + ] } diff --git a/packages/create-remix/CHANGELOG.md b/packages/create-remix/CHANGELOG.md index 3b22a5efcc0..3f60794e796 100644 --- a/packages/create-remix/CHANGELOG.md +++ b/packages/create-remix/CHANGELOG.md @@ -1,5 +1,7 @@ # `create-remix` +## 2.8.0-pre.0 + ## 2.7.2 ## 2.7.1 diff --git a/packages/create-remix/package.json b/packages/create-remix/package.json index 47605ef5769..52fd302fddf 100644 --- a/packages/create-remix/package.json +++ b/packages/create-remix/package.json @@ -1,6 +1,6 @@ { "name": "create-remix", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Create a new Remix app", "homepage": "https://remix.run", "bugs": { diff --git a/packages/remix-architect/CHANGELOG.md b/packages/remix-architect/CHANGELOG.md index f8527dff49c..bf0db183c87 100644 --- a/packages/remix-architect/CHANGELOG.md +++ b/packages/remix-architect/CHANGELOG.md @@ -1,5 +1,12 @@ # `@remix-run/architect` +## 2.8.0-pre.0 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/node@2.8.0-pre.0` + ## 2.7.2 ### Patch Changes diff --git a/packages/remix-architect/package.json b/packages/remix-architect/package.json index 02078f4c3ee..7355de315c7 100644 --- a/packages/remix-architect/package.json +++ b/packages/remix-architect/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/architect", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Architect server request handler for Remix", "bugs": { "url": "https://github.com/remix-run/remix/issues" @@ -15,7 +15,7 @@ "typings": "dist/index.d.ts", "dependencies": { "@architect/functions": "^5.2.0", - "@remix-run/node": "2.7.2", + "@remix-run/node": "2.8.0-pre.0", "@types/aws-lambda": "^8.10.82" }, "devDependencies": { diff --git a/packages/remix-cloudflare-pages/CHANGELOG.md b/packages/remix-cloudflare-pages/CHANGELOG.md index 71a83f41d36..fa005479fc3 100644 --- a/packages/remix-cloudflare-pages/CHANGELOG.md +++ b/packages/remix-cloudflare-pages/CHANGELOG.md @@ -1,5 +1,12 @@ # `@remix-run/cloudflare-pages` +## 2.8.0-pre.0 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/cloudflare@2.8.0-pre.0` + ## 2.7.2 ### Patch Changes diff --git a/packages/remix-cloudflare-pages/package.json b/packages/remix-cloudflare-pages/package.json index 5c0442bb557..91210007bea 100644 --- a/packages/remix-cloudflare-pages/package.json +++ b/packages/remix-cloudflare-pages/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/cloudflare-pages", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Cloudflare Pages request handler for Remix", "bugs": { "url": "https://github.com/remix-run/remix/issues" @@ -15,7 +15,7 @@ "typings": "dist/index.d.ts", "module": "dist/esm/index.js", "dependencies": { - "@remix-run/cloudflare": "2.7.2" + "@remix-run/cloudflare": "2.8.0-pre.0" }, "devDependencies": { "@cloudflare/workers-types": "^4.20230518.0", diff --git a/packages/remix-cloudflare-workers/CHANGELOG.md b/packages/remix-cloudflare-workers/CHANGELOG.md index 4f9c9b2ceca..e270cb53a57 100644 --- a/packages/remix-cloudflare-workers/CHANGELOG.md +++ b/packages/remix-cloudflare-workers/CHANGELOG.md @@ -1,5 +1,12 @@ # `@remix-run/cloudflare-workers` +## 2.8.0-pre.0 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/cloudflare@2.8.0-pre.0` + ## 2.7.2 ### Patch Changes diff --git a/packages/remix-cloudflare-workers/package.json b/packages/remix-cloudflare-workers/package.json index 7c24ed62a67..9bfe3956c77 100644 --- a/packages/remix-cloudflare-workers/package.json +++ b/packages/remix-cloudflare-workers/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/cloudflare-workers", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Cloudflare worker request handler for Remix", "bugs": { "url": "https://github.com/remix-run/remix/issues" @@ -16,7 +16,7 @@ "module": "dist/esm/index.js", "dependencies": { "@cloudflare/kv-asset-handler": "^0.1.3", - "@remix-run/cloudflare": "2.7.2" + "@remix-run/cloudflare": "2.8.0-pre.0" }, "devDependencies": { "@cloudflare/workers-types": "^4.20230518.0", diff --git a/packages/remix-cloudflare/CHANGELOG.md b/packages/remix-cloudflare/CHANGELOG.md index 11e60a3c6d4..1f522d41644 100644 --- a/packages/remix-cloudflare/CHANGELOG.md +++ b/packages/remix-cloudflare/CHANGELOG.md @@ -1,5 +1,12 @@ # `@remix-run/cloudflare` +## 2.8.0-pre.0 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/server-runtime@2.8.0-pre.0` + ## 2.7.2 ### Patch Changes diff --git a/packages/remix-cloudflare/package.json b/packages/remix-cloudflare/package.json index 37e85ea27d7..2d7d1a4cac0 100644 --- a/packages/remix-cloudflare/package.json +++ b/packages/remix-cloudflare/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/cloudflare", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Cloudflare platform abstractions for Remix", "bugs": { "url": "https://github.com/remix-run/remix/issues" @@ -15,7 +15,7 @@ "typings": "dist/index.d.ts", "dependencies": { "@cloudflare/kv-asset-handler": "^0.1.3", - "@remix-run/server-runtime": "2.7.2" + "@remix-run/server-runtime": "2.8.0-pre.0" }, "devDependencies": { "@cloudflare/workers-types": "^4.20230518.0", diff --git a/packages/remix-css-bundle/CHANGELOG.md b/packages/remix-css-bundle/CHANGELOG.md index 5ff55653c18..468281b8d2f 100644 --- a/packages/remix-css-bundle/CHANGELOG.md +++ b/packages/remix-css-bundle/CHANGELOG.md @@ -1,5 +1,7 @@ # @remix-run/css-bundle +## 2.8.0-pre.0 + ## 2.7.2 ## 2.7.1 diff --git a/packages/remix-css-bundle/package.json b/packages/remix-css-bundle/package.json index 8cc58f7dfb2..956bf19cda4 100644 --- a/packages/remix-css-bundle/package.json +++ b/packages/remix-css-bundle/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/css-bundle", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "CSS bundle href when using CSS bundling features in Remix", "homepage": "https://remix.run", "bugs": { diff --git a/packages/remix-deno/CHANGELOG.md b/packages/remix-deno/CHANGELOG.md index b9eb9c084b1..d1585ca4364 100644 --- a/packages/remix-deno/CHANGELOG.md +++ b/packages/remix-deno/CHANGELOG.md @@ -1,5 +1,12 @@ # `@remix-run/deno` +## 2.8.0-pre.0 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/server-runtime@2.8.0-pre.0` + ## 2.7.2 ### Patch Changes diff --git a/packages/remix-deno/package.json b/packages/remix-deno/package.json index 1e3aa66d786..c4725327845 100644 --- a/packages/remix-deno/package.json +++ b/packages/remix-deno/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/deno", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Deno platform abstractions for Remix", "homepage": "https://remix.run", "main": "./index.ts", @@ -15,7 +15,7 @@ "license": "MIT", "sideEffects": false, "dependencies": { - "@remix-run/server-runtime": "2.7.2", + "@remix-run/server-runtime": "2.8.0-pre.0", "mime": "^3.0.0" }, "peerDependencies": { diff --git a/packages/remix-dev/CHANGELOG.md b/packages/remix-dev/CHANGELOG.md index 5cb7ed7cd2e..36d9af746c9 100644 --- a/packages/remix-dev/CHANGELOG.md +++ b/packages/remix-dev/CHANGELOG.md @@ -1,5 +1,22 @@ # `@remix-run/dev` +## 2.8.0-pre.0 + +### Minor Changes + +- Pass resolved `viteConfig` to Remix Vite plugin's `buildEnd` hook ([#8885](https://github.com/remix-run/remix/pull/8885)) + +### Patch Changes + +- fix: mark Layout as browser safe route export ([#8842](https://github.com/remix-run/remix/pull/8842)) +- Vite: Silence build warnings when dependencies include "use client" directives ([#8897](https://github.com/remix-run/remix/pull/8897)) +- Vite: Fix `serverBundles` issue where multiple browser manifests are generated ([#8864](https://github.com/remix-run/remix/pull/8864)) +- Support custom Vite `build.assetsDir` option ([#8843](https://github.com/remix-run/remix/pull/8843)) +- Updated dependencies: + - `@remix-run/node@2.8.0-pre.0` + - `@remix-run/serve@2.8.0-pre.0` + - `@remix-run/server-runtime@2.8.0-pre.0` + ## 2.7.2 ### Patch Changes diff --git a/packages/remix-dev/package.json b/packages/remix-dev/package.json index 0cc96d24b8e..4426870cfd0 100644 --- a/packages/remix-dev/package.json +++ b/packages/remix-dev/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/dev", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Dev tools and CLI for Remix", "homepage": "https://remix.run", "bugs": { @@ -28,9 +28,9 @@ "@babel/types": "^7.22.5", "@mdx-js/mdx": "^2.3.0", "@npmcli/package-json": "^4.0.1", - "@remix-run/node": "2.7.2", + "@remix-run/node": "2.8.0-pre.0", "@remix-run/router": "1.15.2-pre.0", - "@remix-run/server-runtime": "2.7.2", + "@remix-run/server-runtime": "2.8.0-pre.0", "@types/mdx": "^2.0.5", "@vanilla-extract/integration": "^6.2.0", "arg": "^5.0.1", @@ -73,7 +73,7 @@ "ws": "^7.4.5" }, "devDependencies": { - "@remix-run/serve": "2.7.2", + "@remix-run/serve": "2.8.0-pre.0", "@types/cacache": "^17.0.0", "@types/cross-spawn": "^6.0.2", "@types/gunzip-maybe": "^1.4.0", @@ -95,7 +95,7 @@ "wrangler": "^3.28.2" }, "peerDependencies": { - "@remix-run/serve": "^2.7.2", + "@remix-run/serve": "^2.8.0-pre.0", "typescript": "^5.1.0", "vite": "^5.1.0", "wrangler": "^3.28.2" diff --git a/packages/remix-eslint-config/CHANGELOG.md b/packages/remix-eslint-config/CHANGELOG.md index 1213aeac309..8648439832d 100644 --- a/packages/remix-eslint-config/CHANGELOG.md +++ b/packages/remix-eslint-config/CHANGELOG.md @@ -1,5 +1,7 @@ # `@remix-run/eslint-config` +## 2.8.0-pre.0 + ## 2.7.2 ## 2.7.1 diff --git a/packages/remix-eslint-config/package.json b/packages/remix-eslint-config/package.json index f8e64cc3174..9a5a27303a3 100644 --- a/packages/remix-eslint-config/package.json +++ b/packages/remix-eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/eslint-config", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "ESLint configuration for Remix projects", "bugs": { "url": "https://github.com/remix-run/remix/issues" diff --git a/packages/remix-express/CHANGELOG.md b/packages/remix-express/CHANGELOG.md index 878c1ad6142..a3455c44e88 100644 --- a/packages/remix-express/CHANGELOG.md +++ b/packages/remix-express/CHANGELOG.md @@ -1,5 +1,12 @@ # `@remix-run/express` +## 2.8.0-pre.0 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/node@2.8.0-pre.0` + ## 2.7.2 ### Patch Changes diff --git a/packages/remix-express/package.json b/packages/remix-express/package.json index 36e4afec3c7..197ce7d3ffb 100644 --- a/packages/remix-express/package.json +++ b/packages/remix-express/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/express", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Express server request handler for Remix", "bugs": { "url": "https://github.com/remix-run/remix/issues" @@ -14,7 +14,7 @@ "main": "dist/index.js", "typings": "dist/index.d.ts", "dependencies": { - "@remix-run/node": "2.7.2" + "@remix-run/node": "2.8.0-pre.0" }, "devDependencies": { "@types/express": "^4.17.9", diff --git a/packages/remix-node/CHANGELOG.md b/packages/remix-node/CHANGELOG.md index 74d44e883fc..955ce9ddf00 100644 --- a/packages/remix-node/CHANGELOG.md +++ b/packages/remix-node/CHANGELOG.md @@ -1,5 +1,12 @@ # `@remix-run/node` +## 2.8.0-pre.0 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/server-runtime@2.8.0-pre.0` + ## 2.7.2 ### Patch Changes diff --git a/packages/remix-node/package.json b/packages/remix-node/package.json index e836aee5b58..4847c682c4a 100644 --- a/packages/remix-node/package.json +++ b/packages/remix-node/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/node", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Node.js platform abstractions for Remix", "bugs": { "url": "https://github.com/remix-run/remix/issues" @@ -17,7 +17,7 @@ "./install.js" ], "dependencies": { - "@remix-run/server-runtime": "2.7.2", + "@remix-run/server-runtime": "2.8.0-pre.0", "@remix-run/web-fetch": "^4.4.2", "@remix-run/web-file": "^3.1.0", "@remix-run/web-stream": "^1.1.0", diff --git a/packages/remix-react/CHANGELOG.md b/packages/remix-react/CHANGELOG.md index 140d512d2f3..9740a00990d 100644 --- a/packages/remix-react/CHANGELOG.md +++ b/packages/remix-react/CHANGELOG.md @@ -1,5 +1,14 @@ # `@remix-run/react` +## 2.8.0-pre.0 + +### Patch Changes + +- Fix the default root `ErrorBoundary` component so it leverages the user-provided `Layout` component ([#8859](https://github.com/remix-run/remix/pull/8859)) +- Fix the default root `HydrateFallback` component so it leverages any user-provided `Layout` component ([#8892](https://github.com/remix-run/remix/pull/8892)) +- Updated dependencies: + - `@remix-run/server-runtime@2.8.0-pre.0` + ## 2.7.2 ### Patch Changes diff --git a/packages/remix-react/package.json b/packages/remix-react/package.json index e28bcf3f848..4bbc2be6360 100644 --- a/packages/remix-react/package.json +++ b/packages/remix-react/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/react", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "React DOM bindings for Remix", "bugs": { "url": "https://github.com/remix-run/remix/issues" @@ -17,7 +17,7 @@ "module": "dist/esm/index.js", "dependencies": { "@remix-run/router": "1.15.2-pre.0", - "@remix-run/server-runtime": "2.7.2", + "@remix-run/server-runtime": "2.8.0-pre.0", "react-router": "6.22.2-pre.0", "react-router-dom": "6.22.2-pre.0" }, diff --git a/packages/remix-serve/CHANGELOG.md b/packages/remix-serve/CHANGELOG.md index 187a040091c..f28d83e9db4 100644 --- a/packages/remix-serve/CHANGELOG.md +++ b/packages/remix-serve/CHANGELOG.md @@ -1,5 +1,13 @@ # `@remix-run/serve` +## 2.8.0-pre.0 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/express@2.8.0-pre.0` + - `@remix-run/node@2.8.0-pre.0` + ## 2.7.2 ### Patch Changes diff --git a/packages/remix-serve/package.json b/packages/remix-serve/package.json index a2212aefe84..877ff1267fb 100644 --- a/packages/remix-serve/package.json +++ b/packages/remix-serve/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/serve", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Production application server for Remix", "bugs": { "url": "https://github.com/remix-run/remix/issues" @@ -15,8 +15,8 @@ "remix-serve": "dist/cli.js" }, "dependencies": { - "@remix-run/express": "2.7.2", - "@remix-run/node": "2.7.2", + "@remix-run/express": "2.8.0-pre.0", + "@remix-run/node": "2.8.0-pre.0", "chokidar": "^3.5.3", "compression": "^1.7.4", "express": "^4.17.1", diff --git a/packages/remix-server-runtime/CHANGELOG.md b/packages/remix-server-runtime/CHANGELOG.md index 6116808d583..c981b7b27ea 100644 --- a/packages/remix-server-runtime/CHANGELOG.md +++ b/packages/remix-server-runtime/CHANGELOG.md @@ -1,5 +1,7 @@ # `@remix-run/server-runtime` +## 2.8.0-pre.0 + ## 2.7.2 ## 2.7.1 diff --git a/packages/remix-server-runtime/package.json b/packages/remix-server-runtime/package.json index 314e26eebff..85b072cc0cb 100644 --- a/packages/remix-server-runtime/package.json +++ b/packages/remix-server-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/server-runtime", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Server runtime for Remix", "bugs": { "url": "https://github.com/remix-run/remix/issues" diff --git a/packages/remix-testing/CHANGELOG.md b/packages/remix-testing/CHANGELOG.md index 4a98d0f1954..9fafc369c2f 100644 --- a/packages/remix-testing/CHANGELOG.md +++ b/packages/remix-testing/CHANGELOG.md @@ -1,5 +1,13 @@ # `@remix-run/testing` +## 2.8.0-pre.0 + +### Patch Changes + +- Updated dependencies: + - `@remix-run/react@2.8.0-pre.0` + - `@remix-run/node@2.8.0-pre.0` + ## 2.7.2 ### Patch Changes diff --git a/packages/remix-testing/package.json b/packages/remix-testing/package.json index de267c4f782..d801bd84047 100644 --- a/packages/remix-testing/package.json +++ b/packages/remix-testing/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/testing", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "Testing utilities for Remix apps", "homepage": "https://remix.run", "bugs": { @@ -16,8 +16,8 @@ "typings": "./dist/index.d.ts", "module": "./dist/esm/index.js", "dependencies": { - "@remix-run/node": "2.7.2", - "@remix-run/react": "2.7.2", + "@remix-run/node": "2.8.0-pre.0", + "@remix-run/react": "2.8.0-pre.0", "@remix-run/router": "1.15.2-pre.0", "react-router-dom": "6.22.2-pre.0" }, diff --git a/packages/remix/package.json b/packages/remix/package.json index 613ccf215f7..80757a042bf 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -1,6 +1,6 @@ { "name": "remix", - "version": "2.7.2", + "version": "2.8.0-pre.0", "description": "A framework for building better websites", "homepage": "https://remix.run", "bugs": { From d96d9095187526985f2afd2432218a2e230594df Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Tue, 27 Feb 2024 10:58:35 -0500 Subject: [PATCH 23/31] Draft release notes --- CHANGELOG.md | 122 ++++++++++++++------- packages/create-remix/CHANGELOG.md | 6 + packages/remix-css-bundle/CHANGELOG.md | 6 + packages/remix-eslint-config/CHANGELOG.md | 6 + packages/remix-server-runtime/CHANGELOG.md | 4 + 5 files changed, 106 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 243e9b396dd..78480eeef22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,83 +13,88 @@ We manage release notes in this file instead of the paginated Github Releases Pa Table of Contents - [Remix Releases](#remix-releases) - - [2.7.2](#272) + - [v2.8.0](#v280) + - [Minor Changes](#minor-changes) - [Patch Changes](#patch-changes) - - [2.7.1](#271) + - [Updated Dependencies](#updated-dependencies) + - [Changes by Package](#changes-by-package) + - [2.7.2](#272) - [Patch Changes](#patch-changes-1) + - [2.7.1](#271) + - [Patch Changes](#patch-changes-2) - [v2.7.0](#v270) - [What's Changed](#whats-changed) - [Stabilized Vite Plugin](#stabilized-vite-plugin) - [New `Layout` Export](#new-layout-export) - [Basename support](#basename-support) - [Cloudflare Proxy as a Vite Plugin](#cloudflare-proxy-as-a-vite-plugin) - - [Minor Changes](#minor-changes) - - [Patch Changes](#patch-changes-2) - - [Updated Dependencies](#updated-dependencies) - - [Changes by Package](#changes-by-package) - - [v2.6.0](#v260) - - [What's Changed](#whats-changed-1) - - [Unstable Vite Plugin updates](#unstable-vite-plugin-updates) - [Minor Changes](#minor-changes-1) - [Patch Changes](#patch-changes-3) - [Updated Dependencies](#updated-dependencies-1) - [Changes by Package](#changes-by-package-1) - - [v2.5.1](#v251) + - [v2.6.0](#v260) + - [What's Changed](#whats-changed-1) + - [Unstable Vite Plugin updates](#unstable-vite-plugin-updates) + - [Minor Changes](#minor-changes-2) - [Patch Changes](#patch-changes-4) - [Updated Dependencies](#updated-dependencies-2) - [Changes by Package](#changes-by-package-2) + - [v2.5.1](#v251) + - [Patch Changes](#patch-changes-5) + - [Updated Dependencies](#updated-dependencies-3) + - [Changes by Package](#changes-by-package-3) - [v2.5.0](#v250) - [What's Changed](#whats-changed-2) - [SPA Mode (unstable)](#spa-mode-unstable) - [Server Bundles (unstable)](#server-bundles-unstable) - - [Minor Changes](#minor-changes-2) - - [Patch Changes](#patch-changes-5) - - [Updated Dependencies](#updated-dependencies-3) - - [Changes by Package](#changes-by-package-3) - - [v2.4.1](#v241) + - [Minor Changes](#minor-changes-3) - [Patch Changes](#patch-changes-6) - [Updated Dependencies](#updated-dependencies-4) - [Changes by Package](#changes-by-package-4) + - [v2.4.1](#v241) + - [Patch Changes](#patch-changes-7) + - [Updated Dependencies](#updated-dependencies-5) + - [Changes by Package](#changes-by-package-5) - [v2.4.0](#v240) - [What's Changed](#whats-changed-3) - [Client Data](#client-data) - [`future.v3_relativeSplatPath`](#futurev3_relativesplatpath) - [Vite Updates (Unstable)](#vite-updates-unstable) - - [Minor Changes](#minor-changes-3) - - [Patch Changes](#patch-changes-7) - - [Updated Dependencies](#updated-dependencies-5) - - [Changes by Package](#changes-by-package-5) - - [v2.3.1](#v231) + - [Minor Changes](#minor-changes-4) - [Patch Changes](#patch-changes-8) - [Updated Dependencies](#updated-dependencies-6) - [Changes by Package](#changes-by-package-6) + - [v2.3.1](#v231) + - [Patch Changes](#patch-changes-9) + - [Updated Dependencies](#updated-dependencies-7) + - [Changes by Package](#changes-by-package-7) - [v2.3.0](#v230) - [What's Changed](#whats-changed-4) - [Stabilized `useBlocker`](#stabilized-useblocker) - [`unstable_flushSync` API](#unstable_flushsync-api) - - [Minor Changes](#minor-changes-4) - - [Patch Changes](#patch-changes-9) - - [Updated Dependencies](#updated-dependencies-7) - - [Changes by Package](#changes-by-package-7) + - [Minor Changes](#minor-changes-5) + - [Patch Changes](#patch-changes-10) + - [Updated Dependencies](#updated-dependencies-8) + - [Changes by Package](#changes-by-package-8) - [v2.2.0](#v220) - [What's Changed](#whats-changed-5) - [Vite!](#vite) - [New Fetcher APIs](#new-fetcher-apis) - [Persistence Future Flag](#persistence-future-flag) - - [Minor Changes](#minor-changes-5) - - [Patch Changes](#patch-changes-10) - - [Updated Dependencies](#updated-dependencies-8) - - [Changes by Package](#changes-by-package-8) - - [v2.1.0](#v210) - - [What's Changed](#whats-changed-6) - - [View Transitions](#view-transitions) - - [Stable `createRemixStub`](#stable-createremixstub) - [Minor Changes](#minor-changes-6) - [Patch Changes](#patch-changes-11) - [Updated Dependencies](#updated-dependencies-9) - [Changes by Package](#changes-by-package-9) - - [v2.0.1](#v201) + - [v2.1.0](#v210) + - [What's Changed](#whats-changed-6) + - [View Transitions](#view-transitions) + - [Stable `createRemixStub`](#stable-createremixstub) + - [Minor Changes](#minor-changes-7) - [Patch Changes](#patch-changes-12) + - [Updated Dependencies](#updated-dependencies-10) + - [Changes by Package](#changes-by-package-10) + - [v2.0.1](#v201) + - [Patch Changes](#patch-changes-13) - [Changes by Package 🔗](#changes-by-package-) - [v2.0.0](#v200) - [Breaking Changes](#breaking-changes) @@ -101,8 +106,8 @@ We manage release notes in this file instead of the paginated Github Releases Pa - [Breaking Type Changes](#breaking-type-changes) - [New Features](#new-features) - [Other Notable Changes](#other-notable-changes) - - [Updated Dependencies](#updated-dependencies-10) - - [Changes by Package](#changes-by-package-10) + - [Updated Dependencies](#updated-dependencies-11) + - [Changes by Package](#changes-by-package-11) @@ -150,13 +155,55 @@ Date: YYYY-MM-DD --> +## v2.8.0 + +Date: 2024-02-27 + +### Minor Changes + +- `@remix-run/dev` - Vite: Pass resolved `viteConfig` to Remix Vite plugin's `buildEnd` hook ([#8885](https://github.com/remix-run/remix/pull/8885)) + +### Patch Changes + +- `@remix-run/dev` - Mark `Layout` as browser safe route export in `esbuild` compiler ([#8842](https://github.com/remix-run/remix/pull/8842)) +- `@remix-run/dev` - Vite: Silence build warnings when dependencies include `"use client"` directives ([#8897](https://github.com/remix-run/remix/pull/8897)) +- `@remix-run/dev` - Vite: Fix `serverBundles` issue where multiple browser manifests are generated ([#8864](https://github.com/remix-run/remix/pull/8864)) +- `@remix-run/dev` - Vite: Support custom `build.assetsDir` option ([#8843](https://github.com/remix-run/remix/pull/8843)) +- `@remix-run/react` - Fix the default root `ErrorBoundary` component so it leverages the user-provided `Layout` component ([#8859](https://github.com/remix-run/remix/pull/8859)) +- `@remix-run/react` - Fix the default root `HydrateFallback` component so it leverages any user-provided `Layout` component ([#8892](https://github.com/remix-run/remix/pull/8892)) + +### Updated Dependencies + +- [`react-router-dom@6.22.2`](https://github.com/remix-run/react-router/releases/tag/react-router%406.22.2) +- [`@remix-run/router@1.15.2`](https://github.com/remix-run/react-router/blob/main/packages/router/CHANGELOG.md#1152) + +### Changes by Package + +- [`create-remix`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/create-remix/CHANGELOG.md#280) +- [`@remix-run/architect`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-architect/CHANGELOG.md#280) +- [`@remix-run/cloudflare`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-cloudflare/CHANGELOG.md#280) +- [`@remix-run/cloudflare-pages`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-cloudflare-pages/CHANGELOG.md#280) +- [`@remix-run/cloudflare-workers`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-cloudflare-workers/CHANGELOG.md#280) +- [`@remix-run/css-bundle`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-css-bundle/CHANGELOG.md#280) +- [`@remix-run/deno`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-deno/CHANGELOG.md#280) +- [`@remix-run/dev`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-dev/CHANGELOG.md#280) +- [`@remix-run/eslint-config`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-eslint-config/CHANGELOG.md#280) +- [`@remix-run/express`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-express/CHANGELOG.md#280) +- [`@remix-run/node`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-node/CHANGELOG.md#280) +- [`@remix-run/react`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-react/CHANGELOG.md#280) +- [`@remix-run/serve`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-serve/CHANGELOG.md#280) +- [`@remix-run/server-runtime`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-server-runtime/CHANGELOG.md#280) +- [`@remix-run/testing`](https://github.com/remix-run/remix/blob/remix%402.8.0/packages/remix-testing/CHANGELOG.md#280) + +**Full Changelog**: [`v2.7.2...v2.8.0`](https://github.com/remix-run/remix/compare/remix@2.7.2...remix@2.8.0) + ## 2.7.2 Date: 2024-02-21 ### Patch Changes -- Vite: Fix error when building projects with `.css?url` imports ([#8829](https://github.com/remix-run/remix/pull/8829)) +- `@remix-run/dev` - Vite: Fix error when building projects with `.css?url` imports ([#8829](https://github.com/remix-run/remix/pull/8829)) ## 2.7.1 @@ -164,8 +211,7 @@ Date: 2024-02-20 ### Patch Changes -- Fix breaking change for `@remix-run/cloudflare-pages` ([#8819](https://github.com/remix-run/remix/pull/8819)) - - Restore Cloudflare event context fields in `getLoadContext` argument for backwards compatibility. +- `@remix-run/cloudflare-pages` - Fix breaking change and restore Cloudflare event context fields in `getLoadContext` argument for backwards compatibility ([#8819](https://github.com/remix-run/remix/pull/8819)) ## v2.7.0 diff --git a/packages/create-remix/CHANGELOG.md b/packages/create-remix/CHANGELOG.md index 3f60794e796..3a0290c7fe2 100644 --- a/packages/create-remix/CHANGELOG.md +++ b/packages/create-remix/CHANGELOG.md @@ -4,10 +4,16 @@ ## 2.7.2 +No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.7.2. + ## 2.7.1 +No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.7.1. + ## 2.7.0 +No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.7.0. + ## 2.6.0 No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.6.0. diff --git a/packages/remix-css-bundle/CHANGELOG.md b/packages/remix-css-bundle/CHANGELOG.md index 468281b8d2f..d67107e079f 100644 --- a/packages/remix-css-bundle/CHANGELOG.md +++ b/packages/remix-css-bundle/CHANGELOG.md @@ -4,10 +4,16 @@ ## 2.7.2 +No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.7.2. + ## 2.7.1 +No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.7.1. + ## 2.7.0 +No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.7.0. + ## 2.6.0 No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.6.0. diff --git a/packages/remix-eslint-config/CHANGELOG.md b/packages/remix-eslint-config/CHANGELOG.md index 8648439832d..394d8127480 100644 --- a/packages/remix-eslint-config/CHANGELOG.md +++ b/packages/remix-eslint-config/CHANGELOG.md @@ -4,10 +4,16 @@ ## 2.7.2 +No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.7.2. + ## 2.7.1 +No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.7.1. + ## 2.7.0 +No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.7.0. + ## 2.6.0 No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.6.0. diff --git a/packages/remix-server-runtime/CHANGELOG.md b/packages/remix-server-runtime/CHANGELOG.md index c981b7b27ea..c97b2c3e6de 100644 --- a/packages/remix-server-runtime/CHANGELOG.md +++ b/packages/remix-server-runtime/CHANGELOG.md @@ -4,8 +4,12 @@ ## 2.7.2 +No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.7.2. + ## 2.7.1 +No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/remix/blob/main/CHANGELOG.md) for an overview of all changes in v2.7.1. + ## 2.7.0 ### Minor Changes From 3f9c84a489a10b55889d249b19b6e5f8ba6fbaeb Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Tue, 27 Feb 2024 12:56:20 -0500 Subject: [PATCH 24/31] Fix BoundaryShell usage in default HydrateFallback (#8906) --- .changeset/few-rice-join.md | 5 ++++ integration/root-route-test.ts | 1 - integration/spa-mode-test.ts | 2 ++ packages/remix-react/errorBoundaries.tsx | 38 +++++++++++++----------- packages/remix-react/fallback.tsx | 4 +-- 5 files changed, 28 insertions(+), 22 deletions(-) create mode 100644 .changeset/few-rice-join.md diff --git a/.changeset/few-rice-join.md b/.changeset/few-rice-join.md new file mode 100644 index 00000000000..12a47d840be --- /dev/null +++ b/.changeset/few-rice-join.md @@ -0,0 +1,5 @@ +--- +"@remix-run/react": patch +--- + +[REMOVE] Fix issue with hydrate fallback boundary shell usage diff --git a/integration/root-route-test.ts b/integration/root-route-test.ts index 95a6f0d1fc3..b72ee98b1e6 100644 --- a/integration/root-route-test.ts +++ b/integration/root-route-test.ts @@ -148,7 +148,6 @@ test.describe("root route", () => { let app = new PlaywrightFixture(appFixture, page); await app.goto("/"); await page.waitForSelector("h1"); - console.log(await app.getHtml()); expect(await app.getHtml("title")).toMatch("Layout Title"); expect(await app.getHtml("h1")).toMatch("Application Error"); diff --git a/integration/spa-mode-test.ts b/integration/spa-mode-test.ts index 7063399405a..e381287703b 100644 --- a/integration/spa-mode-test.ts +++ b/integration/spa-mode-test.ts @@ -583,6 +583,8 @@ test.describe("SPA Mode", () => { let html = await res.text(); expect(html.match(/ + ); + if (isRouteErrorResponse(error)) { return (

{error.status} {error.statusText}

+ {heyDeveloper}
); } @@ -102,36 +115,24 @@ export function RemixRootDefaultErrorBoundary({ error }: { error: unknown }) { > {errorInstance.stack} + {heyDeveloper} ); } export function BoundaryShell({ title, + renderScripts, children, }: { title: string; + renderScripts?: boolean; children: React.ReactNode | React.ReactNode[]; }) { let { routeModules } = useRemixContext(); - let contents = ( - <> - {children} -