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

Update templates to React 19 #24

Merged
merged 3 commits into from
Dec 9, 2024
Merged

Update templates to React 19 #24

merged 3 commits into from
Dec 9, 2024

Conversation

brookslybrand
Copy link
Contributor

No description provided.

@brookslybrand brookslybrand changed the title Update templates to react 19 Update templates to React 19 Dec 5, 2024
@yoh-000
Copy link

yoh-000 commented Dec 7, 2024

@brookslybrand, the react-19 branch's default template does not work if you set ssr: false in react-router.config.ts. Perhaps not an issue with the template and simply an incompatibility between react-router and react@19? I see this issue: remix-run/react-router#12138

@SiddharthPant
Copy link

This concerns react-compiler that is introduced with React 19. The below file

"moduleResolution": "NodeNext"
in official templates use moduleResolution: NodeNext which causes issues when you try to add react compiler using vite-react-babel plugin in vite.config.ts. Typescript complains that plugins babel() is not a function.
Using moduleResolution: Bundler solves this issue.

Here's a working example of changes required to enable react-compiler for RR7: forge42dev/base-stack#20
I was following the same link when I hit the above error and its resolution.

@brookslybrand
Copy link
Contributor Author

Thanks @yoh-000 for pointing that out. Per the last comment you need to set NODE_ENV=production when running build

"build": "NODE_ENV=production react-router build"

We're looking into if there are better defaults we need to set, but in the meantime this will get you unblocked.

I've updated the appropriate templates to reflect this. I plan to setup a SPA template soon which will have this setup properly by default

@brookslybrand
Copy link
Contributor Author

I'm going to go ahead and merge this. @SiddharthPant please feel free to open up another issue about the "moduleResolution: Bundler" suggestion/issue. It may be something we want to change, but I'm going to let @pcattori or someone else on the team address that

@brookslybrand
Copy link
Contributor Author

@SiddharthPant never mind, I went ahead and updated all remaining tsconfig files in #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants