Skip to content

Commit

Permalink
Move redirects to legacy site config (#5936)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Apr 18, 2023
1 parent a35b64c commit b9ffa56
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 288 deletions.
18 changes: 0 additions & 18 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* Copyright (c) Facebook, Inc. and its affiliates.
*/

const siteConfig = require('./src/siteConfig').siteConfig;

/**
* @type {import('next').NextConfig}
**/
Expand All @@ -16,22 +14,6 @@ const nextConfig = {
legacyBrowsers: false,
browsersListForSwc: true,
},
redirects() {
const redirects = [];
const languageCode = siteConfig.languageCode;
const subdomain =
languageCode === 'en' || !siteConfig.hasLegacySite
? ''
: languageCode + '.';
return [
{
// Assume all *.html links are legacy site URLs.
source: '/:path*(\\.html)',
destination: `https://${subdomain}legacy.reactjs.org/:path*.html`,
permanent: false,
},
];
},
env: {
SANDPACK_BARE_COMPONENTS: process.env.SANDPACK_BARE_COMPONENTS,
},
Expand Down
270 changes: 0 additions & 270 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,271 +4,6 @@
},
"trailingSlash": false,
"redirects": [
{
"source": "/docs/add-react-to-a-website.html",
"destination": "/learn/add-react-to-an-existing-project",
"permanent": false
},
{
"source": "/docs/create-a-new-react-app.html",
"destination": "/learn/start-a-new-react-project",
"permanent": false
},
{
"source": "/docs/release-channels.html",
"destination": "/community/versioning-policy",
"permanent": false
},
{
"source": "/docs/thinking-in-react.html",
"destination": "/learn/thinking-in-react",
"permanent": false
},
{
"source": "/tutorial/tutorial.html",
"destination": "/learn/tutorial-tic-tac-toe",
"permanent": false
},
{
"source": "/community/support.html",
"destination": "/community",
"permanent": false
},
{
"source": "/community/conferences.html",
"destination": "/community/conferences",
"permanent": false
},
{
"source": "/community/meetups.html",
"destination": "/community/meetups",
"permanent": false
},
{
"source": "/community/team.html",
"destination": "/community/team",
"permanent": false
},
{
"source": "/community/videos.html",
"destination": "/community/videos",
"permanent": false
},
{
"source": "/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022.html",
"destination": "/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022",
"permanent": false
},
{
"source": "/blog/2022/03/29/react-v18.html",
"destination": "/blog/2022/03/29/react-v18",
"permanent": false
},
{
"source": "/blog/2022/03/08/react-18-upgrade-guide.html",
"destination": "/blog/2022/03/08/react-18-upgrade-guide",
"permanent": false
},
{
"source": "/blog/2021/12/17/react-conf-2021-recap.html",
"destination": "/blog/2021/12/17/react-conf-2021-recap",
"permanent": false
},
{
"source": "/blog/2021/06/08/the-plan-for-react-18.html",
"destination": "/blog/2021/06/08/the-plan-for-react-18",
"permanent": false
},
{
"source": "/blog/2020/12/21/data-fetching-with-react-server-components.html",
"destination": "/blog/2020/12/21/data-fetching-with-react-server-components",
"permanent": false
},
{
"source": "/tips/controlled-input-null-value.html",
"destination": "/reference/react-dom/components/input#im-getting-an-error-a-component-is-changing-an-uncontrolled-input-to-be-controlled",
"permanent": false
},
{
"source": "/link/switch-to-createroot",
"destination": "https://github.com/reactwg/react-18/discussions/5",
"permanent": false
},
{
"source": "/server-components",
"destination": "/blog/2020/12/21/data-fetching-with-react-server-components",
"permanent": false
},
{
"source": "/concurrent",
"destination": "/blog/2022/03/29/react-v18",
"permanent": false
},
{
"source": "/hooks",
"destination": "/reference/react",
"permanent": false
},
{
"source": "/tutorial",
"destination": "/learn/tutorial-tic-tac-toe",
"permanent": false
},
{
"source": "/link/attribute-behavior",
"destination": "https://legacy.reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html#changes-in-detail",
"permanent": false
},
{
"source": "/link/controlled-components",
"destination": "/reference/react-dom/components/input#controlling-an-input-with-a-state-variable",
"permanent": false
},
{
"source": "/link/crossorigin-error",
"destination": "https://legacy.reactjs.org/docs/cross-origin-errors.html",
"permanent": false
},
{
"source": "/link/dangerously-set-inner-html",
"destination": "/reference/react-dom/components/common#dangerously-setting-the-inner-html",
"permanent": false
},
{
"source": "/link/derived-state",
"destination": "https://legacy.reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html",
"permanent": false
},
{
"source": "/link/error-boundaries",
"destination": "https://legacy.reactjs.org/docs/error-boundaries.html",
"permanent": false
},
{
"source": "/link/event-pooling",
"destination": "https://legacy.reactjs.org/docs/legacy-event-pooling.html",
"permanent": false
},
{
"source": "/link/hooks-data-fetching",
"destination": "/reference/react/useEffect#fetching-data-with-effects",
"permanent": false
},
{
"source": "/link/invalid-aria-props",
"destination": "/warnings/invalid-aria-prop",
"permanent": false
},
{
"source": "/link/invalid-hook-call",
"destination": "/warnings/invalid-hook-call-warning",
"permanent": false
},
{
"source": "/link/legacy-context",
"destination": "https://legacy.reactjs.org/docs/legacy-context.html",
"permanent": false
},
{
"source": "/link/legacy-factories",
"destination": "https://legacy.reactjs.org/warnings/legacy-factories.html",
"permanent": false
},
{
"source": "/link/perf-use-production-build",
"destination": "https://legacy.reactjs.org/docs/optimizing-performance.html#use-the-production-build",
"permanent": false
},
{
"source": "/link/react-devtools",
"destination": "/learn/react-developer-tools",
"permanent": false
},
{
"source": "/link/react-polyfills",
"destination": "https://legacy.reactjs.org/docs/javascript-environment-requirements.html",
"permanent": false
},
{
"source": "/link/refs-must-have-owner",
"destination": "https://legacy.reactjs.org/warnings/refs-must-have-owner.html",
"permanent": false
},
{
"source": "/link/rules-of-hooks",
"destination": "/warnings/invalid-hook-call-warning",
"permanent": false
},
{
"source": "/link/special-props",
"destination": "/warnings/special-props",
"permanent": false
},
{
"source": "/link/strict-mode-find-node",
"destination": "/reference/react-dom/findDOMNode#alternatives",
"permanent": false
},
{
"source": "/link/strict-mode-string-ref",
"destination": "https://legacy.reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs",
"permanent": false
},
{
"source": "/link/unsafe-component-lifecycles",
"destination": "https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html",
"permanent": false
},
{
"source": "/link/warning-keys",
"destination": "/learn/rendering-lists#keeping-list-items-in-order-with-key",
"permanent": false
},
{
"source": "/link/wrap-tests-with-act",
"destination": "https://legacy.reactjs.org/docs/test-utils.html#act",
"permanent": false
},
{
"source": "/link/interaction-tracing",
"destination": "https://gist.github.com/bvaughn/8de925562903afd2e7a12554adcdda16",
"permanent": false
},
{
"source": "/link/profiling",
"destination": "https://gist.github.com/bvaughn/25e6233aeb1b4f0cdb8d8366e54a3977",
"permanent": false
},
{
"source": "/link/test-utils-mock-component",
"destination": "https://gist.github.com/bvaughn/fbf41b3f895bf2d297935faa5525eee9",
"permanent": false
},
{
"source": "/link/uselayouteffect-ssr",
"destination": "https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85",
"permanent": false
},
{
"source": "/link/react-devtools-faq",
"destination": "https://github.com/facebook/react/tree/main/packages/react-devtools#faq",
"permanent": false
},
{
"source": "/link/setstate-in-render",
"destination": "https://github.com/facebook/react/issues/18178#issuecomment-595846312",
"permanent": false
},
{
"source": "/version/15.6",
"destination": "https://react-legacy.netlify.app",
"permanent": false
},
{
"source": "/apis/:path*",
"destination": "/reference/:path*",
"permanent": true
},
{
"source": "/reference",
"destination": "/reference/react",
Expand All @@ -278,11 +13,6 @@
"source": "/learn/meet-the-team",
"destination": "/community/team",
"permanent": true
},
{
"source": "/learn/add-react-to-a-website",
"destination": "/learn/add-react-to-an-existing-project",
"permanent": true
}
],
"headers": [
Expand Down

0 comments on commit b9ffa56

Please sign in to comment.