Updated scripts and config to replace "master" with "main" branch (#21768)

This commit is contained in:
Brian Vaughn 2021-06-29 14:26:24 -04:00 committed by GitHub
parent cae635054e
commit d483463bc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 65 additions and 65 deletions

View File

@ -171,9 +171,9 @@ jobs:
- run: - run:
name: Download artifacts for base revision name: Download artifacts for base revision
command: | command: |
git fetch origin master git fetch origin main
cd ./scripts/release && yarn && cd ../../ cd ./scripts/release && yarn && cd ../../
scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/master) scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/main)
mv ./build2 ./base-build mv ./build2 ./base-build
- persist_to_workspace: - persist_to_workspace:
root: . root: .
@ -356,7 +356,7 @@ jobs:
- run: - run:
name: Run publish script name: Run publish script
command: | command: |
git fetch origin master git fetch origin main
cd ./scripts/release && yarn && cd ../../ cd ./scripts/release && yarn && cd ../../
scripts/release/prepare-release-from-ci.js --skipTests -r << parameters.release_channel >> --commit=<< parameters.commit_sha >> scripts/release/prepare-release-from-ci.js --skipTests -r << parameters.release_channel >> --commit=<< parameters.commit_sha >>
cp ./scripts/release/ci-npmrc ~/.npmrc cp ./scripts/release/ci-npmrc ~/.npmrc
@ -414,7 +414,7 @@ workflows:
filters: filters:
branches: branches:
only: only:
- master - main
# New workflow that will replace "stable" and "experimental" # New workflow that will replace "stable" and "experimental"
build_and_test: build_and_test:
@ -491,14 +491,14 @@ workflows:
filters: filters:
branches: branches:
ignore: ignore:
- master - main
requires: requires:
- setup - setup
- sizebot: - sizebot:
filters: filters:
branches: branches:
ignore: ignore:
- master - main
requires: requires:
- get_base_build - get_base_build
- yarn_build_combined - yarn_build_combined
@ -514,7 +514,7 @@ workflows:
filters: filters:
branches: branches:
only: only:
- master - main
jobs: jobs:
- setup - setup
- test_fuzz: - test_fuzz:
@ -555,7 +555,7 @@ workflows:
filters: filters:
branches: branches:
only: only:
- master - main
jobs: jobs:
- setup - setup
- publish_prerelease: - publish_prerelease:

View File

@ -4,7 +4,7 @@
Before submitting a pull request, please make sure the following is done: Before submitting a pull request, please make sure the following is done:
1. Fork [the repository](https://github.com/facebook/react) and create your branch from `master`. 1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`.
2. Run `yarn` in the repository root. 2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests! 3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development. 4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.

View File

@ -679,7 +679,7 @@ This release was published in a broken state and should be skipped.
### React Is (New) ### React Is (New)
* 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)) * 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))
* 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)) * 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))
### React Lifecycles Compat (New) ### React Lifecycles Compat (New)
@ -688,7 +688,7 @@ This release was published in a broken state and should be skipped.
### Create Subscription (New) ### Create Subscription (New)
* 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)) * 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))
### React Reconciler (Experimental) ### React Reconciler (Experimental)
@ -819,12 +819,12 @@ Starting with 16.1.0, we will no longer be publishing new releases on Bower. You
### React Reconciler (Experimental) ### React Reconciler (Experimental)
* 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)) * 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))
* Add support for React DevTools. ([@gaearon](https://github.com/gaearon) in [#11463](https://github.com/facebook/react/pull/11463)) * Add support for React DevTools. ([@gaearon](https://github.com/gaearon) in [#11463](https://github.com/facebook/react/pull/11463))
### React Call Return (Experimental) ### React Call Return (Experimental)
* 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)) * 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))
## 16.0.1 (August 1, 2018) ## 16.0.1 (August 1, 2018)

View File

