Repository navigation
[MOO-2499]: Upgrade React 19.3 and React Native 0.88 - #236
MxKevinBeqo wants to merge 14 commits into
Conversation
Upgrade the Pluggable Widgets Tools and the widget generator templates to React Native 0.88 (RC) and React 19.3. (MOO-2499) - bump react-native, @react-native/babel-preset, react, react-dom, react-test-renderer and the React types - use @react-native/jest-preset for native tests, since React Native no longer ships its own Jest preset - resolve modules with "bundler" in the base tsconfig, since React Native only exposes its types through package exports - add react-native-worklets and @react-native-vector-icons/common to the native externals and stop terser from removing directives - update the migration script, generator templates and command tests BREAKING CHANGE: widgets are upgraded to React Native 0.88 and React 19.3. The deprecated react-native-vector-icons package is no longer an external of native widgets; use the scoped @react-native-vector-icons/* packages.
On Windows runners the temp directory can be an 8.3 short path (RUNNER~1). Node resolved modules through that short path while Jest resolved them through the long path, so React was loaded twice and the generated native widget tests failed with "Cannot read properties of null (reading 'useReducer')".
|
|
||
| module.exports = { | ||
| preset: "react-native", | ||
| preset: dirname(require.resolve("@react-native/jest-preset")), |
There was a problem hiding this comment.
Shouldn't jest be able to resolve the preset on its own with just the name?
There was a problem hiding this comment.
You are right, I retested with name and it is building ok. Will have to retest on the Windows pipeline again after changing this, since I had some resolution issues there. Thank you!
@rollup/plugin-typescript requires tslib at build time but only lists it as an optional peer dependency. It used to be installed by chance through another package, which is no longer the case, so building a TypeScript widget could fail with "Could not find module 'tslib'".
- drop the unused react-hot-loader path mapping from the tools tsconfig - resolve the native Jest preset by name instead of by absolute path
This reverts commit f263b1b. Resolving the native Jest preset by name lets Jest load it from the real path, which should also avoid loading React twice when the temp directory is an 8.3 short path on Windows runners.
Restore the react-native-vector-icons external and drop its breaking change note from the changelog. Removing the old package name is unrelated to the React Native 0.88 upgrade and can be done separately.
|
Thanks for reviewing this @weirdwater , I appreciate it! I addressed the notes. As the PR description mentions, we will wait for the 12th of October until RN v0.88 releases and then update the dependencies -> rerunning the CI. Until then, I am moving this to Draft at the moment. |
Replace the 0.88.0-rc.3 pins for react-native, @react-native/babel-preset and @react-native/jest-preset with 0.88.0, including the generator templates and expected outputs, the command-tests and the migration constants.
…native.mjs Co-authored-by: Yogendra Shelke <yogendrashelke1992@gmail.com>
…e.config.js Co-authored-by: Yogendra Shelke <yogendrashelke1992@gmail.com>
… React Native 0.88 upgrade (#1)
…e.config.js Co-authored-by: Yogendra Shelke <yogendrashelke1992@gmail.com>
|
Hey @weirdwater , all the changes are in now, together with the official Rn v0.88, so please whenever you get the chance to re-review the new commits 🙇 . |
| dereference: true, | ||
| filter: source => { | ||
| const relativePath = relative(sourcePath, source); | ||
| return ( |
There was a problem hiding this comment.
Is the license glob/pattern no longer relevant?
There was a problem hiding this comment.
From what I checked, the old copy filter was taking in account all files with an extensions (first filter), and then the LICENSE_GLOB to match with license files which have no extension.
One side note which I had to verify with Claude was that now it is a exclude-only filter which means some files like Makefile or bin scripts can also be copied. Should be harmless in theory but if you think differently please let me know.
There was a problem hiding this comment.
I guess that is up to your team to decide, considering this is code path is only used for native widgets. If it is desirable to continue only copying files with extensions and licenses I would modify the predicate to check for these properties as well.
This PR upgrades to React 19.3 and React Native 0.88.