-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
Instructions on how to enable the React Compiler in a Waku pro… #857
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
docs/guides/react-compiler.mdx
Outdated
}); | ||
``` | ||
|
||
For a practical demonstration, visit this [StackBlitz demo](https://stackblitz.com/edit/github-ukt9tm?file=vite.config.ts) which provides a real-world example of the configuration in action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the demo.
For a practical demonstration, visit this [StackBlitz demo](https://stackblitz.com/edit/github-ukt9tm?file=vite.config.ts) which provides a real-world example of the configuration in action. | |
For a practical demonstration, visit this [StackBlitz demo](https://stackblitz.com/edit/github-h4uxwo?file=vite.config.ts) which provides a real-world example of the configuration in action. |
As I tried, removing "annotation" will cause errors. Can you please try it? I guess we should add it in the instruction above. What do you think? Do you think we can recommend it even with "annotation"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we shouldn't add this restriction because if we add an "annotation", users will need add the "use memo" directive manually
I found the error is Error: __vite_ssr_import_1__.c is not a function
, actually I encountered this error when I implement react compiler feature, I can try to fix it issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try to fix it issue
That will be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue occurs when I pass react compiler config in viteReact
called by createRscViteServer
. So in my implementation I only pass react compiler config in viteReact
called by createMainViteServer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not need react compiler for server files?
My plan is to allow customizing vite config for each server in v0.22.0. Give me more time.
description: Learn how to enable the React Compiler in your Waku project using the Vite Plugin to optimize your React applications. | ||
--- | ||
|
||
The React Compiler is a build-time tool designed to optimize React applications automatically. This guide will show you how to enable the React Compiler by integrating it with the `@vitejs/plugin-react`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's build-time only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I wonder if raw Vite app + React Compiler works in DEV mode. I don't think this is Waku specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev mode is also a kind of build-time. built time in this context means it won't haveruntime cost, which will have no exta bundle size & cpu runs when you open browser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
let's revisit this after v0.22 is finished. |
Background: #853