@ -1,4 +1,4 @@
# [React](https://reactjs.org/) &middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/react.svg?style=flat)](https://www.npmjs.com/package/react) [![CircleCI Status](https://circleci.com/gh/facebook/react.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/facebook/react) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request) # [React](https://reactjs.org/) &middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/react.svg?style=flat)](https://www.npmjs.com/package/react) [![CircleCI Status](https://circleci.com/gh/facebook/react.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/facebook/react) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request)
React is a JavaScript library for building user interfaces. React is a JavaScript library for building user interfaces.

View File

@ -18,7 +18,7 @@ platform:
branches: branches:
only: only:
- master - main
# Disable Visual Studio build and deploy # Disable Visual Studio build and deploy
build: off build: off

View File

@ -8,7 +8,7 @@ This utility should be used for subscriptions to a single value that are typical
Other cases have **better long-term solutions**: Other cases have **better long-term solutions**:
* Redux/Flux stores should use the [context API](https://reactjs.org/docs/context.html) instead. * Redux/Flux stores should use the [context API](https://reactjs.org/docs/context.html) instead.
* 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. * 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.
* 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. * 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.
## Limitations in async mode ## Limitations in async mode

View File

@ -71,4 +71,4 @@
## 1.x ## 1.x
The 1.x releases arent 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). The 1.x releases arent 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).

View File

@ -2,7 +2,7 @@
// flow-typed version: 9c71eca8ef/react-test-renderer_v16.x.x/flow_>=v0.47.x // flow-typed version: 9c71eca8ef/react-test-renderer_v16.x.x/flow_>=v0.47.x
// Type definitions for react-test-renderer 16.x.x // Type definitions for react-test-renderer 16.x.x
// Ported from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-test-renderer // Ported from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/main/types/react-test-renderer
'use strict'; 'use strict';

View File

@ -13,5 +13,5 @@
<p> <p>
<b>This page doesn&rsquo;t appear to be using React.</b> <b>This page doesn&rsquo;t appear to be using React.</b>
<br /> <br />
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>. 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>.
</p> </p>

View File

