Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v6 codemod: FatalErrorPage #8713

Merged
merged 5 commits into from
Jun 26, 2023
Merged

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Jun 23, 2023

Codemod to fetch the FatalErrorPage from the create-redwood-app template and replace the current one in the project

For release notes:
Make sure to warn people that their current DevFatalPage will be overwritten. So if they have made any changes to it, they might want to make this change manually. If they don't they'll lose all their customizations.

If you want to do this change manually, this is what it does:

 // still render a generic error page, but your users will prefer something a bit more
 // thoughtful. =)

-// Ensures that production builds do not include the error page
-let RedwoodDevFatalErrorPage = undefined
-if (process.env.NODE_ENV === 'development') {
-  RedwoodDevFatalErrorPage =
-    require('@redwoodjs/web/dist/components/DevFatalErrorPage').DevFatalErrorPage
-}
+// This import will be automatically removed when building for production
+import { DevFatalErrorPage } from '@redwoodjs/web/dist/components/DevFatalErrorPage'

-export default RedwoodDevFatalErrorPage ||
+export default DevFatalErrorPage ||
   (() => (
     <main>
       <style

@Tobbe Tobbe added the release:chore This PR is a chore (means nothing for users) label Jun 23, 2023
@Tobbe Tobbe added this to the v6.0.0 milestone Jun 23, 2023
@notion-workspace
Copy link

@Tobbe Tobbe changed the title v6 codemod: DevFatalPage v6 codemod: FatalErrorPage Jun 23, 2023
Copy link
Collaborator

@dac09 dac09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tobbe do you think you could add a diff to the readme (and PR) (i.e. manual steps) it'll make it easier for Dom with the release notes.

@Tobbe Tobbe enabled auto-merge (squash) June 26, 2023 10:24
@Tobbe Tobbe merged commit f949ddc into redwoodjs:main Jun 26, 2023
28 checks passed
@redwoodjs-bot redwoodjs-bot bot modified the milestones: v6.0.0, next-release Jun 26, 2023
@dac09 dac09 modified the milestones: next-release, v6.0.0 Jun 26, 2023
@Tobbe Tobbe deleted the tobbe-v6-codemod-devfatalpage branch June 26, 2023 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:chore This PR is a chore (means nothing for users)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants