-
-
Notifications
You must be signed in to change notification settings - Fork 637
use v19.0.3 of react-on-rails-rsc as git dep #2197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 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. Comment |
size-limit report 📦
|
5e36ea6 to
e823223
Compare
6fbfbb8 to
8759ecd
Compare
Code Review - PR #2197: Use v19.0.3 of react-on-rails-rsc as git depThank you for working on this update! I've reviewed the changes and have several important findings: 🚨 Critical Issues1. Missing Return Statement in
|
PR Review: React 19.2.1 and react-on-rails-rsc Git Dependency UpgradeSummaryThis PR upgrades React to 19.2.1 and switches react-on-rails-rsc to a git dependency. The changes include test timing adjustments, VM context additions, and fixes for chunk parsing logic. 🔴 CRITICAL ISSUES1. Missing Return Statement in
|
Code Review FeedbackThank you for working on this PR! I've reviewed the changes and have several important observations: 🐛 Critical Bug - Missing Return Statement
The const removeRSCChunkStack = (chunk: string) => {
chunk.split('\n').map(removeRSCChunkStackInternal).join('\n');
};This should be: const removeRSCChunkStack = (chunk: string) => {
return chunk.split('\n').map(removeRSCChunkStackInternal).join('\n');
};Without the
|
Code Review FeedbackThank you for the pull request upgrading to
|
Code Review - PR #2197Critical Issues Found1. Missing Return Statement (packages/react-on-rails-pro/tests/utils/removeRSCChunkStack.ts:37-39) 2. Type Safety Issue (packages/react-on-rails-pro/tests/AsyncQueue.ts:29-32) 3. Dependency Mismatch (packages/react-on-rails-pro/package.json) Missing Requirements
Recommendation🔴 Request Changes - Fix the missing return statement and type safety issues before merging. Update CHANGELOG_PRO.md and resolve the dependency strategy (either publish react-on-rails-rsc to npm or document the git dependency approach). |
Code Review for PR #2197Thank you for working on upgrading to react-on-rails-rsc v19.0.3! I've reviewed the changes and have several critical issues and recommendations: 🚨 CRITICAL BUG - MUST FIX1. removeRSCChunkStack function missing return statement (Line 38)// ❌ BROKEN - No return statement!
const removeRSCChunkStack = (chunk: string) => {
chunk.split('\n').map(removeRSCChunkStackInternal).join('\n');
};
// ✅ SHOULD BE:
const removeRSCChunkStack = (chunk: string) => {
return chunk.split('\n').map(removeRSCChunkStackInternal).join('\n');
};Impact: This function currently returns Location:
|
PR Review: Upgrade to react-on-rails-rsc v19.2.1Thanks for working on this upgrade! I've reviewed the changes and have several concerns that need to be addressed before this can be merged. Critical Issues1. Missing Return Statement in removeRSCChunkStack (Bug) The function removeRSCChunkStack is missing a return statement - it will always return undefined, breaking any code that relies on it. 2. Type Safety Issue in AsyncQueue.dequeue() (Type Error) The logic changed from shift() to join(''), which assumes T is string. The cast as T is unsafe and will fail at runtime if T is not string. Why was this changed? Is this trying to handle multiple buffered items as a single concatenated string? Moderate Issues3. Debugging Comment Left in Production Code Comment suggests underlying test flakiness that wasn't resolved. Why does this fail on CI? 4. Commented Out Assertion Count expect.assertions(258) was commented out, removing a safety check. If the count changed, update it rather than commenting it out. 5. Added Delays in Tests Without Explanation Minor Issues6. Incomplete PR Description 7. Git Dependency in Production Action Items Before Merging
Let me know if you have questions about any of these points! |
Code ReviewThank you for the PR! I've reviewed the changes for upgrading to React 19.2.1 and using the git dependency for react-on-rails-rsc. Here's my feedback: ✅ Positive Observations
🚨 Critical Issues1. Bug in
|
Code Review for PR #2197SummaryThis PR upgrades the react-on-rails-rsc dependency from version ^19.0.3 to a git dependency pointing to React 19.2.1 upgrade branch, along with test fixes and improvements to handle asynchronous RSC payload generation. Critical Bug Found - Missing Return StatementLocation: packages/react-on-rails-pro/tests/utils/removeRSCChunkStack.ts:37-39 The function doesn't return anything! The computed result is never returned, so this function will always return undefined. Fix needed - add return statement at line 38. Significant Issues1. Type Safety Issue in AsyncQueue 2. Disabled Assertion Count 3. Commented-Out Debug Code Code Quality Concerns4. Increased Test Timeouts and Delays 5. Test Behavioral Changes Good Changes
Missing Items
RecommendationsMust Fix (Blocking):
Should Fix (Important): Overall Assessment: The PR has the right intent, but has one critical bug and several quality concerns that should be addressed before merging. |
Code Review - PR #2197: Upgrade to react-on-rails-rsc v19.2.1SummaryThis PR upgrades ✅ Positive Aspects1. Good VM Context UpdatesThe addition of
2. Chunk Buffering FixThe fix in
3. Test Timing ImprovementsAdding
|
Code Review FeedbackThank you for working on upgrading to React 19.2.1! Here are my findings: Critical Issues1. Bug in removeRSCChunkStack.ts - Missing Return Statement The function doesn't return the result - it will always return undefined. Need to add return statement. 2. Semantic Change in AsyncQueue.ts - Breaking Behavior Previously dequeue() returned first item with buffer.shift(). Now it returns ALL buffered items joined as string. This changes behavior and has type safety issues since the class is generic over T but assumes T is string. Issues to Address3. Debugging Comment 4. Test Reliability - Arbitrary Delays Good Changes
SummaryMust fix: Missing return statement and AsyncQueue type safety |
Code Review - PR #2197: Use v19.0.3 of react-on-rails-rsc as git depSummaryThis PR upgrades the
|
Code Review for PR #2197Thank you for working on upgrading to React 19.2.1! I've reviewed the changes and have several important concerns to address. 🚨 Critical Issues1. Bug in
|
| test('Renders concurrent rsc streams as single rsc stream', async () => { | ||
| expect.assertions(258); | ||
| const asyncQueue = new AsyncQueue<string>(); | ||
| // expect.assertions(258); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's delete, not uncomment. expect.assertions is useful in the first place when using callbacks instead of async/await, to check callbacks actually get called.
| // expect.assertions(258); |
|
|
||
| class AsyncQueue<T> { | ||
| private eventEmitter = new EventEmitter(); | ||
| const debounce = <T extends unknown[]>(callback: (...args: T) => void, delay: number) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange we don't already have it somewhere, but apparently not.
Summary
Used
[email protected]andreact v19.2.1as dev dependencies and as dependencies for the dummy apps. Updated the tests to work well with the new behavior. The change in the tests happens because v19.2.1 emits much more debugging chunks for debugging, so we need to merge chunks together before asserting their content.Next Step
Implement the react partial-prerendering (PPR) at react-on-rails-pro. This is a smaple of how to use the partial prerendering API at [email protected]
Problem that wee need to focus on fixing
The React API is limited; you can't choose which components to prerender and which to resume later. You need to select a specific point at time and abort the rendering at it. Hence, all components that are resolved before that minute are prerendered, and all components that are not resolved yet are resumed later.
Possible Solutions
But it causes a problem that all components that use async props will be suspended and not preluded, instead it will be resumed later.