@ -211,4 +211,4 @@ Once the above packages have been built or downloaded, you can watch for changes
yarn start yarn start
``` ```
To test package changes, refer to the [`react-devtools-shell` README](https://github.com/facebook/react/blob/master/packages/react-devtools-shell/README.md). To test package changes, refer to the [`react-devtools-shell` README](https://github.com/facebook/react/blob/main/packages/react-devtools-shell/README.md).

View File

@ -7,7 +7,7 @@
* @flow * @flow
*/ */
// Adapted from: https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js // Adapted from: https://github.com/facebookarchive/fixed-data-table/blob/main/src/vendor_upstream/dom/normalizeWheel.js
export type NormalizedWheelDelta = {| export type NormalizedWheelDelta = {|
deltaX: number, deltaX: number,

View File

@ -672,7 +672,7 @@ describe('ProfilingCache', () => {
const About = () => <div>About</div>; const About = () => <div>About</div>;
// Mimics https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/Router.js // Mimics https://github.com/ReactTraining/react-router/blob/main/packages/react-router/modules/Router.js
function Router({children}) { function Router({children}) {
const [path, setPath] = React.useState('/'); const [path, setPath] = React.useState('/');
return ( return (
@ -682,7 +682,7 @@ describe('ProfilingCache', () => {
); );
} }
// Mimics https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/Switch.js // Mimics https://github.com/ReactTraining/react-router/blob/main/packages/react-router/modules/Switch.js
function Switch({children}) { function Switch({children}) {
return ( return (
<RouterContext.Consumer> <RouterContext.Consumer>
@ -699,14 +699,14 @@ describe('ProfilingCache', () => {
); );
} }
// Mimics https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/Route.js // Mimics https://github.com/ReactTraining/react-router/blob/main/packages/react-router/modules/Route.js
function Route({children, path}) { function Route({children, path}) {
return null; return null;
} }
const linkRef = React.createRef(); const linkRef = React.createRef();
// Mimics https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/modules/Link.js // Mimics https://github.com/ReactTraining/react-router/blob/main/packages/react-router-dom/modules/Link.js
function Link({children, path}) { function Link({children, path}) {
return ( return (
<RouterContext.Consumer> <RouterContext.Consumer>

View File

@ -2633,7 +2633,7 @@ export function attach(
const UNMOUNTED = 3; const UNMOUNTED = 3;
// This function is copied from React and should be kept in sync: // This function is copied from React and should be kept in sync:
// https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiberTreeReflection.js // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js
function isFiberMountedImpl(fiber: Fiber): number { function isFiberMountedImpl(fiber: Fiber): number {
let node = fiber; let node = fiber;
let prevNode = null; let prevNode = null;
@ -2689,7 +2689,7 @@ export function attach(
} }
// This function is copied from React and should be kept in sync: // This function is copied from React and should be kept in sync:
// https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiberTreeReflection.js // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js
// It would be nice if we updated React to inject this function directly (vs just indirectly via findDOMNode). // It would be nice if we updated React to inject this function directly (vs just indirectly via findDOMNode).
// BEGIN copied code // BEGIN copied code
function findCurrentFiberUsingSlowPathById(id: number): Fiber | null { function findCurrentFiberUsingSlowPathById(id: number): Fiber | null {

View File

@ -44,7 +44,7 @@ export const LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY =
export const PROFILER_EXPORT_VERSION = 5; export const PROFILER_EXPORT_VERSION = 5;
export const CHANGE_LOG_URL = export const CHANGE_LOG_URL =
'https://github.com/facebook/react/blob/master/packages/react-devtools/CHANGELOG.md'; 'https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md';
export const UNSUPPORTED_VERSION_URL = export const UNSUPPORTED_VERSION_URL =
'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back'; 'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back';

View File

@ -15,7 +15,7 @@ import {createContext} from 'react';
// TODO (cache) Remove this cache; it is outdated and will not work with newer APIs like startTransition. // TODO (cache) Remove this cache; it is outdated and will not work with newer APIs like startTransition.
// Cache implementation was forked from the React repo: // Cache implementation was forked from the React repo:
// https://github.com/facebook/react/blob/master/packages/react-cache/src/ReactCache.js // https://github.com/facebook/react/blob/main/packages/react-cache/src/ReactCache.js
// //
// This cache is simpler than react-cache in that: // This cache is simpler than react-cache in that:
// 1. Individual items don't need to be invalidated. // 1. Individual items don't need to be invalidated.

View File

@ -2,7 +2,7 @@ Harness for testing local changes to the `react-devtools-inline` and `react-devt
## Development ## Development
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). 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).
The test harness can then be run as follows: The test harness can then be run as follows:
```sh ```sh

View File

@ -2,7 +2,7 @@
<details> <details>
<summary> <summary>
Changes that have landed in master but are not yet released. Changes that have landed in main but are not yet released.
Click to see more. Click to see more.
</summary> </summary>
@ -380,7 +380,7 @@ New keys can be added to object props/state/hooks now. Existing keys can be rena
#### Improved performance #### Improved performance
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. 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.
[Learn more](https://github.com/facebook/react/blob/master/packages/react-devtools/OVERVIEW.md) about the performance optimizations that made this possible. [Learn more](https://github.com/facebook/react/blob/main/packages/react-devtools/OVERVIEW.md) about the performance optimizations that made this possible.
#### Component stacks #### Component stacks
@ -406,7 +406,7 @@ Filter preferences are remembered between sessions.
#### No more inline props #### No more inline props
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. 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.
You can view a component's props, state, and hooks by selecting it: You can view a component's props, state, and hooks by selecting it:

View File

@ -259,7 +259,7 @@ Even when dealing with a single component, serializing deeply nested properties
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".) 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".)
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).) 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).)
> **Note**: DevTools obtains hooks info by re-rendering a component. > **Note**: DevTools obtains hooks info by re-rendering a component.
> Breakpoints will be invoked during this additional (shallow) render, > Breakpoints will be invoked during this additional (shallow) render,

View File

@ -105,7 +105,7 @@ Or you could develop with a local HTTP server [like `serve`](https://www.npmjs.c
**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. **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.
**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. **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.
**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. **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.

View File

@ -51,15 +51,15 @@ const HostConfig = {
* **[Building a simple custom renderer to DOM](https://medium.com/@agent_hunt/hello-world-custom-react-renderer-9a95b7cd04bc)** * **[Building a simple custom renderer to DOM](https://medium.com/@agent_hunt/hello-world-custom-react-renderer-9a95b7cd04bc)**
* **[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)** * **[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)**
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. 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.
The React repository includes several renderers. Each of them has its own host config. The React repository includes several renderers. Each of them has its own host config.
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: 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:
* [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) * [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)
* [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) * [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)
* [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) * [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)
If these links break please file an issue and well 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 well try to help! If these links break please file an issue and well 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 well try to help!
@ -332,10 +332,10 @@ This method should mutate the `container` root node and remove all children from
### Persistence Methods ### Persistence Methods
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. 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.
### Hydration Methods ### Hydration Methods
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. 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.
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. 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.

View File

@ -7,7 +7,7 @@
* @flow * @flow
*/ */
// Keep in sync with https://github.com/facebook/flow/blob/master/lib/react.js // Keep in sync with https://github.com/facebook/flow/blob/main/lib/react.js
export type StatelessFunctionalComponent< export type StatelessFunctionalComponent<
P, P,
> = React$StatelessFunctionalComponent<P>; > = React$StatelessFunctionalComponent<P>;

View File

@ -8,7 +8,7 @@ This utility can be used for subscriptions to a single value that are typically
Most other cases have **better long-term solutions**: Most other cases have **better long-term solutions**:
* Redux/Flux stores should use the [context API](https://reactjs.org/docs/context.html) instead. * Redux/Flux stores should use the [context API](https://reactjs.org/docs/context.html) instead.
* 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. * 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.
* 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. * 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.
## Limitations in concurrent mode ## Limitations in concurrent mode

View File

@ -27,8 +27,8 @@ yarn start --local
# will only build and run remote merge base repo against benchmarks (no local values will be shown) # will only build and run remote merge base repo against benchmarks (no local values will be shown)
yarn start --remote yarn start --remote
# will only build and run remote master repo against benchmarks # will only build and run remote main repo against benchmarks
yarn start --remote=master yarn start --remote=main
# same as "yarn start" # same as "yarn start"
yarn start --remote --local yarn start --remote --local

View File

@ -55,7 +55,7 @@ async function getMergeBaseFromLocalGitRepo(localRepo) {
return await Git.Merge.base( return await Git.Merge.base(
repo, repo,
await repo.getHeadCommit(), await repo.getHeadCommit(),
await repo.getBranchCommit('master') await repo.getBranchCommit('main')
); );
} }
@ -82,15 +82,15 @@ async function buildBenchmarkBundlesFromGitRepo(
// if not, clone the repo to remote-repo folder // if not, clone the repo to remote-repo folder
repo = await Git.Clone(url, remoteRepoDir); repo = await Git.Clone(url, remoteRepoDir);
} }
let commit = await repo.getBranchCommit('master'); let commit = await repo.getBranchCommit('main');
// reset hard to this remote head // reset hard to this remote head
await Git.Reset.reset(repo, commit, Git.Reset.TYPE.HARD); await Git.Reset.reset(repo, commit, Git.Reset.TYPE.HARD);
// then we checkout the latest master head // then we checkout the latest main head
await repo.checkoutBranch('master'); await repo.checkoutBranch('main');
// make sure we pull in the latest changes // make sure we pull in the latest changes
await repo.mergeBranches('master', 'origin/master'); await repo.mergeBranches('main', 'origin/main');
// then we check if we need to move the HEAD to the merge base // then we check if we need to move the HEAD to the merge base
if (commitId && commitId !== 'master') { if (commitId && commitId !== 'main') {
// as the commitId probably came from our local repo // as the commitId probably came from our local repo
// we use it to lookup the right commit in our remote repo // we use it to lookup the right commit in our remote repo
commit = await Git.Commit.lookup(repo, commitId); commit = await Git.Commit.lookup(repo, commitId);

View File

@ -61,7 +61,7 @@ async function runBenchmarks(reactPath) {
} }
// get the performance benchmark results // get the performance benchmark results
// from remote master (default React repo) // from remote main (default React repo)
async function benchmarkRemoteMaster() { async function benchmarkRemoteMaster() {
console.log(chalk.gray(`- Building React bundles...`)); console.log(chalk.gray(`- Building React bundles...`));
let commit = argv.remote; let commit = argv.remote;

View File

@ -2,14 +2,14 @@ The error code system substitutes React's error messages with error IDs to
provide a better debugging support in production. Check out the blog post provide a better debugging support in production. Check out the blog post
[here](https://reactjs.org/blog/2016/07/11/introducing-reacts-error-code-system.html). [here](https://reactjs.org/blog/2016/07/11/introducing-reacts-error-code-system.html).
- [`codes.json`](https://github.com/facebook/react/blob/master/scripts/error-codes/codes.json) - [`codes.json`](https://github.com/facebook/react/blob/main/scripts/error-codes/codes.json)
contains the mapping from IDs to error messages. This file is generated by the contains the mapping from IDs to error messages. This file is generated by the
Gulp plugin and is used by both the Babel plugin and the error decoder page in Gulp plugin and is used by both the Babel plugin and the error decoder page in
our documentation. This file is append-only, which means an existing code in our documentation. This file is append-only, which means an existing code in
the file will never be changed/removed. the file will never be changed/removed.
- [`extract-errors.js`](https://github.com/facebook/react/blob/master/scripts/error-codes/extract-errors.js) - [`extract-errors.js`](https://github.com/facebook/react/blob/main/scripts/error-codes/extract-errors.js)
is an node script that traverses our codebase and updates `codes.json`. You is an node script that traverses our codebase and updates `codes.json`. You
can test it by running `yarn extract-errors`. can test it by running `yarn extract-errors`.
- [`transform-error-messages`](https://github.com/facebook/react/blob/master/scripts/error-codes/transform-error-messages.js) - [`transform-error-messages`](https://github.com/facebook/react/blob/main/scripts/error-codes/transform-error-messages.js)
is a Babel pass that rewrites error messages to IDs for a production is a Babel pass that rewrites error messages to IDs for a production
(minified) build. (minified) build.

View File

@ -18,7 +18,7 @@ const babylonOptions = {
// As a parser, babylon has its own options and we can't directly // As a parser, babylon has its own options and we can't directly
// import/require a babel preset. It should be kept **the same** as // import/require a babel preset. It should be kept **the same** as
// the `babel-plugin-syntax-*` ones specified in // the `babel-plugin-syntax-*` ones specified in
// https://github.com/facebook/fbjs/blob/master/packages/babel-preset-fbjs/configure.js // https://github.com/facebook/fbjs/blob/main/packages/babel-preset-fbjs/configure.js
plugins: [ plugins: [
'classProperties', 'classProperties',
'flow', 'flow',

View File

@ -51,7 +51,7 @@ By default, the changes are compared to HEAD. You can use `--base-ref` to compar
```sh ```sh
yarn merge-fork \ yarn merge-fork \
--base-ref=$(git merge-base HEAD origin/master) --base-ref=$(git merge-base HEAD origin/main)
--base-dir=packages/react-reconciler/src \ --base-dir=packages/react-reconciler/src \
ReactFiberWorkLoop ReactFiberWorkLoop
``` ```

View File

@ -19,7 +19,7 @@ const parserOptions = {
// babelParser has its own options and we can't directly // babelParser has its own options and we can't directly
// import/require a babel preset. It should be kept **the same** as // import/require a babel preset. It should be kept **the same** as
// the `babel-plugin-syntax-*` ones specified in // the `babel-plugin-syntax-*` ones specified in
// https://github.com/facebook/fbjs/blob/master/packages/babel-preset-fbjs/configure.js // https://github.com/facebook/fbjs/blob/main/packages/babel-preset-fbjs/configure.js
plugins: [ plugins: [
'classProperties', 'classProperties',
'flow', 'flow',

View File

@ -50,7 +50,7 @@ The sections below include meaningful `--tags` in the instructions. However, kee
"Next" builds are meant to be lightweight and published often. In most cases, they can be published using artifacts built by Circle CI. "Next" builds are meant to be lightweight and published often. In most cases, they can be published using artifacts built by Circle CI.
To prepare a build for a particular commit: To prepare a build for a particular commit:
1. Choose a commit from [the commit log](https://github.com/facebook/react/commits/master). 1. Choose a commit from [the commit log](https://github.com/facebook/react/commits/main).
2. Copy the SHA (by clicking the 📋 button) 2. Copy the SHA (by clicking the 📋 button)
5. Run the [`prepare-release-from-ci`](#prepare-release-from-ci) script with the SHA <sup>1</sup> you found: 5. Run the [`prepare-release-from-ci`](#prepare-release-from-ci) script with the SHA <sup>1</sup> you found:
```sh ```sh
@ -115,7 +115,7 @@ Begin by creating a branch from the previous git tag<sup>1</sup>:
git checkout -b 16.8.3 v16.8.2 git checkout -b 16.8.3 v16.8.2
``` ```
Next cherry pick any changes from master that you want to include in the release: Next cherry pick any changes from main that you want to include in the release:
```sh ```sh
git cherry-pick <commit-hash> git cherry-pick <commit-hash>

View File

@ -12,7 +12,7 @@ const testPackagingFixture = require('./shared-commands/test-packaging-fixture')
const run = async () => { const run = async () => {
try { try {
addDefaultParamValue(null, '--commit', 'master'); addDefaultParamValue(null, '--commit', 'main');
const params = await parseParams(); const params = await parseParams();
params.cwd = join(__dirname, '..', '..'); params.cwd = join(__dirname, '..', '..');

View File

@ -25,9 +25,9 @@ const run = async ({cwd, packages, skipPackages}, versionsMap) => {
// Guess the next version by incrementing patch. // Guess the next version by incrementing patch.
// The script will confirm this later. // The script will confirm this later.
// By default, new releases from masters should increment the minor version number, // By default, new releases from mains should increment the minor version number,
// and patch releases should be done from branches. // and patch releases should be done from branches.
if (branch === 'master') { if (branch === 'main') {
versionsMap.set(packageName, `${major}.${minor + 1}.0`); versionsMap.set(packageName, `${major}.${minor + 1}.0`);
} else { } else {
versionsMap.set(packageName, `${major}.${minor}.${patch + 1}`); versionsMap.set(packageName, `${major}.${minor}.${patch + 1}`);

View File

@ -78,7 +78,7 @@ async function pollUntilWorkflowFinishes(workflowID) {
async function main() { async function main() {
const headCommitResponse = await fetch( const headCommitResponse = await fetch(
'https://api.github.com/repos/facebook/react/commits/master' 'https://api.github.com/repos/facebook/react/commits/main'
); );
const headCommitJSON = await headCommitResponse.json(); const headCommitJSON = await headCommitResponse.json();
const headCommitSha = headCommitJSON.sha; const headCommitSha = headCommitJSON.sha;

View File

@ -26,7 +26,7 @@ const execGitCmd = args =>
.split('\n'); .split('\n');
const listChangedFiles = () => { const listChangedFiles = () => {
const mergeBase = execGitCmd(['merge-base', 'HEAD', 'master']); const mergeBase = execGitCmd(['merge-base', 'HEAD', 'main']);
return new Set([ return new Set([
...execGitCmd(['diff', '--name-only', '--diff-filter=ACMRTUB', mergeBase]), ...execGitCmd(['diff', '--name-only', '--diff-filter=ACMRTUB', mergeBase]),
...execGitCmd(['ls-files', '--others', '--exclude-standard']), ...execGitCmd(['ls-files', '--others', '--exclude-standard']),