social-app
social-app copied to clipboard
PR #5898 breaks React Compiler optimization
Steps to Reproduce
- checkout 1fc684aaef6dd851b4d6c9a23673fcf4e7170722
- install deps, build, and run Bluesky
-
Shift+M
in terminal, chooseOpen React devtools
- Notice that there are no
Forget
or ✨ badges - checkout commit https://github.com/bluesky-social/social-app/commit/a22685c34542d43a71c3496df28e86207ec7fbed, which is the commit before 1fc684aaef6dd851b4d6c9a23673fcf4e7170722
- repeat 3&4
- Notice that there are
Forget
badges
Attachments
Actual
Expected (notice Forget
badges)
What platform(s) does this occur on?
Android
Device Info
No response
What version of the app are you using?
1.94.0
Additional Information
#5898 uses react-compiler-runtime@beta
for compiling & optimization the React codebase instead of handrolling one from lib/react-compiler-runtime
, as was done previously.
According to React Compiler docs:
React Devtools (v5.0+) has built-in support for React Compiler and will display a “Memo ✨” badge next to components that have been optimized by the compiler.
I've tried to check if the badge is present as stated in the reproduction steps above. However, there are no badges if I build and run the app after #5898 (see attached images).
NOTE: Perhaps there aren't any badges after #5898 because React Devtool used currently by Bluesky is on v4, whereas the docs states React Devtool expects v5.0+. However, prior to #5898 a Forget
badge still shows even on v4. Further confirmation is needed to show that no badges appear even on React Devtool v5.0+.
BTW, the reason I brought this up is because I also wanted to use the react compiler for my app, and used the Bluesky's lib/react-compiler-runtime
old method of doing it. However after switching to using react-compiler-runtime@beta
from npm, the badges no longer appear in React Devtool. So I'm wondering if Bluesky is facing the same issue as I am, which seems to be the case.