Update React Compiler to 1.0.0#13004
Conversation
|
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 12 changed, 0 removedBuild ID: d676c161cab68b3817558dfc |
commit: |
jerelmiller
left a comment
There was a problem hiding this comment.
I'll approve once you've had a chance to look at my comments 🙂
| observable?.restart(); | ||
| } | ||
| }, [optionsRef, recreateRef, observable]); | ||
| }, [observable, setObservable, optionsRef, recreateRef]); |
There was a problem hiding this comment.
This change is curious to me. Isn't setObservable a function returned from useState? Why wouldn't it be considered stable?
There was a problem hiding this comment.
I assumed so too, but the React compiler doesn't recognize it. It might have to do with the way we import React. Either way, if setObservable is missing it won't compile the whole function, so I just added it. It's stable anyways.
There was a problem hiding this comment.
facebook/react#35118 opened a React Compiler bug
There was a problem hiding this comment.
Oh dang good call! I didn't realize that. Thanks for explaining!
| // console.log(reactHooks.configs.flat); | ||
| // })() || {}), | ||
| ...reactHooks.configs.flat.recommended.rules, | ||
| // "react-hooks/unsupported-syntax": "warn", |
There was a problem hiding this comment.
Are you planning on adding these additional configs? Or is it ok that we just accept the recommended rules and remove the rules key?
There was a problem hiding this comment.
Good call. At some point I thought I'd have to change something there and then I didn't. Removing.
| ), | ||
| { | ||
| ...reactHooks.configs.flat.recommended, | ||
| files: ["**/*.ts", "**/*.tsx"], |
There was a problem hiding this comment.
I know this file list came from the previous config, but any chance we could update this to just look at the /react folder? No reason we need to use these rules outside of the React code.
There was a problem hiding this comment.
Good call, restricted it.
|
Again, some CI parts are failing with what looks like an npm outage, but nothing relevant impacted. |
* update react compiler to 1.0.0 * update test * cleanup
No description provided.