Select the manifest.json file inside of the extracted extension folder (ReactDevTools)
7 |
--------------------------------------------------------------------------------
/packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/Platform.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 | 'use strict';
8 |
9 | module.exports = {
10 | OS: 'ios',
11 | };
12 |
--------------------------------------------------------------------------------
/packages/react-reconciler/src/forks/ReactFiberHostConfig.fabric.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-native-renderer/src/ReactFabricHostConfig';
11 |
--------------------------------------------------------------------------------
/packages/react-reconciler/src/forks/ReactFiberHostConfig.native.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-native-renderer/src/ReactNativeHostConfig';
11 |
--------------------------------------------------------------------------------
/packages/react-server-dom-webpack/esm/react-server-dom-webpack-node-loader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from '../src/ReactFlightWebpackNodeLoader.js';
11 |
--------------------------------------------------------------------------------
/packages/react-server/src/forks/ReactServerFormatConfig.dom-browser.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-dom/src/server/ReactDOMServerFormatConfig';
11 |
--------------------------------------------------------------------------------
/packages/react-server/src/forks/ReactServerFormatConfig.dom-relay.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-dom/src/server/ReactDOMServerFormatConfig';
11 |
--------------------------------------------------------------------------------
/packages/shared/hasOwnProperty.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | const hasOwnProperty = Object.prototype.hasOwnProperty;
11 |
12 | export default hasOwnProperty;
13 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | packages/react-devtools-core/dist
2 | packages/react-devtools-extensions/chrome/build
3 | packages/react-devtools-extensions/firefox/build
4 | packages/react-devtools-extensions/shared/build
5 | packages/react-devtools-inline/dist
6 | packages/react-devtools-shell/dist
7 | packages/react-devtools-scheduling-profiler/dist
8 | packages/react-devtools-scheduling-profiler/static
--------------------------------------------------------------------------------
/fixtures/packaging/systemjs-builder/dev/config.js:
--------------------------------------------------------------------------------
1 | System.config({
2 | paths: {
3 | react: '../../../../build/node_modules/react/umd/react.development.js',
4 | 'react-dom':
5 | '../../../../build/node_modules/react-dom/umd/react-dom.development.js',
6 | schedule:
7 | '../../../../build/node_modules/scheduler/umd/schedule.development',
8 | },
9 | });
10 |
--------------------------------------------------------------------------------
/packages/react-devtools-extensions/popups/restricted.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 | This is a restricted browser page.
12 |
13 | React devtools cannot access this page.
14 |
15 |
--------------------------------------------------------------------------------
/packages/react-dom/testing.stable.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from './index.stable.js';
11 | export {act} from 'react-reconciler/src/ReactFiberReconciler';
12 |
--------------------------------------------------------------------------------
/packages/react-reconciler/src/forks/ReactFiberHostConfig.native-relay.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-native-renderer/src/ReactFabricHostConfig';
11 |
--------------------------------------------------------------------------------
/packages/react-server/src/forks/ReactServerStreamConfig.dom-relay.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-server-dom-relay/src/ReactServerStreamConfigFB';
11 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | end_of_line = lf
7 | indent_size = 2
8 | indent_style = space
9 | insert_final_newline = true
10 | max_line_length = 80
11 | trim_trailing_whitespace = true
12 |
13 | [*.md]
14 | max_line_length = 0
15 | trim_trailing_whitespace = false
16 |
17 | [COMMIT_EDITMSG]
18 | max_line_length = 0
19 |
--------------------------------------------------------------------------------
/fixtures/flight/src/ShowMore.client.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | import Container from './Container.js';
4 |
5 | export default function ShowMore({children}) {
6 | const [show, setShow] = React.useState(false);
7 | if (!show) {
8 | return ;
9 | }
10 | return {children};
11 | }
12 |
--------------------------------------------------------------------------------
/fixtures/packaging/systemjs-builder/dev/build.js:
--------------------------------------------------------------------------------
1 | var Builder = require('systemjs-builder');
2 |
3 | var builder = new Builder('/', './config.js');
4 | builder
5 | .buildStatic('./input.js', './output.js')
6 | .then(function() {
7 | console.log('Build complete');
8 | })
9 | .catch(function(err) {
10 | console.log('Build error');
11 | console.log(err);
12 | });
13 |
--------------------------------------------------------------------------------
/packages/react-fs/index.browser.server.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | throw new Error(
11 | 'This entry point is not yet supported in the browser environment',
12 | );
13 |
--------------------------------------------------------------------------------
/packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/legacySendAccessibilityEvent.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | 'use strict';
9 |
10 | module.exports = jest.fn();
11 |
--------------------------------------------------------------------------------
/packages/react-pg/index.browser.server.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | throw new Error(
11 | 'This entry point is not yet supported in the browser environment',
12 | );
13 |
--------------------------------------------------------------------------------
/fixtures/packaging/systemjs-builder/prod/build.js:
--------------------------------------------------------------------------------
1 | var Builder = require('systemjs-builder');
2 |
3 | var builder = new Builder('/', './config.js');
4 | builder
5 | .buildStatic('./input.js', './output.js')
6 | .then(function() {
7 | console.log('Build complete');
8 | })
9 | .catch(function(err) {
10 | console.log('Build error');
11 | console.log(err);
12 | });
13 |
--------------------------------------------------------------------------------
/fixtures/packaging/systemjs-builder/prod/config.js:
--------------------------------------------------------------------------------
1 | System.config({
2 | paths: {
3 | react: '../../../../build/node_modules/react/umd/react.production.min.js',
4 | 'react-dom':
5 | '../../../../build/node_modules/react-dom/umd/react-dom.production.min.js',
6 | schedule:
7 | '../../../../build/node_modules/scheduler/umd/schedule.development',
8 | },
9 | });
10 |
--------------------------------------------------------------------------------
/packages/react-server/src/forks/ReactFlightServerConfig.dom-relay.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-server-dom-relay/src/ReactFlightDOMRelayServerHostConfig';
11 |
--------------------------------------------------------------------------------
/packages/react/unstable-shared-subset.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | throw new Error(
11 | 'This entry point is not yet supported outside of experimental channels',
12 | );
13 |
--------------------------------------------------------------------------------
/fixtures/dom/src/components/App.js:
--------------------------------------------------------------------------------
1 | import Header from './Header';
2 | import Fixtures from './fixtures';
3 | import '../style.css';
4 |
5 | const React = window.React;
6 |
7 | class App extends React.Component {
8 | render() {
9 | return (
10 |
11 |
12 |
13 |
14 | );
15 | }
16 | }
17 |
18 | export default App;
19 |
--------------------------------------------------------------------------------
/fixtures/nesting/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | React App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/__tests__/setupEnv.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // DevTools stores preferences between sessions in localStorage
4 | if (!global.hasOwnProperty('localStorage')) {
5 | global.localStorage = require('local-storage-fallback').default;
6 | }
7 |
8 | // Mimic the global we set with Webpack's DefinePlugin
9 | global.__DEV__ = process.env.NODE_ENV !== 'production';
10 |
--------------------------------------------------------------------------------
/packages/react-dom/testing.experimental.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from './index.experimental.js';
11 | export {act} from 'react-reconciler/src/ReactFiberReconciler';
12 |
--------------------------------------------------------------------------------
/packages/react-reconciler/src/ReactRootTags.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export type RootTag = 0 | 1;
11 |
12 | export const LegacyRoot = 0;
13 | export const ConcurrentRoot = 1;
14 |
--------------------------------------------------------------------------------
/packages/react-server/src/forks/ReactServerFormatConfig.native-relay.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-native-renderer/src/server/ReactNativeServerFormatConfig';
11 |
--------------------------------------------------------------------------------
/packages/scheduler/npm/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | if (typeof window === 'undefined' || typeof MessageChannel !== 'function') {
4 | module.exports = require('./unstable_no_dom');
5 | } else if (process.env.NODE_ENV === 'production') {
6 | module.exports = require('./cjs/scheduler.production.min.js');
7 | } else {
8 | module.exports = require('./cjs/scheduler.development.js');
9 | }
10 |
--------------------------------------------------------------------------------
/fixtures/blocks/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Blocks Fixture
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/devtools/views/ErrorBoundary/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | import ErrorBoundary from './ErrorBoundary';
11 |
12 | export default ErrorBoundary;
13 |
--------------------------------------------------------------------------------
/packages/react-server/src/forks/ReactFlightServerConfig.native-relay.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-server-native-relay/src/ReactFlightNativeRelayServerHostConfig';
11 |
--------------------------------------------------------------------------------
/scripts/circleci/check_license.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | # Make sure we don't introduce accidental references to PATENTS.
6 | EXPECTED='scripts/circleci/check_license.sh'
7 | ACTUAL=$(git grep -l PATENTS)
8 |
9 | if [ "$EXPECTED" != "$ACTUAL" ]; then
10 | echo "PATENTS crept into some new files?"
11 | diff -u <(echo "$EXPECTED") <(echo "$ACTUAL") || true
12 | exit 1
13 | fi
14 |
--------------------------------------------------------------------------------
/fixtures/nesting/src/shared/useTime.js:
--------------------------------------------------------------------------------
1 | import {useState, useEffect} from 'react';
2 |
3 | export default function useTimer() {
4 | const [value, setValue] = useState(() => new Date());
5 | useEffect(() => {
6 | const id = setInterval(() => {
7 | setValue(new Date());
8 | }, 1000);
9 | return () => clearInterval(id);
10 | }, []);
11 | return value.toLocaleTimeString();
12 | }
13 |
--------------------------------------------------------------------------------
/packages/react-devtools-shell/src/app/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | /* GitHub.com frontend fonts */
3 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial,
4 | sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
5 | font-size: 14px;
6 | line-height: 1.5;
7 | }
8 |
9 | h1 {
10 | font-size: 1.5rem;
11 | font-weight: bold;
12 | margin-bottom: 0.5rem;
13 | }
14 |
--------------------------------------------------------------------------------
/fixtures/attribute-behavior/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/react-devtools-shell/src/app/InspectableElements/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | import InspectableElements from './InspectableElements';
11 |
12 | export default InspectableElements;
13 |
--------------------------------------------------------------------------------
/packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/ExceptionsManager.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | 'use strict';
9 |
10 | module.exports = {
11 | handleException: jest.fn(),
12 | };
13 |
--------------------------------------------------------------------------------
/packages/scheduler/README.md:
--------------------------------------------------------------------------------
1 | # `scheduler`
2 |
3 | This is a package for cooperative scheduling in a browser environment. It is currently used internally by React, but we plan to make it more generic.
4 |
5 | The public API for this package is not yet finalized.
6 |
7 | ### Thanks
8 |
9 | The React team thanks [Anton Podviaznikov](https://podviaznikov.com/) for donating the `scheduler` package name.
10 |
--------------------------------------------------------------------------------
/scripts/eslint-rules/README.md:
--------------------------------------------------------------------------------
1 | # Custom ESLint Rules
2 |
3 | This is a dummy npm package that allows us to treat it as an `eslint-plugin`. It's not actually published, nor are the rules here useful for users of React. If you want to lint your React code, try .
4 |
5 | **If you modify this rule, you must re-run `npm install ./eslint-rules` for it to take effect.**
6 |
--------------------------------------------------------------------------------
/fixtures/blocks/delay.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | module.exports = (req, res, next) => {
9 | if (req.query.delay) {
10 | setTimeout(next, Number(req.query.delay));
11 | } else {
12 | next();
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/fixtures/flight/config/jest/cssTransform.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // This is a custom Jest transformer turning style imports into empty objects.
4 | // http://facebook.github.io/jest/docs/en/webpack.html
5 |
6 | module.exports = {
7 | process() {
8 | return 'module.exports = {};';
9 | },
10 | getCacheKey() {
11 | // The output is always the same.
12 | return 'cssTransform';
13 | },
14 | };
15 |
--------------------------------------------------------------------------------
/fixtures/ssr/src/components/Page2.js:
--------------------------------------------------------------------------------
1 | import React, {useContext} from 'react';
2 |
3 | import Theme from './Theme';
4 | import Suspend from './Suspend';
5 |
6 | import './Page.css';
7 |
8 | export default function Page2() {
9 | let theme = useContext(Theme);
10 | return (
11 |
12 | Content of a different page
13 |
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/packages/react-debug-tools/src/ReactDebugTools.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | import {inspectHooks, inspectHooksOfFiber} from './ReactDebugHooks';
11 |
12 | export {inspectHooks, inspectHooksOfFiber};
13 |
--------------------------------------------------------------------------------
/packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/ReactFiberErrorDialog.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow strict
8 | */
9 |
10 | module.exports = {
11 | showErrorDialog: jest.fn(),
12 | };
13 |
--------------------------------------------------------------------------------
/scripts/rollup/shims/facebook-www/findDOMNode.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | * @format
9 | */
10 |
11 | 'use strict';
12 |
13 | const {findDOMNode} = require('ReactDOM');
14 |
15 | module.exports = findDOMNode;
16 |
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/devtools/views/Profiler/constants.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export const barWidthThreshold = 2;
11 | export const maxBarWidth = 30;
12 | export const minBarWidth = 5;
13 |
--------------------------------------------------------------------------------
/packages/react-native-renderer/src/__tests__/__snapshots__/ReactNativeEvents-test.internal.js.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`fails if unknown/unsupported event types are dispatched 1`] = `
4 | " {}
5 | View null"
6 | `;
7 |
8 | exports[`handles events 1`] = `
9 | " {}
10 | View {\\"foo\\":\\"outer\\"}
11 | View {\\"foo\\":\\"inner\\"}"
12 | `;
13 |
--------------------------------------------------------------------------------
/packages/react-server/src/forks/ReactFlightServerConfig.custom.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from '../ReactFlightServerConfigStream';
11 | export * from '../ReactFlightServerBundlerConfigCustom';
12 |
--------------------------------------------------------------------------------
/packages/scheduler/src/SchedulerFeatureFlags.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | */
8 |
9 | export const enableSchedulerDebugging = false;
10 | export const enableIsInputPending = false;
11 | export const enableProfiling = __VARIANT__;
12 |
--------------------------------------------------------------------------------
/fixtures/concurrent/time-slicing/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
--------------------------------------------------------------------------------
/fixtures/packaging/webpack-alias/dev/config.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = {
4 | entry: './input',
5 | output: {
6 | filename: 'output.js',
7 | },
8 | resolve: {
9 | root: path.resolve('../../../../build/node_modules'),
10 | alias: {
11 | react: 'react/umd/react.development',
12 | 'react-dom': 'react-dom/umd/react-dom.development',
13 | },
14 | },
15 | };
16 |
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/devtools/views/Components/SelectedTreeHighlight.css:
--------------------------------------------------------------------------------
1 | .Active,
2 | .Inactive {
3 | position: absolute;
4 | left: 0;
5 | width: 100%;
6 | z-index: 0;
7 | pointer-events: none;
8 | }
9 |
10 | .Active {
11 | background-color: var(--color-selected-tree-highlight-active);
12 | }
13 |
14 | .Inactive {
15 | background-color: var(--color-selected-tree-highlight-inactive);
16 | }
17 |
--------------------------------------------------------------------------------
/packages/react-devtools-shell/src/app/ToDoList/ListItem.css:
--------------------------------------------------------------------------------
1 | .ListItem {
2 | list-style-type: none;
3 | }
4 |
5 | .Input {
6 | cursor: pointer;
7 | }
8 |
9 | .Label {
10 | cursor: pointer;
11 | padding: 0.25rem;
12 | color: #555;
13 | }
14 | .Label:hover {
15 | color: #000;
16 | }
17 |
18 | .IconButton {
19 | padding: 0.25rem;
20 | border: none;
21 | background: none;
22 | cursor: pointer;
23 | }
24 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Reporting Security Issues
2 |
3 | If you believe you have found a security vulnerability in React, we encourage you to let us know right away. We will investigate all legitimate reports and do our best to quickly fix the problem.
4 |
5 | Please refer to the following page for our responsible disclosure policy, reward guidelines, and those things that should not be reported:
6 |
7 | https://www.facebook.com/whitehat
8 |
--------------------------------------------------------------------------------
/fixtures/packaging/webpack-alias/prod/config.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = {
4 | entry: './input',
5 | output: {
6 | filename: 'output.js',
7 | },
8 | resolve: {
9 | root: path.resolve('../../../../build/node_modules'),
10 | alias: {
11 | react: 'react/umd/react.production.min',
12 | 'react-dom': 'react-dom/umd/react-dom.production.min',
13 | },
14 | },
15 | };
16 |
--------------------------------------------------------------------------------
/scripts/rollup/shims/facebook-www/renderSubtreeIntoContainer_DO_NOT_USE.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | 'use strict';
9 |
10 | const ReactDOM = require('ReactDOM');
11 |
12 | module.exports = ReactDOM.unstable_renderSubtreeIntoContainer;
13 |
--------------------------------------------------------------------------------
/fixtures/concurrent/time-slicing/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/fixtures/dom/README.md:
--------------------------------------------------------------------------------
1 | # DOM Fixtures
2 |
3 | A set of DOM test cases for quickly identifying browser issues.
4 |
5 | ## Setup
6 |
7 | To reference a local build of React, first run `yarn build` at the root
8 | of the React project. Then:
9 |
10 | ```
11 | cd fixtures/dom
12 | yarn
13 | yarn start
14 | ```
15 |
16 | The `start` command runs a script that copies over the local build of react into
17 | the public directory.
18 |
--------------------------------------------------------------------------------
/fixtures/nesting/src/modern/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {StrictMode} from 'react';
3 | import ReactDOM from 'react-dom';
4 | import {Provider} from 'react-redux';
5 | import App from './App';
6 | import {store} from '../store';
7 |
8 | ReactDOM.render(
9 |
10 |
11 |
12 |
13 | ,
14 | document.getElementById('root')
15 | );
16 |
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/devtools/views/Profiler/NoCommitData.css:
--------------------------------------------------------------------------------
1 | .NoCommitData {
2 | width: 100%;
3 | height: 100%;
4 | display: flex;
5 | flex-direction: column;
6 | align-items: center;
7 | justify-content: center;
8 | }
9 |
10 | .Header {
11 | font-size: var(--font-size-sans-large);
12 | margin-bottom: 0.5rem;
13 | }
14 |
15 | .FilterMessage {
16 | display: flex;
17 | align-items: center;
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/devtools/views/Tooltip.css:
--------------------------------------------------------------------------------
1 | .Tooltip {
2 | border: none;
3 | border-radius: 0.25rem;
4 | padding: 0.25rem 0.5rem;
5 | font-family: var(--font-family-sans);
6 | font-size: 12px;
7 | background-color: var(--color-tooltip-background);
8 | color: var(--color-tooltip-text);
9 |
10 | /* Make sure this is above the DevTools, which are above the Overlay */
11 | z-index: 10000002;
12 | }
13 |
--------------------------------------------------------------------------------
/packages/react-fs/README.md:
--------------------------------------------------------------------------------
1 | # react-fs
2 |
3 | This package is meant to be used alongside yet-to-be-released, experimental React features. It's unlikely to be useful in any other context.
4 |
5 | **Do not use in a real application.** We're publishing this early for
6 | demonstration purposes.
7 |
8 | **Use it at your own risk.**
9 |
10 | # No, Really, It Is Unstable
11 |
12 | The API ~~may~~ will change wildly between versions.
13 |
--------------------------------------------------------------------------------
/packages/react-pg/README.md:
--------------------------------------------------------------------------------
1 | # react-pg
2 |
3 | This package is meant to be used alongside yet-to-be-released, experimental React features. It's unlikely to be useful in any other context.
4 |
5 | **Do not use in a real application.** We're publishing this early for
6 | demonstration purposes.
7 |
8 | **Use it at your own risk.**
9 |
10 | # No, Really, It Is Unstable
11 |
12 | The API ~~may~~ will change wildly between versions.
13 |
--------------------------------------------------------------------------------
/packages/react-fetch/README.md:
--------------------------------------------------------------------------------
1 | # react-fetch
2 |
3 | This package is meant to be used alongside yet-to-be-released, experimental React features. It's unlikely to be useful in any other context.
4 |
5 | **Do not use in a real application.** We're publishing this early for
6 | demonstration purposes.
7 |
8 | **Use it at your own risk.**
9 |
10 | # No, Really, It Is Unstable
11 |
12 | The API ~~may~~ will change wildly between versions.
13 |
--------------------------------------------------------------------------------
/packages/react-reconciler/src/__mocks__/scheduler/tracing.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | // This placeholder is to support a legacy/regression test in ReactFresh-test.
11 | // Without this mock, jest.mock('scheduler/tracing') throws.
12 |
--------------------------------------------------------------------------------
/packages/react-server/src/forks/ReactFlightServerConfig.dom.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from '../ReactFlightServerConfigStream';
11 | export * from 'react-server-dom-webpack/src/ReactFlightServerWebpackBundlerConfig';
12 |
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/AutoSizeInput.css:
--------------------------------------------------------------------------------
1 | .Input {
2 | min-width: 0.5rem;
3 | flex: 1 1 auto;
4 | border: none;
5 | background: transparent;
6 | outline: none;
7 | padding: 0;
8 | border: none;
9 | font-family: var(--font-family-monospace);
10 | font-size: var(--font-size-monospace-normal);
11 | }
12 |
13 | .Input:focus {
14 | border-color: var(--color-border);
15 | }
16 |
--------------------------------------------------------------------------------
/packages/react-fs/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | throw new Error(
11 | 'React FS cannot be used outside a react-server environment. ' +
12 | 'You must configure Node.js using the `--conditions react-server` flag.',
13 | );
14 |
--------------------------------------------------------------------------------
/packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/RCTEventEmitter.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | 'use strict';
9 |
10 | const RCTEventEmitter = {
11 | register: jest.fn(),
12 | };
13 |
14 | module.exports = RCTEventEmitter;
15 |
--------------------------------------------------------------------------------
/packages/react-pg/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | throw new Error(
11 | 'React PG cannot be used outside a react-server environment. ' +
12 | 'You must configure Node.js using the `--conditions react-server` flag.',
13 | );
14 |
--------------------------------------------------------------------------------
/packages/react-server/src/forks/ReactFlightServerConfig.dom-browser.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from '../ReactFlightServerConfigStream';
11 | export * from 'react-server-dom-webpack/src/ReactFlightServerWebpackBundlerConfig';
12 |
--------------------------------------------------------------------------------
/fixtures/dom/src/components/Fixture.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | const React = window.React;
3 |
4 | const propTypes = {
5 | children: PropTypes.node.isRequired,
6 | };
7 |
8 | class Fixture extends React.Component {
9 | render() {
10 | const {children} = this.props;
11 |
12 | return
{children}
;
13 | }
14 | }
15 |
16 | Fixture.propTypes = propTypes;
17 |
18 | export default Fixture;
19 |
--------------------------------------------------------------------------------
/fixtures/packaging/rjs/dev/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | baseUrl: '.',
3 | name: 'input',
4 | out: 'output.js',
5 | optimize: 'none',
6 | paths: {
7 | react: '../../../../build/node_modules/react/umd/react.development',
8 | 'react-dom':
9 | '../../../../build/node_modules/react-dom/umd/react-dom.development',
10 | schedule:
11 | '../../../../build/node_modules/scheduler/umd/schedule.development',
12 | },
13 | };
14 |
--------------------------------------------------------------------------------
/packages/eslint-plugin-react-hooks/npm/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // TODO: this doesn't make sense for an ESLint rule.
4 | // We need to fix our build process to not create bundles for "raw" packages like this.
5 | if (process.env.NODE_ENV === 'production') {
6 | module.exports = require('./cjs/eslint-plugin-react-hooks.production.min.js');
7 | } else {
8 | module.exports = require('./cjs/eslint-plugin-react-hooks.development.js');
9 | }
10 |
--------------------------------------------------------------------------------
/packages/react-client/src/forks/ReactFlightClientHostConfig.dom-relay.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-server-dom-relay/src/ReactFlightDOMRelayClientHostConfig';
11 | export * from '../ReactFlightClientHostConfigNoStream';
12 |
--------------------------------------------------------------------------------
/packages/shared/forks/object-assign.umd.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | import * as React from 'react';
11 |
12 | const ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
13 |
14 | export default ReactInternals.assign;
15 |
--------------------------------------------------------------------------------
/fixtures/nesting/src/store.js:
--------------------------------------------------------------------------------
1 | import {createStore} from 'redux';
2 |
3 | function reducer(state = 0, action) {
4 | switch (action.type) {
5 | case 'increment':
6 | return state + 1;
7 | default:
8 | return state;
9 | }
10 | }
11 |
12 | // Because this file is declared above both Modern and Legacy folders,
13 | // we can import this from either folder without duplicating the object.
14 | export const store = createStore(reducer);
15 |
--------------------------------------------------------------------------------
/packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/BatchedBridge.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | 'use strict';
9 |
10 | const BatchedBridge = {
11 | registerCallableModule: jest.fn(),
12 | };
13 |
14 | module.exports = BatchedBridge;
15 |
--------------------------------------------------------------------------------
/scripts/release/prepare-release-from-npm-commands/get-latest-next-version.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | 'use strict';
4 |
5 | const {execRead, logPromise} = require('../utils');
6 |
7 | const run = async () => {
8 | const version = await execRead('npm info react@next version');
9 |
10 | return version;
11 | };
12 |
13 | module.exports = async params => {
14 | return logPromise(run(params), 'Determining latest "next" release version');
15 | };
16 |
--------------------------------------------------------------------------------
/fixtures/packaging/rjs/prod/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | baseUrl: '.',
3 | name: 'input',
4 | out: 'output.js',
5 | optimize: 'none',
6 | paths: {
7 | react: '../../../../build/node_modules/react/umd/react.production.min',
8 | 'react-dom':
9 | '../../../../build/node_modules/react-dom/umd/react-dom.production.min',
10 | schedule:
11 | '../../../../build/node_modules/scheduler/umd/schedule.development',
12 | },
13 | };
14 |
--------------------------------------------------------------------------------
/packages/react-client/src/forks/ReactFlightClientHostConfig.native-relay.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-server-native-relay/src/ReactFlightNativeRelayClientHostConfig';
11 | export * from '../ReactFlightClientHostConfigNoStream';
12 |
--------------------------------------------------------------------------------
/packages/react-dom/server.browser.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export {
11 | renderToString,
12 | renderToStaticMarkup,
13 | renderToNodeStream,
14 | renderToStaticNodeStream,
15 | version,
16 | } from './src/server/ReactDOMServerBrowser';
17 |
--------------------------------------------------------------------------------
/packages/react-dom/src/events/PluginModuleType.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export type AnyNativeEvent = Event | KeyboardEvent | MouseEvent | TouchEvent;
11 |
12 | export type PluginName = string;
13 |
14 | export type EventSystemFlags = number;
15 |
--------------------------------------------------------------------------------
/packages/shared/ReactSharedInternals.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | import * as React from 'react';
11 |
12 | const ReactSharedInternals =
13 | React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
14 |
15 | export default ReactSharedInternals;
16 |
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const {esNextPaths} = require('./scripts/shared/pathsByLanguageVersion');
4 |
5 | module.exports = {
6 | bracketSpacing: false,
7 | singleQuote: true,
8 | jsxBracketSameLine: true,
9 | trailingComma: 'es5',
10 | printWidth: 80,
11 | parser: 'babel',
12 |
13 | overrides: [
14 | {
15 | files: esNextPaths,
16 | options: {
17 | trailingComma: 'all',
18 | },
19 | },
20 | ],
21 | };
22 |
--------------------------------------------------------------------------------
/fixtures/flight/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 | /dist
14 | .eslintcache
15 |
16 | # misc
17 | .DS_Store
18 | .env.local
19 | .env.development.local
20 | .env.test.local
21 | .env.production.local
22 |
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 |
--------------------------------------------------------------------------------
/fixtures/packaging/browserify/prod/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "browserify-prod-fixture",
4 | "dependencies": {
5 | "browserify": "^13.3.0"
6 | },
7 | "scripts": {
8 | "build": "rm -f output.js && browserify ./input.js -g [envify --NODE_ENV 'production'] -o output.js",
9 | "prebuild": "cp -r ../../../../build/node_modules/* ./node_modules/"
10 | },
11 | "devDependencies": {
12 | "envify": "^4.0.0"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/flattenStyle.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | 'use strict';
9 |
10 | // TODO: Move flattenStyle into react
11 |
12 | const flattenStyle = function() {};
13 |
14 | module.exports = flattenStyle;
15 |
--------------------------------------------------------------------------------
/packages/react-devtools-scheduling-profiler/src/constants.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export {
11 | COMFORTABLE_LINE_HEIGHT,
12 | COMPACT_LINE_HEIGHT,
13 | } from 'react-devtools-shared/src/constants.js';
14 |
15 | export const REACT_TOTAL_NUM_LANES = 31;
16 |
--------------------------------------------------------------------------------
/packages/react-devtools-scheduling-profiler/src/import-worker/InvalidProfileError.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | /**
11 | * An error thrown when an invalid profile could not be processed.
12 | */
13 | export default class InvalidProfileError extends Error {}
14 |
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/devtools/views/Components/TreeFocusedContext.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | import {createContext} from 'react';
11 |
12 | const TreeFocusedContext = createContext(false);
13 |
14 | export default TreeFocusedContext;
15 |
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/devtools/views/UnsupportedVersionDialog.css:
--------------------------------------------------------------------------------
1 | .Row {
2 | display: flex;
3 | flex-direction: row;
4 | align-items: center;
5 | }
6 |
7 | .Column {
8 | display: flex;
9 | flex-direction: column;
10 | align-items: center;
11 | }
12 |
13 | .Title {
14 | font-size: var(--font-size-sans-large);
15 | margin-bottom: 0.5rem;
16 | }
17 |
18 | .ReleaseNotesLink {
19 | color: var(--color-button-active);
20 | }
--------------------------------------------------------------------------------
/packages/react-reconciler/src/MaxInts.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | // Max 31 bit integer. The max integer size in V8 for 32-bit systems.
11 | // Math.pow(2, 30) - 1
12 | // 0b111111111111111111111111111111
13 | export const MAX_SIGNED_31_BIT_INT = 1073741823;
14 |
--------------------------------------------------------------------------------
/packages/react-suspense-test-utils/README.md:
--------------------------------------------------------------------------------
1 | # react-suspense-test-utils
2 |
3 | This package is meant to be used alongside yet-to-be-released, experimental React features. It's unlikely to be useful in any other context.
4 |
5 | **Do not use in a real application.** We're publishing this early for
6 | demonstration purposes.
7 |
8 | **Use it at your own risk.**
9 |
10 | # No, Really, It Is Unstable
11 |
12 | The API ~~may~~ will change wildly between versions.
13 |
--------------------------------------------------------------------------------
/packages/shared/ExecutionEnvironment.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export const canUseDOM: boolean = !!(
11 | typeof window !== 'undefined' &&
12 | typeof window.document !== 'undefined' &&
13 | typeof window.document.createElement !== 'undefined'
14 | );
15 |
--------------------------------------------------------------------------------
/scripts/rollup/shims/react-native/ReactFeatureFlags.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @format
8 | * @flow strict-local
9 | */
10 |
11 | 'use strict';
12 |
13 | const ReactFeatureFlags = {
14 | debugRenderPhaseSideEffects: false,
15 | };
16 |
17 | module.exports = ReactFeatureFlags;
18 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | contact_links:
2 | - name: 📃 Documentation Issue
3 | url: https://github.com/reactjs/reactjs.org/issues/new
4 | about: This issue tracker is not for documentation issues. Please file documentation issues here.
5 | - name: 🤔 Questions and Help
6 | url: https://reactjs.org/community/support.html
7 | about: This issue tracker is not for support questions. Please refer to the React community's help and discussion forums.
8 |
--------------------------------------------------------------------------------
/fixtures/blocks/src/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | import React from 'react';
9 | import {unstable_createRoot as createRoot} from 'react-dom';
10 | import './index.css';
11 | import Router from './Router';
12 |
13 | createRoot(document.getElementById('root')).render();
14 |
--------------------------------------------------------------------------------
/fixtures/expiration/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
23 | public/react.development.js
24 | public/react-dom.development.js
--------------------------------------------------------------------------------
/packages/react-native-renderer/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-renderer",
3 | "version": "16.0.0",
4 | "private": true,
5 | "repository": {
6 | "type" : "git",
7 | "url" : "https://github.com/facebook/react.git",
8 | "directory": "packages/react-native-renderer"
9 | },
10 | "dependencies": {
11 | "object-assign": "^4.1.1",
12 | "scheduler": "^0.11.0"
13 | },
14 | "peerDependencies": {
15 | "react": "^17.0.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/react-native-renderer/src/ReactNativeEventPluginOrder.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | const ReactNativeEventPluginOrder = [
11 | 'ResponderEventPlugin',
12 | 'ReactNativeBridgeEventPlugin',
13 | ];
14 |
15 | export default ReactNativeEventPluginOrder;
16 |
--------------------------------------------------------------------------------
/packages/react-server-dom-relay/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-server-dom-relay",
3 | "version": "0.1.0",
4 | "private": true,
5 | "repository": {
6 | "type" : "git",
7 | "url" : "https://github.com/facebook/react.git",
8 | "directory": "packages/react-server-dom-relay"
9 | },
10 | "dependencies": {
11 | "object-assign": "^4.1.1",
12 | "scheduler": "^0.11.0"
13 | },
14 | "peerDependencies": {
15 | "react": "^17.0.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/react-server-dom-webpack/writer.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | throw new Error(
11 | 'The React Server Writer cannot be used outside a react-server environment. ' +
12 | 'You must configure Node.js using the `--conditions react-server` flag.',
13 | );
14 |
--------------------------------------------------------------------------------
/scripts/perf-counters/README.md:
--------------------------------------------------------------------------------
1 | # perf-counters
2 |
3 | Lightweight bindings to Linux perf event counters.
4 |
5 | ```
6 | $ node
7 | > var PerfCounters = require('perf-counters');
8 | > PerfCounters.init();
9 | > var start = PerfCounters.getCounters(); console.log('test'); var end = PerfCounters.getCounters();
10 | test
11 | > start
12 | { instructions: 1382, loads: 421, stores: 309 }
13 | > end
14 | { instructions: 647633, loads: 195771, stores: 133246 }
15 | >
16 | ```
17 |
--------------------------------------------------------------------------------
/fixtures/fiber-debugger/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-fiber-debugger",
3 | "version": "0.0.1",
4 | "private": true,
5 | "devDependencies": {
6 | "react-scripts": "0.9.5"
7 | },
8 | "dependencies": {
9 | "dagre": "^0.7.4",
10 | "pretty-format": "^4.2.1",
11 | "react-draggable": "^2.2.6",
12 | "react-motion": "^0.5.0"
13 | },
14 | "scripts": {
15 | "start": "react-scripts start",
16 | "build": "react-scripts build"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/devtools/views/Components/NewArrayValue.css:
--------------------------------------------------------------------------------
1 | .NewArrayValue {
2 | white-space: nowrap;
3 | display: flex;
4 | align-items: center;
5 | }
6 |
7 | .EditableName {
8 | margin-left: 1rem;
9 | }
10 |
11 | .Invalid {
12 | background-color: var(--color-background-invalid);
13 | color: var(--color-text-invalid) !important;
14 | }
15 |
16 | .Input:focus,
17 | .Invalid:focus {
18 | background-color: var(--color-button-background-focus);
19 | }
--------------------------------------------------------------------------------
/scripts/release/build-release-locally-commands/update-version-numbers.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | 'use strict';
4 |
5 | const {logPromise, updateVersionsForNext} = require('../utils');
6 | const theme = require('../theme');
7 |
8 | module.exports = async ({reactVersion, tempDirectory, version}) => {
9 | return logPromise(
10 | updateVersionsForNext(tempDirectory, reactVersion, version),
11 | theme`Updating version numbers ({version ${version}})`
12 | );
13 | };
14 |
--------------------------------------------------------------------------------
/fixtures/packaging/globals/dev.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/fixtures/packaging/webpack/prod/config.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var webpack = require('webpack');
3 |
4 | module.exports = {
5 | entry: './input',
6 | output: {
7 | filename: 'output.js',
8 | },
9 | resolve: {
10 | root: path.resolve('../../../../build/node_modules/'),
11 | },
12 | plugins: [
13 | new webpack.DefinePlugin({
14 | 'process.env': {
15 | NODE_ENV: JSON.stringify('production'),
16 | },
17 | }),
18 | ],
19 | };
20 |
--------------------------------------------------------------------------------
/packages/react-devtools-scheduling-profiler/src/App.css:
--------------------------------------------------------------------------------
1 | .DevTools {
2 | width: 100%;
3 | height: 100%;
4 | display: flex;
5 | flex-direction: column;
6 | background-color: var(--color-background);
7 | color: var(--color-text);
8 | }
9 |
10 | .TabContent {
11 | flex: 1 1 100%;
12 | overflow: auto;
13 | -webkit-app-region: no-drag;
14 | }
15 |
16 | .DevTools, .DevTools * {
17 | box-sizing: border-box;
18 | -webkit-font-smoothing: var(--font-smoothing);
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow strict
8 | */
9 |
10 | 'use strict';
11 |
12 | // Noop
13 |
14 | // TODO #10932517: Move all initialization callers back into react-native
15 |
16 |
--------------------------------------------------------------------------------
/packages/react/src/IsSomeRendererActing.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | /**
11 | * Used by act() to track whether you're inside an act() scope.
12 | */
13 |
14 | const IsSomeRendererActing = {
15 | current: (false: boolean),
16 | };
17 | export default IsSomeRendererActing;
18 |
--------------------------------------------------------------------------------
/fixtures/fiber-debugger/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | React App
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/packages/react-devtools-extensions/popups/production.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 | This page is using the production build of React. ✅
15 |
16 | Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
17 |
18 |
--------------------------------------------------------------------------------
/packages/react-devtools-scheduling-profiler/src/index.css:
--------------------------------------------------------------------------------
1 | html {
2 | height: 100%;
3 | }
4 |
5 | body {
6 | height: 100%;
7 | margin: 0;
8 | font-family: var(--font-family-sans);
9 | font-size: var(--font-size-sans-normal);
10 | background-color: var(--color-background);
11 | color: var(--color-text);
12 | }
13 |
14 | code {
15 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
16 | monospace;
17 | }
18 |
19 | .Container {
20 | height: 100%;
21 | }
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/node_modules/react-window/src/index.js:
--------------------------------------------------------------------------------
1 | // @flow
2 |
3 | export { default as VariableSizeGrid } from './VariableSizeGrid';
4 | export { default as VariableSizeList } from './VariableSizeList';
5 | export { default as FixedSizeGrid } from './FixedSizeGrid';
6 | export { default as FixedSizeList } from './FixedSizeList';
7 |
8 | export { default as areEqual } from './areEqual';
9 | export { default as shouldComponentUpdate } from './shouldComponentUpdate';
10 |
--------------------------------------------------------------------------------
/scripts/circleci/pack_and_store_artifact.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | # Compress build directory into a single tarball for easy download
6 | tar -zcvf ./build.tgz ./build
7 |
8 | # NPM pack all modules to ensure we archive the correct set of files
9 | cd ./build/node_modules
10 | for dir in ./* ; do
11 | npm pack "$dir"
12 | done
13 |
14 | # Compress packed modules into a single tarball for easy download by the publish script
15 | tar -zcvf ../../node_modules.tgz ./*.tgz
16 |
--------------------------------------------------------------------------------
/fixtures/devtools/regression/server.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const finalhandler = require('finalhandler');
4 | const http = require('http');
5 | const serveStatic = require('serve-static');
6 |
7 | // Serve fixtures folder
8 | const serve = serveStatic(__dirname, {index: 'index.html'});
9 |
10 | // Create server
11 | const server = http.createServer(function onRequest(req, res) {
12 | serve(req, res, finalhandler(req, res));
13 | });
14 |
15 | // Listen
16 | server.listen(3000);
17 |
--------------------------------------------------------------------------------
/fixtures/packaging/globals/prod.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/fixtures/art/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | VectorWidget
5 |
6 |
7 |
8 |
9 |
If you're seeing this message, it means you haven't generated the bundle file for this example. Try running:
10 |
11 |
12 | npm install
13 | npm run build
14 |
15 |
16 |
then reload the page.
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/fixtures/dom/src/components/fixtures/event-pooling/index.js:
--------------------------------------------------------------------------------
1 | import FixtureSet from '../../FixtureSet';
2 | import MouseMove from './mouse-move';
3 | import Persistence from './persistence';
4 |
5 | const React = window.React;
6 |
7 | class EventPooling extends React.Component {
8 | render() {
9 | return (
10 |
11 |
12 |
13 |
14 | );
15 | }
16 | }
17 |
18 | export default EventPooling;
19 |
--------------------------------------------------------------------------------
/fixtures/nesting/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
25 | # copies of shared
26 | src/*/shared
27 | src/*/node_modules
28 |
--------------------------------------------------------------------------------
/packages/react-devtools-scheduling-profiler/src/content-views/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from './FlamechartView';
11 | export * from './ReactEventsView';
12 | export * from './ReactMeasuresView';
13 | export * from './TimeAxisMarkersView';
14 | export * from './UserTimingMarksView';
15 |
--------------------------------------------------------------------------------
/scripts/circleci/check_minified_errors.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Ensure errors are minified in production
4 |
5 | OUT=$(git --no-pager grep -n --untracked --no-exclude-standard 'FIXME (minify-errors-in-prod)' -- './build/*')
6 |
7 | if [ "$OUT" != "" ]; then
8 | echo "$OUT";
9 | echo -e "\n";
10 | echo "Detected an unminified error message in the production build. User-facing errors message must have a corresponding error code in scripts/error-codes/codes.json."
11 | exit 1
12 | fi
13 |
14 | exit 0
15 |
--------------------------------------------------------------------------------
/fixtures/dom/src/components/fixtures/mouse-events/index.js:
--------------------------------------------------------------------------------
1 | import FixtureSet from '../../FixtureSet';
2 | import MouseMovement from './mouse-movement';
3 | import MouseEnter from './mouse-enter';
4 |
5 | const React = window.React;
6 |
7 | class MouseEvents extends React.Component {
8 | render() {
9 | return (
10 |
11 |
12 |
13 |
14 | );
15 | }
16 | }
17 |
18 | export default MouseEvents;
19 |
--------------------------------------------------------------------------------
/packages/react-devtools-extensions/chrome/README.md:
--------------------------------------------------------------------------------
1 | # The Chrome extension
2 |
3 | The source code for this extension has moved to `shells/webextension`.
4 |
5 | Modify the source code there and then rebuild this extension by running `node build` from this directory or `yarn run build:extension:chrome` from the root directory.
6 |
7 | ## Testing in Chrome
8 |
9 | You can test a local build of the web extension like so:
10 |
11 | 1. Build the extension: `node build`
12 | 1. Follow the on-screen instructions.
13 |
--------------------------------------------------------------------------------
/packages/react-devtools/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | const {connectToDevTools} = require('react-devtools-core/backend');
11 |
12 | // Connect immediately with default options.
13 | // If you need more control, use `react-devtools-core` directly instead of `react-devtools`.
14 | connectToDevTools();
15 |
--------------------------------------------------------------------------------
/packages/react-suspense-test-utils/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-suspense-test-utils",
3 | "version": "0.1.0",
4 | "private": true,
5 | "repository": {
6 | "type" : "git",
7 | "url" : "https://github.com/facebook/react.git",
8 | "directory": "packages/react-suspense-test-utils"
9 | },
10 | "license": "MIT",
11 | "files": [
12 | "LICENSE",
13 | "README.md",
14 | "index.js",
15 | "cjs/"
16 | ],
17 | "peerDependencies": {
18 | "react": "^17.0.0"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/fixtures/flight/src/index.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import {Suspense} from 'react';
3 | import ReactDOM from 'react-dom';
4 | import ReactServerDOMReader from 'react-server-dom-webpack';
5 |
6 | let data = ReactServerDOMReader.createFromFetch(fetch('http://localhost:3001'));
7 |
8 | function Content() {
9 | return data.readRoot();
10 | }
11 |
12 | ReactDOM.render(
13 | Loading...}>
14 |
15 | ,
16 | document.getElementById('root')
17 | );
18 |
--------------------------------------------------------------------------------
/packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/deepFreezeAndThrowOnMutationInDev.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | 'use strict';
9 |
10 | // TODO: move into react or fbjs
11 |
12 | const deepFreezeAndThrowOnMutationInDev = function() {};
13 |
14 | module.exports = deepFreezeAndThrowOnMutationInDev;
15 |
--------------------------------------------------------------------------------
/scripts/jest/jest.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | /**
3 | * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
4 | *
5 | * This source code is licensed under the MIT license found in the
6 | * LICENSE file in the root directory of this source tree.
7 | */
8 | 'use strict';
9 |
10 | // --- Welcome to debugging React tests ---
11 | // The debugger pauses on this statement so that you can open the dev tools.
12 | // You can now set breakpoints and begin debugging.
13 | require('jest-cli/bin/jest');
14 |
--------------------------------------------------------------------------------
/scripts/rollup/shims/facebook-www/ReactBrowserEventEmitter_DO_NOT_USE.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | 'use strict';
9 |
10 | const {
11 | __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
12 | } = require('ReactDOM');
13 |
14 | module.exports =
15 | __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactBrowserEventEmitter;
16 |
--------------------------------------------------------------------------------
/packages/react-devtools-shared/src/devtools/views/Components/HocBadges.css:
--------------------------------------------------------------------------------
1 | .HocBadges {
2 | padding: 0.125rem 0.25rem;
3 | user-select: none;
4 | }
5 |
6 | .Badge {
7 | display: inline-block;
8 | background-color: var(--color-component-badge-background);
9 | color: var(--color-text);
10 | padding: 0.125rem 0.25rem;
11 | line-height: normal;
12 | border-radius: 0.125rem;
13 | margin-right: 0.25rem;
14 | font-family: var(--font-family-monospace);
15 | font-size: var(--font-size-monospace-small);
16 | }
17 |
--------------------------------------------------------------------------------
/packages/react-devtools-extensions/edge/README.md:
--------------------------------------------------------------------------------
1 | # The Microsoft Edge extension
2 |
3 | The source code for this extension has moved to `shells/webextension`.
4 |
5 | Modify the source code there and then rebuild this extension by running `node build` from this directory or `yarn run build:extension:edge` from the root directory.
6 |
7 | ## Testing in Microsoft Edge
8 |
9 | You can test a local build of the web extension like so:
10 |
11 | 1. Build the extension: `node build`
12 | 1. Follow the on-screen instructions.
13 |
--------------------------------------------------------------------------------
/packages/react-devtools-scheduling-profiler/src/view-base/constants.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export const MOVE_WHEEL_DELTA_THRESHOLD = 1;
11 | export const ZOOM_WHEEL_DELTA_THRESHOLD = 1;
12 | export const MIN_ZOOM_LEVEL = 0.25;
13 | export const MAX_ZOOM_LEVEL = 1000;
14 | export const DEFAULT_ZOOM_LEVEL = 0.25;
15 |
--------------------------------------------------------------------------------
/packages/react-server-native-relay/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-server-native-relay",
3 | "version": "0.1.0",
4 | "private": true,
5 | "repository": {
6 | "type" : "git",
7 | "url" : "https://github.com/facebook/react.git",
8 | "directory": "packages/react-server-native-relay"
9 | },
10 | "dependencies": {
11 | "object-assign": "^4.1.1",
12 | "scheduler": "^0.11.0"
13 | },
14 | "peerDependencies": {
15 | "react": "^17.0.0",
16 | "react-native-renderer": "^17.0.0"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/fixtures/dom/src/components/fixtures/hydration/data.js:
--------------------------------------------------------------------------------
1 | export const SAMPLE_CODE = `
2 | class Fixture extends React.Component {
3 | state = {
4 | value: 'asdf'
5 | }
6 |
7 | onChange(event) {
8 | this.setState({ value: event.target.value });
9 | }
10 |
11 | render() {
12 | const { value } = this.state;
13 |
14 | return (
15 |
19 | );
20 | }
21 | }
22 | `.trim();
23 |
--------------------------------------------------------------------------------
/fixtures/dom/src/components/propTypes.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import semver from 'semver';
3 |
4 | export function semverString(props, propName, componentName) {
5 | let version = props[propName];
6 |
7 | let error = PropTypes.string(...arguments);
8 | if (!error && version != null && !semver.valid(version))
9 | error = new Error(
10 | `\`${propName}\` should be a valid "semantic version" matching ` +
11 | 'an existing React version'
12 | );
13 |
14 | return error || null;
15 | }
16 |
--------------------------------------------------------------------------------
/packages/react-client/src/forks/ReactFlightClientHostConfig.dom.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-client/src/ReactFlightClientHostConfigBrowser';
11 | export * from 'react-client/src/ReactFlightClientHostConfigStream';
12 | export * from 'react-server-dom-webpack/src/ReactFlightClientWebpackBundlerConfig';
13 |
--------------------------------------------------------------------------------
/packages/react-dom/server.node.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | // For some reason Flow doesn't like export * in this file. I don't know why.
11 | export {
12 | renderToString,
13 | renderToStaticMarkup,
14 | renderToNodeStream,
15 | renderToStaticNodeStream,
16 | version,
17 | } from './src/server/ReactDOMServerNode';
18 |
--------------------------------------------------------------------------------
/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | */
8 |
9 | export const {
10 | enableIsInputPending,
11 | enableSchedulerDebugging,
12 | enableProfiling: enableProfilingFeatureFlag,
13 | } = require('SchedulerFeatureFlags');
14 |
15 | export const enableProfiling = __PROFILE__ && enableProfilingFeatureFlag;
16 |
--------------------------------------------------------------------------------
/fixtures/attribute-behavior/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 | /public/react.development.js
12 | /public/react-dom.development.js
13 | /public/react-dom-server.browser.development.js
14 |
15 | # misc
16 | .DS_Store
17 | .env.local
18 | .env.development.local
19 | .env.test.local
20 | .env.production.local
21 |
22 | npm-debug.log*
23 | yarn-debug.log*
24 | yarn-error.log*
25 |
--------------------------------------------------------------------------------
/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-dev-runtime.production.min.js:
--------------------------------------------------------------------------------
1 | /** @license React v15.7.0
2 | * react-jsx-dev-runtime.production.min.js
3 | *
4 | * Copyright (c) Facebook, Inc. and its affiliates.
5 | *
6 | * This source code is licensed under the MIT license found in the
7 | * LICENSE file in the root directory of this source tree.
8 | */
9 | 'use strict';require("react");exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var a=Symbol.for;exports.Fragment=a("react.fragment")}exports.jsxDEV=void 0;
10 |
--------------------------------------------------------------------------------
/packages/react-client/src/forks/ReactFlightClientHostConfig.dom-browser.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | export * from 'react-client/src/ReactFlightClientHostConfigBrowser';
11 | export * from 'react-client/src/ReactFlightClientHostConfigStream';
12 | export * from 'react-server-dom-webpack/src/ReactFlightClientWebpackBundlerConfig';
13 |
--------------------------------------------------------------------------------
/packages/react-server-dom-relay/src/__mocks__/JSResourceReference.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | 'use strict';
9 |
10 | class JSResourceReference {
11 | constructor(exportedValue) {
12 | this._moduleId = exportedValue;
13 | }
14 | getModuleId() {
15 | return this._moduleId;
16 | }
17 | }
18 |
19 | module.exports = JSResourceReference;
20 |
--------------------------------------------------------------------------------
/packages/react/src/__tests__/testDefinitions/PropTypes.d.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | /**
9 | * TypeScript Definition File for React.
10 | *
11 | * Full type definitions are not yet officially supported. These are mostly
12 | * just helpers for the unit test.
13 | */
14 |
15 | declare module 'prop-types' {
16 | export let string : any;
17 | }
18 |
--------------------------------------------------------------------------------
/scripts/circleci/check_modules.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | # Make sure we don't introduce accidental @providesModule annotations.
6 | EXPECTED='scripts/rollup/wrappers.js'
7 | ACTUAL=$(git grep -l @providesModule -- './*.js' ':!scripts/rollup/shims/*.js')
8 |
9 | # Colors
10 | red=$'\e[1;31m'
11 | end=$'\e[0m'
12 |
13 | if [ "$EXPECTED" != "$ACTUAL" ]; then
14 | printf "%s\n" "${red}ERROR: @providesModule crept into some new files?${end}"
15 | diff -u <(echo "$EXPECTED") <(echo "$ACTUAL") || true
16 | exit 1
17 | fi
18 |
--------------------------------------------------------------------------------
/fixtures/dom/src/find-dom-node.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a standard way to access a DOM node across all versions of
3 | * React.
4 | */
5 |
6 | import {reactPaths} from './react-loader';
7 |
8 | const React = window.React;
9 | const ReactDOM = window.ReactDOM;
10 |
11 | export function findDOMNode(target) {
12 | const {needsReactDOM} = reactPaths();
13 |
14 | if (needsReactDOM) {
15 | return ReactDOM.findDOMNode(target);
16 | } else {
17 | // eslint-disable-next-line
18 | return React.findDOMNode(target);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-dev-runtime.production.min.js:
--------------------------------------------------------------------------------
1 | /** @license React v0.14.10
2 | * react-jsx-dev-runtime.production.min.js
3 | *
4 | * Copyright (c) Facebook, Inc. and its affiliates.
5 | *
6 | * This source code is licensed under the MIT license found in the
7 | * LICENSE file in the root directory of this source tree.
8 | */
9 | 'use strict';require("react");exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var a=Symbol.for;exports.Fragment=a("react.fragment")}exports.jsxDEV=void 0;
10 |
--------------------------------------------------------------------------------
/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-dev-runtime.production.min.js:
--------------------------------------------------------------------------------
1 | /** @license React v16.14.0
2 | * react-jsx-dev-runtime.production.min.js
3 | *
4 | * Copyright (c) Facebook, Inc. and its affiliates.
5 | *
6 | * This source code is licensed under the MIT license found in the
7 | * LICENSE file in the root directory of this source tree.
8 | */
9 | 'use strict';require("react");exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var a=Symbol.for;exports.Fragment=a("react.fragment")}exports.jsxDEV=void 0;
10 |
--------------------------------------------------------------------------------
/fixtures/stacks/BabelClasses.js:
--------------------------------------------------------------------------------
1 | // Compile this with Babel.
2 | // babel --config-file ./babel.config.json BabelClasses.js --out-file BabelClasses-compiled.js --source-maps
3 |
4 | class BabelClass extends React.Component {
5 | render() {
6 | return this.props.children;
7 | }
8 | }
9 |
10 | class BabelClassWithFields extends React.Component {
11 | // These compile to defineProperty which can break some interception techniques.
12 | props;
13 | state = {};
14 | render() {
15 | return this.props.children;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/shared/isArray.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | declare function isArray(a: mixed): boolean %checks(Array.isArray(a));
11 |
12 | const isArrayImpl = Array.isArray;
13 |
14 | // eslint-disable-next-line no-redeclare
15 | function isArray(a: mixed): boolean {
16 | return isArrayImpl(a);
17 | }
18 |
19 | export default isArray;
20 |
--------------------------------------------------------------------------------
/scripts/bench/benchmarks/hacker-news/build.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const {join} = require('path');
4 |
5 | async function build(reactPath, asyncCopyTo) {
6 | // copy the UMD bundles
7 | await asyncCopyTo(
8 | join(reactPath, 'build', 'dist', 'react.production.min.js'),
9 | join(__dirname, 'react.production.min.js')
10 | );
11 | await asyncCopyTo(
12 | join(reactPath, 'build', 'dist', 'react-dom.production.min.js'),
13 | join(__dirname, 'react-dom.production.min.js')
14 | );
15 | }
16 |
17 | module.exports = build;
18 |
--------------------------------------------------------------------------------
/packages/react-devtools-scheduling-profiler/src/context/ContextMenuItem.css:
--------------------------------------------------------------------------------
1 | .ContextMenuItem {
2 | display: flex;
3 | align-items: center;
4 | color: #333;
5 | padding: 0.5rem 0.75rem;
6 | cursor: default;
7 | border-top: 1px solid #ccc;
8 | }
9 | .ContextMenuItem:first-of-type {
10 | border-top: none;
11 | }
12 | .ContextMenuItem:hover,
13 | .ContextMenuItem:focus {
14 | outline: 0;
15 | background-color: rgba(0, 136, 250, 0.1);
16 | }
17 | .ContextMenuItem:active {
18 | background-color: #0088fa;
19 | color: #fff;
20 | }
21 |
--------------------------------------------------------------------------------
/packages/react/src/ReactCurrentBatchConfig.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | /**
11 | * Keeps track of the current batch's configuration such as how long an update
12 | * should suspend for if it needs to.
13 | */
14 | const ReactCurrentBatchConfig = {
15 | transition: (0: number),
16 | };
17 |
18 | export default ReactCurrentBatchConfig;
19 |
--------------------------------------------------------------------------------
/scripts/bench/benchmarks/pe-no-components/build.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const {join} = require('path');
4 |
5 | async function build(reactPath, asyncCopyTo) {
6 | // copy the UMD bundles
7 | await asyncCopyTo(
8 | join(reactPath, 'build', 'dist', 'react.production.min.js'),
9 | join(__dirname, 'react.production.min.js')
10 | );
11 | await asyncCopyTo(
12 | join(reactPath, 'build', 'dist', 'react-dom.production.min.js'),
13 | join(__dirname, 'react-dom.production.min.js')
14 | );
15 | }
16 |
17 | module.exports = build;
18 |
--------------------------------------------------------------------------------
/packages/react-dom/src/shared/HTMLNodeType.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | *
7 | * @flow
8 | */
9 |
10 | /**
11 | * HTML nodeType values that represent the type of the node
12 | */
13 |
14 | export const ELEMENT_NODE = 1;
15 | export const TEXT_NODE = 3;
16 | export const COMMENT_NODE = 8;
17 | export const DOCUMENT_NODE = 9;
18 | export const DOCUMENT_FRAGMENT_NODE = 11;
19 |
--------------------------------------------------------------------------------