feat: upgrade to React 19, remove Rax compat layer#7169
Open
feat: upgrade to React 19, remove Rax compat layer#7169
Conversation
- Upgrade react/react-dom to ^19.0.0 in root and all packages - Update @types/react and @types/react-dom to ^19.0.0 - Set peerDependencies to '^18.0.0 || ^19.0.0' for dual-version compat - Update @ice/jsx-runtime peer to '^16 || ^17 || ^18 || ^19' - Remove packages/rax-compat and packages/plugin-rax-compat - Remove examples/rax-inline-style and examples/rax-project - Remove rax-related documentation - Add TODO comments for forwardRef (React 19 deprecation) - Add TODO comments for Context.Provider (React 19 simplification) - Add migration guide: update-from-icejs3.md - Keep react-router-dom and react-reconciler versions unchanged - Keep react-refresh at 0.14.0 (already React 19 compatible)
…xamples - Remove @ice/plugin-rax-compat from basic-project, disable-data-loader, multi-target examples - Regenerate pnpm-lock.yaml to match updated package.json versions
- Add pnpm.overrides to force @types/react@^19 across all packages (prevents dual @types/react@18 + @types/react@19 in node_modules) - Upgrade react-router-dom 6.21.3 → 6.30.3 (React 19 type compat) - Upgrade @remix-run/router 1.14.2 → 1.23.2 (required by react-router-dom 6.30.3) - Regenerate pnpm-lock.yaml
f8ee55c to
a55616b
Compare
…bility - React 19 no longer provides global JSX namespace - Use React.ReactElement instead of JSX.Element for type definitions - Affects: MetaType, TitleType, LinksType, ScriptsType, DataType, FirstChunkCacheType, MainType
- React 19 requires useRef to be called with an initial value - Fixes TS2554: Expected 1 arguments, but got 0
a55616b to
4bc08f3
Compare
- Multiple React versions (18.2.0 and 19.x) caused 'Invalid hook call' errors - Added overrides for react, react-dom, @types/react, @types/react-dom to ^19.0.0 - This ensures all dependencies use React 19
- React 19 upgrade resolved the type issues - Removed ts-expect-error comments in: - packages/ice/src/bundler/webpack/start.ts - packages/ice/src/webpack/ServerCompilerPlugin.ts
- tsx 3.x uses deprecated --loader flag - tsx 4.x uses --import flag which is compatible with Node.js 20.6.0+ - Fixes CI build error on newer Node.js versions
The pnpm-lock.yaml uses lockfileVersion 9.0 which requires pnpm 9.x. Using pnpm@8.9.2 caused 'Ignoring not compatible lockfile' warning and led to dependency version conflicts.
dts-bundle contains both .ts and .js files. tsx loads .ts files, where 'import * as assert from assert' makes assert an object instead of a function. This patch removes the .ts files.
- RawCopyGlobOptions interface uses 'ignore' not 'gitignore' - pnpm 9.x requires Node 18+, remove Node 16 from CI matrix
- Add type assertion for devServer property on Configuration - Remove return value from tapPromise callback to match void return type
- Update react-reconciler from 0.27.0 to 0.33.0 - Update scheduler from 0.20.1 to 0.25.0 - React 19 requires newer react-reconciler version
- Add resolveUpdatePriority, setCurrentUpdatePriority, getCurrentUpdatePriority - Add shouldAttemptEagerTransition - These APIs are required by react-reconciler 0.33.0 for React 19
- Delete rax-inline-style.test.ts and rax-project.test.ts - Add resolveEventTimeStamp, resolveEventType, trackSchedulerEvent APIs - These APIs are required by react-reconciler 0.33.0 for React 19
- Add missing host config methods for react-reconciler 0.33.0 - Fix createContainer API with new required parameters (error handlers) - Use updateContainerSync + flushSyncWork for synchronous rendering - Fix commitUpdate parameter order - Add hideTextInstance, unhideTextInstance, resetTextContent - Add maySuspendCommit, preloadInstance, startSuspendingCommit - Add NotPendingTransition, HostTransitionContext, resetFormInstance - Add bindToConsole, scheduleMicrotask This fixes most of the miniapp-react-dom tests for React 19.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ice.js v4: React 19 升级 + 移除 Rax 兼容层
变更概览
依赖升级
^19.0.0(根 + 所有 packages)^19.0.0^18.0.0 || ^19.0.0^16 || ^17 || ^18 || ^19移除 Rax
packages/rax-compat/packages/plugin-rax-compat/examples/rax-inline-style/,examples/rax-project/React 19 适配标注
forwardRef使用处(React 19 已废弃,可改用 ref-as-prop)Context.Provider使用处(React 19 可简化为直接使用 Context)迁移文档
website/docs/guide/advanced/update-from-icejs3.md未包含(后续 PR)
测试
138 files changed, 1456 additions, 4868 deletions