Commit Graph

415 Commits

Author SHA1 Message Date
Lauren Tan
67ea821e5f [publish] Fix files field for packages, invalid version range
The [`files` field](https://docs.npmjs.com/cli/v10/commands/npm-publish#files-included-in-package)
controls what files get included in the published package.

This PR specifies the `files` field on our publishable packages to only
include the `dist` directory, since we don't need to ship any types or
sourcemaps with 3 of them.

react-compiler-runtime is a runtime package which has sourcemaps, so we
also include the `src` directory in the published package.

Also fixes an invalid version range for the react peer dependency in
react-compiler-runtime, tested that it works via https://semver.npmjs.com/

ghstack-source-id: 12b36c203fc9fd8d72a1995fb3fba2312de4aa51
Pull Request resolved: https://github.com/facebook/react-forget/pull/2965
2024-05-14 11:02:29 -04:00
Joe Savona
b956024f3d Fix Jest tests
ghstack-source-id: e2507b7285bb52ee02d2cece35aa16eb0bc0baa5
Pull Request resolved: https://github.com/facebook/react-forget/pull/2963
2024-05-13 14:10:16 -07:00
Joe Savona
7e3be125e8 Use unique name for c import local identifier
ghstack-source-id: 93055b972f
Pull Request resolved: https://github.com/facebook/react-forget/pull/2961
2024-05-13 12:59:19 -07:00
Lauren Tan
9b0044e213 Better detection for reanimated
We found this issue through enabling the compiler on the React Conf app.

`babel-preset-expo` automatically adds the `react-native-animated`
plugin to apps that use the preset. This means that Expo apps sometimes
omit the react-native-animated plugin from their config, which was
failing our existing check. This PR copies the same detection that Expo
does for adding reanimated as a fallback

ghstack-source-id: 46f7aec0bc
Pull Request resolved: https://github.com/facebook/react-forget/pull/2953
2024-05-11 00:56:48 -04:00
Lauren Tan
c58142ba35 ReAnimated -> Reanimated
Fixes a small typo by request

ghstack-source-id: 00889150a9
Pull Request resolved: https://github.com/facebook/react-forget/pull/2952
2024-05-11 00:56:48 -04:00
Joe Savona
6b23c25ff9 Support HMR
Adds supports for hot module reloading (HMR) by resetting the cache if a hash of the source file changes. This is enabled via a compiler flag, but also enabled automatically via the babel plugin when NODE_ENV=development.

ghstack-source-id: 5cd1ad5c89
Pull Request resolved: https://github.com/facebook/react-forget/pull/2951
2024-05-09 13:59:31 -07:00
Lauren Tan
b28c53dcf1 Clarify how to address ValidateNoCapitalizedCalls errors
Make it clearer how to address this error by allowlisting globals that
are known to be safe

ghstack-source-id: e7fa6464ebb561a7a1366ff70430842007c6552e
Pull Request resolved: https://github.com/facebook/react-forget/pull/2909
2024-05-06 20:13:45 -04:00
Jan Kassens
e2d47342be Use default runtimeModule setting in Snap tests (#2940)
Lots of updated snapshots. The only updated code is resolving this TODO:

2b14805f98/packages/snap/src/compiler.ts (L41)
2024-05-06 19:57:37 -04:00
Jan Kassens
e63d3d1491 Upgrade to React 19 beta (#2938)
- Updated all directly defined dependencies to the latest React 19 Beta
- `package.json`: used `resolutions` to force React 19 for `react-is` transitive dependency
- `package.json`: postinstall script to patch fbt for the React 19 element Symbol
- Match on the message in Snap to exclude a React 19 warning that `act` should be imported from `react` instead (from inside `@testing-library/react`)
- Some updated snapshots, I think due to now recovering behavior of `useMemoCache`, please review.

In a next step, we can do the following. I excluded it since it from here as it made the PR unreviewable on GitHub.

- Snapshots now use `react/compiler-runtime` as in prod, so the different default in Snap is no longer needed.
2024-05-06 19:48:39 -04:00
Pieter Vanderwerff
738ddf7419 Support <fbs> in addition to <fbt>
ghstack-source-id: 1ab99ebb5cef3f42399682a338feb12c4cf55f4c
Pull Request resolved: https://github.com/facebook/react-forget/pull/2933
2024-05-03 13:27:51 -07:00
Joe Savona
82137ec184 Rename react-compiler-runtime
ghstack-source-id: c6c825f5efdb4f9c413050b22b7713966871338c
Pull Request resolved: https://github.com/facebook/react-forget/pull/2931
2024-05-02 17:14:26 -07:00
Joe Savona
1c8f8bfb89 Rename ReactForgetBabelPlugin locals
ghstack-source-id: 9cd5fe41ae322632dfeb3d5c7468268678006d94
Pull Request resolved: https://github.com/facebook/react-forget/pull/2929
2024-05-02 17:14:25 -07:00
Joe Savona
95e3cdcfa1 Rename {r,R}unReactForgetBabelPlugin
ghstack-source-id: e7f00aab61dd749dc6ba11ce7e4d14603bfeeab9
Pull Request resolved: https://github.com/facebook/react-forget/pull/2928
2024-05-02 17:14:24 -07:00
Joe Savona
b844766e6c Update references to Forget to React Compiler
ghstack-source-id: cce73f26b7b3903b8d79b70dbc24cbee09693d81
Pull Request resolved: https://github.com/facebook/react-forget/pull/2927
2024-05-02 14:28:06 -07:00
Joe Savona
48e0c70292 Rename babel plugin
ghstack-source-id: bb66913e2d3c814696311371ed655f3da03d1199
Pull Request resolved: https://github.com/facebook/react-forget/pull/2926
2024-05-02 14:12:33 -07:00