react/scripts/merge-fork
Andrew Clark 8f05f2bd6d
Land Lanes implementation in old fork (#19108)
* Add autofix to cross-fork lint rule

* replace-fork: Replaces old fork contents with new

For each file in the new fork, copies the contents into the
corresponding file of the old fork, replacing what was already there.

In contrast to merge-fork, which performs a three-way merge.

* Replace old fork contents with new fork

First I ran  `yarn replace-fork`.

Then I ran `yarn lint` with autofix enabled. There's currently no way to
do that from the command line (we should fix that), so I had to edit the
lint script file.

* Manual fix-ups

Removes dead branches, removes prefixes from internal fields.  Stuff
like that.

* Fix DevTools tests

DevTools tests only run against the old fork, which is why I didn't
catch these earlier.

There is one test that is still failing. I'm fairly certain it's related
to the layout of the Suspense fiber: we no longer conditionally wrap the
primary children. They are always wrapped in an extra fiber.

Since this has been running in www for weeks without major issues, I'll
defer fixing the remaining test to a follow up.
2020-06-11 20:05:15 -07:00
..
merge-fork.js Script for syncing changes between forks (#18550) 2020-04-09 11:37:13 -07:00
README.md Script for syncing changes between forks (#18550) 2020-04-09 11:37:13 -07:00
replace-fork.js Land Lanes implementation in old fork (#19108) 2020-06-11 20:05:15 -07:00

merge-fork

Script for syncing changes between forked modules.

Basic example

yarn merge-fork --base-dir=packages/react-reconciler/src ReactFiberWorkLoop

This will take all the changes in ReactFiberWorkLoop.new.js and apply them to ReactFiberWorkLoop.old.js.

Syncing multiple modules at once

You can merge multiple modules at a time:

yarn merge-fork \
  --base-dir=packages/react-reconciler/src \
  ReactFiberWorkLoop \
  ReactFiberBeginWork \
  ReactFiberCompleteWork \
  ReactFiberCommitWork

Syncing modules with different names

You can provide explicit "old" and "new" file names. This only works for one module at a time:

yarn merge-fork \
  --base-dir=packages/react-reconciler/src \
  --old=ReactFiberExpirationTime.js \
  --new=ReactFiberLane.js

Syncing modules in the opposite direction (old -> new)

The default is to merge changes from the new module to the old one. To merge changes in the opposite direction, use --reverse.

yarn merge-fork \
  --reverse \
  --base-dir=packages/react-reconciler/src \
  ReactFiberWorkLoop

Comparing changes to an older base rev

By default, the changes are compared to HEAD. You can use --base-ref to compare to any rev. For example, while working on a PR, you might make multiple commits to the new fork before you're ready to backport them to the old one. In that case, you want to compare to the merge base of your PR branch:

yarn merge-fork \
  --base-ref=$(git merge-base HEAD origin/master)
  --base-dir=packages/react-reconciler/src \
  ReactFiberWorkLoop