Skip to content

Conversation

pataar
Copy link
Contributor

@pataar pataar commented Oct 11, 2025

This pull request adds the new, official, React Compiler to the starter kit.

React Compiler is a build-time tool that optimizes your React app through automatic memoization. React Compiler automatically optimizes your React application at build time. React is often fast enough without optimization, but sometimes you need to manually memoize components and values to keep your app responsive. This manual memoization is tedious, easy to get wrong, and adds extra code to maintain. React Compiler does this optimization automatically for you, freeing you from this mental burden so you can focus on building features.

I made sure all the React related dependencies are on a compatible version. The version of the React eslint plugin had some errors on a couple of hooks and components. I made changes accordingly. Happy to clarify any changes when needed.

@pataar pataar changed the title Add the React Compiler Add the official React Compiler Oct 11, 2025
@pataar pataar force-pushed the react_compiler branch 2 times, most recently from b3c6462 to dcff467 Compare October 11, 2025 22:08
@joetannenbaum
Copy link
Contributor

Thanks for this PR! In testing I'm finding that the mobile hook is now firing quite a lot (the get snapshot function), is that expected?

@pataar
Copy link
Contributor Author

pataar commented Oct 13, 2025

Thanks for this PR! In testing I'm finding that the mobile hook is now firing quite a lot (the get snapshot function), is that expected?

Hi @joetannenbaum, does it trigger renders or is the callback function being invoked many times?

I implemented the hook based on https://react.dev/reference/react/useSyncExternalStore#subscribing-to-a-browser-api. I could try to extract the snapshot function from the component so it's using the same reference. Might be the issue.

@pataar
Copy link
Contributor Author

pataar commented Oct 13, 2025

@joetannenbaum Unfortunately I can't test the fix because I added it on mobile. Would you be able to check if my recent commit fixes the issue?

@pataar
Copy link
Contributor Author

pataar commented Oct 15, 2025

I can test the changes this friday.

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.

2 participants