Updated scripts and config to replace "master" with "main" branch (#21768)
Brian Vaughn committed
Jun 29, 2021 at 14:26 UTC
d483463bc86555decb3e8caa18459d1d0f7c0148
34 files changed
+65
-65
.circleci/config.yml
+8
-8
@@ -171,9 +171,9 @@ jobs:
171
- run:
172
name: Download artifacts for base revision
173
command: |
174
- git fetch origin master
174
+ git fetch origin main
175
cd ./scripts/release && yarn && cd ../../
176
- scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/master)
176
+ scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/main)
177
mv ./build2 ./base-build
178
- persist_to_workspace:
179
root: .
@@ -356,7 +356,7 @@ jobs:
356
- run:
357
name: Run publish script
358
command: |
359
- git fetch origin master
359
+ git fetch origin main
360
cd ./scripts/release && yarn && cd ../../
361
scripts/release/prepare-release-from-ci.js --skipTests -r << parameters.release_channel >> --commit=<< parameters.commit_sha >>
362
cp ./scripts/release/ci-npmrc ~/.npmrc
@@ -414,7 +414,7 @@ workflows:
414
filters:
415
branches:
416
only:
417
- - master
417
+ - main
418
419
# New workflow that will replace "stable" and "experimental"
420
build_and_test:
@@ -491,14 +491,14 @@ workflows:
491
filters:
492
branches:
493
ignore:
494
- - master
494
+ - main
495
requires:
496
- setup
497
- sizebot:
498
filters:
499
branches:
500
ignore:
501
- - master
501
+ - main
502
requires:
503
- get_base_build
504
- yarn_build_combined
@@ -514,7 +514,7 @@ workflows:
514
filters:
515
branches:
516
only:
517
- - master
517
+ - main
518
jobs:
519
- setup
520
- test_fuzz:
@@ -555,7 +555,7 @@ workflows:
555
filters:
556
branches:
557
only:
558
- - master
558
+ - main
559
jobs:
560
- setup
561
- publish_prerelease:
.github/PULL_REQUEST_TEMPLATE.md
+1
-1
@@ -4,7 +4,7 @@
4
5
Before submitting a pull request, please make sure the following is done:
6
7
- 1. Fork [the repository](https://github.com/facebook/react) and create your branch from `master`.
7
+ 1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`.
8
2. Run `yarn` in the repository root.
9
3. If you've fixed a bug or added code that should be tested, add tests!
10
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
CHANGELOG.md
+4
-4
@@ -679,7 +679,7 @@ This release was published in a broken state and should be skipped.
679
680
### React Is (New)
681
682
-* First release of the [new package](https://github.com/facebook/react/tree/master/packages/react-is) that libraries can use to detect different React node types. ([@bvaughn](https://github.com/bvaughn) in [#12199](https://github.com/facebook/react/pull/12199))
682
+* First release of the [new package](https://github.com/facebook/react/tree/main/packages/react-is) that libraries can use to detect different React node types. ([@bvaughn](https://github.com/bvaughn) in [#12199](https://github.com/facebook/react/pull/12199))
683
* Add `ReactIs.isValidElementType()` to help higher-order components validate their inputs. ([@jamesreggio](https://github.com/jamesreggio) in [#12483](https://github.com/facebook/react/pull/12483))
684
685
### React Lifecycles Compat (New)
@@ -688,7 +688,7 @@ This release was published in a broken state and should be skipped.
688
689
### Create Subscription (New)
690
691
-* First release of the [new package](https://github.com/facebook/react/tree/master/packages/create-subscription) to subscribe to external data sources safely for async rendering. ([@bvaughn](https://github.com/bvaughn) in [#12325](https://github.com/facebook/react/pull/12325))
691
+* First release of the [new package](https://github.com/facebook/react/tree/main/packages/create-subscription) to subscribe to external data sources safely for async rendering. ([@bvaughn](https://github.com/bvaughn) in [#12325](https://github.com/facebook/react/pull/12325))
692
693
### React Reconciler (Experimental)
694
@@ -819,12 +819,12 @@ Starting with 16.1.0, we will no longer be publishing new releases on Bower. You
819
820
### React Reconciler (Experimental)
821
822
-* First release of the [new experimental package](https://github.com/facebook/react/blob/master/packages/react-reconciler/README.md) for creating custom renderers. ([@iamdustan](https://github.com/iamdustan) in [#10758](https://github.com/facebook/react/pull/10758))
822
+* First release of the [new experimental package](https://github.com/facebook/react/blob/main/packages/react-reconciler/README.md) for creating custom renderers. ([@iamdustan](https://github.com/iamdustan) in [#10758](https://github.com/facebook/react/pull/10758))
823
* Add support for React DevTools. ([@gaearon](https://github.com/gaearon) in [#11463](https://github.com/facebook/react/pull/11463))
824
825
### React Call Return (Experimental)
826
827
-* First release of the [new experimental package](https://github.com/facebook/react/tree/master/packages/react-call-return) for parent-child communication. ([@gaearon](https://github.com/gaearon) in [#11364](https://github.com/facebook/react/pull/11364))
827
+* First release of the [new experimental package](https://github.com/facebook/react/tree/main/packages/react-call-return) for parent-child communication. ([@gaearon](https://github.com/gaearon) in [#11364](https://github.com/facebook/react/pull/11364))
828
829
## 16.0.1 (August 1, 2018)
830
README.md
+1
-1
@@ -1,4 +1,4 @@
1
-# [React](https://reactjs.org/) · [](https://github.com/facebook/react/blob/master/LICENSE) [](https://www.npmjs.com/package/react) [](https://circleci.com/gh/facebook/react) [](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request)
1
+# [React](https://reactjs.org/) · [](https://github.com/facebook/react/blob/main/LICENSE) [](https://www.npmjs.com/package/react) [](https://circleci.com/gh/facebook/react) [](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request)
2
3
React is a JavaScript library for building user interfaces.
4
appveyor.yml
+1
-1
@@ -18,7 +18,7 @@ platform:
18
19
branches:
20
only:
21
- - master
21
+ - main
22
23
# Disable Visual Studio build and deploy
24
build: off
packages/create-subscription/README.md
+1
-1
@@ -8,7 +8,7 @@ This utility should be used for subscriptions to a single value that are typical
8
9
Other cases have **better long-term solutions**:
10
* Redux/Flux stores should use the [context API](https://reactjs.org/docs/context.html) instead.
11
-* I/O subscriptions (e.g. notifications) that update infrequently should use [`react-cache`](https://github.com/facebook/react/blob/master/packages/react-cache/README.md) instead.
11
+* I/O subscriptions (e.g. notifications) that update infrequently should use [`react-cache`](https://github.com/facebook/react/blob/main/packages/react-cache/README.md) instead.
12
* Complex libraries like Relay/Apollo should manage subscriptions manually with the same techniques which this library uses under the hood (as referenced [here](https://gist.github.com/bvaughn/d569177d70b50b58bff69c3c4a5353f3)) in a way that is most optimized for their library usage.
13
14
## Limitations in async mode
packages/eslint-plugin-react-hooks/CHANGELOG.md
+1
-1
@@ -71,4 +71,4 @@
71
72
## 1.x
73
74
-The 1.x releases aren’t noted in this changelog, but you can find them in the [commit history](https://github.com/facebook/react/commits/master/packages/eslint-plugin-react-hooks).
74
+The 1.x releases aren’t noted in this changelog, but you can find them in the [commit history](https://github.com/facebook/react/commits/main/packages/eslint-plugin-react-hooks).
packages/react-devtools-extensions/flow-typed/npm/react-test-renderer_v16.x.x.js
+1
-1
@@ -2,7 +2,7 @@
2
// flow-typed version: 9c71eca8ef/react-test-renderer_v16.x.x/flow_>=v0.47.x
3
4
// Type definitions for react-test-renderer 16.x.x
5
-// Ported from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-test-renderer
5
+// Ported from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/main/types/react-test-renderer
6
7
'use strict';
8
packages/react-devtools-extensions/popups/disabled.html
+1
-1
@@ -13,5 +13,5 @@
13
<p>
14
<b>This page doesn’t appear to be using React.</b>
15
<br />
16
- If this seems wrong, follow the <a href="https://github.com/facebook/react/tree/master/packages/react-devtools#the-react-tab-doesnt-show-up">troubleshooting instructions</a>.
16
+ If this seems wrong, follow the <a href="https://github.com/facebook/react/tree/main/packages/react-devtools#the-react-tab-doesnt-show-up">troubleshooting instructions</a>.
17
</p>
packages/react-devtools-inline/README.md
+1
-1
@@ -211,4 +211,4 @@ Once the above packages have been built or downloaded, you can watch for changes
211
yarn start
212
```
213
214
-To test package changes, refer to the [`react-devtools-shell` README](https://github.com/facebook/react/blob/master/packages/react-devtools-shell/README.md).
214
+To test package changes, refer to the [`react-devtools-shell` README](https://github.com/facebook/react/blob/main/packages/react-devtools-shell/README.md).
packages/react-devtools-scheduling-profiler/src/view-base/utils/normalizeWheel.js
+1
-1
@@ -7,7 +7,7 @@
7
* @flow
8
*/
9
10
-// Adapted from: https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js
10
+// Adapted from: https://github.com/facebookarchive/fixed-data-table/blob/main/src/vendor_upstream/dom/normalizeWheel.js
11
12
export type NormalizedWheelDelta = {|
13
deltaX: number,
packages/react-devtools-shared/src/__tests__/profilingCache-test.js
+4
-4
@@ -672,7 +672,7 @@ describe('ProfilingCache', () => {
672
673
const About = () => <div>About</div>;
674
675
- // Mimics https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/Router.js
675
+ // Mimics https://github.com/ReactTraining/react-router/blob/main/packages/react-router/modules/Router.js
676
function Router({children}) {
677
const [path, setPath] = React.useState('/');
678
return (
@@ -682,7 +682,7 @@ describe('ProfilingCache', () => {
682
);
683
}
684
685
- // Mimics https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/Switch.js
685
+ // Mimics https://github.com/ReactTraining/react-router/blob/main/packages/react-router/modules/Switch.js
686
function Switch({children}) {
687
return (
688
<RouterContext.Consumer>
@@ -699,14 +699,14 @@ describe('ProfilingCache', () => {
699
);
700
}
701
702
- // Mimics https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/Route.js
702
+ // Mimics https://github.com/ReactTraining/react-router/blob/main/packages/react-router/modules/Route.js
703
function Route({children, path}) {
704
return null;
705
}
706
707
const linkRef = React.createRef();
708
709
- // Mimics https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/modules/Link.js
709
+ // Mimics https://github.com/ReactTraining/react-router/blob/main/packages/react-router-dom/modules/Link.js
710
function Link({children, path}) {
711
return (
712
<RouterContext.Consumer>
packages/react-devtools-shared/src/backend/renderer.js
+2
-2
@@ -2633,7 +2633,7 @@ export function attach(
2633
const UNMOUNTED = 3;
2634
2635
// This function is copied from React and should be kept in sync:
2636
- // https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiberTreeReflection.js
2636
+ // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js
2637
function isFiberMountedImpl(fiber: Fiber): number {
2638
let node = fiber;
2639
let prevNode = null;
@@ -2689,7 +2689,7 @@ export function attach(
2689
}
2690
2691
// This function is copied from React and should be kept in sync:
2692
- // https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiberTreeReflection.js
2692
+ // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js
2693
// It would be nice if we updated React to inject this function directly (vs just indirectly via findDOMNode).
2694
// BEGIN copied code
2695
function findCurrentFiberUsingSlowPathById(id: number): Fiber | null {
packages/react-devtools-shared/src/constants.js
+1
-1
@@ -44,7 +44,7 @@ export const LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY =
44
export const PROFILER_EXPORT_VERSION = 5;
45
46
export const CHANGE_LOG_URL =
47
- 'https://github.com/facebook/react/blob/master/packages/react-devtools/CHANGELOG.md';
47
+ 'https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md';
48
49
export const UNSUPPORTED_VERSION_URL =
50
'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back';
packages/react-devtools-shared/src/devtools/cache.js
+1
-1
@@ -15,7 +15,7 @@ import {createContext} from 'react';
15
// TODO (cache) Remove this cache; it is outdated and will not work with newer APIs like startTransition.
16
17
// Cache implementation was forked from the React repo:
18
-// https://github.com/facebook/react/blob/master/packages/react-cache/src/ReactCache.js
18
+// https://github.com/facebook/react/blob/main/packages/react-cache/src/ReactCache.js
19
//
20
// This cache is simpler than react-cache in that:
21
// 1. Individual items don't need to be invalidated.
packages/react-devtools-shell/README.md
+1
-1
@@ -2,7 +2,7 @@ Harness for testing local changes to the `react-devtools-inline` and `react-devt
2
3
## Development
4
5
-This target should be run in parallel with the `react-devtools-inline` package. The first step then is to run that target following the instructions in the [`react-devtools-inline` README](https://github.com/facebook/react/blob/master/packages/react-devtools-inline/README.md).
5
+This target should be run in parallel with the `react-devtools-inline` package. The first step then is to run that target following the instructions in the [`react-devtools-inline` README](https://github.com/facebook/react/blob/main/packages/react-devtools-inline/README.md).
6
7
The test harness can then be run as follows:
8
```sh
packages/react-devtools/CHANGELOG.md
+3
-3
@@ -2,7 +2,7 @@
2
3
<details>
4
<summary>
5
- Changes that have landed in master but are not yet released.
5
+ Changes that have landed in main but are not yet released.
6
Click to see more.
7
</summary>
8
@@ -380,7 +380,7 @@ New keys can be added to object props/state/hooks now. Existing keys can be rena
380
#### Improved performance
381
The legacy DevTools extension used to add significant performance overhead, making it unusable for some larger React applications. That overhead has been effectively eliminated in version 4.
382
383
-[Learn more](https://github.com/facebook/react/blob/master/packages/react-devtools/OVERVIEW.md) about the performance optimizations that made this possible.
383
+[Learn more](https://github.com/facebook/react/blob/main/packages/react-devtools/OVERVIEW.md) about the performance optimizations that made this possible.
384
385
#### Component stacks
386
@@ -406,7 +406,7 @@ Filter preferences are remembered between sessions.
406
407
#### No more inline props
408
409
-Components in the tree no longer show inline props. This was done to [make DevTools faster](https://github.com/facebook/react/blob/master/packages/react-devtools/OVERVIEW.md) and to make it easier to browse larger component trees.
409
+Components in the tree no longer show inline props. This was done to [make DevTools faster](https://github.com/facebook/react/blob/main/packages/react-devtools/OVERVIEW.md) and to make it easier to browse larger component trees.
410
411
You can view a component's props, state, and hooks by selecting it:
412
packages/react-devtools/OVERVIEW.md
+1
-1
@@ -259,7 +259,7 @@ Even when dealing with a single component, serializing deeply nested properties
259
260
Hooks present a unique challenge for the DevTools because of the concept of _custom_ hooks. (A custom hook is essentially any function that calls at least one of the built-in hooks. By convention custom hooks also have names that begin with "use".)
261
262
-So how does DevTools identify custom functions called from within third party components? It does this by temporarily overriding React's built-in hooks and shallow rendering the component in question. Whenever one of the (overridden) built-in hooks are called, it parses the call stack to spot potential custom hooks (functions between the component itself and the built-in hook). This approach enables it to build a tree structure describing all of the calls to both the built-in _and_ custom hooks, along with the values passed to those hooks. (If you're interested in learning more about this, [here is the source code](https://github.com/facebook/react/blob/master/packages/react-debug-tools/src/ReactDebugHooks.js).)
262
+So how does DevTools identify custom functions called from within third party components? It does this by temporarily overriding React's built-in hooks and shallow rendering the component in question. Whenever one of the (overridden) built-in hooks are called, it parses the call stack to spot potential custom hooks (functions between the component itself and the built-in hook). This approach enables it to build a tree structure describing all of the calls to both the built-in _and_ custom hooks, along with the values passed to those hooks. (If you're interested in learning more about this, [here is the source code](https://github.com/facebook/react/blob/main/packages/react-debug-tools/src/ReactDebugHooks.js).)
263
264
> **Note**: DevTools obtains hooks info by re-rendering a component.
265
> Breakpoints will be invoked during this additional (shallow) render,
packages/react-devtools/README.md
+1
-1
@@ -105,7 +105,7 @@ Or you could develop with a local HTTP server [like `serve`](https://www.npmjs.c
105
106
**If your app is inside of CodePen**, make sure you are registered. Then press Fork (if it's not your pen), and then choose Change View > Debug. The Debug view is inspectable with DevTools because it doesn't use an iframe.
107
108
-**If your app is inside an iframe, a Chrome extension, React Native, or in another unusual environment**, try [the standalone version instead](https://github.com/facebook/react/tree/master/packages/react-devtools). Chrome apps are currently not inspectable.
108
+**If your app is inside an iframe, a Chrome extension, React Native, or in another unusual environment**, try [the standalone version instead](https://github.com/facebook/react/tree/main/packages/react-devtools). Chrome apps are currently not inspectable.
109
110
**If you still have issues** please [report them](https://github.com/facebook/react/issues/new?labels=Component:%20Developer%20Tools). Don't forget to specify your OS, browser version, extension version, and the exact instructions to reproduce the issue with a screenshot.
111
packages/react-reconciler/README.md
+6
-6
@@ -51,15 +51,15 @@ const HostConfig = {
51
* **[Building a simple custom renderer to DOM](https://medium.com/@agent_hunt/hello-world-custom-react-renderer-9a95b7cd04bc)**
52
* **[Building a simple custom renderer to native](https://medium.com/@agent_hunt/introduction-to-react-native-renderers-aka-react-native-is-the-java-and-react-native-renderers-are-828a0022f433)**
53
54
-The full list of supported methods [can be found here](https://github.com/facebook/react/blob/master/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js). For their signatures, we recommend looking at specific examples below.
54
+The full list of supported methods [can be found here](https://github.com/facebook/react/blob/main/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js). For their signatures, we recommend looking at specific examples below.
55
56
The React repository includes several renderers. Each of them has its own host config.
57
58
The examples in the React repository are declared a bit differently than a third-party renderer would be. In particular, the `HostConfig` object mentioned above is never explicitly declared, and instead is a *module* in our code. However, its exports correspond directly to properties on a `HostConfig` object you'd need to declare in your code:
59
60
-* [React ART](https://github.com/facebook/react/blob/master/packages/react-art/src/ReactART.js) and its [host config](https://github.com/facebook/react/blob/master/packages/react-art/src/ReactARTHostConfig.js)
61
-* [React DOM](https://github.com/facebook/react/blob/master/packages/react-dom/src/client/ReactDOM.js) and its [host config](https://github.com/facebook/react/blob/master/packages/react-dom/src/client/ReactDOMHostConfig.js)
62
-* [React Native](https://github.com/facebook/react/blob/master/packages/react-native-renderer/src/ReactNativeRenderer.js) and its [host config](https://github.com/facebook/react/blob/master/packages/react-native-renderer/src/ReactNativeHostConfig.js)
60
+* [React ART](https://github.com/facebook/react/blob/main/packages/react-art/src/ReactART.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-art/src/ReactARTHostConfig.js)
61
+* [React DOM](https://github.com/facebook/react/blob/main/packages/react-dom/src/client/ReactDOM.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-dom/src/client/ReactDOMHostConfig.js)
62
+* [React Native](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactNativeRenderer.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactNativeHostConfig.js)
63
64
If these links break please file an issue and we’ll fix them. They intentionally link to the latest versions since the API is still evolving. If you have more questions please file an issue and we’ll try to help!
65
@@ -332,10 +332,10 @@ This method should mutate the `container` root node and remove all children from
332
333
### Persistence Methods
334
335
-If you use the persistent mode instead of the mutation mode, you would still need the "Core Methods". However, instead of the Mutation Methods above you will implement a different set of methods that performs cloning nodes and replacing them at the root level. You can find a list of them in the "Persistence" section [listed in this file](https://github.com/facebook/react/blob/master/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js). File an issue if you need help.
335
+If you use the persistent mode instead of the mutation mode, you would still need the "Core Methods". However, instead of the Mutation Methods above you will implement a different set of methods that performs cloning nodes and replacing them at the root level. You can find a list of them in the "Persistence" section [listed in this file](https://github.com/facebook/react/blob/main/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js). File an issue if you need help.
336
337
### Hydration Methods
338
339
You can optionally implement hydration to "attach" to the existing tree during the initial render instead of creating it from scratch. For example, the DOM renderer uses this to attach to an HTML markup.
340
341
-To support hydration, you need to declare `supportsHydration: true` and then implement the methods in the "Hydration" section [listed in this file](https://github.com/facebook/react/blob/master/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js). File an issue if you need help.
341
+To support hydration, you need to declare `supportsHydration: true` and then implement the methods in the "Hydration" section [listed in this file](https://github.com/facebook/react/blob/main/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js). File an issue if you need help.
packages/react/index.js
+1
-1
@@ -7,7 +7,7 @@
7
* @flow
8
*/
9
10
-// Keep in sync with https://github.com/facebook/flow/blob/master/lib/react.js
10
+// Keep in sync with https://github.com/facebook/flow/blob/main/lib/react.js
11
export type StatelessFunctionalComponent<
12
P,
13
> = React$StatelessFunctionalComponent<P>;
packages/use-subscription/README.md
+1
-1
@@ -8,7 +8,7 @@ This utility can be used for subscriptions to a single value that are typically
8
9
Most other cases have **better long-term solutions**:
10
* Redux/Flux stores should use the [context API](https://reactjs.org/docs/context.html) instead.
11
-* I/O subscriptions (e.g. notifications) that update infrequently should use a mechanism like [`react-cache`](https://github.com/facebook/react/blob/master/packages/react-cache/README.md) instead.
11
+* I/O subscriptions (e.g. notifications) that update infrequently should use a mechanism like [`react-cache`](https://github.com/facebook/react/blob/main/packages/react-cache/README.md) instead.
12
* Complex libraries like Relay/Apollo should manage subscriptions manually with the same techniques which this library uses under the hood (as referenced [here](https://gist.github.com/bvaughn/d569177d70b50b58bff69c3c4a5353f3)) in a way that is most optimized for their library usage.
13
14
## Limitations in concurrent mode
scripts/bench/README.md
+2
-2
@@ -27,8 +27,8 @@ yarn start --local
27
# will only build and run remote merge base repo against benchmarks (no local values will be shown)
28
yarn start --remote
29
30
-# will only build and run remote master repo against benchmarks
31
-yarn start --remote=master
30
+# will only build and run remote main repo against benchmarks
31
+yarn start --remote=main
32
33
# same as "yarn start"
34
yarn start --remote --local
scripts/bench/build.js
+6
-6
@@ -55,7 +55,7 @@ async function getMergeBaseFromLocalGitRepo(localRepo) {
55
return await Git.Merge.base(
56
repo,
57
await repo.getHeadCommit(),
58
- await repo.getBranchCommit('master')
58
+ await repo.getBranchCommit('main')
59
);
60
}
61
@@ -82,15 +82,15 @@ async function buildBenchmarkBundlesFromGitRepo(
82
// if not, clone the repo to remote-repo folder
83
repo = await Git.Clone(url, remoteRepoDir);
84
}
85
- let commit = await repo.getBranchCommit('master');
85
+ let commit = await repo.getBranchCommit('main');
86
// reset hard to this remote head
87
await Git.Reset.reset(repo, commit, Git.Reset.TYPE.HARD);
88
- // then we checkout the latest master head
89
- await repo.checkoutBranch('master');
88
+ // then we checkout the latest main head
89
+ await repo.checkoutBranch('main');
90
// make sure we pull in the latest changes
91
- await repo.mergeBranches('master', 'origin/master');
91
+ await repo.mergeBranches('main', 'origin/main');
92
// then we check if we need to move the HEAD to the merge base
93
- if (commitId && commitId !== 'master') {
93
+ if (commitId && commitId !== 'main') {
94
// as the commitId probably came from our local repo
95
// we use it to lookup the right commit in our remote repo
96
commit = await Git.Commit.lookup(repo, commitId);
scripts/bench/runner.js
+1
-1
@@ -61,7 +61,7 @@ async function runBenchmarks(reactPath) {
61
}
62
63
// get the performance benchmark results
64
-// from remote master (default React repo)
64
+// from remote main (default React repo)
65
async function benchmarkRemoteMaster() {
66
console.log(chalk.gray(`- Building React bundles...`));
67
let commit = argv.remote;
scripts/error-codes/README.md
+3
-3
@@ -2,14 +2,14 @@ The error code system substitutes React's error messages with error IDs to
2
provide a better debugging support in production. Check out the blog post
3
[here](https://reactjs.org/blog/2016/07/11/introducing-reacts-error-code-system.html).
4
5
-- [`codes.json`](https://github.com/facebook/react/blob/master/scripts/error-codes/codes.json)
5
+- [`codes.json`](https://github.com/facebook/react/blob/main/scripts/error-codes/codes.json)
6
contains the mapping from IDs to error messages. This file is generated by the
7
Gulp plugin and is used by both the Babel plugin and the error decoder page in
8
our documentation. This file is append-only, which means an existing code in
9
the file will never be changed/removed.
10
-- [`extract-errors.js`](https://github.com/facebook/react/blob/master/scripts/error-codes/extract-errors.js)
10
+- [`extract-errors.js`](https://github.com/facebook/react/blob/main/scripts/error-codes/extract-errors.js)
11
is an node script that traverses our codebase and updates `codes.json`. You
12
can test it by running `yarn extract-errors`.
13
-- [`transform-error-messages`](https://github.com/facebook/react/blob/master/scripts/error-codes/transform-error-messages.js)
13
+- [`transform-error-messages`](https://github.com/facebook/react/blob/main/scripts/error-codes/transform-error-messages.js)
14
is a Babel pass that rewrites error messages to IDs for a production
15
(minified) build.
scripts/error-codes/extract-errors.js
+1
-1
@@ -18,7 +18,7 @@ const babylonOptions = {
18
// As a parser, babylon has its own options and we can't directly
19
// import/require a babel preset. It should be kept **the same** as
20
// the `babel-plugin-syntax-*` ones specified in
21
- // https://github.com/facebook/fbjs/blob/master/packages/babel-preset-fbjs/configure.js
21
+ // https://github.com/facebook/fbjs/blob/main/packages/babel-preset-fbjs/configure.js
22
plugins: [
23
'classProperties',
24
'flow',
scripts/merge-fork/README.md
+1
-1
@@ -51,7 +51,7 @@ By default, the changes are compared to HEAD. You can use `--base-ref` to compar
51
52
```sh
53
yarn merge-fork \
54
- --base-ref=$(git merge-base HEAD origin/master)
54
+ --base-ref=$(git merge-base HEAD origin/main)
55
--base-dir=packages/react-reconciler/src \
56
ReactFiberWorkLoop
57
```
scripts/print-warnings/print-warnings.js
+1
-1
@@ -19,7 +19,7 @@ const parserOptions = {
19
// babelParser has its own options and we can't directly
20
// import/require a babel preset. It should be kept **the same** as
21
// the `babel-plugin-syntax-*` ones specified in
22
- // https://github.com/facebook/fbjs/blob/master/packages/babel-preset-fbjs/configure.js
22
+ // https://github.com/facebook/fbjs/blob/main/packages/babel-preset-fbjs/configure.js
23
plugins: [
24
'classProperties',
25
'flow',
scripts/release/README.md
+2
-2
@@ -50,7 +50,7 @@ The sections below include meaningful `--tags` in the instructions. However, kee
50
"Next" builds are meant to be lightweight and published often. In most cases, they can be published using artifacts built by Circle CI.
51
52
To prepare a build for a particular commit:
53
-1. Choose a commit from [the commit log](https://github.com/facebook/react/commits/master).
53
+1. Choose a commit from [the commit log](https://github.com/facebook/react/commits/main).
54
2. Copy the SHA (by clicking the 📋 button)
55
5. Run the [`prepare-release-from-ci`](#prepare-release-from-ci) script with the SHA <sup>1</sup> you found:
56
```sh
@@ -115,7 +115,7 @@ Begin by creating a branch from the previous git tag<sup>1</sup>:
115
git checkout -b 16.8.3 v16.8.2
116
```
117
118
-Next cherry pick any changes from master that you want to include in the release:
118
+Next cherry pick any changes from main that you want to include in the release:
119
120
```sh
121
git cherry-pick <commit-hash>
scripts/release/prepare-release-from-ci.js
+1
-1
@@ -12,7 +12,7 @@ const testPackagingFixture = require('./shared-commands/test-packaging-fixture')
12
13
const run = async () => {
14
try {
15
- addDefaultParamValue(null, '--commit', 'master');
15
+ addDefaultParamValue(null, '--commit', 'main');
16
17
const params = await parseParams();
18
params.cwd = join(__dirname, '..', '..');
scripts/release/prepare-release-from-npm-commands/guess-stable-version-numbers.js
+2
-2
@@ -25,9 +25,9 @@ const run = async ({cwd, packages, skipPackages}, versionsMap) => {
25
26
// Guess the next version by incrementing patch.
27
// The script will confirm this later.
28
- // By default, new releases from masters should increment the minor version number,
28
+ // By default, new releases from mains should increment the minor version number,
29
// and patch releases should be done from branches.
30
- if (branch === 'master') {
30
+ if (branch === 'main') {
31
versionsMap.set(packageName, `${major}.${minor + 1}.0`);
32
} else {
33
versionsMap.set(packageName, `${major}.${minor}.${patch + 1}`);
scripts/release/publish-using-ci-workflow.js
+1
-1
@@ -78,7 +78,7 @@ async function pollUntilWorkflowFinishes(workflowID) {
78
79
async function main() {
80
const headCommitResponse = await fetch(
81
- 'https://api.github.com/repos/facebook/react/commits/master'
81
+ 'https://api.github.com/repos/facebook/react/commits/main'
82
);
83
const headCommitJSON = await headCommitResponse.json();
84
const headCommitSha = headCommitJSON.sha;
scripts/shared/listChangedFiles.js
+1
-1
@@ -26,7 +26,7 @@ const execGitCmd = args =>
26
.split('\n');
27
28
const listChangedFiles = () => {
29
- const mergeBase = execGitCmd(['merge-base', 'HEAD', 'master']);
29
+ const mergeBase = execGitCmd(['merge-base', 'HEAD', 'main']);
30
return new Set([
31
...execGitCmd(['diff', '--name-only', '--diff-filter=ACMRTUB', mergeBase]),
32
...execGitCmd(['ls-files', '--others', '--exclude-standard']),