From 7bd40bc9db7f4e2c93a5029f632875285a45c39a Mon Sep 17 00:00:00 2001 From: Colum Ferry Date: Fri, 3 May 2024 16:53:50 +0100 Subject: [PATCH] fix(remix): ensure default meta tags are always present for generated applications #23037 (#23169) ## Current Behavior Meta tags that are required and recommended for remix apps are not being rendered correctly when deployed to serverless locations such as AWS Lambda We do not attach them in the way that Remix recommends ## Expected Behavior Attach these meta tags in the method that remix itself recommends to ensure maximum compatibility ## Related Issue(s) Fixes #23037 --- .../application.impl.spec.ts.snap | 40 +++++++++---------- .../files/common/app/root.tsx__tmpl__ | 4 +- .../setup-tailwind.impl.spec.ts.snap | 8 ++-- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap b/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap index 2475dbe1560f4f..dc9fad80308d79 100644 --- a/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap +++ b/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap @@ -34,9 +34,7 @@ import { export const meta: MetaFunction = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; @@ -44,6 +42,8 @@ export default function App() { return ( + + @@ -106,9 +106,7 @@ import { export const meta: MetaFunction = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; @@ -116,6 +114,8 @@ export default function App() { return ( + + @@ -266,15 +266,15 @@ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provide } from '@remix-run/react'; export const meta = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; export default function App() { return ( + + @@ -475,9 +475,7 @@ import { export const meta: MetaFunction = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; @@ -485,6 +483,8 @@ export default function App() { return ( + + @@ -547,9 +547,7 @@ import { export const meta: MetaFunction = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; @@ -557,6 +555,8 @@ export default function App() { return ( + + @@ -619,9 +619,7 @@ import { export const meta: MetaFunction = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; @@ -629,6 +627,8 @@ export default function App() { return ( + + @@ -779,15 +779,15 @@ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived -- } from '@remix-run/react'; export const meta = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; export default function App() { return ( + + @@ -988,9 +988,7 @@ import { export const meta: MetaFunction = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; @@ -998,6 +996,8 @@ export default function App() { return ( + + @@ -1075,15 +1075,15 @@ exports[`Remix Application Standalone Project Repo --js should create the applic } from '@remix-run/react'; export const meta = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; export default function App() { return ( + + @@ -1328,9 +1328,7 @@ import { export const meta: MetaFunction = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; @@ -1338,6 +1336,8 @@ export default function App() { return ( + + diff --git a/packages/remix/src/generators/application/files/common/app/root.tsx__tmpl__ b/packages/remix/src/generators/application/files/common/app/root.tsx__tmpl__ index f7bdf668cab46d..7b97b10c540dac 100644 --- a/packages/remix/src/generators/application/files/common/app/root.tsx__tmpl__ +++ b/packages/remix/src/generators/application/files/common/app/root.tsx__tmpl__ @@ -9,15 +9,15 @@ import { } from "@remix-run/react"; export const meta: MetaFunction = () => ([{ - charset: "utf-8", title: "New Remix App", - viewport: "width=device-width,initial-scale=1", }]); export default function App() { return ( + + diff --git a/packages/remix/src/generators/setup-tailwind/__snapshots__/setup-tailwind.impl.spec.ts.snap b/packages/remix/src/generators/setup-tailwind/__snapshots__/setup-tailwind.impl.spec.ts.snap index 0c441de8b93686..23eae4984a0644 100644 --- a/packages/remix/src/generators/setup-tailwind/__snapshots__/setup-tailwind.impl.spec.ts.snap +++ b/packages/remix/src/generators/setup-tailwind/__snapshots__/setup-tailwind.impl.spec.ts.snap @@ -35,15 +35,15 @@ import twStyles from './tailwind.css'; export const links = () => [{ rel: 'stylesheet', href: twStyles }]; export const meta = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; export default function App() { return ( + + @@ -122,9 +122,7 @@ export const links: LinksFunction = () => [ export const meta: MetaFunction = () => [ { - charset: 'utf-8', title: 'New Remix App', - viewport: 'width=device-width,initial-scale=1', }, ]; @@ -132,6 +130,8 @@ export default function App() { return ( + +