Problem
Currently, upgrading react-server-dom-webpack requires maintaining two separate repositories:
shakacode/react_on_rails_rsc (this repo) — ships the RSC npm package with built artifacts in src/react-server-dom-webpack/
abanoubghadban/react (a fork of facebook/react) — hosts rsc-patches/v<version> branches containing [RSC-PATCH] commits on top of upstream React tags
The fork repo exists solely to park a small set of patch commits on top of vanilla React, build the patched react-server-dom-webpack package, and copy the output into this repo.
Pain Points
- Two repos to maintain — contributors need access to both; cross-repo changes require two commits, two push cycles
- Disconnected history — patches in the fork are invisible from this repo's PR/review flow
- CI complexity — any automated upgrade or validation needs credentials and clone access to the fork
- Fork staleness — the fork accumulates upstream drift and must be periodically rebased
Goal
Investigate options to consolidate everything into shakacode/react_on_rails_rsc so that abanoubghadban/react can be archived or deleted.
Options Identified
- Git submodule — embed the fork as
vendor/react/
- Git subtree — merge fork history into this repo
- On-demand clone — auto-clone the fork at upgrade time (script-managed, gitignored)
- Patch files — store
[RSC-PATCH] commits as .patch files in this repo; build from vanilla facebook/react at upgrade time
See the investigation doc in the associated PR for detailed analysis of each option.
Decision
After analysis, Option 4 (patch files) was selected as the approach to implement. This will be implemented in a follow-up issue after the currently open PRs are merged.
Related
Problem
Currently, upgrading
react-server-dom-webpackrequires maintaining two separate repositories:shakacode/react_on_rails_rsc(this repo) — ships the RSC npm package with built artifacts insrc/react-server-dom-webpack/abanoubghadban/react(a fork offacebook/react) — hostsrsc-patches/v<version>branches containing[RSC-PATCH]commits on top of upstream React tagsThe fork repo exists solely to park a small set of patch commits on top of vanilla React, build the patched
react-server-dom-webpackpackage, and copy the output into this repo.Pain Points
Goal
Investigate options to consolidate everything into
shakacode/react_on_rails_rscso thatabanoubghadban/reactcan be archived or deleted.Options Identified
vendor/react/[RSC-PATCH]commits as.patchfiles in this repo; build from vanillafacebook/reactat upgrade timeSee the investigation doc in the associated PR for detailed analysis of each option.
Decision
After analysis, Option 4 (patch files) was selected as the approach to implement. This will be implemented in a follow-up issue after the currently open PRs are merged.
Related
scripts/react-upgrade/src/react-server-dom-webpack/