fix: guard missing React version export - #810
Conversation
|
@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. Walkthrough本次变更为 ChangesReact version 缺失处理
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The change prevents an import-time crash when React lacks a version export while preserving the existing behavior when the version is available. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 小兔守着 version 门, Comment |
cc94637 to
3825a2b
Compare
3825a2b to
a42c5a7
Compare
|
CI failed. |
Signed-off-by: 陳廷安 <73953029+nrps9909@users.noreply.github.com>
a42c5a7 to
3863469
Compare
|
Rebased onto current
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #810 +/- ##
=======================================
Coverage 86.77% 86.77%
=======================================
Files 41 41
Lines 1096 1096
Branches 397 382 -15
=======================================
Hits 951 951
Misses 143 143
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
rc-util/es/refwhen a bundler's React interop object does not exposeversionversionis availableWhy
rc-util@5.44.4started readingversion.split(...)at module scope, and the same unguarded read remains in the current@rc-component/utilsource. In the Vite production-build cases reported in #647 and #783, the React named export can beundefined, so importingref.jsthrows before the application renders. Treating a missing version as an unknown version keeps the React 18-compatible path and prevents the module-load failure. A legacyrc-utilrelease would require a maintainer backport to5.x.Verification — September 17, 2026
Rebased onto current
master(c241125); signed/GitHub-Verified head:3863469d708a5a5be1b34e93148c10572fae31a4.pickAttrsand React-17 fallback test failures.action_required. A maintainer must approve the fork workflow before it can run.AI assistance disclosure
Codex assisted with implementation, conflict resolution, regression tests, and validation.