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

Instructions on how to enable the React Compiler in a Waku pro… #857

Merged
merged 4 commits into from
Dec 30, 2024

Conversation

L-Qun
Copy link
Contributor

@L-Qun L-Qun commented Aug 29, 2024

Background: #853

Copy link

vercel bot commented Aug 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Dec 30, 2024 3:04pm

Copy link

codesandbox-ci bot commented Aug 29, 2024

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.

});
```

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.
Copy link
Owner

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.

Suggested change
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"?

Copy link
Contributor Author

@L-Qun L-Qun Aug 30, 2024

Choose a reason for hiding this comment

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

image

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

Copy link
Owner

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.

Copy link
Contributor Author

@L-Qun L-Qun Aug 30, 2024

Choose a reason for hiding this comment

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

image

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

Copy link
Owner

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.

Copy link
Owner

Choose a reason for hiding this comment

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

Actually, I noticed the change isn't breaking much, so I decided to work on it during v0.21.*.

#24 (comment) @rmarscher

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
@dai-shi
Copy link
Owner

dai-shi commented Oct 4, 2024

let's revisit this after v0.22 is finished.

@dai-shi dai-shi marked this pull request as draft October 4, 2024 03:24
@rmarscher rmarscher mentioned this pull request Dec 28, 2024
Copy link
Owner

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Thanks to #1102.

docs/guides/react-compiler.mdx Show resolved Hide resolved
docs/guides/react-compiler.mdx Outdated Show resolved Hide resolved
docs/guides/react-compiler.mdx Outdated Show resolved Hide resolved
@dai-shi dai-shi marked this pull request as ready for review December 30, 2024 15:07
@dai-shi dai-shi merged commit dec088b into dai-shi:main Dec 30, 2024
26 checks passed
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