From 99e04f2ca3a9fb8c30c197712ca33637446955b4 Mon Sep 17 00:00:00 2001 From: Mark Dalgleish Date: Wed, 26 Jul 2023 14:51:37 +1000 Subject: [PATCH 1/8] feat: remove v1 meta API --- .changeset/remove-v1-meta.md | 50 +++ docs/api/conventions.md | 2 +- docs/file-conventions/root.md | 17 +- docs/guides/constraints.md | 10 +- docs/guides/mdx.md | 15 +- docs/guides/migrating-react-router-app.md | 32 +- docs/guides/styling.md | 11 +- docs/route/meta-v2.md | 256 +----------- docs/route/meta.md | 282 +++++++++---- docs/tutorials/jokes.md | 36 +- integration/defer-test.ts | 20 +- integration/hmr-log-test.ts | 2 - integration/hmr-test.ts | 2 - integration/link-test.ts | 22 +- integration/mdx-test.ts | 5 +- integration/meta-test.ts | 385 ------------------ packages/remix-cloudflare/index.ts | 11 +- packages/remix-deno/index.ts | 11 +- .../fixtures/cloudflare/app/root.tsx | 9 +- .../__tests__/fixtures/deno/app/root.tsx | 9 +- .../fixtures/deno/app/routes/index.tsx | 5 + .../fixtures/indie-stack/app/root.tsx | 9 +- .../fixtures/indie-stack/app/routes/index.tsx | 6 + .../__tests__/fixtures/node/app/root.tsx | 9 +- .../fixtures/node/app/routes/index.tsx | 6 + .../remix-dev/__tests__/readConfig-test.ts | 2 - packages/remix-dev/config.ts | 12 - packages/remix-node/index.ts | 11 +- .../remix-react/__tests__/components-test.tsx | 1 - .../__tests__/scroll-restoration-test.tsx | 1 - packages/remix-react/components.tsx | 160 +------- packages/remix-react/entry.ts | 1 - packages/remix-react/index.tsx | 7 +- packages/remix-react/routeModules.ts | 71 +--- .../__tests__/handler-test.ts | 4 +- packages/remix-server-runtime/entry.ts | 1 - packages/remix-server-runtime/index.ts | 9 +- packages/remix-server-runtime/reexport.ts | 9 +- packages/remix-server-runtime/routeModules.ts | 96 ++--- packages/remix-testing/create-remix-stub.tsx | 1 - .../playground/template/app/routes/index.tsx | 12 +- .../playground/template/app/routes/join.tsx | 16 +- .../playground/template/app/routes/login.tsx | 20 +- .../playground/template/app/routes/notes.tsx | 12 +- .../template/app/routes/notes/$noteId.tsx | 6 +- .../template/app/routes/notes/index.tsx | 4 +- .../template/app/routes/notes/new.tsx | 14 +- scripts/playground/template/remix.config.js | 3 - templates/arc/app/routes/_index.tsx | 4 +- templates/arc/remix.config.js | 1 - .../cloudflare-pages/app/routes/_index.tsx | 4 +- templates/cloudflare-pages/remix.config.js | 1 - .../cloudflare-workers/app/routes/_index.tsx | 4 +- templates/cloudflare-workers/remix.config.js | 1 - templates/deno/app/routes/_index.tsx | 4 +- templates/deno/remix.config.js | 1 - templates/express/app/routes/_index.tsx | 4 +- templates/express/remix.config.js | 1 - templates/fly/app/routes/_index.tsx | 4 +- templates/fly/remix.config.js | 1 - templates/netlify/app/routes/_index.tsx | 4 +- templates/netlify/remix.config.js | 1 - templates/remix-javascript/remix.config.js | 1 - templates/remix/app/routes/_index.tsx | 4 +- templates/remix/remix.config.js | 1 - templates/vercel/app/routes/_index.tsx | 4 +- templates/vercel/remix.config.js | 1 - 67 files changed, 480 insertions(+), 1261 deletions(-) create mode 100644 .changeset/remove-v1-meta.md diff --git a/.changeset/remove-v1-meta.md b/.changeset/remove-v1-meta.md new file mode 100644 index 00000000000..2896e4c2d31 --- /dev/null +++ b/.changeset/remove-v1-meta.md @@ -0,0 +1,50 @@ +--- +"remix": major +"@remix-run/cloudflare": major +"@remix-run/deno": major +"@remix-run/dev": major +"@remix-run/node": major +"@remix-run/react": major +"@remix-run/server-runtime": major +"@remix-run/testing": major +--- + +We have made a few important changes to the route `meta` API as reflected in the v1 implementation when using the `future.v2_meta` config option. + +- The `meta` function should no longer return an object, but an array of objects that map to the HTML tag's respective attributes. This provides more flexibility and control over how certain tags are rendered, and the order in which they appear. +- In most cases, `meta` descriptor objects render a `` tag. There are a few notable exceptions: + - `{ title: "My app" }` will render `My app`. + - `{ 'script:ld+json': { /* ... */ } }` will render ``, where the value is serialized to JSON and rendered inside the `