From 6eca8eff08e293229c2ff957f175573faf994fc0 Mon Sep 17 00:00:00 2001 From: IDrissAitHafid <31975500+IDrissAitHafid@users.noreply.github.com> Date: Thu, 8 Oct 2020 13:46:15 +0100 Subject: [PATCH 0001/1603] updating the informations needed when adding a root node to a tree in react-devtools overview doc (#19979) Co-authored-by: Idriss AITHAFID --- packages/react-devtools/OVERVIEW.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/react-devtools/OVERVIEW.md b/packages/react-devtools/OVERVIEW.md index fa9fc8c1bdd7..19b54f0124af 100644 --- a/packages/react-devtools/OVERVIEW.md +++ b/packages/react-devtools/OVERVIEW.md @@ -49,20 +49,22 @@ Later operations will reference strings by a one-based index. For example, `1` w #### Adding a root node -Adding a root to the tree requires sending 4 numbers: +Adding a root to the tree requires sending 5 numbers: 1. add operation constant (`1`) 1. fiber id -1. element type constant (`8 === ElementTypeRoot`) +1. element type constant (`11 === ElementTypeRoot`) 1. profiling supported flag +1. owner metadata flag For example, adding a root fiber with an id of 1: ```js [ 1, // add operation 1, // fiber id - 8, // ElementTypeRoot + 11, // ElementTypeRoot 1, // this root's renderer supports profiling + 1, // this root has owner metadata ] ``` From 40c52de96043f56430d464a62635014f0e8dd900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Markb=C3=A5ge?= Date: Thu, 8 Oct 2020 14:11:15 -0400 Subject: [PATCH 0002/1603] [Flight] Add Runtime Errors for Non-serializable Values (#19980) * Error on encoding non-serializable props * Add DEV time warnings to enforce that values are plain objects --- .../src/__tests__/ReactFlight-test.js | 121 +++++++++ .../react-server/src/ReactFlightServer.js | 246 +++++++++++++++++- scripts/error-codes/codes.json | 7 +- 3 files changed, 368 insertions(+), 6 deletions(-) diff --git a/packages/react-client/src/__tests__/ReactFlight-test.js b/packages/react-client/src/__tests__/ReactFlight-test.js index 8e877ea10164..e08e61748cd4 100644 --- a/packages/react-client/src/__tests__/ReactFlight-test.js +++ b/packages/react-client/src/__tests__/ReactFlight-test.js @@ -18,6 +18,7 @@ let ReactNoop; let ReactNoopFlightServer; let ReactNoopFlightServerRuntime; let ReactNoopFlightClient; +let ErrorBoundary; describe('ReactFlight', () => { beforeEach(() => { @@ -29,6 +30,27 @@ describe('ReactFlight', () => { ReactNoopFlightServerRuntime = require('react-noop-renderer/flight-server-runtime'); ReactNoopFlightClient = require('react-noop-renderer/flight-client'); act = ReactNoop.act; + + ErrorBoundary = class extends React.Component { + state = {hasError: false, error: null}; + static getDerivedStateFromError(error) { + return { + hasError: true, + error, + }; + } + componentDidMount() { + expect(this.state.hasError).toBe(true); + expect(this.state.error).toBeTruthy(); + expect(this.state.error.message).toContain(this.props.expectedMessage); + } + render() { + if (this.state.hasError) { + return this.state.error.message; + } + return this.props.children; + } + }; }); function block(render, load) { @@ -127,4 +149,103 @@ describe('ReactFlight', () => { expect(ReactNoop).toMatchRenderedOutput(Hello, Seb Smith); }); } + + it('should error if a non-serializable value is passed to a host component', () => { + function EventHandlerProp() { + return ( +
+ Test +
+ ); + } + function FunctionProp() { + return
{() => {}}
; + } + function SymbolProp() { + return
; + } + + const event = ReactNoopFlightServer.render(); + const fn = ReactNoopFlightServer.render(); + const symbol = ReactNoopFlightServer.render(); + + function Client({transport}) { + return ReactNoopFlightClient.read(transport); + } + + act(() => { + ReactNoop.render( + <> + + + + + + + + + + , + ); + }); + }); + + it('should warn in DEV if a toJSON instance is passed to a host component', () => { + expect(() => { + const transport = ReactNoopFlightServer.render( + , + ); + act(() => { + ReactNoop.render(ReactNoopFlightClient.read(transport)); + }); + }).toErrorDev( + 'Only plain objects can be passed to client components from server components. ', + {withoutStack: true}, + ); + }); + + it('should warn in DEV if a special object is passed to a host component', () => { + expect(() => { + const transport = ReactNoopFlightServer.render(); + act(() => { + ReactNoop.render(ReactNoopFlightClient.read(transport)); + }); + }).toErrorDev( + 'Only plain objects can be passed to client components from server components. ' + + 'Built-ins like Math are not supported.', + {withoutStack: true}, + ); + }); + + it('should warn in DEV if an object with symbols is passed to a host component', () => { + expect(() => { + const transport = ReactNoopFlightServer.render( + , + ); + act(() => { + ReactNoop.render(ReactNoopFlightClient.read(transport)); + }); + }).toErrorDev( + 'Only plain objects can be passed to client components from server components. ' + + 'Objects with symbol properties like Symbol.iterator are not supported.', + {withoutStack: true}, + ); + }); + + it('should warn in DEV if a class instance is passed to a host component', () => { + class Foo { + method() {} + } + expect(() => { + const transport = ReactNoopFlightServer.render( + , + ); + act(() => { + ReactNoop.render(ReactNoopFlightClient.read(transport)); + }); + }).toErrorDev( + 'Only plain objects can be passed to client components from server components. ', + {withoutStack: true}, + ); + }); }); diff --git a/packages/react-server/src/ReactFlightServer.js b/packages/react-server/src/ReactFlightServer.js index 17fd077c57f8..d934ce5f7fbf 100644 --- a/packages/react-server/src/ReactFlightServer.js +++ b/packages/react-server/src/ReactFlightServer.js @@ -50,6 +50,8 @@ import * as React from 'react'; import ReactSharedInternals from 'shared/ReactSharedInternals'; import invariant from 'shared/invariant'; +const isArray = Array.isArray; + type ReactJSONValue = | string | boolean @@ -186,12 +188,146 @@ function escapeStringValue(value: string): string { } } +function isObjectPrototype(object): boolean { + if (!object) { + return false; + } + // $FlowFixMe + const ObjectPrototype = Object.prototype; + if (object === ObjectPrototype) { + return true; + } + // It might be an object from a different Realm which is + // still just a plain simple object. + if (Object.getPrototypeOf(object)) { + return false; + } + const names = Object.getOwnPropertyNames(object); + for (let i = 0; i < names.length; i++) { + if (!(names[i] in ObjectPrototype)) { + return false; + } + } + return true; +} + +function isSimpleObject(object): boolean { + if (!isObjectPrototype(Object.getPrototypeOf(object))) { + return false; + } + const names = Object.getOwnPropertyNames(object); + for (let i = 0; i < names.length; i++) { + const descriptor = Object.getOwnPropertyDescriptor(object, names[i]); + if (!descriptor || !descriptor.enumerable) { + return false; + } + } + return true; +} + +function objectName(object): string { + const name = Object.prototype.toString.call(object); + return name.replace(/^\[object (.*)\]$/, function(m, p0) { + return p0; + }); +} + +function describeKeyForErrorMessage(key: string): string { + const encodedKey = JSON.stringify(key); + return '"' + key + '"' === encodedKey ? key : encodedKey; +} + +function describeValueForErrorMessage(value: ReactModel): string { + switch (typeof value) { + case 'string': { + return JSON.stringify( + value.length <= 10 ? value : value.substr(0, 10) + '...', + ); + } + case 'object': { + if (isArray(value)) { + return '[...]'; + } + const name = objectName(value); + if (name === '[object Object]') { + return '{...}'; + } + return name; + } + case 'function': + return 'function'; + default: + // eslint-disable-next-line + return String(value); + } +} + +function describeObjectForErrorMessage( + objectOrArray: + | {+[key: string | number]: ReactModel} + | $ReadOnlyArray, +): string { + if (isArray(objectOrArray)) { + let str = '['; + // $FlowFixMe: Should be refined by now. + const array: $ReadOnlyArray = objectOrArray; + for (let i = 0; i < array.length; i++) { + if (i > 0) { + str += ', '; + } + if (i > 6) { + str += '...'; + break; + } + str += describeValueForErrorMessage(array[i]); + } + str += ']'; + return str; + } else { + let str = '{'; + // $FlowFixMe: Should be refined by now. + const object: {+[key: string | number]: ReactModel} = objectOrArray; + const names = Object.keys(object); + for (let i = 0; i < names.length; i++) { + if (i > 0) { + str += ', '; + } + if (i > 6) { + str += '...'; + break; + } + const name = names[i]; + str += + describeKeyForErrorMessage(name) + + ': ' + + describeValueForErrorMessage(object[name]); + } + str += '}'; + return str; + } +} + export function resolveModelToJSON( request: Request, parent: {+[key: string | number]: ReactModel} | $ReadOnlyArray, key: string, value: ReactModel, ): ReactJSONValue { + if (__DEV__) { + // $FlowFixMe + const originalValue = parent[key]; + if (typeof originalValue === 'object' && originalValue !== value) { + console.error( + 'Only plain objects can be passed to client components from server components. ' + + 'Objects with toJSON methods are not supported. Convert it manually ' + + 'to a simple value before passing it to props. ' + + 'Remove %s from these props: %s', + describeKeyForErrorMessage(key), + describeObjectForErrorMessage(parent), + ); + } + } + // Special Symbols switch (value) { case REACT_ELEMENT_TYPE: @@ -263,10 +399,6 @@ export function resolveModelToJSON( } } - if (typeof value === 'string') { - return escapeStringValue(value); - } - // Resolve server components. while ( typeof value === 'object' && @@ -293,7 +425,111 @@ export function resolveModelToJSON( } } - return value; + if (typeof value === 'object') { + if (__DEV__) { + if (value !== null && !isArray(value)) { + // Verify that this is a simple plain object. + if (objectName(value) !== 'Object') { + console.error( + 'Only plain objects can be passed to client components from server components. ' + + 'Built-ins like %s are not supported. ' + + 'Remove %s from these props: %s', + objectName(value), + describeKeyForErrorMessage(key), + describeObjectForErrorMessage(parent), + ); + } else if (!isSimpleObject(value)) { + console.error( + 'Only plain objects can be passed to client components from server components. ' + + 'Classes or other objects with methods are not supported. ' + + 'Remove %s from these props: %s', + describeKeyForErrorMessage(key), + describeObjectForErrorMessage(parent), + ); + } else if (Object.getOwnPropertySymbols) { + const symbols = Object.getOwnPropertySymbols(value); + if (symbols.length > 0) { + console.error( + 'Only plain objects can be passed to client components from server components. ' + + 'Objects with symbol properties like %s are not supported. ' + + 'Remove %s from these props: %s', + symbols[0].description, + describeKeyForErrorMessage(key), + describeObjectForErrorMessage(parent), + ); + } + } + } + } + return value; + } + + if (typeof value === 'string') { + return escapeStringValue(value); + } + + if ( + typeof value === 'boolean' || + typeof value === 'number' || + typeof value === 'undefined' + ) { + return value; + } + + if (typeof value === 'function') { + if (/^on[A-Z]/.test(key)) { + invariant( + false, + 'Event handlers cannot be passed to client component props. ' + + 'Remove %s from these props if possible: %s\n' + + 'If you need interactivity, consider converting part of this to a client component.', + describeKeyForErrorMessage(key), + describeObjectForErrorMessage(parent), + ); + } else { + invariant( + false, + 'Functions cannot be passed directly to client components ' + + "because they're not serializable. " + + 'Remove %s (%s) from this object, or avoid the entire object: %s', + describeKeyForErrorMessage(key), + value.displayName || value.name || 'function', + describeObjectForErrorMessage(parent), + ); + } + } + + if (typeof value === 'symbol') { + invariant( + false, + 'Symbol values (%s) cannot be passed to client components. ' + + 'Remove %s from this object, or avoid the entire object: %s', + value.description, + describeKeyForErrorMessage(key), + describeObjectForErrorMessage(parent), + ); + } + + // $FlowFixMe: bigint isn't added to Flow yet. + if (typeof value === 'bigint') { + invariant( + false, + 'BigInt (%s) is not yet supported in client component props. ' + + 'Remove %s from this object or use a plain number instead: %s', + value, + describeKeyForErrorMessage(key), + describeObjectForErrorMessage(parent), + ); + } + + invariant( + false, + 'Type %s is not supported in client component props. ' + + 'Remove %s from this object, or avoid the entire object: %s', + typeof value, + describeKeyForErrorMessage(key), + describeObjectForErrorMessage(parent), + ); } function emitErrorChunk(request: Request, id: number, error: mixed): void { diff --git a/scripts/error-codes/codes.json b/scripts/error-codes/codes.json index 069339abfdd2..369c97c32a2c 100644 --- a/scripts/error-codes/codes.json +++ b/scripts/error-codes/codes.json @@ -361,5 +361,10 @@ "370": "ReactDOM.createEventHandle: setter called with an invalid callback. The callback must be a function.", "371": "Text string must be rendered within a component.\n\nText: %s", "372": "Cannot call unstable_createEventHandle with \"%s\", as it is not an event known to React.", - "373": "This Hook is not supported in Server Components." + "373": "This Hook is not supported in Server Components.", + "374": "Event handlers cannot be passed to client component props. Remove %s from these props if possible: %s\nIf you need interactivity, consider converting part of this to a client component.", + "375": "Functions cannot be passed directly to client components because they're not serializable. Remove %s (%s) from this object, or avoid the entire object: %s", + "376": "Symbol values (%s) cannot be passed to client components. Remove %s from this object, or avoid the entire object: %s", + "377": "BigInt (%s) is not yet supported in client component props. Remove %s from this object or use a plain number instead: %s", + "378": "Type %s is not supported in client component props. Remove %s from this object, or avoid the entire object: %s" } From 993ca533b42756811731f6b7791ae06a35ee6b4d Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 8 Oct 2020 19:32:28 +0100 Subject: [PATCH 0003/1603] Enable eager listeners statically (#19983) --- .../src/__tests__/ReactDOMFiber-test.js | 1 - .../react-dom/src/client/ReactDOMComponent.js | 88 +---------------- .../src/client/ReactDOMEventHandle.js | 87 +---------------- .../src/client/ReactDOMHostConfig.js | 12 +-- packages/react-dom/src/client/ReactDOMRoot.js | 31 +----- .../src/events/DOMPluginEventSystem.js | 97 ++++--------------- .../src/events/ReactDOMEventListener.js | 19 ++-- .../src/events/ReactDOMEventReplaying.js | 46 +-------- .../DOMPluginEventSystem-test.internal.js | 2 +- .../src/events/plugins/SelectEventPlugin.js | 23 +---- .../__tests__/SimpleEventPlugin-test.js | 40 ++------ packages/shared/ReactFeatureFlags.js | 2 - .../forks/ReactFeatureFlags.native-fb.js | 1 - .../forks/ReactFeatureFlags.native-oss.js | 1 - .../forks/ReactFeatureFlags.test-renderer.js | 1 - .../ReactFeatureFlags.test-renderer.native.js | 1 - .../ReactFeatureFlags.test-renderer.www.js | 1 - .../shared/forks/ReactFeatureFlags.testing.js | 1 - .../forks/ReactFeatureFlags.testing.www.js | 1 - .../forks/ReactFeatureFlags.www-dynamic.js | 1 - .../shared/forks/ReactFeatureFlags.www.js | 1 - 21 files changed, 55 insertions(+), 402 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMFiber-test.js b/packages/react-dom/src/__tests__/ReactDOMFiber-test.js index 130c06b443c6..ec3ec75ce482 100644 --- a/packages/react-dom/src/__tests__/ReactDOMFiber-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMFiber-test.js @@ -1040,7 +1040,6 @@ describe('ReactDOMFiber', () => { expect(ops).toEqual([]); }); - // @gate enableEagerRootListeners it('listens to events that do not exist in the Portal subtree', () => { const onClick = jest.fn(); diff --git a/packages/react-dom/src/client/ReactDOMComponent.js b/packages/react-dom/src/client/ReactDOMComponent.js index 8f0e3302327c..86789230ca0f 100644 --- a/packages/react-dom/src/client/ReactDOMComponent.js +++ b/packages/react-dom/src/client/ReactDOMComponent.js @@ -61,12 +61,7 @@ import { shouldRemoveAttribute, } from '../shared/DOMProperty'; import assertValidProps from '../shared/assertValidProps'; -import { - DOCUMENT_NODE, - ELEMENT_NODE, - COMMENT_NODE, - DOCUMENT_FRAGMENT_NODE, -} from '../shared/HTMLNodeType'; +import {DOCUMENT_NODE} from '../shared/HTMLNodeType'; import isCustomComponent from '../shared/isCustomComponent'; import possibleStandardNames from '../shared/possibleStandardNames'; import {validateProperties as validateARIAProperties} from '../shared/ReactDOMInvalidARIAHook'; @@ -74,12 +69,8 @@ import {validateProperties as validateInputProperties} from '../shared/ReactDOMN import {validateProperties as validateUnknownProperties} from '../shared/ReactDOMUnknownPropertyHook'; import {REACT_OPAQUE_ID_TYPE} from 'shared/ReactSymbols'; +import {enableTrustedTypesIntegration} from 'shared/ReactFeatureFlags'; import { - enableTrustedTypesIntegration, - enableEagerRootListeners, -} from 'shared/ReactFeatureFlags'; -import { - listenToReactEvent, mediaEventTypes, listenToNonDelegatedEvent, } from '../events/DOMPluginEventSystem'; @@ -253,39 +244,6 @@ if (__DEV__) { }; } -export function ensureListeningTo( - rootContainerInstance: Element | Node, - reactPropEvent: string, - targetElement: Element | null, -): void { - if (!enableEagerRootListeners) { - // If we have a comment node, then use the parent node, - // which should be an element. - const rootContainerElement = - rootContainerInstance.nodeType === COMMENT_NODE - ? rootContainerInstance.parentNode - : rootContainerInstance; - if (__DEV__) { - if ( - rootContainerElement == null || - (rootContainerElement.nodeType !== ELEMENT_NODE && - // This is to support rendering into a ShadowRoot: - rootContainerElement.nodeType !== DOCUMENT_FRAGMENT_NODE) - ) { - console.error( - 'ensureListeningTo(): received a container that was not an element node. ' + - 'This is likely a bug in React. Please file an issue.', - ); - } - } - listenToReactEvent( - reactPropEvent, - ((rootContainerElement: any): Element), - targetElement, - ); - } -} - function getOwnerDocumentFromRootContainer( rootContainerElement: Element | Document, ): Document { @@ -364,9 +322,7 @@ function setInitialDOMProperties( if (__DEV__ && typeof nextProp !== 'function') { warnForInvalidEventListener(propKey, nextProp); } - if (!enableEagerRootListeners) { - ensureListeningTo(rootContainerElement, propKey, domElement); - } else if (propKey === 'onScroll') { + if (propKey === 'onScroll') { listenToNonDelegatedEvent('scroll', domElement); } } @@ -577,11 +533,6 @@ export function setInitialProperties( // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); - if (!enableEagerRootListeners) { - // For controlled components we always need to ensure we're listening - // to onChange. Even if there is no listener. - ensureListeningTo(rootContainerElement, 'onChange', domElement); - } break; case 'option': ReactDOMOptionValidateProps(domElement, rawProps); @@ -593,11 +544,6 @@ export function setInitialProperties( // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); - if (!enableEagerRootListeners) { - // For controlled components we always need to ensure we're listening - // to onChange. Even if there is no listener. - ensureListeningTo(rootContainerElement, 'onChange', domElement); - } break; case 'textarea': ReactDOMTextareaInitWrapperState(domElement, rawProps); @@ -605,11 +551,6 @@ export function setInitialProperties( // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); - if (!enableEagerRootListeners) { - // For controlled components we always need to ensure we're listening - // to onChange. Even if there is no listener. - ensureListeningTo(rootContainerElement, 'onChange', domElement); - } break; default: props = rawProps; @@ -827,9 +768,7 @@ export function diffProperties( if (__DEV__ && typeof nextProp !== 'function') { warnForInvalidEventListener(propKey, nextProp); } - if (!enableEagerRootListeners) { - ensureListeningTo(rootContainerElement, propKey, domElement); - } else if (propKey === 'onScroll') { + if (propKey === 'onScroll') { listenToNonDelegatedEvent('scroll', domElement); } } @@ -983,11 +922,6 @@ export function diffHydratedProperties( // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); - if (!enableEagerRootListeners) { - // For controlled components we always need to ensure we're listening - // to onChange. Even if there is no listener. - ensureListeningTo(rootContainerElement, 'onChange', domElement); - } break; case 'option': ReactDOMOptionValidateProps(domElement, rawProps); @@ -997,22 +931,12 @@ export function diffHydratedProperties( // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); - if (!enableEagerRootListeners) { - // For controlled components we always need to ensure we're listening - // to onChange. Even if there is no listener. - ensureListeningTo(rootContainerElement, 'onChange', domElement); - } break; case 'textarea': ReactDOMTextareaInitWrapperState(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); - if (!enableEagerRootListeners) { - // For controlled components we always need to ensure we're listening - // to onChange. Even if there is no listener. - ensureListeningTo(rootContainerElement, 'onChange', domElement); - } break; } @@ -1079,9 +1003,7 @@ export function diffHydratedProperties( if (__DEV__ && typeof nextProp !== 'function') { warnForInvalidEventListener(propKey, nextProp); } - if (!enableEagerRootListeners) { - ensureListeningTo(rootContainerElement, propKey, domElement); - } else if (propKey === 'onScroll') { + if (propKey === 'onScroll') { listenToNonDelegatedEvent('scroll', domElement); } } diff --git a/packages/react-dom/src/client/ReactDOMEventHandle.js b/packages/react-dom/src/client/ReactDOMEventHandle.js index ed227252e153..69a2eb4851f1 100644 --- a/packages/react-dom/src/client/ReactDOMEventHandle.js +++ b/packages/react-dom/src/client/ReactDOMEventHandle.js @@ -16,23 +16,19 @@ import type { import {allNativeEvents} from '../events/EventRegistry'; import { - getClosestInstanceFromNode, getEventHandlerListeners, setEventHandlerListeners, - getFiberFromScopeInstance, doesTargetHaveEventHandle, addEventHandleToTarget, } from './ReactDOMComponentTree'; -import {ELEMENT_NODE, COMMENT_NODE} from '../shared/HTMLNodeType'; +import {ELEMENT_NODE} from '../shared/HTMLNodeType'; import {listenToNativeEvent} from '../events/DOMPluginEventSystem'; -import {HostRoot, HostPortal} from 'react-reconciler/src/ReactWorkTags'; import {IS_EVENT_HANDLE_NON_MANAGED_NODE} from '../events/EventSystemFlags'; import { enableScopeAPI, enableCreateEventHandleAPI, - enableEagerRootListeners, } from 'shared/ReactFeatureFlags'; import invariant from 'shared/invariant'; @@ -40,19 +36,6 @@ type EventHandleOptions = {| capture?: boolean, |}; -function getNearestRootOrPortalContainer(node: Fiber): null | Element { - while (node !== null) { - const tag = node.tag; - // Once we encounter a host container or root container - // we can return their DOM instance. - if (tag === HostRoot || tag === HostPortal) { - return node.stateNode.containerInfo; - } - node = node.return; - } - return null; -} - function isValidEventTarget(target: EventTarget | ReactScopeInstance): boolean { return typeof (target: Object).addEventListener === 'function'; } @@ -73,79 +56,15 @@ function createEventHandleListener( }; } -function registerEventOnNearestTargetContainer( - targetFiber: Fiber, - domEventName: DOMEventName, - isCapturePhaseListener: boolean, - targetElement: Element | null, -): void { - if (!enableEagerRootListeners) { - // If it is, find the nearest root or portal and make it - // our event handle target container. - let targetContainer = getNearestRootOrPortalContainer(targetFiber); - if (targetContainer === null) { - if (__DEV__) { - console.error( - 'ReactDOM.createEventHandle: setListener called on an target ' + - 'that did not have a corresponding root. This is likely a bug in React.', - ); - } - return; - } - if (targetContainer.nodeType === COMMENT_NODE) { - targetContainer = ((targetContainer.parentNode: any): Element); - } - listenToNativeEvent( - domEventName, - isCapturePhaseListener, - targetContainer, - targetElement, - ); - } -} - function registerReactDOMEvent( target: EventTarget | ReactScopeInstance, domEventName: DOMEventName, isCapturePhaseListener: boolean, ): void { - // Check if the target is a DOM element. if ((target: any).nodeType === ELEMENT_NODE) { - if (!enableEagerRootListeners) { - const targetElement = ((target: any): Element); - // Check if the DOM element is managed by React. - const targetFiber = getClosestInstanceFromNode(targetElement); - if (targetFiber === null) { - if (__DEV__) { - console.error( - 'ReactDOM.createEventHandle: setListener called on an element ' + - 'target that is not managed by React. Ensure React rendered the DOM element.', - ); - } - return; - } - registerEventOnNearestTargetContainer( - targetFiber, - domEventName, - isCapturePhaseListener, - targetElement, - ); - } + // Do nothing. We already attached all root listeners. } else if (enableScopeAPI && isReactScope(target)) { - if (!enableEagerRootListeners) { - const scopeTarget = ((target: any): ReactScopeInstance); - const targetFiber = getFiberFromScopeInstance(scopeTarget); - if (targetFiber === null) { - // Scope is unmounted, do not proceed. - return; - } - registerEventOnNearestTargetContainer( - targetFiber, - domEventName, - isCapturePhaseListener, - null, - ); - } + // Do nothing. We already attached all root listeners. } else if (isValidEventTarget(target)) { const eventTarget = ((target: any): EventTarget); // These are valid event targets, but they are also diff --git a/packages/react-dom/src/client/ReactDOMHostConfig.js b/packages/react-dom/src/client/ReactDOMHostConfig.js index e5ce50add75a..63fdb08a3ae8 100644 --- a/packages/react-dom/src/client/ReactDOMHostConfig.js +++ b/packages/react-dom/src/client/ReactDOMHostConfig.js @@ -67,13 +67,9 @@ import { enableFundamentalAPI, enableCreateEventHandleAPI, enableScopeAPI, - enableEagerRootListeners, } from 'shared/ReactFeatureFlags'; import {HostComponent, HostText} from 'react-reconciler/src/ReactWorkTags'; -import { - listenToReactEvent, - listenToAllSupportedEvents, -} from '../events/DOMPluginEventSystem'; +import {listenToAllSupportedEvents} from '../events/DOMPluginEventSystem'; export type Type = string; export type Props = { @@ -1073,11 +1069,7 @@ export function makeOpaqueHydratingObject( } export function preparePortalMount(portalInstance: Instance): void { - if (enableEagerRootListeners) { - listenToAllSupportedEvents(portalInstance); - } else { - listenToReactEvent('onMouseEnter', portalInstance, null); - } + listenToAllSupportedEvents(portalInstance); } export function prepareScopeUpdate( diff --git a/packages/react-dom/src/client/ReactDOMRoot.js b/packages/react-dom/src/client/ReactDOMRoot.js index 11ec850a4ab2..66a31328540e 100644 --- a/packages/react-dom/src/client/ReactDOMRoot.js +++ b/packages/react-dom/src/client/ReactDOMRoot.js @@ -36,14 +36,12 @@ import { unmarkContainerAsRoot, } from './ReactDOMComponentTree'; import {listenToAllSupportedEvents} from '../events/DOMPluginEventSystem'; -import {eagerlyTrapReplayableEvents} from '../events/ReactDOMEventReplaying'; import { ELEMENT_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE, } from '../shared/HTMLNodeType'; -import {ensureListeningTo} from './ReactDOMComponent'; import { createContainer, @@ -52,7 +50,6 @@ import { registerMutableSourceForHydration, } from 'react-reconciler/src/ReactFiberReconciler'; import invariant from 'shared/invariant'; -import {enableEagerRootListeners} from 'shared/ReactFeatureFlags'; import { BlockingRoot, ConcurrentRoot, @@ -133,30 +130,10 @@ function createRootImpl( null; const root = createContainer(container, tag, hydrate, hydrationCallbacks); markContainerAsRoot(root.current, container); - const containerNodeType = container.nodeType; - - if (enableEagerRootListeners) { - const rootContainerElement = - container.nodeType === COMMENT_NODE ? container.parentNode : container; - listenToAllSupportedEvents(rootContainerElement); - } else { - if (hydrate && tag !== LegacyRoot) { - const doc = - containerNodeType === DOCUMENT_NODE - ? container - : container.ownerDocument; - // We need to cast this because Flow doesn't work - // with the hoisted containerNodeType. If we inline - // it, then Flow doesn't complain. We intentionally - // hoist it to reduce code-size. - eagerlyTrapReplayableEvents(container, ((doc: any): Document)); - } else if ( - containerNodeType !== DOCUMENT_FRAGMENT_NODE && - containerNodeType !== DOCUMENT_NODE - ) { - ensureListeningTo(container, 'onMouseEnter', null); - } - } + + const rootContainerElement = + container.nodeType === COMMENT_NODE ? container.parentNode : container; + listenToAllSupportedEvents(rootContainerElement); if (mutableSources) { for (let i = 0; i < mutableSources.length; i++) { diff --git a/packages/react-dom/src/events/DOMPluginEventSystem.js b/packages/react-dom/src/events/DOMPluginEventSystem.js index 0b374b6e91d2..74b95dea3d4e 100644 --- a/packages/react-dom/src/events/DOMPluginEventSystem.js +++ b/packages/react-dom/src/events/DOMPluginEventSystem.js @@ -21,7 +21,7 @@ import type { } from './ReactSyntheticEventType'; import type {Fiber} from 'react-reconciler/src/ReactInternalTypes'; -import {registrationNameDependencies, allNativeEvents} from './EventRegistry'; +import {allNativeEvents} from './EventRegistry'; import { IS_CAPTURE_PHASE, IS_EVENT_HANDLE_NON_MANAGED_NODE, @@ -51,7 +51,6 @@ import { enableLegacyFBSupport, enableCreateEventHandleAPI, enableScopeAPI, - enableEagerRootListeners, } from 'shared/ReactFeatureFlags'; import { invokeGuardedCallbackAndCatchFirstError, @@ -320,32 +319,30 @@ const listeningMarker = .slice(2); export function listenToAllSupportedEvents(rootContainerElement: EventTarget) { - if (enableEagerRootListeners) { - if ((rootContainerElement: any)[listeningMarker]) { - // Performance optimization: don't iterate through events - // for the same portal container or root node more than once. - // TODO: once we remove the flag, we may be able to also - // remove some of the bookkeeping maps used for laziness. - return; - } - (rootContainerElement: any)[listeningMarker] = true; - allNativeEvents.forEach(domEventName => { - if (!nonDelegatedEvents.has(domEventName)) { - listenToNativeEvent( - domEventName, - false, - ((rootContainerElement: any): Element), - null, - ); - } + if ((rootContainerElement: any)[listeningMarker]) { + // Performance optimization: don't iterate through events + // for the same portal container or root node more than once. + // TODO: once we remove the flag, we may be able to also + // remove some of the bookkeeping maps used for laziness. + return; + } + (rootContainerElement: any)[listeningMarker] = true; + allNativeEvents.forEach(domEventName => { + if (!nonDelegatedEvents.has(domEventName)) { listenToNativeEvent( domEventName, - true, + false, ((rootContainerElement: any): Element), null, ); - }); - } + } + listenToNativeEvent( + domEventName, + true, + ((rootContainerElement: any): Element), + null, + ); + }); } export function listenToNativeEvent( @@ -411,60 +408,6 @@ export function listenToNativeEvent( } } -export function listenToReactEvent( - reactEvent: string, - rootContainerElement: Element, - targetElement: Element | null, -): void { - if (!enableEagerRootListeners) { - const dependencies = registrationNameDependencies[reactEvent]; - const dependenciesLength = dependencies.length; - // If the dependencies length is 1, that means we're not using a polyfill - // plugin like ChangeEventPlugin, BeforeInputPlugin, EnterLeavePlugin - // and SelectEventPlugin. We always use the native bubble event phase for - // these plugins and emulate two phase event dispatching. SimpleEventPlugin - // always only has a single dependency and SimpleEventPlugin events also - // use either the native capture event phase or bubble event phase, there - // is no emulation (except for focus/blur, but that will be removed soon). - const isPolyfillEventPlugin = dependenciesLength !== 1; - - if (isPolyfillEventPlugin) { - const listenerSet = getEventListenerSet(rootContainerElement); - // When eager listeners are off, this Set has a dual purpose: it both - // captures which native listeners we registered (e.g. "click__bubble") - // and *React* lazy listeners (e.g. "onClick") so we don't do extra checks. - // This second usage does not exist in the eager mode. - if (!listenerSet.has(reactEvent)) { - listenerSet.add(reactEvent); - for (let i = 0; i < dependenciesLength; i++) { - listenToNativeEvent( - dependencies[i], - false, - rootContainerElement, - targetElement, - ); - } - } - } else { - const isCapturePhaseListener = - reactEvent.substr(-7) === 'Capture' && - // Edge case: onGotPointerCapture and onLostPointerCapture - // end with "Capture" but that's part of their event names. - // The Capture versions would end with CaptureCapture. - // So we have to check against that. - // This check works because none of the events we support - // end with "Pointer". - reactEvent.substr(-14, 7) !== 'Pointer'; - listenToNativeEvent( - dependencies[0], - isCapturePhaseListener, - rootContainerElement, - targetElement, - ); - } - } -} - function addTrappedEventListener( targetContainer: EventTarget, domEventName: DOMEventName, diff --git a/packages/react-dom/src/events/ReactDOMEventListener.js b/packages/react-dom/src/events/ReactDOMEventListener.js index 3aacb54873d2..d5f13d3b0ad9 100644 --- a/packages/react-dom/src/events/ReactDOMEventListener.js +++ b/packages/react-dom/src/events/ReactDOMEventListener.js @@ -40,7 +40,6 @@ import {getClosestInstanceFromNode} from '../client/ReactDOMComponentTree'; import { enableLegacyFBSupport, - enableEagerRootListeners, decoupleUpdatePriorityFromScheduler, } from 'shared/ReactFeatureFlags'; import { @@ -188,16 +187,14 @@ export function dispatchEvent( if (!_enabled) { return; } - let allowReplay = true; - if (enableEagerRootListeners) { - // TODO: replaying capture phase events is currently broken - // because we used to do it during top-level native bubble handlers - // but now we use different bubble and capture handlers. - // In eager mode, we attach capture listeners early, so we need - // to filter them out until we fix the logic to handle them correctly. - // This could've been outside the flag but I put it inside to reduce risk. - allowReplay = (eventSystemFlags & IS_CAPTURE_PHASE) === 0; - } + + // TODO: replaying capture phase events is currently broken + // because we used to do it during top-level native bubble handlers + // but now we use different bubble and capture handlers. + // In eager mode, we attach capture listeners early, so we need + // to filter them out until we fix the logic to handle them correctly. + const allowReplay = (eventSystemFlags & IS_CAPTURE_PHASE) === 0; + if ( allowReplay && hasQueuedDiscreteEvents() && diff --git a/packages/react-dom/src/events/ReactDOMEventReplaying.js b/packages/react-dom/src/events/ReactDOMEventReplaying.js index 8b8d08f5e06a..2fbe0e1b0b61 100644 --- a/packages/react-dom/src/events/ReactDOMEventReplaying.js +++ b/packages/react-dom/src/events/ReactDOMEventReplaying.js @@ -14,10 +14,7 @@ import type {EventSystemFlags} from './EventSystemFlags'; import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes'; import type {LanePriority} from 'react-reconciler/src/ReactFiberLane'; -import { - enableSelectiveHydration, - enableEagerRootListeners, -} from 'shared/ReactFeatureFlags'; +import {enableSelectiveHydration} from 'shared/ReactFeatureFlags'; import { unstable_runWithPriority as runWithPriority, unstable_scheduleCallback as scheduleCallback, @@ -85,7 +82,6 @@ type PointerEvent = Event & { }; import {IS_REPLAYED} from './EventSystemFlags'; -import {listenToNativeEvent} from './DOMPluginEventSystem'; type QueuedReplayableEvent = {| blockedOn: null | Container | SuspenseInstance, @@ -159,50 +155,10 @@ const discreteReplayableEvents: Array = [ 'submit', ]; -const continuousReplayableEvents: Array = [ - 'dragenter', - 'dragleave', - 'focusin', - 'focusout', - 'mouseover', - 'mouseout', - 'pointerover', - 'pointerout', - 'gotpointercapture', - 'lostpointercapture', -]; - export function isReplayableDiscreteEvent(eventType: DOMEventName): boolean { return discreteReplayableEvents.indexOf(eventType) > -1; } -function trapReplayableEventForContainer( - domEventName: DOMEventName, - container: Container, -) { - // When the flag is on, we do this in a unified codepath elsewhere. - if (!enableEagerRootListeners) { - listenToNativeEvent(domEventName, false, ((container: any): Element), null); - } -} - -export function eagerlyTrapReplayableEvents( - container: Container, - document: Document, -) { - // When the flag is on, we do this in a unified codepath elsewhere. - if (!enableEagerRootListeners) { - // Discrete - discreteReplayableEvents.forEach(domEventName => { - trapReplayableEventForContainer(domEventName, container); - }); - // Continuous - continuousReplayableEvents.forEach(domEventName => { - trapReplayableEventForContainer(domEventName, container); - }); - } -} - function createQueuedReplayableEvent( blockedOn: null | Container | SuspenseInstance, domEventName: DOMEventName, diff --git a/packages/react-dom/src/events/__tests__/DOMPluginEventSystem-test.internal.js b/packages/react-dom/src/events/__tests__/DOMPluginEventSystem-test.internal.js index a2517cba8345..6a3662962a74 100644 --- a/packages/react-dom/src/events/__tests__/DOMPluginEventSystem-test.internal.js +++ b/packages/react-dom/src/events/__tests__/DOMPluginEventSystem-test.internal.js @@ -2643,7 +2643,7 @@ describe('DOMPluginEventSystem', () => { expect(log[5]).toEqual(['bubble', buttonElement]); }); - // @gate experimental && enableEagerRootListeners + // @gate experimental it('propagates known createEventHandle events through portals without inner listeners', () => { const buttonRef = React.createRef(); const divRef = React.createRef(); diff --git a/packages/react-dom/src/events/plugins/SelectEventPlugin.js b/packages/react-dom/src/events/plugins/SelectEventPlugin.js index e1989b773b56..befa735be878 100644 --- a/packages/react-dom/src/events/plugins/SelectEventPlugin.js +++ b/packages/react-dom/src/events/plugins/SelectEventPlugin.js @@ -16,14 +16,10 @@ import {canUseDOM} from 'shared/ExecutionEnvironment'; import {SyntheticEvent} from '../../events/SyntheticEvent'; import isTextInputElement from '../isTextInputElement'; import shallowEqual from 'shared/shallowEqual'; -import {enableEagerRootListeners} from 'shared/ReactFeatureFlags'; import {registerTwoPhaseEvent} from '../EventRegistry'; import getActiveElement from '../../client/getActiveElement'; -import { - getNodeFromInstance, - getEventListenerSet, -} from '../../client/ReactDOMComponentTree'; +import {getNodeFromInstance} from '../../client/ReactDOMComponentTree'; import {hasSelectionCapabilities} from '../../client/ReactInputSelection'; import {DOCUMENT_NODE} from '../../shared/HTMLNodeType'; import {accumulateTwoPhaseListeners} from '../DOMPluginEventSystem'; @@ -154,23 +150,6 @@ function extractEvents( eventSystemFlags: EventSystemFlags, targetContainer: EventTarget, ) { - if (!enableEagerRootListeners) { - const eventListenerSet = getEventListenerSet(targetContainer); - // Track whether all listeners exists for this plugin. If none exist, we do - // not extract events. See #3639. - if ( - // If we are handling selectionchange, then we don't need to - // check for the other dependencies, as selectionchange is only - // event attached from the onChange plugin and we don't expose an - // onSelectionChange event from React. - domEventName !== 'selectionchange' && - !eventListenerSet.has('onSelect') && - !eventListenerSet.has('onSelectCapture') - ) { - return; - } - } - const targetNode = targetInst ? getNodeFromInstance(targetInst) : window; switch (domEventName) { diff --git a/packages/react-dom/src/events/plugins/__tests__/SimpleEventPlugin-test.js b/packages/react-dom/src/events/plugins/__tests__/SimpleEventPlugin-test.js index a01bb938883c..92ee2e369315 100644 --- a/packages/react-dom/src/events/plugins/__tests__/SimpleEventPlugin-test.js +++ b/packages/react-dom/src/events/plugins/__tests__/SimpleEventPlugin-test.js @@ -516,36 +516,16 @@ describe('SimpleEventPlugin', function() { return nativeAddEventListener.apply(this, arguments); }; - ReactDOM.render( -
{}} - onTouchMove={() => {}} - onWheel={() => {}} - // A few events that should be unaffected: - onClick={() => {}} - onScroll={() => {}} - onTouchEnd={() => {}} - onChange={() => {}} - onPointerDown={() => {}} - onPointerMove={() => {}} - />, - container, - ); - - if (gate(flags => flags.enableEagerRootListeners)) { - expect(passiveEvents).toEqual([ - 'touchstart', - 'touchstart', - 'touchmove', - 'touchmove', - 'wheel', - 'wheel', - ]); - } else { - expect(passiveEvents).toEqual(['touchstart', 'touchmove', 'wheel']); - } + ReactDOM.render(
, container); + + expect(passiveEvents).toEqual([ + 'touchstart', + 'touchstart', + 'touchmove', + 'touchmove', + 'wheel', + 'wheel', + ]); }); }); }); diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js index 1302c0f6ff7f..836b78524ef9 100644 --- a/packages/shared/ReactFeatureFlags.js +++ b/packages/shared/ReactFeatureFlags.js @@ -133,6 +133,4 @@ export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; -export const enableEagerRootListeners = true; - export const enableDoubleInvokingEffects = false; diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb.js b/packages/shared/forks/ReactFeatureFlags.native-fb.js index bd4a939be432..82e8d4dcd7ba 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-fb.js +++ b/packages/shared/forks/ReactFeatureFlags.native-fb.js @@ -49,7 +49,6 @@ export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = true; export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; -export const enableEagerRootListeners = true; export const enableDoubleInvokingEffects = false; diff --git a/packages/shared/forks/ReactFeatureFlags.native-oss.js b/packages/shared/forks/ReactFeatureFlags.native-oss.js index 7a120940842d..7a793d16ab33 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-oss.js +++ b/packages/shared/forks/ReactFeatureFlags.native-oss.js @@ -48,7 +48,6 @@ export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = true; export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; -export const enableEagerRootListeners = true; export const enableDoubleInvokingEffects = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.js index 6804c1923bf8..4402523c5410 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.js @@ -48,7 +48,6 @@ export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = true; export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; -export const enableEagerRootListeners = true; export const enableDoubleInvokingEffects = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js index f4ccc11a08cf..a71ad45dbd46 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js @@ -48,7 +48,6 @@ export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = true; export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; -export const enableEagerRootListeners = true; export const enableDoubleInvokingEffects = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js index b4b7a56097c7..c60072346eab 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js @@ -48,7 +48,6 @@ export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = true; export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; -export const enableEagerRootListeners = true; export const enableDoubleInvokingEffects = false; diff --git a/packages/shared/forks/ReactFeatureFlags.testing.js b/packages/shared/forks/ReactFeatureFlags.testing.js index f28ad3567e0e..90c1fa268b25 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.js @@ -48,7 +48,6 @@ export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = true; export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; -export const enableEagerRootListeners = true; export const enableDoubleInvokingEffects = false; diff --git a/packages/shared/forks/ReactFeatureFlags.testing.www.js b/packages/shared/forks/ReactFeatureFlags.testing.www.js index a962b280a23a..717199df1d53 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.www.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.www.js @@ -48,7 +48,6 @@ export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = true; export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = true; -export const enableEagerRootListeners = true; export const enableDoubleInvokingEffects = false; diff --git a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js index 881a0e61010d..103e8adc5c72 100644 --- a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js +++ b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js @@ -19,7 +19,6 @@ export const enableFilterEmptyStringAttributesDOM = __VARIANT__; export const enableLegacyFBSupport = __VARIANT__; export const decoupleUpdatePriorityFromScheduler = __VARIANT__; export const skipUnmountedBoundaries = __VARIANT__; -export const enableEagerRootListeners = !__VARIANT__; // Enable this flag to help with concurrent mode debugging. // It logs information to the console about React scheduling, rendering, and commit phases. diff --git a/packages/shared/forks/ReactFeatureFlags.www.js b/packages/shared/forks/ReactFeatureFlags.www.js index ea9610713d05..58d6987495f9 100644 --- a/packages/shared/forks/ReactFeatureFlags.www.js +++ b/packages/shared/forks/ReactFeatureFlags.www.js @@ -27,7 +27,6 @@ export const { decoupleUpdatePriorityFromScheduler, enableDebugTracing, skipUnmountedBoundaries, - enableEagerRootListeners, enableDoubleInvokingEffects, } = dynamicFeatureFlags; From 0a4c7c565146222a2b701455ba2d66540063b98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Markb=C3=A5ge?= Date: Thu, 8 Oct 2020 20:02:23 -0400 Subject: [PATCH 0004/1603] [Flight] Don't warn for key, but error for ref (#19986) * Improve error message by expanding the object in question * Don't warn for key/ref getters * Error if refs are passed in server components or to client components --- .../src/__tests__/ReactFlight-test.js | 16 +++++ .../react-server/src/ReactFlightServer.js | 62 ++++++++++++++++--- scripts/error-codes/codes.json | 5 +- 3 files changed, 71 insertions(+), 12 deletions(-) diff --git a/packages/react-client/src/__tests__/ReactFlight-test.js b/packages/react-client/src/__tests__/ReactFlight-test.js index e08e61748cd4..865686b7e077 100644 --- a/packages/react-client/src/__tests__/ReactFlight-test.js +++ b/packages/react-client/src/__tests__/ReactFlight-test.js @@ -165,9 +165,15 @@ describe('ReactFlight', () => { return
; } + const ref = React.createRef(); + function RefProp() { + return
; + } + const event = ReactNoopFlightServer.render(); const fn = ReactNoopFlightServer.render(); const symbol = ReactNoopFlightServer.render(); + const refs = ReactNoopFlightServer.render(); function Client({transport}) { return ReactNoopFlightClient.read(transport); @@ -185,6 +191,9 @@ describe('ReactFlight', () => { + + + , ); }); @@ -217,6 +226,13 @@ describe('ReactFlight', () => { ); }); + it('should NOT warn in DEV for key getters', () => { + const transport = ReactNoopFlightServer.render(
); + act(() => { + ReactNoop.render(ReactNoopFlightClient.read(transport)); + }); + }); + it('should warn in DEV if an object with symbols is passed to a host component', () => { expect(() => { const transport = ReactNoopFlightServer.render( diff --git a/packages/react-server/src/ReactFlightServer.js b/packages/react-server/src/ReactFlightServer.js index d934ce5f7fbf..eccc17c2a193 100644 --- a/packages/react-server/src/ReactFlightServer.js +++ b/packages/react-server/src/ReactFlightServer.js @@ -119,6 +119,15 @@ export function createRequest( function attemptResolveElement(element: React$Element): ReactModel { const type = element.type; const props = element.props; + if (element.ref !== null && element.ref !== undefined) { + // When the ref moves to the regular props object this will implicitly + // throw for functions. We could probably relax it to a DEV warning for other + // cases. + invariant( + false, + 'Refs cannot be used in server components, nor passed to client components.', + ); + } if (typeof type === 'function') { // This is a server-side component. return type(props); @@ -153,7 +162,11 @@ function attemptResolveElement(element: React$Element): ReactModel { } } } - invariant(false, 'Unsupported type.'); + invariant( + false, + 'Unsupported server component type: %s', + describeValueForErrorMessage(type), + ); } function pingSegment(request: Request, segment: Segment): void { @@ -218,7 +231,19 @@ function isSimpleObject(object): boolean { const names = Object.getOwnPropertyNames(object); for (let i = 0; i < names.length; i++) { const descriptor = Object.getOwnPropertyDescriptor(object, names[i]); - if (!descriptor || !descriptor.enumerable) { + if (!descriptor) { + return false; + } + if (!descriptor.enumerable) { + if ( + (names[i] === 'key' || names[i] === 'ref') && + typeof descriptor.get === 'function' + ) { + // React adds key and ref getters to props objects to issue warnings. + // Those getters will not be transferred to the client, but that's ok, + // so we'll special case them. + continue; + } return false; } } @@ -249,7 +274,7 @@ function describeValueForErrorMessage(value: ReactModel): string { return '[...]'; } const name = objectName(value); - if (name === '[object Object]') { + if (name === 'Object') { return '{...}'; } return name; @@ -266,6 +291,7 @@ function describeObjectForErrorMessage( objectOrArray: | {+[key: string | number]: ReactModel} | $ReadOnlyArray, + expandedName?: string, ): string { if (isArray(objectOrArray)) { let str = '['; @@ -279,7 +305,16 @@ function describeObjectForErrorMessage( str += '...'; break; } - str += describeValueForErrorMessage(array[i]); + const value = array[i]; + if ( + '' + i === expandedName && + typeof value === 'object' && + value !== null + ) { + str += describeObjectForErrorMessage(value); + } else { + str += describeValueForErrorMessage(value); + } } str += ']'; return str; @@ -297,10 +332,17 @@ function describeObjectForErrorMessage( break; } const name = names[i]; - str += - describeKeyForErrorMessage(name) + - ': ' + - describeValueForErrorMessage(object[name]); + str += describeKeyForErrorMessage(name) + ': '; + const value = object[name]; + if ( + name === expandedName && + typeof value === 'object' && + value !== null + ) { + str += describeObjectForErrorMessage(value); + } else { + str += describeValueForErrorMessage(value); + } } str += '}'; return str; @@ -444,7 +486,7 @@ export function resolveModelToJSON( 'Classes or other objects with methods are not supported. ' + 'Remove %s from these props: %s', describeKeyForErrorMessage(key), - describeObjectForErrorMessage(parent), + describeObjectForErrorMessage(parent, key), ); } else if (Object.getOwnPropertySymbols) { const symbols = Object.getOwnPropertySymbols(value); @@ -455,7 +497,7 @@ export function resolveModelToJSON( 'Remove %s from these props: %s', symbols[0].description, describeKeyForErrorMessage(key), - describeObjectForErrorMessage(parent), + describeObjectForErrorMessage(parent, key), ); } } diff --git a/scripts/error-codes/codes.json b/scripts/error-codes/codes.json index 369c97c32a2c..6eb8441d1fff 100644 --- a/scripts/error-codes/codes.json +++ b/scripts/error-codes/codes.json @@ -340,7 +340,7 @@ "348": "ensureListeningTo(): received a container that was not an element node. This is likely a bug in React.", "349": "Expected a work-in-progress root. This is a bug in React. Please file an issue.", "350": "Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.", - "351": "Unsupported type.", + "351": "Unsupported server component type: %s", "352": "React Blocks (and Lazy Components) are expected to be replaced by a compiler on the server. Try configuring your compiler set up and avoid using React.lazy inside of Blocks.", "353": "A server block should never encode any other slots. This is a bug in React.", "354": "getInspectorDataForViewAtPoint() is not available in production.", @@ -366,5 +366,6 @@ "375": "Functions cannot be passed directly to client components because they're not serializable. Remove %s (%s) from this object, or avoid the entire object: %s", "376": "Symbol values (%s) cannot be passed to client components. Remove %s from this object, or avoid the entire object: %s", "377": "BigInt (%s) is not yet supported in client component props. Remove %s from this object or use a plain number instead: %s", - "378": "Type %s is not supported in client component props. Remove %s from this object, or avoid the entire object: %s" + "378": "Type %s is not supported in client component props. Remove %s from this object, or avoid the entire object: %s", + "379": "Refs cannot be used in server components, nor passed to client components." } From f46a80ae11ce606e5dc148f9399bef7c60a755a2 Mon Sep 17 00:00:00 2001 From: Saikat Guha Date: Fri, 9 Oct 2020 07:26:30 +0530 Subject: [PATCH 0005/1603] Update outdated links and fix two broken links (#19985) * update all facebook.github.io links * facebookincubator links : update some outdated links and fix two other broken links where they are actually the latest updated ones --- CHANGELOG.md | 2 +- fixtures/attribute-behavior/README.md | 4 ++-- fixtures/flight/config/jest/cssTransform.js | 2 +- fixtures/flight/config/jest/fileTransform.js | 2 +- .../src/__tests__/ReactDevToolsHooksIntegration-test.js | 2 +- .../src/__tests__/ReactHooksInspectionIntegration-test.js | 2 +- packages/react-devtools-extensions/popups/deadcode.html | 2 +- packages/react-devtools-extensions/popups/development.html | 2 +- packages/react-devtools-extensions/popups/outdated.html | 2 +- packages/react-devtools-extensions/popups/unminified.html | 2 +- packages/react-devtools/README.md | 2 +- packages/react-test-renderer/README.md | 2 +- packages/shared/invokeGuardedCallbackImpl.js | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a3c50fa6f83..7882adf318b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1218,7 +1218,7 @@ Each of these changes will continue to work as before with a new warning until t - Shallow renderer now returns the rendered output from `render()`. ([@simonewebdesign](https://github.com/simonewebdesign) in [#5411](https://github.com/facebook/react/pull/5411)) - React no longer depends on ES5 *shams* for `Object.create` and `Object.freeze` in older environments. It still, however, requires ES5 *shims* in those environments. ([@dgreensp](https://github.com/dgreensp) in [#4959](https://github.com/facebook/react/pull/4959)) - React DOM now allows `data-` attributes with names that start with numbers. ([@nLight](https://github.com/nLight) in [#5216](https://github.com/facebook/react/pull/5216)) -- React DOM adds a new `suppressContentEditableWarning` prop for components like [Draft.js](https://facebook.github.io/draft-js/) that intentionally manage `contentEditable` children with React. ([@mxstbr](https://github.com/mxstbr) in [#6112](https://github.com/facebook/react/pull/6112)) +- React DOM adds a new `suppressContentEditableWarning` prop for components like [Draft.js](https://draftjs.org/) that intentionally manage `contentEditable` children with React. ([@mxstbr](https://github.com/mxstbr) in [#6112](https://github.com/facebook/react/pull/6112)) - React improves the performance for `createClass()` on complex specs. ([@sophiebits](https://github.com/sophiebits) in [#5550](https://github.com/facebook/react/pull/5550)) diff --git a/fixtures/attribute-behavior/README.md b/fixtures/attribute-behavior/README.md index d14c5e55cdbd..fbf2acfb5230 100644 --- a/fixtures/attribute-behavior/README.md +++ b/fixtures/attribute-behavior/README.md @@ -26,6 +26,6 @@ Right now, we use a purple outline to call out cases where the assigned property --- -This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app). +This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). -You can find the guide for how to do things in a CRA [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md). +You can find the guide for how to do things in a CRA [here](https://github.com/facebook/create-react-app/blob/master/packages/cra-template/template/README.md). diff --git a/fixtures/flight/config/jest/cssTransform.js b/fixtures/flight/config/jest/cssTransform.js index 8f65114812a4..35fe644d7e03 100644 --- a/fixtures/flight/config/jest/cssTransform.js +++ b/fixtures/flight/config/jest/cssTransform.js @@ -1,7 +1,7 @@ 'use strict'; // This is a custom Jest transformer turning style imports into empty objects. -// http://facebook.github.io/jest/docs/en/webpack.html +// https://jestjs.io/docs/en/webpack.html module.exports = { process() { diff --git a/fixtures/flight/config/jest/fileTransform.js b/fixtures/flight/config/jest/fileTransform.js index aab67618c38b..3ce5e04c6e43 100644 --- a/fixtures/flight/config/jest/fileTransform.js +++ b/fixtures/flight/config/jest/fileTransform.js @@ -4,7 +4,7 @@ const path = require('path'); const camelcase = require('camelcase'); // This is a custom Jest transformer turning file imports into filenames. -// http://facebook.github.io/jest/docs/en/webpack.html +// https://jestjs.io/docs/en/webpack.html module.exports = { process(src, filename) { diff --git a/packages/react-debug-tools/src/__tests__/ReactDevToolsHooksIntegration-test.js b/packages/react-debug-tools/src/__tests__/ReactDevToolsHooksIntegration-test.js index 71587ef89d25..6f9cf52787e1 100644 --- a/packages/react-debug-tools/src/__tests__/ReactDevToolsHooksIntegration-test.js +++ b/packages/react-debug-tools/src/__tests__/ReactDevToolsHooksIntegration-test.js @@ -133,7 +133,7 @@ describe('React hooks DevTools integration', () => { }); // This test case is based on an open source bug report: - // facebookincubator/redux-react-hook/issues/34#issuecomment-466693787 + // https://github.com/facebookincubator/redux-react-hook/issues/34#issuecomment-466693787 it('should handle interleaved stateful hooks (e.g. useState) and non-stateful hooks (e.g. useContext)', () => { const MyContext = React.createContext(1); diff --git a/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js b/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js index 4dfe0bac0b1f..29ce46b5545a 100644 --- a/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js +++ b/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js @@ -797,7 +797,7 @@ describe('ReactHooksInspectionIntegration', () => { }); // This test case is based on an open source bug report: - // facebookincubator/redux-react-hook/issues/34#issuecomment-466693787 + // https://github.com/facebookincubator/redux-react-hook/issues/34#issuecomment-466693787 it('should properly advance the current hook for useContext', () => { const MyContext = React.createContext(1); diff --git a/packages/react-devtools-extensions/popups/deadcode.html b/packages/react-devtools-extensions/popups/deadcode.html index cdd4c278e86c..4073f80bde20 100644 --- a/packages/react-devtools-extensions/popups/deadcode.html +++ b/packages/react-devtools-extensions/popups/deadcode.html @@ -24,7 +24,7 @@ This makes its size larger, and causes React to run slower.

- Make sure to set up dead code elimination before deployment. + Make sure to set up dead code elimination before deployment.


diff --git a/packages/react-devtools-extensions/popups/development.html b/packages/react-devtools-extensions/popups/development.html index 3d092a5eb69f..5d537ed37c67 100644 --- a/packages/react-devtools-extensions/popups/development.html +++ b/packages/react-devtools-extensions/popups/development.html @@ -20,7 +20,7 @@

Note that the development build is not suitable for production.
- Make sure to use the production build before deployment. + Make sure to use the production build before deployment.


diff --git a/packages/react-devtools-extensions/popups/outdated.html b/packages/react-devtools-extensions/popups/outdated.html index 8f3f3f950876..53484658b046 100644 --- a/packages/react-devtools-extensions/popups/outdated.html +++ b/packages/react-devtools-extensions/popups/outdated.html @@ -21,7 +21,7 @@ We recommend updating React to ensure that you receive important bugfixes and performance improvements.

- You can find the upgrade instructions on the React blog. + You can find the upgrade instructions on the React blog.


diff --git a/packages/react-devtools-extensions/popups/unminified.html b/packages/react-devtools-extensions/popups/unminified.html index c53885f5098c..b61fb78519b2 100644 --- a/packages/react-devtools-extensions/popups/unminified.html +++ b/packages/react-devtools-extensions/popups/unminified.html @@ -23,7 +23,7 @@ This makes its size larger, and causes React to run slower.

- Make sure to set up minification before deployment. + Make sure to set up minification before deployment.


diff --git a/packages/react-devtools/README.md b/packages/react-devtools/README.md index afb8749d5aca..2551416b970d 100644 --- a/packages/react-devtools/README.md +++ b/packages/react-devtools/README.md @@ -101,7 +101,7 @@ By default DevTools listen to port `8097` on `localhost`. If you need to customi Or you could develop with a local HTTP server [like `serve`](https://www.npmjs.com/package/serve). -**The React tab won't show up if the site doesn't use React**, or if React can't communicate with the devtools. When the page loads, the devtools sets a global named `__REACT_DEVTOOLS_GLOBAL_HOOK__`, then React communicates with that hook during initialization. You can test this on the [React website](http://facebook.github.io/react/) or by inspecting [Facebook](https://www.facebook.com/). +**The React tab won't show up if the site doesn't use React**, or if React can't communicate with the devtools. When the page loads, the devtools sets a global named `__REACT_DEVTOOLS_GLOBAL_HOOK__`, then React communicates with that hook during initialization. You can test this on the [React website](https://reactjs.org/) or by inspecting [Facebook](https://www.facebook.com/). **If your app is inside of CodePen**, make sure you are registered. Then press Fork (if it's not your pen), and then choose Change View > Debug. The Debug view is inspectable with DevTools because it doesn't use an iframe. diff --git a/packages/react-test-renderer/README.md b/packages/react-test-renderer/README.md index 5ce816cbc740..70e37778d3a3 100644 --- a/packages/react-test-renderer/README.md +++ b/packages/react-test-renderer/README.md @@ -23,4 +23,4 @@ console.log(renderer.toJSON()); // children: [ 'Facebook' ] } ``` -You can also use Jest's snapshot testing feature to automatically save a copy of the JSON tree to a file and check in your tests that it hasn't changed: https://facebook.github.io/jest/blog/2016/07/27/jest-14.html. +You can also use Jest's snapshot testing feature to automatically save a copy of the JSON tree to a file and check in your tests that it hasn't changed: https://jestjs.io/blog/2016/07/27/jest-14.html. diff --git a/packages/shared/invokeGuardedCallbackImpl.js b/packages/shared/invokeGuardedCallbackImpl.js index e7a1ba398a24..215a8ae91c51 100644 --- a/packages/shared/invokeGuardedCallbackImpl.js +++ b/packages/shared/invokeGuardedCallbackImpl.js @@ -81,7 +81,7 @@ if (__DEV__) { ) { // If document doesn't exist we know for sure we will crash in this method // when we call document.createEvent(). However this can cause confusing - // errors: https://github.com/facebookincubator/create-react-app/issues/3482 + // errors: https://github.com/facebook/create-react-app/issues/3482 // So we preemptively throw with a better message instead. invariant( typeof document !== 'undefined', From 48907797294340b6d5d8fecfbcf97edf0691888d Mon Sep 17 00:00:00 2001 From: IDrissAitHafid <31975500+IDrissAitHafid@users.noreply.github.com> Date: Fri, 9 Oct 2020 14:29:30 +0100 Subject: [PATCH 0006/1603] Updated OVERVIEW.md to the new infos required when adding a new leaf node to the tree (#19981) Co-authored-by: Idriss AITHAFID --- packages/react-devtools/OVERVIEW.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react-devtools/OVERVIEW.md b/packages/react-devtools/OVERVIEW.md index 19b54f0124af..a59a9fcc3bfd 100644 --- a/packages/react-devtools/OVERVIEW.md +++ b/packages/react-devtools/OVERVIEW.md @@ -70,7 +70,7 @@ For example, adding a root fiber with an id of 1: #### Adding a leaf node -Adding a leaf node takes a variable number of numbers since we need to decode the name (and potentially the key): +Adding a leaf node to the tree requires sending 7 numbers: 1. add operation constant (`1`) 1. fiber id @@ -88,7 +88,6 @@ For example, adding a function component `` with an id 2: 1, // ElementTypeClass 1, // parent id 0, // owner id - 3, // encoded display name size 1, // id of "Foo" displayName in the string table 0, // id of null key in the string table (always zero for null) ] From 7e405d458d6481fb1c04dfca6afab0651e6f67cd Mon Sep 17 00:00:00 2001 From: Nick Reiley Date: Mon, 12 Oct 2020 22:07:10 +0500 Subject: [PATCH 0007/1603] [DevTools] Add DevTools forked Feature flags (#18994) Also resolve an uncaught error in extension build (#18843). Co-authored-by: Brian Vaughn Co-authored-by: Brian Vaughn --- .eslintrc.js | 4 ++- .../react-devtools-core/webpack.backend.js | 10 ++++-- .../react-devtools-core/webpack.standalone.js | 10 ++++-- .../webpack.config.js | 8 +++-- .../react-devtools-inline/webpack.config.js | 8 +++-- packages/react-devtools-shared/buildUtils.js | 33 +++++++++++++++++++ .../config/DevToolsFeatureFlags.default.js | 16 +++++++++ .../config/DevToolsFeatureFlags.extension.js | 29 ++++++++++++++++ packages/react-devtools-shared/src/hook.js | 6 +++- .../react-devtools-shell/webpack.config.js | 8 +++-- scripts/flow/createFlowConfigs.js | 1 + scripts/flow/react-devtools.js | 3 +- scripts/jest/config.build-devtools.js | 3 ++ scripts/jest/setupEnvironment.js | 2 ++ scripts/jest/typescript/jest.d.ts | 2 ++ 15 files changed, 128 insertions(+), 15 deletions(-) create mode 100644 packages/react-devtools-shared/buildUtils.js create mode 100644 packages/react-devtools-shared/src/config/DevToolsFeatureFlags.default.js create mode 100644 packages/react-devtools-shared/src/config/DevToolsFeatureFlags.extension.js diff --git a/.eslintrc.js b/.eslintrc.js index 036df0925197..cb2d737a12f6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -201,9 +201,11 @@ module.exports = { spyOnDev: true, spyOnDevAndProd: true, spyOnProd: true, + __EXPERIMENTAL__: true, + __EXTENSION__: true, __PROFILE__: true, + __TEST__: true, __UMD__: true, - __EXPERIMENTAL__: true, __VARIANT__: true, gate: true, trustedTypes: true, diff --git a/packages/react-devtools-core/webpack.backend.js b/packages/react-devtools-core/webpack.backend.js index b0809234ff23..f111d7330c62 100644 --- a/packages/react-devtools-core/webpack.backend.js +++ b/packages/react-devtools-core/webpack.backend.js @@ -4,6 +4,7 @@ const { GITHUB_URL, getVersionString, } = require('react-devtools-extensions/utils'); +const {resolveFeatureFlags} = require('react-devtools-shared/buildUtils'); const NODE_ENV = process.env.NODE_ENV; if (!NODE_ENV) { @@ -39,17 +40,20 @@ module.exports = { resolve: { alias: { react: resolve(builtModulesDir, 'react'), - 'react-dom': resolve(builtModulesDir, 'react-dom'), 'react-debug-tools': resolve(builtModulesDir, 'react-debug-tools'), + 'react-devtools-feature-flags': resolveFeatureFlags('core/backend'), + 'react-dom': resolve(builtModulesDir, 'react-dom'), 'react-is': resolve(builtModulesDir, 'react-is'), scheduler: resolve(builtModulesDir, 'scheduler'), }, }, plugins: [ new DefinePlugin({ - __DEV__: true, - __PROFILE__: false, + __DEV__, __EXPERIMENTAL__: true, + __EXTENSION__: false, + __PROFILE__: false, + __TEST__: NODE_ENV === 'test', 'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`, 'process.env.GITHUB_URL': `"${GITHUB_URL}"`, }), diff --git a/packages/react-devtools-core/webpack.standalone.js b/packages/react-devtools-core/webpack.standalone.js index 4d00d0f2d3a6..64556ae65812 100644 --- a/packages/react-devtools-core/webpack.standalone.js +++ b/packages/react-devtools-core/webpack.standalone.js @@ -4,6 +4,7 @@ const { GITHUB_URL, getVersionString, } = require('react-devtools-extensions/utils'); +const {resolveFeatureFlags} = require('react-devtools-shared/buildUtils'); const NODE_ENV = process.env.NODE_ENV; if (!NODE_ENV) { @@ -33,8 +34,9 @@ module.exports = { resolve: { alias: { react: resolve(builtModulesDir, 'react'), - 'react-dom': resolve(builtModulesDir, 'react-dom'), 'react-debug-tools': resolve(builtModulesDir, 'react-debug-tools'), + 'react-devtools-feature-flags': resolveFeatureFlags('core/standalone'), + 'react-dom': resolve(builtModulesDir, 'react-dom'), 'react-is': resolve(builtModulesDir, 'react-is'), scheduler: resolve(builtModulesDir, 'scheduler'), }, @@ -47,9 +49,11 @@ module.exports = { }, plugins: [ new DefinePlugin({ - __DEV__: false, - __PROFILE__: false, + __DEV__, __EXPERIMENTAL__: true, + __EXTENSION__: false, + __PROFILE__: false, + __TEST__: NODE_ENV === 'test', 'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`, 'process.env.GITHUB_URL': `"${GITHUB_URL}"`, 'process.env.NODE_ENV': `"${NODE_ENV}"`, diff --git a/packages/react-devtools-extensions/webpack.config.js b/packages/react-devtools-extensions/webpack.config.js index e2720ec240a9..1a406ccdaf90 100644 --- a/packages/react-devtools-extensions/webpack.config.js +++ b/packages/react-devtools-extensions/webpack.config.js @@ -3,6 +3,7 @@ const {resolve} = require('path'); const {DefinePlugin} = require('webpack'); const {GITHUB_URL, getVersionString} = require('./utils'); +const {resolveFeatureFlags} = require('react-devtools-shared/buildUtils'); const NODE_ENV = process.env.NODE_ENV; if (!NODE_ENV) { @@ -39,6 +40,7 @@ module.exports = { alias: { react: resolve(builtModulesDir, 'react'), 'react-debug-tools': resolve(builtModulesDir, 'react-debug-tools'), + 'react-devtools-feature-flags': resolveFeatureFlags('extension'), 'react-dom': resolve(builtModulesDir, 'react-dom'), 'react-is': resolve(builtModulesDir, 'react-is'), scheduler: resolve(builtModulesDir, 'scheduler'), @@ -49,9 +51,11 @@ module.exports = { }, plugins: [ new DefinePlugin({ - __DEV__: false, - __PROFILE__: false, + __DEV__, __EXPERIMENTAL__: true, + __EXTENSION__: true, + __PROFILE__: false, + __TEST__: NODE_ENV === 'test', 'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`, 'process.env.GITHUB_URL': `"${GITHUB_URL}"`, 'process.env.NODE_ENV': `"${NODE_ENV}"`, diff --git a/packages/react-devtools-inline/webpack.config.js b/packages/react-devtools-inline/webpack.config.js index 85c7da82ea3e..af829455c6bd 100644 --- a/packages/react-devtools-inline/webpack.config.js +++ b/packages/react-devtools-inline/webpack.config.js @@ -4,6 +4,7 @@ const { GITHUB_URL, getVersionString, } = require('react-devtools-extensions/utils'); +const {resolveFeatureFlags} = require('react-devtools-shared/buildUtils'); const NODE_ENV = process.env.NODE_ENV; if (!NODE_ENV) { @@ -11,7 +12,7 @@ if (!NODE_ENV) { process.exit(1); } -const __DEV__ = true; // NODE_ENV === 'development'; +const __DEV__ = NODE_ENV === 'development'; const DEVTOOLS_VERSION = getVersionString(); @@ -32,6 +33,7 @@ module.exports = { react: 'react', // TODO: Once this package is published, remove the external // 'react-debug-tools': 'react-debug-tools', + 'react-devtools-feature-flags': resolveFeatureFlags('inline'), 'react-dom': 'react-dom', 'react-is': 'react-is', scheduler: 'scheduler', @@ -42,8 +44,10 @@ module.exports = { plugins: [ new DefinePlugin({ __DEV__, - __PROFILE__: false, __EXPERIMENTAL__: true, + __EXTENSION__: false, + __PROFILE__: false, + __TEST__: NODE_ENV === 'test', 'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`, 'process.env.GITHUB_URL': `"${GITHUB_URL}"`, 'process.env.NODE_ENV': `"${NODE_ENV}"`, diff --git a/packages/react-devtools-shared/buildUtils.js b/packages/react-devtools-shared/buildUtils.js new file mode 100644 index 000000000000..d5f48d63421b --- /dev/null +++ b/packages/react-devtools-shared/buildUtils.js @@ -0,0 +1,33 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +const {resolve} = require('path'); + +function resolveFeatureFlags(target) { + let flagsPath; + switch (target) { + case 'core/backend': + case 'core/standalone': + case 'inline': + case 'shell': + flagsPath = 'DevToolsFeatureFlags.default'; + break; + case 'extension': + flagsPath = 'DevToolsFeatureFlags.extension'; + break; + default: + console.error(`Invalid target "${target}"`); + process.exit(1); + } + + return resolve(__dirname, 'src/config/', flagsPath); +} + +module.exports = { + resolveFeatureFlags, +}; diff --git a/packages/react-devtools-shared/src/config/DevToolsFeatureFlags.default.js b/packages/react-devtools-shared/src/config/DevToolsFeatureFlags.default.js new file mode 100644 index 000000000000..9e2d09d6304f --- /dev/null +++ b/packages/react-devtools-shared/src/config/DevToolsFeatureFlags.default.js @@ -0,0 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + */ + +/************************************************************************ + * This file is forked between different DevTools implementations. + * It should never be imported directly! + * It should always be imported from "react-devtools-feature-flags". + ************************************************************************/ + +// TODO Add feature flags here... diff --git a/packages/react-devtools-shared/src/config/DevToolsFeatureFlags.extension.js b/packages/react-devtools-shared/src/config/DevToolsFeatureFlags.extension.js new file mode 100644 index 000000000000..a224621bb79b --- /dev/null +++ b/packages/react-devtools-shared/src/config/DevToolsFeatureFlags.extension.js @@ -0,0 +1,29 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + */ + +/************************************************************************ + * This file is forked between different DevTools implementations. + * It should never be imported directly! + * It should always be imported from "react-devtools-feature-flags". + ************************************************************************/ + +// TODO Add feature flags here... + +/************************************************************************ + * Do not edit the code below. + * It ensures this fork exports the same types as the default flags file. + ************************************************************************/ + +import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default'; +import typeof * as ExportsType from './DevToolsFeatureFlags.extension'; + +// eslint-disable-next-line no-unused-vars +type Check<_X, Y: _X, X: Y = _X> = null; +// eslint-disable-next-line no-unused-expressions +(null: Check); diff --git a/packages/react-devtools-shared/src/hook.js b/packages/react-devtools-shared/src/hook.js index f9f65df7fb9c..62234fdc4642 100644 --- a/packages/react-devtools-shared/src/hook.js +++ b/packages/react-devtools-shared/src/hook.js @@ -172,7 +172,11 @@ export function installHook(target: any): DevToolsHook | null { // In that case, we'll patch later (when the frontend attaches). // // Don't patch in test environments because we don't want to interfere with Jest's own console overrides. - if (process.env.NODE_ENV !== 'test') { + // + // Note that because this function is inlined, this conditional check must only use static booleans. + // Otherwise the extension will throw with an undefined error. + // (See comments in the try/catch below for more context on inlining.) + if (!__EXTENSION__ && !__TEST__) { try { const appendComponentStack = window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ !== false; diff --git a/packages/react-devtools-shell/webpack.config.js b/packages/react-devtools-shell/webpack.config.js index 500fed2fb12e..c61e8850295c 100644 --- a/packages/react-devtools-shell/webpack.config.js +++ b/packages/react-devtools-shell/webpack.config.js @@ -4,6 +4,7 @@ const { GITHUB_URL, getVersionString, } = require('react-devtools-extensions/utils'); +const {resolveFeatureFlags} = require('react-devtools-shared/buildUtils'); const NODE_ENV = process.env.NODE_ENV; if (!NODE_ENV) { @@ -33,8 +34,9 @@ const config = { resolve: { alias: { react: resolve(builtModulesDir, 'react'), - 'react-dom': resolve(builtModulesDir, 'react-dom'), 'react-debug-tools': resolve(builtModulesDir, 'react-debug-tools'), + 'react-devtools-feature-flags': resolveFeatureFlags('shell'), + 'react-dom': resolve(builtModulesDir, 'react-dom'), 'react-is': resolve(builtModulesDir, 'react-is'), scheduler: resolve(builtModulesDir, 'scheduler'), }, @@ -45,8 +47,10 @@ const config = { plugins: [ new DefinePlugin({ __DEV__, - __PROFILE__: false, __EXPERIMENTAL__: true, + __EXTENSION__: false, + __PROFILE__: false, + __TEST__: NODE_ENV === 'test', 'process.env.GITHUB_URL': `"${GITHUB_URL}"`, 'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`, }), diff --git a/scripts/flow/createFlowConfigs.js b/scripts/flow/createFlowConfigs.js index ff7bf1b9c6f8..62a54d11122a 100644 --- a/scripts/flow/createFlowConfigs.js +++ b/scripts/flow/createFlowConfigs.js @@ -53,6 +53,7 @@ module.name_mapper='ReactServerStreamConfig$$' -> 'forks/ReactServerStreamConfig module.name_mapper='ReactServerFormatConfig$$' -> 'forks/ReactServerFormatConfig.${serverRenderer}' module.name_mapper='ReactFlightServerConfig$$' -> 'forks/ReactFlightServerConfig.${serverRenderer}' module.name_mapper='ReactFlightClientHostConfig$$' -> 'forks/ReactFlightClientHostConfig.${serverRenderer}' +module.name_mapper='react-devtools-feature-flags' -> 'react-devtools-shared/src/config/DevToolsFeatureFlags.default' `.trim(), ) .replace('%REACT_RENDERER_FLOW_IGNORES%', ignoredPaths.join('\n')); diff --git a/scripts/flow/react-devtools.js b/scripts/flow/react-devtools.js index bab037351147..c8a8789de4ef 100644 --- a/scripts/flow/react-devtools.js +++ b/scripts/flow/react-devtools.js @@ -7,4 +7,5 @@ * @flow */ -// No types +declare var __EXTENSION__: boolean; +declare var __TEST__: boolean; diff --git a/scripts/jest/config.build-devtools.js b/scripts/jest/config.build-devtools.js index 494cc4a8e721..7f1cd8855929 100644 --- a/scripts/jest/config.build-devtools.js +++ b/scripts/jest/config.build-devtools.js @@ -26,6 +26,9 @@ const packages = readdirSync(packagesRoot).filter(dir => { // Create a module map to point React packages to the build output const moduleNameMapper = {}; +moduleNameMapper['react-devtools-feature-flags'] = + '/packages/react-devtools-shared/src/config/DevToolsFeatureFlags.default'; + // Map packages to bundles packages.forEach(name => { // Root entry point diff --git a/scripts/jest/setupEnvironment.js b/scripts/jest/setupEnvironment.js index 456645cddaba..2ba88b156169 100644 --- a/scripts/jest/setupEnvironment.js +++ b/scripts/jest/setupEnvironment.js @@ -5,6 +5,8 @@ if (NODE_ENV !== 'development' && NODE_ENV !== 'production') { throw new Error('NODE_ENV must either be set to development or production.'); } global.__DEV__ = NODE_ENV === 'development'; +global.__EXTENSION__ = false; +global.__TEST__ = NODE_ENV === 'test'; global.__PROFILE__ = NODE_ENV === 'development'; global.__UMD__ = false; diff --git a/scripts/jest/typescript/jest.d.ts b/scripts/jest/typescript/jest.d.ts index ef5ec332bbd7..ca68247fb9fb 100644 --- a/scripts/jest/typescript/jest.d.ts +++ b/scripts/jest/typescript/jest.d.ts @@ -1,5 +1,7 @@ declare var jasmine: any; declare var __DEV__: boolean; +declare var __TEST__: boolean; +declare var __EXTENSION__: boolean; declare function afterEach(fn: any): any; declare function beforeEach(fn: any): any; From 7559722a865e89992f75ff38c1015a865660c3cd Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 13 Oct 2020 13:08:12 -0400 Subject: [PATCH 0008/1603] Fix bad null check in DevTools highlight code (#20010) --- .../src/backend/views/Highlighter/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-devtools-shared/src/backend/views/Highlighter/index.js b/packages/react-devtools-shared/src/backend/views/Highlighter/index.js index bfd9c7c23033..1278619c5b07 100644 --- a/packages/react-devtools-shared/src/backend/views/Highlighter/index.js +++ b/packages/react-devtools-shared/src/backend/views/Highlighter/index.js @@ -103,7 +103,7 @@ export default function setupHighlighter( } let nodes: ?Array = null; - if (renderer !== null) { + if (renderer != null) { nodes = ((renderer.findNativeNodesForFiberID( id, ): any): ?Array); From e614e6965749c096c9db0e6ad2844a2803ebdcb6 Mon Sep 17 00:00:00 2001 From: IDrissAitHafid <31975500+IDrissAitHafid@users.noreply.github.com> Date: Tue, 13 Oct 2020 18:38:58 +0100 Subject: [PATCH 0009/1603] handled a missing suspense fiber when suspense is filtered on the profiler (#19987) Co-authored-by: Brian Vaughn --- .../storeComponentFilters-test.js.snap | 13 ++++++++ .../__tests__/storeComponentFilters-test.js | 30 +++++++++++++++++++ .../src/backend/renderer.js | 2 +- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/packages/react-devtools-shared/src/__tests__/__snapshots__/storeComponentFilters-test.js.snap b/packages/react-devtools-shared/src/__tests__/__snapshots__/storeComponentFilters-test.js.snap index 884b6cbcec85..cfe68aa69ecb 100644 --- a/packages/react-devtools-shared/src/__tests__/__snapshots__/storeComponentFilters-test.js.snap +++ b/packages/react-devtools-shared/src/__tests__/__snapshots__/storeComponentFilters-test.js.snap @@ -84,6 +84,19 @@ exports[`Store component filters should ignore invalid ElementTypeRoot filter: 2

`; +exports[`Store component filters should not break when Suspense nodes are filtered from the tree: 1: suspended 1`] = ` +[root] + ▾ + ▾ +
+`; + +exports[`Store component filters should not break when Suspense nodes are filtered from the tree: 2: resolved 1`] = ` +[root] + ▾ + +`; + exports[`Store component filters should support filtering by element type: 1: mount 1`] = ` [root] ▾ diff --git a/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js b/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js index 1a5be03f09aa..bfbf3e98210a 100644 --- a/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js +++ b/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js @@ -227,4 +227,34 @@ describe('Store component filters', () => { ]), ); }); + + it('should not break when Suspense nodes are filtered from the tree', () => { + const promise = new Promise(() => {}); + + const Loading = () =>
Loading...
; + + const Component = ({shouldSuspend}) => { + if (shouldSuspend) { + throw promise; + } + return null; + }; + + const Wrapper = ({shouldSuspend}) => ( + }> + + + ); + + store.componentFilters = [ + utils.createElementTypeFilter(Types.ElementTypeSuspense), + ]; + + const container = document.createElement('div'); + act(() => ReactDOM.render(, container)); + expect(store).toMatchSnapshot('1: suspended'); + + act(() => ReactDOM.render(, container)); + expect(store).toMatchSnapshot('2: resolved'); + }); }); diff --git a/packages/react-devtools-shared/src/backend/renderer.js b/packages/react-devtools-shared/src/backend/renderer.js index 2b382e24a59e..c10d71bbfec2 100644 --- a/packages/react-devtools-shared/src/backend/renderer.js +++ b/packages/react-devtools-shared/src/backend/renderer.js @@ -1572,7 +1572,7 @@ export function attach( if (nextPrimaryChildSet !== null) { mountFiberRecursively( nextPrimaryChildSet, - nextFiber, + shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate, ); From 880587366d84f9d36dd606088bc7bad050ead77e Mon Sep 17 00:00:00 2001 From: Ricky Date: Wed, 14 Oct 2020 08:54:34 -0400 Subject: [PATCH 0010/1603] Deprecate old test script commands (#19893) * Deprecate old test script commands * Update PR template test script * Add test-stable and test-www-classic * Update circle test names * Rename test-www-classic to test-classic * Missed some job renames * Missed some more job renames --- .circleci/config.yml | 86 ++++++++++++++++---------------- .github/PULL_REQUEST_TEMPLATE.md | 2 +- package.json | 28 ++++++----- scripts/jest/jest-cli.js | 9 ++++ 4 files changed, 68 insertions(+), 57 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07459b232ab1..d41354116fbe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -101,7 +101,7 @@ jobs: - *restore_node_modules - run: node ./scripts/tasks/flow-ci - RELEASE_CHANNEL_stable_yarn_test: + yarn_test-stable: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM @@ -109,7 +109,7 @@ jobs: steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=stable --ci + - run: yarn test-stable --ci yarn_test: docker: *docker @@ -120,79 +120,79 @@ jobs: - *restore_node_modules - run: yarn test --ci - RELEASE_CHANNEL_stable_yarn_test_www: + yarn_test-classic: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=www-classic --ci + - run: yarn test-classic --ci - RELEASE_CHANNEL_stable_yarn_test_www_variant: + yarn_test-classic_variant: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=www-classic --variant --ci + - run: yarn test-classic --variant --ci - RELEASE_CHANNEL_stable_yarn_test_prod_www: + yarn_test-classic_prod: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=www-classic --prod --ci + - run: yarn test-classic --prod --ci - RELEASE_CHANNEL_stable_yarn_test_prod_www_variant: + yarn_test-classic_prod_variant: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=www-classic --prod --variant --ci + - run: yarn test-classic --prod --variant --ci - yarn_test_www: + yarn_test-www: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=www-modern --ci + - run: yarn test-www --ci - yarn_test_www_variant: + yarn_test-www_variant: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=www-modern --variant --ci + - run: yarn test-www --variant --ci - yarn_test_prod_www: + yarn_test-www_prod: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=www-modern --prod --ci + - run: yarn test-www --prod --ci - yarn_test_prod_www_variant: + yarn_test-www_prod_variant: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=www-modern --prod --variant --ci + - run: yarn test-www --prod --variant --ci - RELEASE_CHANNEL_stable_yarn_test_persistent: + yarn_test-stable_persistent: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM @@ -200,9 +200,9 @@ jobs: steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=stable --persistent --ci + - run: yarn test-stable --persistent --ci - RELEASE_CHANNEL_stable_yarn_test_prod: + yarn_test-stable_prod: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM @@ -210,7 +210,7 @@ jobs: steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=stable --prod --ci + - run: yarn test-stable --prod --ci yarn_test_prod: docker: *docker @@ -219,7 +219,7 @@ jobs: steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=experimental --prod --ci + - run: yarn test --prod --ci RELEASE_CHANNEL_stable_yarn_build: docker: *docker @@ -316,7 +316,7 @@ jobs: root: packages/react-devtools-scheduling-profiler paths: - dist - + deploy_devtools_scheduling_profiler: docker: *docker environment: *environment @@ -389,7 +389,7 @@ jobs: command: yarn lint-build - run: scripts/circleci/check_minified_errors.sh - RELEASE_CHANNEL_stable_yarn_test_build: + yarn_test-stable_build: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM @@ -397,7 +397,7 @@ jobs: - checkout - attach_workspace: *attach_workspace - *restore_node_modules - - run: yarn test --release-channel=stable --build --ci + - run: yarn test-stable --build --ci yarn_test_build: docker: *docker @@ -407,7 +407,7 @@ jobs: - checkout - attach_workspace: *attach_workspace - *restore_node_modules - - run: yarn test --release-channel=experimental --build --ci + - run: yarn test --build --ci yarn_test_build_devtools: docker: *docker @@ -447,7 +447,7 @@ jobs: FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci - RELEASE_CHANNEL_stable_yarn_test_build_prod: + yarn_test-stable_build_prod: docker: *docker environment: *environment parallelism: *TEST_PARALLELISM @@ -455,7 +455,7 @@ jobs: - checkout - attach_workspace: *attach_workspace - *restore_node_modules - - run: yarn test --release-channel=stable --build --prod --ci + - run: yarn test-stable --build --prod --ci yarn_test_build_prod: docker: *docker @@ -465,7 +465,7 @@ jobs: - checkout - attach_workspace: *attach_workspace - *restore_node_modules - - run: yarn test --release-channel=experimental --build --prod --ci + - run: yarn test --build --prod --ci workflows: version: 2 @@ -478,25 +478,25 @@ workflows: - yarn_flow: requires: - setup - - RELEASE_CHANNEL_stable_yarn_test: + - yarn_test-stable: requires: - setup - - RELEASE_CHANNEL_stable_yarn_test_prod: + - yarn_test-stable_prod: requires: - setup - - RELEASE_CHANNEL_stable_yarn_test_persistent: + - yarn_test-stable_persistent: requires: - setup - - RELEASE_CHANNEL_stable_yarn_test_www: + - yarn_test-classic: requires: - setup - - RELEASE_CHANNEL_stable_yarn_test_www_variant: + - yarn_test-classic_variant: requires: - setup - - RELEASE_CHANNEL_stable_yarn_test_prod_www: + - yarn_test-classic_prod: requires: - setup - - RELEASE_CHANNEL_stable_yarn_test_prod_www_variant: + - yarn_test-classic_prod_variant: requires: - setup - RELEASE_CHANNEL_stable_yarn_build: @@ -511,10 +511,10 @@ workflows: - RELEASE_CHANNEL_stable_yarn_lint_build: requires: - RELEASE_CHANNEL_stable_yarn_build - - RELEASE_CHANNEL_stable_yarn_test_build: + - yarn_test-stable_build: requires: - RELEASE_CHANNEL_stable_yarn_build - - RELEASE_CHANNEL_stable_yarn_test_build_prod: + - yarn_test-stable_build_prod: requires: - RELEASE_CHANNEL_stable_yarn_build - RELEASE_CHANNEL_stable_yarn_test_dom_fixtures: @@ -530,16 +530,16 @@ workflows: - yarn_test_prod: requires: - setup - - yarn_test_www: + - yarn_test-www: requires: - setup - - yarn_test_www_variant: + - yarn_test-www_variant: requires: - setup - - yarn_test_prod_www: + - yarn_test-www_prod: requires: - setup - - yarn_test_prod_www_variant: + - yarn_test-www_prod_variant: requires: - setup - yarn_build: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7759363adb33..11ef400966cd 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,7 +8,7 @@ 2. Run `yarn` in the repository root. 3. If you've fixed a bug or added code that should be tested, add tests! 4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development. - 5. Run `yarn test-prod` to test in the production environment. It supports the same options as `yarn test`. + 5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`. 6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect". 7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`). 8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files. diff --git a/package.json b/package.json index 42e625fd6cbd..64e4430ede0a 100644 --- a/package.json +++ b/package.json @@ -110,21 +110,23 @@ "lint-build": "node ./scripts/rollup/validate/index.js", "extract-errors": "yarn build --type=dev --extract-errors", "postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && node ./scripts/flow/createFlowConfigs.js && node ./scripts/yarn/downloadReactIsForPrettyFormat.js", - "debug-test": "yarn test --debug", + "debug-test": "yarn test --deprecated 'yarn test --debug'", "test": "node ./scripts/jest/jest-cli.js", - "test-www": "yarn test --release-channel=www-modern", - "test-www-variant": "yarn test --release-channel=www-modern --variant", - "test-prod-www": "yarn test --prod --release-channel=www-modern", - "test-prod-www-variant": "yarn test --prod --release-channel=www-modern --variant", - "test-persistent": "yarn test --persistent", - "debug-test-persistent": "yarn test --debug --persistent", - "test-prod": "yarn test --prod", - "debug-test-prod": "yarn test --debug --prod", - "test-prod-build": "yarn test --prod --build", - "test-build": "yarn test --build", - "test-build-prod": "yarn test --build --prod", + "test-stable": "node ./scripts/jest/jest-cli.js --release-channel=stable", + "test-www": "node ./scripts/jest/jest-cli.js --release-channel=www-modern", + "test-classic": "node ./scripts/jest/jest-cli.js --release-channel=www-classic", + "test-www-variant": "yarn test --deprecated 'yarn test-www --variant'", + "test-prod-www": "yarn test --deprecated 'yarn test-www --prod'", + "test-prod-www-variant": "yarn test --deprecated 'yarn test-www --prod --variant'", + "test-persistent": "yarn test --deprecated 'yarn test --persistent'", + "debug-test-persistent": "yarn test --deprecated 'yarn test --debug --persistent'", + "test-prod": "yarn test --deprecated 'yarn test --prod'", + "debug-test-prod": "yarn test --deprecated 'yarn test --debug --prod'", + "test-prod-build": "yarn test --deprecated 'yarn test --prod --build'", + "test-build": "yarn test --deprecated 'yarn test --build'", + "test-build-prod": "yarn test --deprecated 'yarn test --build --prod'", "test-build-devtools": "yarn test --build --project devtools", - "debug-test-build-devtools": "yarn test --debug --build --project devtools", + "debug-test-build-devtools": "yarn test --deprecated 'yarn test-build-devtools --debug'", "test-dom-fixture": "cd fixtures/dom && yarn && yarn prestart && yarn test", "flow": "node ./scripts/tasks/flow.js", "flow-ci": "node ./scripts/tasks/flow-ci.js", diff --git a/scripts/jest/jest-cli.js b/scripts/jest/jest-cli.js index 4bd737713466..19e3879c776a 100644 --- a/scripts/jest/jest-cli.js +++ b/scripts/jest/jest-cli.js @@ -93,6 +93,11 @@ const argv = yargs type: 'boolean', default: false, }, + deprecated: { + describe: 'Print deprecation message for command.', + requiresArg: true, + type: 'string', + }, }).argv; function logError(message) { @@ -287,6 +292,10 @@ function getEnvars() { } function main() { + if (argv.deprecated) { + console.log(chalk.red(`\nPlease run: \`${argv.deprecated}\` instead.\n`)); + return; + } validateOptions(); const args = getCommandArgs(); const envars = getEnvars(); From f75f8b48a2ab14e31712389f91750c58de18c378 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Wed, 14 Oct 2020 13:19:47 -0400 Subject: [PATCH 0011/1603] DevTools always overrides the dispatcher when shallow rendering (#20011) This is done so that any effects scheduled by the shallow render are thrown away. Unlike the code this was forked from (in ReactComponentStackFrame) DevTools should override the dispatcher even when DevTools is compiled in production mode, because the app itself may be in development mode and log errors/warnings. --- .../src/__tests__/componentStacks-test.js | 105 ++++++++++++++++++ .../backend/DevToolsComponentStackFrame.js | 24 ++-- 2 files changed, 117 insertions(+), 12 deletions(-) create mode 100644 packages/react-devtools-shared/src/__tests__/componentStacks-test.js diff --git a/packages/react-devtools-shared/src/__tests__/componentStacks-test.js b/packages/react-devtools-shared/src/__tests__/componentStacks-test.js new file mode 100644 index 000000000000..3028fc182da5 --- /dev/null +++ b/packages/react-devtools-shared/src/__tests__/componentStacks-test.js @@ -0,0 +1,105 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + */ + +function normalizeCodeLocInfo(str) { + if (typeof str !== 'string') { + return str; + } + // This special case exists only for the special source location in + // ReactElementValidator. That will go away if we remove source locations. + str = str.replace(/Check your code at .+?:\d+/g, 'Check your code at **'); + // V8 format: + // at Component (/path/filename.js:123:45) + // React format: + // in Component (at filename.js:123) + return str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) { + return '\n in ' + name + ' (at **)'; + }); +} + +describe('component stack', () => { + let React; + let ReactDOM; + let act; + let mockError; + let mockWarn; + + beforeEach(() => { + // Intercept native console methods before DevTools bootstraps. + // Normalize component stack locations. + mockError = jest.fn(); + mockWarn = jest.fn(); + console.error = (...args) => { + mockError(...args.map(normalizeCodeLocInfo)); + }; + console.warn = (...args) => { + mockWarn(...args.map(normalizeCodeLocInfo)); + }; + + const utils = require('./utils'); + act = utils.act; + + React = require('react'); + ReactDOM = require('react-dom'); + }); + + it('should log the current component stack along with an error or warning', () => { + const Grandparent = () => ; + const Parent = () => ; + const Child = () => { + console.error('Test error.'); + console.warn('Test warning.'); + return null; + }; + + const container = document.createElement('div'); + + act(() => ReactDOM.render(, container)); + + expect(mockError).toHaveBeenCalledWith( + 'Test error.', + '\n in Child (at **)' + + '\n in Parent (at **)' + + '\n in Grandparent (at **)', + ); + expect(mockWarn).toHaveBeenCalledWith( + 'Test warning.', + '\n in Child (at **)' + + '\n in Parent (at **)' + + '\n in Grandparent (at **)', + ); + }); + + // This test should have caught #19911 + // but didn't because both DevTools and ReactDOM are running in the same memory space, + // so the case we're testing against (DevTools prod build and React DEV build) doesn't exist. + // It would be nice to figure out a way to test this combination at some point... + xit('should disable the current dispatcher before shallow rendering so no effects get scheduled', () => { + let useEffectCount = 0; + + const Example = props => { + React.useEffect(() => { + useEffectCount++; + expect(props).toBeDefined(); + }, [props]); + console.warn('Warning to trigger appended component stacks.'); + return null; + }; + + const container = document.createElement('div'); + act(() => ReactDOM.render(, container)); + + expect(useEffectCount).toBe(1); + + expect(mockWarn).toHaveBeenCalledWith( + 'Warning to trigger appended component stacks.', + '\n in Example (at **)', + ); + }); +}); diff --git a/packages/react-devtools-shared/src/backend/DevToolsComponentStackFrame.js b/packages/react-devtools-shared/src/backend/DevToolsComponentStackFrame.js index b3b306a111be..581fdfa40a1b 100644 --- a/packages/react-devtools-shared/src/backend/DevToolsComponentStackFrame.js +++ b/packages/react-devtools-shared/src/backend/DevToolsComponentStackFrame.js @@ -85,14 +85,16 @@ export function describeNativeComponentFrame( Error.prepareStackTrace = undefined; reentry = true; - let previousDispatcher; - if (__DEV__) { - previousDispatcher = currentDispatcherRef.current; - // Set the dispatcher in DEV because this might be call in the render function - // for warnings. - currentDispatcherRef.current = null; - disableLogs(); - } + + // Override the dispatcher so effects scheduled by this shallow render are thrown away. + // + // Note that unlike the code this was forked from (in ReactComponentStackFrame) + // DevTools should override the dispatcher even when DevTools is compiled in production mode, + // because the app itself may be in development mode and log errors/warnings. + const previousDispatcher = currentDispatcherRef.current; + currentDispatcherRef.current = null; + disableLogs(); + try { // This should throw. if (construct) { @@ -188,10 +190,8 @@ export function describeNativeComponentFrame( Error.prepareStackTrace = previousPrepareStackTrace; - if (__DEV__) { - currentDispatcherRef.current = previousDispatcher; - reenableLogs(); - } + currentDispatcherRef.current = previousDispatcher; + reenableLogs(); } // Fallback to just using the name if we couldn't make it throw. const name = fn ? fn.displayName || fn.name : ''; From 6d50a9d090a2a672fc3dea5ce77a3a05332a6caa Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 14 Oct 2020 18:28:03 +0100 Subject: [PATCH 0012/1603] Fixture: Legacy JSX Runtimes (#20012) * Fixture: Legacy JSX Runtimes * Add more comments --- fixtures/legacy-jsx-runtimes/README.md | 12 + fixtures/legacy-jsx-runtimes/babel.config.js | 12 + fixtures/legacy-jsx-runtimes/lint-runtimes.js | 63 + fixtures/legacy-jsx-runtimes/package.json | 19 + .../cjs/react-jsx-dev-runtime.development.js | 861 ++++ .../react-jsx-dev-runtime.production.min.js | 9 + .../cjs/react-jsx-runtime.development.js | 883 ++++ .../cjs/react-jsx-runtime.production.min.js | 10 + .../react-14/jsx-dev-runtime.js | 7 + .../react-14/jsx-runtime.js | 7 + .../legacy-jsx-runtimes/react-14/package.json | 6 + .../react-14/react-14.test.js | 780 ++++ .../legacy-jsx-runtimes/react-14/yarn.lock | 285 ++ .../cjs/react-jsx-dev-runtime.development.js | 866 ++++ .../react-jsx-dev-runtime.production.min.js | 9 + .../cjs/react-jsx-runtime.development.js | 888 ++++ .../cjs/react-jsx-runtime.production.min.js | 10 + .../react-15/jsx-dev-runtime.js | 7 + .../react-15/jsx-runtime.js | 7 + .../legacy-jsx-runtimes/react-15/package.json | 6 + .../react-15/react-15.test.js | 775 ++++ .../legacy-jsx-runtimes/react-15/yarn.lock | 149 + .../cjs/react-jsx-dev-runtime.development.js | 889 ++++ .../react-jsx-dev-runtime.production.min.js | 9 + .../cjs/react-jsx-runtime.development.js | 911 ++++ .../cjs/react-jsx-runtime.production.min.js | 10 + .../react-16/jsx-dev-runtime.js | 7 + .../react-16/jsx-runtime.js | 7 + .../legacy-jsx-runtimes/react-16/package.json | 7 + .../react-16/react-16.test.js | 773 ++++ .../legacy-jsx-runtimes/react-16/yarn.lock | 61 + .../cjs/react-jsx-dev-runtime.development.js | 1203 ++++++ .../react-jsx-dev-runtime.production.min.js | 9 + .../cjs/react-jsx-runtime.development.js | 1221 ++++++ .../cjs/react-jsx-runtime.production.min.js | 10 + .../react-17/jsx-dev-runtime.js | 7 + .../react-17/jsx-runtime.js | 7 + .../legacy-jsx-runtimes/react-17/package.json | 7 + .../react-17/react-17.test.js | 773 ++++ .../legacy-jsx-runtimes/react-17/yarn.lock | 59 + fixtures/legacy-jsx-runtimes/setupTests.js | 318 ++ fixtures/legacy-jsx-runtimes/yarn.lock | 3780 +++++++++++++++++ scripts/prettier/index.js | 2 +- 43 files changed, 15740 insertions(+), 1 deletion(-) create mode 100644 fixtures/legacy-jsx-runtimes/README.md create mode 100644 fixtures/legacy-jsx-runtimes/babel.config.js create mode 100644 fixtures/legacy-jsx-runtimes/lint-runtimes.js create mode 100644 fixtures/legacy-jsx-runtimes/package.json create mode 100644 fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-dev-runtime.development.js create mode 100644 fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-dev-runtime.production.min.js create mode 100644 fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-runtime.development.js create mode 100644 fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-runtime.production.min.js create mode 100644 fixtures/legacy-jsx-runtimes/react-14/jsx-dev-runtime.js create mode 100644 fixtures/legacy-jsx-runtimes/react-14/jsx-runtime.js create mode 100644 fixtures/legacy-jsx-runtimes/react-14/package.json create mode 100644 fixtures/legacy-jsx-runtimes/react-14/react-14.test.js create mode 100644 fixtures/legacy-jsx-runtimes/react-14/yarn.lock create mode 100644 fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-dev-runtime.development.js create mode 100644 fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-dev-runtime.production.min.js create mode 100644 fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-runtime.development.js create mode 100644 fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-runtime.production.min.js create mode 100644 fixtures/legacy-jsx-runtimes/react-15/jsx-dev-runtime.js create mode 100644 fixtures/legacy-jsx-runtimes/react-15/jsx-runtime.js create mode 100644 fixtures/legacy-jsx-runtimes/react-15/package.json create mode 100644 fixtures/legacy-jsx-runtimes/react-15/react-15.test.js create mode 100644 fixtures/legacy-jsx-runtimes/react-15/yarn.lock create mode 100644 fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-dev-runtime.development.js create mode 100644 fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-dev-runtime.production.min.js create mode 100644 fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-runtime.development.js create mode 100644 fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-runtime.production.min.js create mode 100644 fixtures/legacy-jsx-runtimes/react-16/jsx-dev-runtime.js create mode 100644 fixtures/legacy-jsx-runtimes/react-16/jsx-runtime.js create mode 100644 fixtures/legacy-jsx-runtimes/react-16/package.json create mode 100644 fixtures/legacy-jsx-runtimes/react-16/react-16.test.js create mode 100644 fixtures/legacy-jsx-runtimes/react-16/yarn.lock create mode 100644 fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-dev-runtime.development.js create mode 100644 fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-dev-runtime.production.min.js create mode 100644 fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-runtime.development.js create mode 100644 fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-runtime.production.min.js create mode 100644 fixtures/legacy-jsx-runtimes/react-17/jsx-dev-runtime.js create mode 100644 fixtures/legacy-jsx-runtimes/react-17/jsx-runtime.js create mode 100644 fixtures/legacy-jsx-runtimes/react-17/package.json create mode 100644 fixtures/legacy-jsx-runtimes/react-17/react-17.test.js create mode 100644 fixtures/legacy-jsx-runtimes/react-17/yarn.lock create mode 100644 fixtures/legacy-jsx-runtimes/setupTests.js create mode 100644 fixtures/legacy-jsx-runtimes/yarn.lock diff --git a/fixtures/legacy-jsx-runtimes/README.md b/fixtures/legacy-jsx-runtimes/README.md new file mode 100644 index 000000000000..376c2c4f208f --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/README.md @@ -0,0 +1,12 @@ +# Legacy JSX Runtimes + +This is an internal testing fixture for the special JSX runtime versions released for 0.14, 15, and 16. + +They are checked into the corresponding `react-*/cjs/*` folders. + +Run the full regression suite: + +``` +yarn +yarn test +``` diff --git a/fixtures/legacy-jsx-runtimes/babel.config.js b/fixtures/legacy-jsx-runtimes/babel.config.js new file mode 100644 index 000000000000..132bbca7ae23 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/babel.config.js @@ -0,0 +1,12 @@ +module.exports = { + presets: [ + [ + '@babel/react', + { + runtime: 'automatic', + development: process.env.BABEL_ENV === 'development', + }, + ], + ], + plugins: ['@babel/plugin-transform-modules-commonjs'], +}; diff --git a/fixtures/legacy-jsx-runtimes/lint-runtimes.js b/fixtures/legacy-jsx-runtimes/lint-runtimes.js new file mode 100644 index 000000000000..fb6584c572f7 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/lint-runtimes.js @@ -0,0 +1,63 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @emails react-core + */ + +'use strict'; + +const path = require('path'); + +const {ESLint} = require('eslint'); + +function getESLintInstance(format) { + return new ESLint({ + useEslintrc: false, + overrideConfigFile: + __dirname + `../../../scripts/rollup/validate/eslintrc.${format}.js`, + ignore: false, + }); +} + +const esLints = { + cjs: getESLintInstance('cjs'), +}; + +// Performs sanity checks on bundles *built* by Rollup. +// Helps catch Rollup regressions. +async function lint(folder) { + console.log(`Linting ` + folder); + const eslint = esLints.cjs; + + const results = await eslint.lintFiles([ + __dirname + '/' + folder + '/cjs/react-jsx-dev-runtime.development.js', + __dirname + '/' + folder + '/cjs/react-jsx-dev-runtime.production.min.js', + __dirname + '/' + folder + '/cjs/react-jsx-runtime.development.js', + __dirname + '/' + folder + '/cjs/react-jsx-runtime.production.min.js', + ]); + if ( + results.some(result => result.errorCount > 0 || result.warningCount > 0) + ) { + process.exitCode = 1; + console.log(`Failed`); + const formatter = await eslint.loadFormatter('stylish'); + const resultText = formatter.format(results); + console.log(resultText); + } +} + +async function lintEverything() { + console.log(`Linting known bundles...`); + await lint('react-14'); + await lint('react-15'); + await lint('react-16'); + await lint('react-17'); +} + +lintEverything().catch(error => { + process.exitCode = 1; + console.error(error); +}); diff --git a/fixtures/legacy-jsx-runtimes/package.json b/fixtures/legacy-jsx-runtimes/package.json new file mode 100644 index 000000000000..94feb1aed0d1 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/package.json @@ -0,0 +1,19 @@ +{ + "dependencies": { + "@babel/plugin-transform-modules-commonjs": "^7.10.4", + "@babel/preset-react": "^7.10.4", + "jest": "^26.5.3" + }, + "jest": { + "setupFilesAfterEnv": ["./setupTests.js"] + }, + "scripts": { + "install-all": "cd react-14 && yarn && cd ../react-15 && yarn && cd ../react-16 && yarn && cd ../react-17 && yarn && cd ..", + "lint": "node lint-runtimes.js", + "pretest": "yarn install-all && yarn lint", + "test-jsxdev-dev": "BABEL_ENV=development NODE_ENV=development jest", + "test-jsx-dev": "BABEL_ENV=production NODE_ENV=development jest", + "test-jsx-prod": "BABEL_ENV=production NODE_ENV=production jest", + "test": "yarn test-jsxdev-dev && yarn test-jsx-dev && yarn test-jsx-prod" + } +} diff --git a/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-dev-runtime.development.js b/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-dev-runtime.development.js new file mode 100644 index 000000000000..31238ef27cf8 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-dev-runtime.development.js @@ -0,0 +1,861 @@ +/** @license React v0.14.10 + * react-jsx-dev-runtime.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +var React = require('react'); + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +exports.Fragment = 0xeacb; +var REACT_STRICT_MODE_TYPE = 0xeacc; +var REACT_PROFILER_TYPE = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +var REACT_SUSPENSE_TYPE = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); + REACT_PROFILER_TYPE = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var stack = ''; + + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableScopeAPI = false; // Experimental Create Event Handle API. + +function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; +} +var BEFORE_SLASH_RE = /^(.*)[\\\/]/; +function describeComponentFrame (name, source, ownerName) { + var sourceInfo = ''; + + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + + return '\n in ' + (name || 'Unknown') + sourceInfo; +} + +var Resolved = 1; +function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; +} +var loggedTypeFailures = {}; +var currentlyValidatingElement = null; + +function setCurrentlyValidatingElement(element) { + currentlyValidatingElement = element; +} + +function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } +} + +var ReactCurrentOwner = require('react/lib/ReactCurrentOwner'); +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown; +var specialPropRefWarningShown; +var didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; +} + +function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; +} + +function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } +} + +function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } +} +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; +/** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + +function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.
+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + key = '' + maybeKey; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + if (hasValidRef(config)) { + ref = config.ref; + } // Remaining properties are added to a new props object + + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } +} + +var ReactCurrentOwner$1 = require('react/lib/ReactCurrentOwner'); + +function setCurrentlyValidatingElement$1(element) { + currentlyValidatingElement = element; +} + +var propTypesMisspellWarningShown; + +{ + propTypesMisspellWarningShown = false; +} +/** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + +function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } +} + +function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = ReactCurrentOwner$1.current.getName(); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } +} + +function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } +} +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } +} +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + +function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + element._owner.getName() + "."; + } + + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } +} +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + +function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } +} +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + +function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + +function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } +} + +function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendum(source); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + var children = props.children; + + if (children !== undefined) { + if (isStaticChildren) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); + } + + if (Object.freeze) { + Object.freeze(children); + } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); + } + } else { + validateChildKeys(children, type); + } + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } +} // These two functions exist to still get child warnings in dev + +var jsxDEV$1 = jsxWithValidation ; + +exports.jsxDEV = jsxDEV$1; + })(); +} diff --git a/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-dev-runtime.production.min.js b/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-dev-runtime.production.min.js new file mode 100644 index 000000000000..1cdc0e2730e8 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-dev-runtime.production.min.js @@ -0,0 +1,9 @@ +/** @license React v0.14.10 + * react-jsx-dev-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'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; diff --git a/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-runtime.development.js b/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-runtime.development.js new file mode 100644 index 000000000000..5658993188ae --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-runtime.development.js @@ -0,0 +1,883 @@ +/** @license React v0.14.10 + * react-jsx-runtime.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +var React = require('react'); + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +exports.Fragment = 0xeacb; +var REACT_STRICT_MODE_TYPE = 0xeacc; +var REACT_PROFILER_TYPE = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +var REACT_SUSPENSE_TYPE = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); + REACT_PROFILER_TYPE = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var stack = ''; + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableScopeAPI = false; // Experimental Create Event Handle API. + +function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; +} + + +var BEFORE_SLASH_RE = /^(.*)[\\\/]/; +function describeComponentFrame (name, source, ownerName) { + var sourceInfo = ''; + + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + + return '\n in ' + (name || 'Unknown') + sourceInfo; +} + +var Resolved = 1; +function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; +} + +var loggedTypeFailures = {}; +var currentlyValidatingElement = null; + +function setCurrentlyValidatingElement(element) { + { + currentlyValidatingElement = element; + } +} + +function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } +} + +var ReactCurrentOwner = require('react/lib/ReactCurrentOwner'); +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown; +var specialPropRefWarningShown; +var didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; +} + +function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; +} + +function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } +} + +function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } +} +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; +/** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + +function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.
+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + key = '' + maybeKey; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + if (hasValidRef(config)) { + ref = config.ref; + } // Remaining properties are added to a new props object + + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } +} + +var ReactCurrentOwner$1 = require('react/lib/ReactCurrentOwner'); + +function setCurrentlyValidatingElement$1(element) { + currentlyValidatingElement = element; +} + +var propTypesMisspellWarningShown; + +{ + propTypesMisspellWarningShown = false; +} +/** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + +function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } +} + +function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = ReactCurrentOwner$1.current.getName(); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } +} + +function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } +} +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } +} +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + +function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + element._owner.getName() + "."; + } + + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } +} +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + +function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } +} +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + +function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + +function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } +} + +function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendum(source); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + var children = props.children; + + if (children !== undefined) { + if (isStaticChildren) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); + } + + if (Object.freeze) { + Object.freeze(children); + } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); + } + } else { + validateChildKeys(children, type); + } + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } +} // These two functions exist to still get child warnings in dev +// even with the prod transform. This means that jsxDEV is purely +// opt-in behavior for better messages but that we won't stop +// giving you warnings if you use production apis. + +function jsxWithValidationStatic(type, props, key) { + { + return jsxWithValidation(type, props, key, true); + } +} +function jsxWithValidationDynamic(type, props, key) { + { + return jsxWithValidation(type, props, key, false); + } +} + +var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children. +// for now we can ship identical prod functions + +var jsxs = jsxWithValidationStatic ; + +exports.jsx = jsx; +exports.jsxs = jsxs; + })(); +} diff --git a/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-runtime.production.min.js b/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-runtime.production.min.js new file mode 100644 index 000000000000..517b90d6793a --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-14/cjs/react-jsx-runtime.production.min.js @@ -0,0 +1,10 @@ +/** @license React v0.14.10 + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=require("react/lib/ReactCurrentOwner"),n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0}; +function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q; diff --git a/fixtures/legacy-jsx-runtimes/react-14/jsx-dev-runtime.js b/fixtures/legacy-jsx-runtimes/react-14/jsx-dev-runtime.js new file mode 100644 index 000000000000..324eb11e5992 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-14/jsx-dev-runtime.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-dev-runtime.production.min.js'); +} else { + module.exports = require('./cjs/react-jsx-dev-runtime.development.js'); +} diff --git a/fixtures/legacy-jsx-runtimes/react-14/jsx-runtime.js b/fixtures/legacy-jsx-runtimes/react-14/jsx-runtime.js new file mode 100644 index 000000000000..0416df54291a --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-14/jsx-runtime.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-runtime.production.min.js'); +} else { + module.exports = require('./cjs/react-jsx-runtime.development.js'); +} diff --git a/fixtures/legacy-jsx-runtimes/react-14/package.json b/fixtures/legacy-jsx-runtimes/react-14/package.json new file mode 100644 index 000000000000..20cff83c9d8e --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-14/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "react": "0.14", + "react-dom": "0.14" + } +} diff --git a/fixtures/legacy-jsx-runtimes/react-14/react-14.test.js b/fixtures/legacy-jsx-runtimes/react-14/react-14.test.js new file mode 100644 index 000000000000..a7161485a363 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-14/react-14.test.js @@ -0,0 +1,780 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @emails react-core + */ + +// These tests are based on ReactJSXElement-test, +// ReactJSXElementValidator-test, ReactComponent-test, +// and ReactElementJSX-test. + +jest.mock('react/jsx-runtime', () => require('./jsx-runtime'), {virtual: true}); +jest.mock('react/jsx-dev-runtime', () => require('./jsx-dev-runtime'), { + virtual: true, +}); + +let React = require('react'); +let ReactDOM = require('react-dom'); +let ReactTestUtils = { + renderIntoDocument(el) { + const container = document.createElement('div'); + return ReactDOM.render(el, container); + }, +}; +let PropTypes = React.PropTypes; +let Component = class Component extends React.Component { + render() { + return
; + } +}; +let RequiredPropComponent = class extends React.Component { + render() { + return {this.props.prop}; + } +}; +RequiredPropComponent.displayName = 'RequiredPropComponent'; +RequiredPropComponent.propTypes = {prop: PropTypes.string.isRequired}; + +it('works', () => { + const container = document.createElement('div'); + ReactDOM.render(

hello

, container); + expect(container.textContent).toBe('hello'); +}); + +it('returns a complete element according to spec', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('allows a lower-case to be passed as the string type', () => { + const element =
; + expect(element.type).toBe('div'); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('allows a string to be passed as the type', () => { + const TagName = 'div'; + const element = ; + expect(element.type).toBe('div'); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('returns an immutable element', () => { + const element = ; + if (process.env.NODE_ENV === 'development') { + expect(() => (element.type = 'div')).toThrow(); + } else { + expect(() => (element.type = 'div')).not.toThrow(); + } +}); + +it('does not reuse the object that is spread into props', () => { + const config = {foo: 1}; + const element = ; + expect(element.props.foo).toBe(1); + config.foo = 2; + expect(element.props.foo).toBe(1); +}); + +it('extracts key and ref from the rest of the props', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe('12'); + expect(element.ref).toBe('34'); + const expectation = {foo: '56'}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('coerces the key to a string', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe('12'); + expect(element.ref).toBe(null); + const expectation = {foo: '56'}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('merges JSX children onto the children prop', () => { + const a = 1; + const element = {a}; + expect(element.props.children).toBe(a); +}); + +it('does not override children if no JSX children are provided', () => { + const element = ; + expect(element.props.children).toBe('text'); +}); + +it('overrides children if null is provided as a JSX child', () => { + const element = {null}; + expect(element.props.children).toBe(null); +}); + +it('overrides children if undefined is provided as an argument', () => { + const element = {undefined}; + expect(element.props.children).toBe(undefined); + + const element2 = React.cloneElement( + , + {}, + undefined + ); + expect(element2.props.children).toBe(undefined); +}); + +it('merges JSX children onto the children prop in an array', () => { + const a = 1; + const b = 2; + const c = 3; + const element = ( + + {a} + {b} + {c} + + ); + expect(element.props.children).toEqual([1, 2, 3]); +}); + +it('allows static methods to be called using the type property', () => { + class StaticMethodComponent { + static someStaticMethod() { + return 'someReturnValue'; + } + render() { + return
; + } + } + + const element = ; + expect(element.type.someStaticMethod()).toBe('someReturnValue'); +}); + +it('identifies valid elements', () => { + expect(React.isValidElement(
)).toEqual(true); + expect(React.isValidElement()).toEqual(true); + + expect(React.isValidElement(null)).toEqual(false); + expect(React.isValidElement(true)).toEqual(false); + expect(React.isValidElement({})).toEqual(false); + expect(React.isValidElement('string')).toEqual(false); + expect(React.isValidElement(Component)).toEqual(false); + expect(React.isValidElement({type: 'div', props: {}})).toEqual(false); +}); + +it('is indistinguishable from a plain object', () => { + const element =
; + const object = {}; + expect(element.constructor).toBe(object.constructor); +}); + +it('should use default prop value when removing a prop', () => { + Component.defaultProps = {fruit: 'persimmon'}; + + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.props.fruit).toBe('mango'); + + ReactDOM.render(, container); + expect(instance.props.fruit).toBe('persimmon'); +}); + +it('should normalize props with default values', () => { + class NormalizingComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NormalizingComponent.defaultProps = {prop: 'testKey'}; + + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.props.prop).toBe('testKey'); + + const inst2 = ReactDOM.render( + , + container + ); + expect(inst2.props.prop).toBe(null); +}); + +it('warns for keys for arrays of elements in children position', () => { + expect(() => + ReactTestUtils.renderIntoDocument( + {[, ]} + ) + ).toErrorDev('Each child in a list should have a unique "key" prop.', { + withoutStack: true, + }); +}); + +it('warns for keys for arrays of elements with owner info', () => { + class InnerComponent extends React.Component { + render() { + return {this.props.childSet}; + } + } + + class ComponentWrapper extends React.Component { + render() { + return , ]} />; + } + } + + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'Each child in a list should have a unique "key" prop.' + + '\n\nCheck the render method of `InnerComponent`. ' + + 'It was passed a child from ComponentWrapper. ', + {withoutStack: true} + ); +}); + +it('does not warn for arrays of elements with keys', () => { + ReactTestUtils.renderIntoDocument( + {[, ]} + ); +}); + +it('does not warn for iterable elements with keys', () => { + const iterable = { + '@@iterator': function() { + let i = 0; + return { + next: function() { + const done = ++i > 2; + return { + value: done ? undefined : , + done: done, + }; + }, + }; + }, + }; + + ReactTestUtils.renderIntoDocument({iterable}); +}); + +it('does not warn for numeric keys in entry iterable as a child', () => { + const iterable = { + '@@iterator': function() { + let i = 0; + return { + next: function() { + const done = ++i > 2; + return {value: done ? undefined : [i, ], done: done}; + }, + }; + }, + }; + iterable.entries = iterable['@@iterator']; + + ReactTestUtils.renderIntoDocument({iterable}); +}); + +it('does not warn when the element is directly as children', () => { + ReactTestUtils.renderIntoDocument( + + + + + ); +}); + +it('does not warn when the child array contains non-elements', () => { + void ({[{}, {}]}); +}); + +it('should give context for PropType errors in nested components.', () => { + // In this test, we're making sure that if a proptype error is found in a + // component, we give a small hint as to which parent instantiated that + // component as per warnings about key usage in ReactElementValidator. + function MyComp({color}) { + return
My color is {color}
; + } + MyComp.propTypes = { + color: PropTypes.string, + }; + class ParentComp extends React.Component { + render() { + return ; + } + } + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'Warning: Failed prop type: ' + + 'Invalid prop `color` of type `number` supplied to `MyComp`, ' + + 'expected `string`.', + {withoutStack: true} + ); +}); + +it('gives a helpful error when passing null, undefined, or boolean', () => { + const Undefined = undefined; + const Null = null; + const True = true; + const Div = 'div'; + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: undefined. You likely forgot to export your ' + + "component from the file it's defined in, or you might have mixed up " + + 'default and named imports.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: null.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: boolean.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + // No error expected + void (
); +}); + +it('should check default prop values', () => { + RequiredPropComponent.defaultProps = {prop: null}; + + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'Warning: Failed prop type: Required prop `prop` was not specified in ' + + '`RequiredPropComponent`.', + {withoutStack: true} + ); +}); + +it('should warn on invalid prop types', () => { + // Since there is no prevalidation step for ES6 classes, there is no hook + // for us to issue a warning earlier than element creation when the error + // actually occurs. Since this step is skipped in production, we should just + // warn instead of throwing for this case. + class NullPropTypeComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NullPropTypeComponent.propTypes = { + prop: null, + }; + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'NullPropTypeComponent: prop type `prop` is invalid; it must be a ' + + 'function, usually from the `prop-types` package,', + {withoutStack: true} + ); +}); + +xit('should warn on invalid context types', () => { + class NullContextTypeComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NullContextTypeComponent.contextTypes = { + prop: null, + }; + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'NullContextTypeComponent: type `prop` is invalid; it must ' + + 'be a function, usually from the `prop-types` package,' + ); +}); + +it('should warn if getDefaultProps is specified on the class', () => { + class GetDefaultPropsComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + GetDefaultPropsComponent.getDefaultProps = () => ({ + prop: 'foo', + }); + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'getDefaultProps is only used on classic React.createClass definitions.' + + ' Use a static property named `defaultProps` instead.', + {withoutStack: true} + ); +}); + +it('should warn if component declares PropTypes instead of propTypes', () => { + class MisspelledPropTypesComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + MisspelledPropTypesComponent.PropTypes = { + prop: PropTypes.string, + }; + expect(() => + ReactTestUtils.renderIntoDocument( + + ) + ).toErrorDev( + 'Warning: Component MisspelledPropTypesComponent declared `PropTypes` ' + + 'instead of `propTypes`. Did you misspell the property assignment?', + {withoutStack: true} + ); +}); + +// Not supported. +xit('warns for fragments with illegal attributes', () => { + class Foo extends React.Component { + render() { + return hello; + } + } + + expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( + 'Invalid prop `a` supplied to `React.Fragment`. React.Fragment ' + + 'can only have `key` and `children` props.' + ); +}); + +// Not supported. +xit('warns for fragments with refs', () => { + class Foo extends React.Component { + render() { + return ( + { + this.foo = bar; + }}> + hello + + ); + } + } + + expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( + 'Invalid attribute `ref` supplied to `React.Fragment`.' + ); +}); + +// Not supported. +xit('does not warn for fragments of multiple elements without keys', () => { + ReactTestUtils.renderIntoDocument( + <> + 1 + 2 + + ); +}); + +// Not supported. +xit('warns for fragments of multiple elements with same key', () => { + expect(() => + ReactTestUtils.renderIntoDocument( + <> + 1 + 2 + 3 + + ) + ).toErrorDev('Encountered two children with the same key, `a`.', { + withoutStack: true, + }); +}); + +// Not supported. +xit('does not call lazy initializers eagerly', () => { + let didCall = false; + const Lazy = React.lazy(() => { + didCall = true; + return {then() {}}; + }); + ; + expect(didCall).toBe(false); +}); + +it('supports classic refs', () => { + class Foo extends React.Component { + render() { + return
; + } + } + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.refs.inner.className).toBe('foo'); +}); + +it('should support refs on owned components', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + class Component extends React.Component { + render() { + const inner = ; + const outer = ( + + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.refs.inner.getObject()).toEqual(innerObj); + expect(this.refs.outer.getObject()).toEqual(outerObj); + } + } + + ReactTestUtils.renderIntoDocument(); +}); + +it('should support callback-style refs', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + let mounted = false; + + class Component extends React.Component { + render() { + const inner = ( + (this.innerRef = c)} /> + ); + const outer = ( + (this.outerRef = c)}> + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.innerRef.getObject()).toEqual(innerObj); + expect(this.outerRef.getObject()).toEqual(outerObj); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +// Not supported. +xit('should support object-style refs', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + let mounted = false; + + class Component extends React.Component { + constructor() { + super(); + this.innerRef = React.createRef(); + this.outerRef = React.createRef(); + } + render() { + const inner = ; + const outer = ( + + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.innerRef.current.getObject()).toEqual(innerObj); + expect(this.outerRef.current.getObject()).toEqual(outerObj); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +it('should support new-style refs with mixed-up owners', () => { + class Wrapper extends React.Component { + getTitle = () => { + return this.props.title; + }; + + render() { + return this.props.getContent(); + } + } + + let mounted = false; + + class Component extends React.Component { + getInner = () => { + // (With old-style refs, it's impossible to get a ref to this div + // because Wrapper is the current owner when this function is called.) + return
(this.innerRef = c)} />; + }; + + render() { + return ( + (this.wrapperRef = c)} + getContent={this.getInner} + /> + ); + } + + componentDidMount() { + // Check .props.title to make sure we got the right elements back + expect(this.wrapperRef.getTitle()).toBe('wrapper'); + expect(this.innerRef.className).toBe('inner'); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +it('should warn when `key` is being accessed on composite element', () => { + const container = document.createElement('div'); + class Child extends React.Component { + render() { + return
{this.props.key}
; + } + } + class Parent extends React.Component { + render() { + return ( +
+ + + +
+ ); + } + } + expect(() => + ReactDOM.render(, container) + ).toErrorDev( + 'Child: `key` is not a prop. Trying to access it will result ' + + 'in `undefined` being returned. If you need to access the same ' + + 'value within the child component, you should pass it as a different ' + + 'prop. (https://reactjs.org/link/special-props)', + {withoutStack: true} + ); +}); + +it('should warn when `ref` is being accessed', () => { + const container = document.createElement('div'); + class Child extends React.Component { + render() { + return
{this.props.ref}
; + } + } + class Parent extends React.Component { + render() { + return ( +
+ +
+ ); + } + } + expect(() => + ReactDOM.render(, container) + ).toErrorDev( + 'Child: `ref` is not a prop. Trying to access it will result ' + + 'in `undefined` being returned. If you need to access the same ' + + 'value within the child component, you should pass it as a different ' + + 'prop. (https://reactjs.org/link/special-props)', + {withoutStack: true} + ); +}); + +// Note: no warning before 16. +it('should NOT warn when owner and self are different for string refs', () => { + class ClassWithRenderProp extends React.Component { + render() { + return this.props.children(); + } + } + + class ClassParent extends React.Component { + render() { + return ( + {() =>
} + ); + } + } + + const container = document.createElement('div'); + ReactDOM.render(, container); +}); diff --git a/fixtures/legacy-jsx-runtimes/react-14/yarn.lock b/fixtures/legacy-jsx-runtimes/react-14/yarn.lock new file mode 100644 index 000000000000..e6924d109655 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-14/yarn.lock @@ -0,0 +1,285 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +acorn@^5.2.1: + version "5.7.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e" + integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= + +asap@~2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= + +ast-types@0.9.6: + version "0.9.6" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" + integrity sha1-ECyenpAF0+fjgpvwxPok7oYu6bk= + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base62@^1.1.0: + version "1.2.8" + resolved "https://registry.yarnpkg.com/base62/-/base62-1.2.8.tgz#1264cb0fb848d875792877479dbe8bae6bae3428" + integrity sha512-V6YHUbjLxN1ymqNLb1DPHoU1CpfdL7d2YTIp5W3U4hhoG4hhxNmsFDs66M9EXxBiSEke5Bt5dwdfMwwZF70iLA== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +commander@^2.5.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commoner@^0.10.1: + version "0.10.8" + resolved "https://registry.yarnpkg.com/commoner/-/commoner-0.10.8.tgz#34fc3672cd24393e8bb47e70caa0293811f4f2c5" + integrity sha1-NPw2cs0kOT6LtH5wyqApOBH08sU= + dependencies: + commander "^2.5.0" + detective "^4.3.1" + glob "^5.0.15" + graceful-fs "^4.1.2" + iconv-lite "^0.4.5" + mkdirp "^0.5.0" + private "^0.1.6" + q "^1.1.2" + recast "^0.11.17" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +core-js@^1.0.0: + version "1.2.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" + integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY= + +defined@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= + +detective@^4.3.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.1.tgz#0eca7314338442febb6d65da54c10bb1c82b246e" + integrity sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig== + dependencies: + acorn "^5.2.1" + defined "^1.0.0" + +envify@^3.0.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/envify/-/envify-3.4.1.tgz#d7122329e8df1688ba771b12501917c9ce5cbce8" + integrity sha1-1xIjKejfFoi6dxsSUBkXyc5cvOg= + dependencies: + jstransform "^11.0.3" + through "~2.3.4" + +esprima-fb@^15001.1.0-dev-harmony-fb: + version "15001.1.0-dev-harmony-fb" + resolved "https://registry.yarnpkg.com/esprima-fb/-/esprima-fb-15001.1.0-dev-harmony-fb.tgz#30a947303c6b8d5e955bee2b99b1d233206a6901" + integrity sha1-MKlHMDxrjV6VW+4rmbHSMyBqaQE= + +esprima@~3.1.0: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= + +fbjs@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.6.1.tgz#9636b7705f5ba9684d44b72f78321254afc860f7" + integrity sha1-lja3cF9bqWhNRLcveDISVK/IYPc= + dependencies: + core-js "^1.0.0" + loose-envify "^1.0.0" + promise "^7.0.3" + ua-parser-js "^0.7.9" + whatwg-fetch "^0.9.0" + +glob@^5.0.15: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.2: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +iconv-lite@^0.4.5: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +jstransform@^11.0.3: + version "11.0.3" + resolved "https://registry.yarnpkg.com/jstransform/-/jstransform-11.0.3.tgz#09a78993e0ae4d4ef4487f6155a91f6190cb4223" + integrity sha1-CaeJk+CuTU70SH9hVakfYZDLQiM= + dependencies: + base62 "^1.1.0" + commoner "^0.10.1" + esprima-fb "^15001.1.0-dev-harmony-fb" + object-assign "^2.0.0" + source-map "^0.4.2" + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +"minimatch@2 || 3": + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +mkdirp@^0.5.0: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + dependencies: + minimist "^1.2.5" + +object-assign@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-2.1.1.tgz#43c36e5d569ff8e4816c4efa8be02d26967c18aa" + integrity sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +private@^0.1.6, private@~0.1.5: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== + +promise@^7.0.3: + version "7.3.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" + integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg== + dependencies: + asap "~2.0.3" + +q@^1.1.2: + version "1.5.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= + +react-dom@0.14: + version "0.14.9" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-0.14.9.tgz#05064a3dcf0fb1880a3b2bfc9d58c55d8d9f6293" + integrity sha1-BQZKPc8PsYgKOyv8nVjFXY2fYpM= + +react@0.14: + version "0.14.9" + resolved "https://registry.yarnpkg.com/react/-/react-0.14.9.tgz#9110a6497c49d44ba1c0edd317aec29c2e0d91d1" + integrity sha1-kRCmSXxJ1EuhwO3TF67CnC4NkdE= + dependencies: + envify "^3.0.0" + fbjs "^0.6.1" + +recast@^0.11.17: + version "0.11.23" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3" + integrity sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM= + dependencies: + ast-types "0.9.6" + esprima "~3.1.0" + private "~0.1.5" + source-map "~0.5.0" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +source-map@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + integrity sha1-66T12pwNyZneaAMti092FzZSA2s= + dependencies: + amdefine ">=0.0.4" + +source-map@~0.5.0: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +through@~2.3.4: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +ua-parser-js@^0.7.9: + version "0.7.22" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.22.tgz#960df60a5f911ea8f1c818f3747b99c6e177eae3" + integrity sha512-YUxzMjJ5T71w6a8WWVcMGM6YWOTX27rCoIQgLXiWaxqXSx9D7DNjiGWn1aJIRSQ5qr0xuhra77bSIh6voR/46Q== + +whatwg-fetch@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-0.9.0.tgz#0e3684c6cb9995b43efc9df03e4c365d95fd9cc0" + integrity sha1-DjaExsuZlbQ+/J3wPkw2XZX9nMA= + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= diff --git a/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-dev-runtime.development.js b/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-dev-runtime.development.js new file mode 100644 index 000000000000..ecad786788f0 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-dev-runtime.development.js @@ -0,0 +1,866 @@ +/** @license React v15.7.0 + * react-jsx-dev-runtime.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +var React = require('react'); +var ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook'); + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +exports.Fragment = 0xeacb; +var REACT_STRICT_MODE_TYPE = 0xeacc; +var REACT_PROFILER_TYPE = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +var REACT_SUSPENSE_TYPE = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); + REACT_PROFILER_TYPE = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var stack = ''; + + if (currentlyValidatingElement) { + stack += ReactComponentTreeHook.getCurrentStackAddendum(currentlyValidatingElement) + } + + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableScopeAPI = false; // Experimental Create Event Handle API. + +function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; +} +var BEFORE_SLASH_RE = /^(.*)[\\\/]/; +function describeComponentFrame (name, source, ownerName) { + var sourceInfo = ''; + + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + + return '\n in ' + (name || 'Unknown') + sourceInfo; +} + +var Resolved = 1; +function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; +} +var loggedTypeFailures = {}; +var currentlyValidatingElement = null; + +function setCurrentlyValidatingElement(element) { + currentlyValidatingElement = element; +} + +function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } +} + +var ReactCurrentOwner = require('react/lib/ReactCurrentOwner'); +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown; +var specialPropRefWarningShown; +var didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; +} + +function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; +} + +function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } +} + +function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } +} +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; +/** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + +function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.
+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + key = '' + maybeKey; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + if (hasValidRef(config)) { + ref = config.ref; + } // Remaining properties are added to a new props object + + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } +} + +var ReactCurrentOwner$1 = require('react/lib/ReactCurrentOwner'); + +function setCurrentlyValidatingElement$1(element) { + currentlyValidatingElement = element; +} + +var propTypesMisspellWarningShown; + +{ + propTypesMisspellWarningShown = false; +} +/** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + +function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } +} + +function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = ReactCurrentOwner$1.current.getName(); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } +} + +function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } +} +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } +} +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + +function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + element._owner.getName() + "."; + } + + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } +} +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + +function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } +} +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + +function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + +function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } +} + +function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendum(source); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + var children = props.children; + + if (children !== undefined) { + if (isStaticChildren) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); + } + + if (Object.freeze) { + Object.freeze(children); + } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); + } + } else { + validateChildKeys(children, type); + } + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } +} // These two functions exist to still get child warnings in dev + +var jsxDEV$1 = jsxWithValidation ; + +exports.jsxDEV = jsxDEV$1; + })(); +} diff --git a/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-dev-runtime.production.min.js b/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-dev-runtime.production.min.js new file mode 100644 index 000000000000..d3abdf0a41b5 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-dev-runtime.production.min.js @@ -0,0 +1,9 @@ +/** @license React v15.7.0 + * react-jsx-dev-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'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; diff --git a/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-runtime.development.js b/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-runtime.development.js new file mode 100644 index 000000000000..9fce32b1c1e4 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-runtime.development.js @@ -0,0 +1,888 @@ +/** @license React v15.7.0 + * react-jsx-runtime.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +var React = require('react'); +var ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook'); + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +exports.Fragment = 0xeacb; +var REACT_STRICT_MODE_TYPE = 0xeacc; +var REACT_PROFILER_TYPE = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +var REACT_SUSPENSE_TYPE = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); + REACT_PROFILER_TYPE = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var stack = ''; + + if (currentlyValidatingElement) { + stack += ReactComponentTreeHook.getCurrentStackAddendum(currentlyValidatingElement) + } + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableScopeAPI = false; // Experimental Create Event Handle API. + +function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; +} + + +var BEFORE_SLASH_RE = /^(.*)[\\\/]/; +function describeComponentFrame (name, source, ownerName) { + var sourceInfo = ''; + + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + + return '\n in ' + (name || 'Unknown') + sourceInfo; +} + +var Resolved = 1; +function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; +} + +var loggedTypeFailures = {}; +var currentlyValidatingElement = null; + +function setCurrentlyValidatingElement(element) { + { + currentlyValidatingElement = element; + } +} + +function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } +} + +var ReactCurrentOwner = require('react/lib/ReactCurrentOwner'); +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown; +var specialPropRefWarningShown; +var didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; +} + +function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; +} + +function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } +} + +function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } +} +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; +/** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + +function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.
+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + key = '' + maybeKey; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + if (hasValidRef(config)) { + ref = config.ref; + } // Remaining properties are added to a new props object + + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } +} + +var ReactCurrentOwner$1 = require('react/lib/ReactCurrentOwner'); + +function setCurrentlyValidatingElement$1(element) { + currentlyValidatingElement = element; +} + +var propTypesMisspellWarningShown; + +{ + propTypesMisspellWarningShown = false; +} +/** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + +function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } +} + +function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = ReactCurrentOwner$1.current.getName(); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } +} + +function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } +} +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } +} +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + +function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + element._owner.getName() + "."; + } + + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } +} +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + +function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } +} +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + +function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + +function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } +} + +function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendum(source); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + var children = props.children; + + if (children !== undefined) { + if (isStaticChildren) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); + } + + if (Object.freeze) { + Object.freeze(children); + } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); + } + } else { + validateChildKeys(children, type); + } + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } +} // These two functions exist to still get child warnings in dev +// even with the prod transform. This means that jsxDEV is purely +// opt-in behavior for better messages but that we won't stop +// giving you warnings if you use production apis. + +function jsxWithValidationStatic(type, props, key) { + { + return jsxWithValidation(type, props, key, true); + } +} +function jsxWithValidationDynamic(type, props, key) { + { + return jsxWithValidation(type, props, key, false); + } +} + +var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children. +// for now we can ship identical prod functions + +var jsxs = jsxWithValidationStatic ; + +exports.jsx = jsx; +exports.jsxs = jsxs; + })(); +} diff --git a/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-runtime.production.min.js b/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-runtime.production.min.js new file mode 100644 index 000000000000..a80ad2d1384e --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-15/cjs/react-jsx-runtime.production.min.js @@ -0,0 +1,10 @@ +/** @license React v15.7.0 + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=require("react/lib/ReactCurrentOwner"),n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0}; +function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q; diff --git a/fixtures/legacy-jsx-runtimes/react-15/jsx-dev-runtime.js b/fixtures/legacy-jsx-runtimes/react-15/jsx-dev-runtime.js new file mode 100644 index 000000000000..324eb11e5992 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-15/jsx-dev-runtime.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-dev-runtime.production.min.js'); +} else { + module.exports = require('./cjs/react-jsx-dev-runtime.development.js'); +} diff --git a/fixtures/legacy-jsx-runtimes/react-15/jsx-runtime.js b/fixtures/legacy-jsx-runtimes/react-15/jsx-runtime.js new file mode 100644 index 000000000000..0416df54291a --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-15/jsx-runtime.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-runtime.production.min.js'); +} else { + module.exports = require('./cjs/react-jsx-runtime.development.js'); +} diff --git a/fixtures/legacy-jsx-runtimes/react-15/package.json b/fixtures/legacy-jsx-runtimes/react-15/package.json new file mode 100644 index 000000000000..e5d144ca0533 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-15/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "react": "15", + "react-dom": "15" + } +} diff --git a/fixtures/legacy-jsx-runtimes/react-15/react-15.test.js b/fixtures/legacy-jsx-runtimes/react-15/react-15.test.js new file mode 100644 index 000000000000..75891a88b8a5 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-15/react-15.test.js @@ -0,0 +1,775 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @emails react-core + */ + +// These tests are based on ReactJSXElement-test, +// ReactJSXElementValidator-test, ReactComponent-test, +// and ReactElementJSX-test. + +jest.mock('react/jsx-runtime', () => require('./jsx-runtime'), {virtual: true}); +jest.mock('react/jsx-dev-runtime', () => require('./jsx-dev-runtime'), { + virtual: true, +}); + +let React = require('react'); +let ReactDOM = require('react-dom'); +let ReactTestUtils = { + renderIntoDocument(el) { + const container = document.createElement('div'); + return ReactDOM.render(el, container); + }, +}; +let PropTypes = require('prop-types'); +let Component = class Component extends React.Component { + render() { + return
; + } +}; +let RequiredPropComponent = class extends React.Component { + render() { + return {this.props.prop}; + } +}; +RequiredPropComponent.displayName = 'RequiredPropComponent'; +RequiredPropComponent.propTypes = {prop: PropTypes.string.isRequired}; + +it('works', () => { + const container = document.createElement('div'); + ReactDOM.render(

hello

, container); + expect(container.textContent).toBe('hello'); +}); + +it('returns a complete element according to spec', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('allows a lower-case to be passed as the string type', () => { + const element =
; + expect(element.type).toBe('div'); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('allows a string to be passed as the type', () => { + const TagName = 'div'; + const element = ; + expect(element.type).toBe('div'); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('returns an immutable element', () => { + const element = ; + if (process.env.NODE_ENV === 'development') { + expect(() => (element.type = 'div')).toThrow(); + } else { + expect(() => (element.type = 'div')).not.toThrow(); + } +}); + +it('does not reuse the object that is spread into props', () => { + const config = {foo: 1}; + const element = ; + expect(element.props.foo).toBe(1); + config.foo = 2; + expect(element.props.foo).toBe(1); +}); + +it('extracts key and ref from the rest of the props', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe('12'); + expect(element.ref).toBe('34'); + const expectation = {foo: '56'}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('coerces the key to a string', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe('12'); + expect(element.ref).toBe(null); + const expectation = {foo: '56'}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('merges JSX children onto the children prop', () => { + const a = 1; + const element = {a}; + expect(element.props.children).toBe(a); +}); + +it('does not override children if no JSX children are provided', () => { + const element = ; + expect(element.props.children).toBe('text'); +}); + +it('overrides children if null is provided as a JSX child', () => { + const element = {null}; + expect(element.props.children).toBe(null); +}); + +it('overrides children if undefined is provided as an argument', () => { + const element = {undefined}; + expect(element.props.children).toBe(undefined); + + const element2 = React.cloneElement( + , + {}, + undefined + ); + expect(element2.props.children).toBe(undefined); +}); + +it('merges JSX children onto the children prop in an array', () => { + const a = 1; + const b = 2; + const c = 3; + const element = ( + + {a} + {b} + {c} + + ); + expect(element.props.children).toEqual([1, 2, 3]); +}); + +it('allows static methods to be called using the type property', () => { + class StaticMethodComponent { + static someStaticMethod() { + return 'someReturnValue'; + } + render() { + return
; + } + } + + const element = ; + expect(element.type.someStaticMethod()).toBe('someReturnValue'); +}); + +it('identifies valid elements', () => { + expect(React.isValidElement(
)).toEqual(true); + expect(React.isValidElement()).toEqual(true); + + expect(React.isValidElement(null)).toEqual(false); + expect(React.isValidElement(true)).toEqual(false); + expect(React.isValidElement({})).toEqual(false); + expect(React.isValidElement('string')).toEqual(false); + expect(React.isValidElement(Component)).toEqual(false); + expect(React.isValidElement({type: 'div', props: {}})).toEqual(false); +}); + +it('is indistinguishable from a plain object', () => { + const element =
; + const object = {}; + expect(element.constructor).toBe(object.constructor); +}); + +it('should use default prop value when removing a prop', () => { + Component.defaultProps = {fruit: 'persimmon'}; + + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.props.fruit).toBe('mango'); + + ReactDOM.render(, container); + expect(instance.props.fruit).toBe('persimmon'); +}); + +it('should normalize props with default values', () => { + class NormalizingComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NormalizingComponent.defaultProps = {prop: 'testKey'}; + + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.props.prop).toBe('testKey'); + + const inst2 = ReactDOM.render( + , + container + ); + expect(inst2.props.prop).toBe(null); +}); + +it('warns for keys for arrays of elements in children position', () => { + expect(() => + ReactTestUtils.renderIntoDocument( + {[, ]} + ) + ).toErrorDev('Each child in a list should have a unique "key" prop.'); +}); + +it('warns for keys for arrays of elements with owner info', () => { + class InnerComponent extends React.Component { + render() { + return {this.props.childSet}; + } + } + + class ComponentWrapper extends React.Component { + render() { + return , ]} />; + } + } + + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'Each child in a list should have a unique "key" prop.' + + '\n\nCheck the render method of `InnerComponent`. ' + + 'It was passed a child from ComponentWrapper. ' + ); +}); + +it('does not warn for arrays of elements with keys', () => { + ReactTestUtils.renderIntoDocument( + {[, ]} + ); +}); + +it('does not warn for iterable elements with keys', () => { + const iterable = { + '@@iterator': function() { + let i = 0; + return { + next: function() { + const done = ++i > 2; + return { + value: done ? undefined : , + done: done, + }; + }, + }; + }, + }; + + ReactTestUtils.renderIntoDocument({iterable}); +}); + +it('does not warn for numeric keys in entry iterable as a child', () => { + const iterable = { + '@@iterator': function() { + let i = 0; + return { + next: function() { + const done = ++i > 2; + return {value: done ? undefined : [i, ], done: done}; + }, + }; + }, + }; + iterable.entries = iterable['@@iterator']; + + ReactTestUtils.renderIntoDocument({iterable}); +}); + +it('does not warn when the element is directly as children', () => { + ReactTestUtils.renderIntoDocument( + + + + + ); +}); + +it('does not warn when the child array contains non-elements', () => { + void ({[{}, {}]}); +}); + +it('should give context for PropType errors in nested components.', () => { + // In this test, we're making sure that if a proptype error is found in a + // component, we give a small hint as to which parent instantiated that + // component as per warnings about key usage in ReactElementValidator. + function MyComp({color}) { + return
My color is {color}
; + } + MyComp.propTypes = { + color: PropTypes.string, + }; + class ParentComp extends React.Component { + render() { + return ; + } + } + expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( + 'Warning: Failed prop type: ' + + 'Invalid prop `color` of type `number` supplied to `MyComp`, ' + + 'expected `string`.\n' + + ' in MyComp (at **)\n' + + ' in ParentComp (at **)' + ); +}); + +it('gives a helpful error when passing null, undefined, or boolean', () => { + const Undefined = undefined; + const Null = null; + const True = true; + const Div = 'div'; + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: undefined. You likely forgot to export your ' + + "component from the file it's defined in, or you might have mixed up " + + 'default and named imports.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: null.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: boolean.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + // No error expected + void (
); +}); + +it('should check default prop values', () => { + RequiredPropComponent.defaultProps = {prop: null}; + + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'Warning: Failed prop type: The prop `prop` is marked as required in ' + + '`RequiredPropComponent`, but its value is `null`.\n' + + ' in RequiredPropComponent (at **)' + ); +}); + +it('should warn on invalid prop types', () => { + // Since there is no prevalidation step for ES6 classes, there is no hook + // for us to issue a warning earlier than element creation when the error + // actually occurs. Since this step is skipped in production, we should just + // warn instead of throwing for this case. + class NullPropTypeComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NullPropTypeComponent.propTypes = { + prop: null, + }; + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'NullPropTypeComponent: prop type `prop` is invalid; it must be a ' + + 'function, usually from the `prop-types` package,' + ); +}); + +xit('should warn on invalid context types', () => { + class NullContextTypeComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NullContextTypeComponent.contextTypes = { + prop: null, + }; + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'NullContextTypeComponent: type `prop` is invalid; it must ' + + 'be a function, usually from the `prop-types` package,' + ); +}); + +it('should warn if getDefaultProps is specified on the class', () => { + class GetDefaultPropsComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + GetDefaultPropsComponent.getDefaultProps = () => ({ + prop: 'foo', + }); + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'getDefaultProps is only used on classic React.createClass definitions.' + + ' Use a static property named `defaultProps` instead.', + {withoutStack: true} + ); +}); + +it('should warn if component declares PropTypes instead of propTypes', () => { + class MisspelledPropTypesComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + MisspelledPropTypesComponent.PropTypes = { + prop: PropTypes.string, + }; + expect(() => + ReactTestUtils.renderIntoDocument( + + ) + ).toErrorDev( + 'Warning: Component MisspelledPropTypesComponent declared `PropTypes` ' + + 'instead of `propTypes`. Did you misspell the property assignment?', + {withoutStack: true} + ); +}); + +// Not supported. +xit('warns for fragments with illegal attributes', () => { + class Foo extends React.Component { + render() { + return hello; + } + } + + expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( + 'Invalid prop `a` supplied to `React.Fragment`. React.Fragment ' + + 'can only have `key` and `children` props.' + ); +}); + +// Not supported. +xit('warns for fragments with refs', () => { + class Foo extends React.Component { + render() { + return ( + { + this.foo = bar; + }}> + hello + + ); + } + } + + expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( + 'Invalid attribute `ref` supplied to `React.Fragment`.' + ); +}); + +// Not supported. +xit('does not warn for fragments of multiple elements without keys', () => { + ReactTestUtils.renderIntoDocument( + <> + 1 + 2 + + ); +}); + +// Not supported. +xit('warns for fragments of multiple elements with same key', () => { + expect(() => + ReactTestUtils.renderIntoDocument( + <> + 1 + 2 + 3 + + ) + ).toErrorDev('Encountered two children with the same key, `a`.', { + withoutStack: true, + }); +}); + +// Not supported. +xit('does not call lazy initializers eagerly', () => { + let didCall = false; + const Lazy = React.lazy(() => { + didCall = true; + return {then() {}}; + }); + ; + expect(didCall).toBe(false); +}); + +it('supports classic refs', () => { + class Foo extends React.Component { + render() { + return
; + } + } + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.refs.inner.className).toBe('foo'); +}); + +it('should support refs on owned components', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + class Component extends React.Component { + render() { + const inner = ; + const outer = ( + + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.refs.inner.getObject()).toEqual(innerObj); + expect(this.refs.outer.getObject()).toEqual(outerObj); + } + } + + ReactTestUtils.renderIntoDocument(); +}); + +it('should support callback-style refs', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + let mounted = false; + + class Component extends React.Component { + render() { + const inner = ( + (this.innerRef = c)} /> + ); + const outer = ( + (this.outerRef = c)}> + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.innerRef.getObject()).toEqual(innerObj); + expect(this.outerRef.getObject()).toEqual(outerObj); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +// Not supported. +xit('should support object-style refs', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + let mounted = false; + + class Component extends React.Component { + constructor() { + super(); + this.innerRef = React.createRef(); + this.outerRef = React.createRef(); + } + render() { + const inner = ; + const outer = ( + + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.innerRef.current.getObject()).toEqual(innerObj); + expect(this.outerRef.current.getObject()).toEqual(outerObj); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +it('should support new-style refs with mixed-up owners', () => { + class Wrapper extends React.Component { + getTitle = () => { + return this.props.title; + }; + + render() { + return this.props.getContent(); + } + } + + let mounted = false; + + class Component extends React.Component { + getInner = () => { + // (With old-style refs, it's impossible to get a ref to this div + // because Wrapper is the current owner when this function is called.) + return
(this.innerRef = c)} />; + }; + + render() { + return ( + (this.wrapperRef = c)} + getContent={this.getInner} + /> + ); + } + + componentDidMount() { + // Check .props.title to make sure we got the right elements back + expect(this.wrapperRef.getTitle()).toBe('wrapper'); + expect(this.innerRef.className).toBe('inner'); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +it('should warn when `key` is being accessed on composite element', () => { + const container = document.createElement('div'); + class Child extends React.Component { + render() { + return
{this.props.key}
; + } + } + class Parent extends React.Component { + render() { + return ( +
+ + + +
+ ); + } + } + expect(() => + ReactDOM.render(, container) + ).toErrorDev( + 'Child: `key` is not a prop. Trying to access it will result ' + + 'in `undefined` being returned. If you need to access the same ' + + 'value within the child component, you should pass it as a different ' + + 'prop. (https://reactjs.org/link/special-props)', + {withoutStack: true} + ); +}); + +it('should warn when `ref` is being accessed', () => { + const container = document.createElement('div'); + class Child extends React.Component { + render() { + return
{this.props.ref}
; + } + } + class Parent extends React.Component { + render() { + return ( +
+ +
+ ); + } + } + expect(() => + ReactDOM.render(, container) + ).toErrorDev( + 'Child: `ref` is not a prop. Trying to access it will result ' + + 'in `undefined` being returned. If you need to access the same ' + + 'value within the child component, you should pass it as a different ' + + 'prop. (https://reactjs.org/link/special-props)', + {withoutStack: true} + ); +}); + +// Note: no warning before 16. +it('should NOT warn when owner and self are different for string refs', () => { + class ClassWithRenderProp extends React.Component { + render() { + return this.props.children(); + } + } + + class ClassParent extends React.Component { + render() { + return ( + {() =>
} + ); + } + } + + const container = document.createElement('div'); + ReactDOM.render(, container); +}); diff --git a/fixtures/legacy-jsx-runtimes/react-15/yarn.lock b/fixtures/legacy-jsx-runtimes/react-15/yarn.lock new file mode 100644 index 000000000000..47c01c42e828 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-15/yarn.lock @@ -0,0 +1,149 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +asap@~2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= + +core-js@^1.0.0: + version "1.2.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" + integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY= + +create-react-class@^15.6.0: + version "15.6.3" + resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036" + integrity sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg== + dependencies: + fbjs "^0.8.9" + loose-envify "^1.3.1" + object-assign "^4.1.1" + +encoding@^0.1.11: + version "0.1.13" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" + integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== + dependencies: + iconv-lite "^0.6.2" + +fbjs@^0.8.9: + version "0.8.17" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" + integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.18" + +iconv-lite@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.2.tgz#ce13d1875b0c3a674bd6a04b7f76b01b1b6ded01" + integrity sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + +is-stream@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +isomorphic-fetch@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= + dependencies: + node-fetch "^1.0.1" + whatwg-fetch ">=0.10.0" + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +node-fetch@^1.0.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +promise@^7.1.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" + integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg== + dependencies: + asap "~2.0.3" + +prop-types@^15.5.10: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + +react-dom@15: + version "15.6.2" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.2.tgz#41cfadf693b757faf2708443a1d1fd5a02bef730" + integrity sha1-Qc+t9pO3V/rycIRDodH9WgK+9zA= + dependencies: + fbjs "^0.8.9" + loose-envify "^1.1.0" + object-assign "^4.1.0" + prop-types "^15.5.10" + +react-is@^16.8.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +react@15: + version "15.6.2" + resolved "https://registry.yarnpkg.com/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72" + integrity sha1-26BDSrQ5z+gvEI8PURZjkIF5qnI= + dependencies: + create-react-class "^15.6.0" + fbjs "^0.8.9" + loose-envify "^1.1.0" + object-assign "^4.1.0" + prop-types "^15.5.10" + +"safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + +ua-parser-js@^0.7.18: + version "0.7.22" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.22.tgz#960df60a5f911ea8f1c818f3747b99c6e177eae3" + integrity sha512-YUxzMjJ5T71w6a8WWVcMGM6YWOTX27rCoIQgLXiWaxqXSx9D7DNjiGWn1aJIRSQ5qr0xuhra77bSIh6voR/46Q== + +whatwg-fetch@>=0.10.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.4.1.tgz#e5f871572d6879663fa5674c8f833f15a8425ab3" + integrity sha512-sofZVzE1wKwO+EYPbWfiwzaKovWiZXf4coEzjGP9b2GBVgQRLQUZ2QcuPpQExGDAW5GItpEm6Tl4OU5mywnAoQ== diff --git a/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-dev-runtime.development.js b/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-dev-runtime.development.js new file mode 100644 index 000000000000..880e9b652f0b --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-dev-runtime.development.js @@ -0,0 +1,889 @@ +/** @license React v16.14.0 + * react-jsx-dev-runtime.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +var React = require('react'); + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +exports.Fragment = 0xeacb; +var REACT_STRICT_MODE_TYPE = 0xeacc; +var REACT_PROFILER_TYPE = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +var REACT_SUSPENSE_TYPE = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); + REACT_PROFILER_TYPE = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ''; + + if (currentlyValidatingElement) { + var name = getComponentName(currentlyValidatingElement.type); + var owner = currentlyValidatingElement._owner; + stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type)); + } + + stack += ReactDebugCurrentFrame.getStackAddendum(); + + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableScopeAPI = false; // Experimental Create Event Handle API. + +function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; +} +var BEFORE_SLASH_RE = /^(.*)[\\\/]/; +function describeComponentFrame (name, source, ownerName) { + var sourceInfo = ''; + + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + + return '\n in ' + (name || 'Unknown') + sourceInfo; +} + +var Resolved = 1; +function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; +} +var loggedTypeFailures = {}; +var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; +var currentlyValidatingElement = null; + +function setCurrentlyValidatingElement(element) { + currentlyValidatingElement = element; +} + +function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } +} + +var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown; +var specialPropRefWarningShown; +var didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; +} + +function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; +} + +function warnIfStringRefCannotBeAutoConverted(config, self) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); + + didWarnAboutStringRefs[componentName] = true; + } + } + } +} + +function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } +} + +function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } +} +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; +/** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + +function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.
+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + key = '' + maybeKey; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + if (hasValidRef(config)) { + ref = config.ref; + warnIfStringRefCannotBeAutoConverted(config, self); + } // Remaining properties are added to a new props object + + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } +} + +var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; +var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + +function setCurrentlyValidatingElement$1(element) { + currentlyValidatingElement = element; +} + +var propTypesMisspellWarningShown; + +{ + propTypesMisspellWarningShown = false; +} +/** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + +function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } +} + +function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = getComponentName(ReactCurrentOwner$1.current.type); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } +} + +function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } +} +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } +} +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + +function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; + } + + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } +} +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + +function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } +} +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + +function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + +function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } +} + +function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendum(source); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + var children = props.children; + + if (children !== undefined) { + if (isStaticChildren) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); + } + + if (Object.freeze) { + Object.freeze(children); + } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); + } + } else { + validateChildKeys(children, type); + } + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } +} // These two functions exist to still get child warnings in dev + +var jsxDEV$1 = jsxWithValidation ; + +exports.jsxDEV = jsxDEV$1; + })(); +} diff --git a/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-dev-runtime.production.min.js b/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-dev-runtime.production.min.js new file mode 100644 index 000000000000..a20e4b9242b9 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-dev-runtime.production.min.js @@ -0,0 +1,9 @@ +/** @license React v16.14.0 + * react-jsx-dev-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'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; diff --git a/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-runtime.development.js b/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-runtime.development.js new file mode 100644 index 000000000000..76e6f2457b9c --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-runtime.development.js @@ -0,0 +1,911 @@ +/** @license React v16.14.0 + * react-jsx-runtime.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +var React = require('react'); + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +exports.Fragment = 0xeacb; +var REACT_STRICT_MODE_TYPE = 0xeacc; +var REACT_PROFILER_TYPE = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +var REACT_SUSPENSE_TYPE = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); + REACT_PROFILER_TYPE = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ''; + + if (currentlyValidatingElement) { + var name = getComponentName(currentlyValidatingElement.type); + var owner = currentlyValidatingElement._owner; + stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type)); + } + + stack += ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableScopeAPI = false; // Experimental Create Event Handle API. + +function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; +} + + +var BEFORE_SLASH_RE = /^(.*)[\\\/]/; +function describeComponentFrame (name, source, ownerName) { + var sourceInfo = ''; + + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + + return '\n in ' + (name || 'Unknown') + sourceInfo; +} + +var Resolved = 1; +function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; +} + +var loggedTypeFailures = {}; +var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; +var currentlyValidatingElement = null; + +function setCurrentlyValidatingElement(element) { + { + currentlyValidatingElement = element; + } +} + +function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } +} + +var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown; +var specialPropRefWarningShown; +var didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; +} + +function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; +} + +function warnIfStringRefCannotBeAutoConverted(config, self) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); + + didWarnAboutStringRefs[componentName] = true; + } + } + } +} + +function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } +} + +function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } +} +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; +/** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + +function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.
+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + key = '' + maybeKey; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + if (hasValidRef(config)) { + ref = config.ref; + warnIfStringRefCannotBeAutoConverted(config, self); + } // Remaining properties are added to a new props object + + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } +} + +var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; +var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + +function setCurrentlyValidatingElement$1(element) { + currentlyValidatingElement = element; +} + +var propTypesMisspellWarningShown; + +{ + propTypesMisspellWarningShown = false; +} +/** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + +function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } +} + +function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = getComponentName(ReactCurrentOwner$1.current.type); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } +} + +function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } +} +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } +} +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + +function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; + } + + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } +} +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + +function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } +} +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + +function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + +function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } +} + +function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendum(source); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + var children = props.children; + + if (children !== undefined) { + if (isStaticChildren) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); + } + + if (Object.freeze) { + Object.freeze(children); + } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); + } + } else { + validateChildKeys(children, type); + } + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } +} // These two functions exist to still get child warnings in dev +// even with the prod transform. This means that jsxDEV is purely +// opt-in behavior for better messages but that we won't stop +// giving you warnings if you use production apis. + +function jsxWithValidationStatic(type, props, key) { + { + return jsxWithValidation(type, props, key, true); + } +} +function jsxWithValidationDynamic(type, props, key) { + { + return jsxWithValidation(type, props, key, false); + } +} + +var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children. +// for now we can ship identical prod functions + +var jsxs = jsxWithValidationStatic ; + +exports.jsx = jsx; +exports.jsxs = jsxs; + })(); +} diff --git a/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-runtime.production.min.js b/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-runtime.production.min.js new file mode 100644 index 000000000000..cbc6bf496a52 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-16/cjs/react-jsx-runtime.production.min.js @@ -0,0 +1,10 @@ +/** @license React v16.14.0 + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0}; +function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q; diff --git a/fixtures/legacy-jsx-runtimes/react-16/jsx-dev-runtime.js b/fixtures/legacy-jsx-runtimes/react-16/jsx-dev-runtime.js new file mode 100644 index 000000000000..324eb11e5992 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-16/jsx-dev-runtime.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-dev-runtime.production.min.js'); +} else { + module.exports = require('./cjs/react-jsx-dev-runtime.development.js'); +} diff --git a/fixtures/legacy-jsx-runtimes/react-16/jsx-runtime.js b/fixtures/legacy-jsx-runtimes/react-16/jsx-runtime.js new file mode 100644 index 000000000000..0416df54291a --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-16/jsx-runtime.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-runtime.production.min.js'); +} else { + module.exports = require('./cjs/react-jsx-runtime.development.js'); +} diff --git a/fixtures/legacy-jsx-runtimes/react-16/package.json b/fixtures/legacy-jsx-runtimes/react-16/package.json new file mode 100644 index 000000000000..a283476fb76b --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-16/package.json @@ -0,0 +1,7 @@ +{ + "dependencies": { + "prop-types": "^15.7.2", + "react": "16", + "react-dom": "16" + } +} diff --git a/fixtures/legacy-jsx-runtimes/react-16/react-16.test.js b/fixtures/legacy-jsx-runtimes/react-16/react-16.test.js new file mode 100644 index 000000000000..55bcb8ae84ac --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-16/react-16.test.js @@ -0,0 +1,773 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @emails react-core + */ + +// These tests are based on ReactJSXElement-test, +// ReactJSXElementValidator-test, ReactComponent-test, +// and ReactElementJSX-test. + +jest.mock('react/jsx-runtime', () => require('./jsx-runtime'), {virtual: true}); +jest.mock('react/jsx-dev-runtime', () => require('./jsx-dev-runtime'), { + virtual: true, +}); + +let React = require('react'); +let ReactDOM = require('react-dom'); +let ReactTestUtils = { + renderIntoDocument(el) { + const container = document.createElement('div'); + return ReactDOM.render(el, container); + }, +}; +let PropTypes = require('prop-types'); +let Component = class Component extends React.Component { + render() { + return
; + } +}; +let RequiredPropComponent = class extends React.Component { + render() { + return {this.props.prop}; + } +}; +RequiredPropComponent.displayName = 'RequiredPropComponent'; +RequiredPropComponent.propTypes = {prop: PropTypes.string.isRequired}; + +it('works', () => { + const container = document.createElement('div'); + ReactDOM.render(

hello

, container); + expect(container.textContent).toBe('hello'); +}); + +it('returns a complete element according to spec', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('allows a lower-case to be passed as the string type', () => { + const element =
; + expect(element.type).toBe('div'); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('allows a string to be passed as the type', () => { + const TagName = 'div'; + const element = ; + expect(element.type).toBe('div'); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('returns an immutable element', () => { + const element = ; + if (process.env.NODE_ENV === 'development') { + expect(() => (element.type = 'div')).toThrow(); + } else { + expect(() => (element.type = 'div')).not.toThrow(); + } +}); + +it('does not reuse the object that is spread into props', () => { + const config = {foo: 1}; + const element = ; + expect(element.props.foo).toBe(1); + config.foo = 2; + expect(element.props.foo).toBe(1); +}); + +it('extracts key and ref from the rest of the props', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe('12'); + expect(element.ref).toBe('34'); + const expectation = {foo: '56'}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('coerces the key to a string', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe('12'); + expect(element.ref).toBe(null); + const expectation = {foo: '56'}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('merges JSX children onto the children prop', () => { + const a = 1; + const element = {a}; + expect(element.props.children).toBe(a); +}); + +it('does not override children if no JSX children are provided', () => { + const element = ; + expect(element.props.children).toBe('text'); +}); + +it('overrides children if null is provided as a JSX child', () => { + const element = {null}; + expect(element.props.children).toBe(null); +}); + +it('overrides children if undefined is provided as an argument', () => { + const element = {undefined}; + expect(element.props.children).toBe(undefined); + + const element2 = React.cloneElement( + , + {}, + undefined + ); + expect(element2.props.children).toBe(undefined); +}); + +it('merges JSX children onto the children prop in an array', () => { + const a = 1; + const b = 2; + const c = 3; + const element = ( + + {a} + {b} + {c} + + ); + expect(element.props.children).toEqual([1, 2, 3]); +}); + +it('allows static methods to be called using the type property', () => { + class StaticMethodComponent { + static someStaticMethod() { + return 'someReturnValue'; + } + render() { + return
; + } + } + + const element = ; + expect(element.type.someStaticMethod()).toBe('someReturnValue'); +}); + +it('identifies valid elements', () => { + expect(React.isValidElement(
)).toEqual(true); + expect(React.isValidElement()).toEqual(true); + + expect(React.isValidElement(null)).toEqual(false); + expect(React.isValidElement(true)).toEqual(false); + expect(React.isValidElement({})).toEqual(false); + expect(React.isValidElement('string')).toEqual(false); + expect(React.isValidElement(Component)).toEqual(false); + expect(React.isValidElement({type: 'div', props: {}})).toEqual(false); +}); + +it('is indistinguishable from a plain object', () => { + const element =
; + const object = {}; + expect(element.constructor).toBe(object.constructor); +}); + +it('should use default prop value when removing a prop', () => { + Component.defaultProps = {fruit: 'persimmon'}; + + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.props.fruit).toBe('mango'); + + ReactDOM.render(, container); + expect(instance.props.fruit).toBe('persimmon'); +}); + +it('should normalize props with default values', () => { + class NormalizingComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NormalizingComponent.defaultProps = {prop: 'testKey'}; + + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.props.prop).toBe('testKey'); + + const inst2 = ReactDOM.render( + , + container + ); + expect(inst2.props.prop).toBe(null); +}); + +it('warns for keys for arrays of elements in children position', () => { + expect(() => + ReactTestUtils.renderIntoDocument( + {[, ]} + ) + ).toErrorDev('Each child in a list should have a unique "key" prop.'); +}); + +it('warns for keys for arrays of elements with owner info', () => { + class InnerComponent extends React.Component { + render() { + return {this.props.childSet}; + } + } + + class ComponentWrapper extends React.Component { + render() { + return , ]} />; + } + } + + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'Each child in a list should have a unique "key" prop.' + + '\n\nCheck the render method of `InnerComponent`. ' + + 'It was passed a child from ComponentWrapper. ' + ); +}); + +it('does not warn for arrays of elements with keys', () => { + ReactTestUtils.renderIntoDocument( + {[, ]} + ); +}); + +it('does not warn for iterable elements with keys', () => { + const iterable = { + '@@iterator': function() { + let i = 0; + return { + next: function() { + const done = ++i > 2; + return { + value: done ? undefined : , + done: done, + }; + }, + }; + }, + }; + + ReactTestUtils.renderIntoDocument({iterable}); +}); + +it('does not warn for numeric keys in entry iterable as a child', () => { + const iterable = { + '@@iterator': function() { + let i = 0; + return { + next: function() { + const done = ++i > 2; + return {value: done ? undefined : [i, ], done: done}; + }, + }; + }, + }; + iterable.entries = iterable['@@iterator']; + + ReactTestUtils.renderIntoDocument({iterable}); +}); + +it('does not warn when the element is directly as children', () => { + ReactTestUtils.renderIntoDocument( + + + + + ); +}); + +it('does not warn when the child array contains non-elements', () => { + void ({[{}, {}]}); +}); + +it('should give context for PropType errors in nested components.', () => { + // In this test, we're making sure that if a proptype error is found in a + // component, we give a small hint as to which parent instantiated that + // component as per warnings about key usage in ReactElementValidator. + function MyComp({color}) { + return
My color is {color}
; + } + MyComp.propTypes = { + color: PropTypes.string, + }; + class ParentComp extends React.Component { + render() { + return ; + } + } + expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( + 'Warning: Failed prop type: ' + + 'Invalid prop `color` of type `number` supplied to `MyComp`, ' + + 'expected `string`.\n' + + ' in MyComp (at **)\n' + + ' in ParentComp (at **)' + ); +}); + +it('gives a helpful error when passing null, undefined, or boolean', () => { + const Undefined = undefined; + const Null = null; + const True = true; + const Div = 'div'; + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: undefined. You likely forgot to export your ' + + "component from the file it's defined in, or you might have mixed up " + + 'default and named imports.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: null.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: boolean.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + // No error expected + void (
); +}); + +it('should check default prop values', () => { + RequiredPropComponent.defaultProps = {prop: null}; + + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'Warning: Failed prop type: The prop `prop` is marked as required in ' + + '`RequiredPropComponent`, but its value is `null`.\n' + + ' in RequiredPropComponent (at **)' + ); +}); + +it('should warn on invalid prop types', () => { + // Since there is no prevalidation step for ES6 classes, there is no hook + // for us to issue a warning earlier than element creation when the error + // actually occurs. Since this step is skipped in production, we should just + // warn instead of throwing for this case. + class NullPropTypeComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NullPropTypeComponent.propTypes = { + prop: null, + }; + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'NullPropTypeComponent: prop type `prop` is invalid; it must be a ' + + 'function, usually from the `prop-types` package,' + ); +}); + +it('should warn on invalid context types', () => { + class NullContextTypeComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NullContextTypeComponent.contextTypes = { + prop: null, + }; + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'NullContextTypeComponent: context type `prop` is invalid; it must ' + + 'be a function, usually from the `prop-types` package,' + ); +}); + +it('should warn if getDefaultProps is specified on the class', () => { + class GetDefaultPropsComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + GetDefaultPropsComponent.getDefaultProps = () => ({ + prop: 'foo', + }); + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'getDefaultProps is only used on classic React.createClass definitions.' + + ' Use a static property named `defaultProps` instead.', + {withoutStack: true} + ); +}); + +it('should warn if component declares PropTypes instead of propTypes', () => { + class MisspelledPropTypesComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + MisspelledPropTypesComponent.PropTypes = { + prop: PropTypes.string, + }; + expect(() => + ReactTestUtils.renderIntoDocument( + + ) + ).toErrorDev( + 'Warning: Component MisspelledPropTypesComponent declared `PropTypes` ' + + 'instead of `propTypes`. Did you misspell the property assignment?', + {withoutStack: true} + ); +}); + +it('warns for fragments with illegal attributes', () => { + class Foo extends React.Component { + render() { + return hello; + } + } + + expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( + 'Invalid prop `a` supplied to `React.Fragment`. React.Fragment ' + + 'can only have `key` and `children` props.' + ); +}); + +it('warns for fragments with refs', () => { + class Foo extends React.Component { + render() { + return ( + { + this.foo = bar; + }}> + hello + + ); + } + } + + expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( + 'Invalid attribute `ref` supplied to `React.Fragment`.' + ); +}); + +it('does not warn for fragments of multiple elements without keys', () => { + ReactTestUtils.renderIntoDocument( + <> + 1 + 2 + + ); +}); + +it('warns for fragments of multiple elements with same key', () => { + expect(() => + ReactTestUtils.renderIntoDocument( + <> + 1 + 2 + 3 + + ) + ).toErrorDev('Encountered two children with the same key, `a`.', { + withoutStack: true, + }); +}); + +it('does not call lazy initializers eagerly', () => { + let didCall = false; + const Lazy = React.lazy(() => { + didCall = true; + return {then() {}}; + }); + ; + expect(didCall).toBe(false); +}); + +it('supports classic refs', () => { + class Foo extends React.Component { + render() { + return
; + } + } + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.refs.inner.className).toBe('foo'); +}); + +it('should support refs on owned components', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + class Component extends React.Component { + render() { + const inner = ; + const outer = ( + + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.refs.inner.getObject()).toEqual(innerObj); + expect(this.refs.outer.getObject()).toEqual(outerObj); + } + } + + ReactTestUtils.renderIntoDocument(); +}); + +it('should support callback-style refs', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + let mounted = false; + + class Component extends React.Component { + render() { + const inner = ( + (this.innerRef = c)} /> + ); + const outer = ( + (this.outerRef = c)}> + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.innerRef.getObject()).toEqual(innerObj); + expect(this.outerRef.getObject()).toEqual(outerObj); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +it('should support object-style refs', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + let mounted = false; + + class Component extends React.Component { + constructor() { + super(); + this.innerRef = React.createRef(); + this.outerRef = React.createRef(); + } + render() { + const inner = ; + const outer = ( + + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.innerRef.current.getObject()).toEqual(innerObj); + expect(this.outerRef.current.getObject()).toEqual(outerObj); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +it('should support new-style refs with mixed-up owners', () => { + class Wrapper extends React.Component { + getTitle = () => { + return this.props.title; + }; + + render() { + return this.props.getContent(); + } + } + + let mounted = false; + + class Component extends React.Component { + getInner = () => { + // (With old-style refs, it's impossible to get a ref to this div + // because Wrapper is the current owner when this function is called.) + return
(this.innerRef = c)} />; + }; + + render() { + return ( + (this.wrapperRef = c)} + getContent={this.getInner} + /> + ); + } + + componentDidMount() { + // Check .props.title to make sure we got the right elements back + expect(this.wrapperRef.getTitle()).toBe('wrapper'); + expect(this.innerRef.className).toBe('inner'); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +it('should warn when `key` is being accessed on composite element', () => { + const container = document.createElement('div'); + class Child extends React.Component { + render() { + return
{this.props.key}
; + } + } + class Parent extends React.Component { + render() { + return ( +
+ + + +
+ ); + } + } + expect(() => ReactDOM.render(, container)).toErrorDev( + 'Child: `key` is not a prop. Trying to access it will result ' + + 'in `undefined` being returned. If you need to access the same ' + + 'value within the child component, you should pass it as a different ' + + 'prop. (https://reactjs.org/link/special-props)' + ); +}); + +it('should warn when `ref` is being accessed', () => { + const container = document.createElement('div'); + class Child extends React.Component { + render() { + return
{this.props.ref}
; + } + } + class Parent extends React.Component { + render() { + return ( +
+ +
+ ); + } + } + expect(() => ReactDOM.render(, container)).toErrorDev( + 'Child: `ref` is not a prop. Trying to access it will result ' + + 'in `undefined` being returned. If you need to access the same ' + + 'value within the child component, you should pass it as a different ' + + 'prop. (https://reactjs.org/link/special-props)' + ); +}); + +it('should warn when owner and self are different for string refs', () => { + class ClassWithRenderProp extends React.Component { + render() { + return this.props.children(); + } + } + + class ClassParent extends React.Component { + render() { + return ( + {() =>
} + ); + } + } + + const container = document.createElement('div'); + if (process.env.BABEL_ENV === 'development') { + expect(() => ReactDOM.render(, container)).toErrorDev([ + 'Warning: Component "ClassWithRenderProp" contains the string ref "myRef". ' + + 'Support for string refs will be removed in a future major release. ' + + 'This case cannot be automatically converted to an arrow function. ' + + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + + 'Learn more about using refs safely here: ' + + 'https://reactjs.org/link/strict-mode-string-ref', + ]); + } else { + ReactDOM.render(, container); + } +}); diff --git a/fixtures/legacy-jsx-runtimes/react-16/yarn.lock b/fixtures/legacy-jsx-runtimes/react-16/yarn.lock new file mode 100644 index 000000000000..0c9a46a49a49 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-16/yarn.lock @@ -0,0 +1,61 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +prop-types@^15.6.2, prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + +react-dom@16: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f" + integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + scheduler "^0.19.1" + +react-is@^16.8.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +react@16: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e" + integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + +scheduler@^0.19.1: + version "0.19.1" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" + integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" diff --git a/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-dev-runtime.development.js b/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-dev-runtime.development.js new file mode 100644 index 000000000000..3b7122293e1b --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-dev-runtime.development.js @@ -0,0 +1,1203 @@ +/** @license React v17.0.0-rc.3 + * react-jsx-dev-runtime.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +var React = require('react'); +var _assign = require('object-assign'); + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +exports.Fragment = 0xeacb; +var REACT_STRICT_MODE_TYPE = 0xeacc; +var REACT_PROFILER_TYPE = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +var REACT_SUSPENSE_TYPE = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); + REACT_PROFILER_TYPE = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableScopeAPI = false; // Experimental Create Event Handle API. + +function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getContextName(type) { + return type.displayName || 'Context'; +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return 'Profiler'; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + '.Consumer'; + + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + '.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + return getComponentName(init(payload)); + } catch (x) { + return null; + } + } + } + } + + return null; +} + +// Helpers to patch console.logs to avoid logging during side-effect free +// replaying on render function. This currently only patches the object +// lazily which won't cover if the log function was extracted eagerly. +// We could also eagerly patch the method. +var disabledDepth = 0; +var prevLog; +var prevInfo; +var prevWarn; +var prevError; +var prevGroup; +var prevGroupCollapsed; +var prevGroupEnd; + +function disabledLog() {} + +disabledLog.__reactDisabledLog = true; +function disableLogs() { + { + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 + + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + /* eslint-enable react-internal/no-production-logging */ + } + + disabledDepth++; + } +} +function reenableLogs() { + { + disabledDepth--; + + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + var props = { + configurable: true, + enumerable: true, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + log: _assign({}, props, { + value: prevLog + }), + info: _assign({}, props, { + value: prevInfo + }), + warn: _assign({}, props, { + value: prevWarn + }), + error: _assign({}, props, { + value: prevError + }), + group: _assign({}, props, { + value: prevGroup + }), + groupCollapsed: _assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: _assign({}, props, { + value: prevGroupEnd + }) + }); + /* eslint-enable react-internal/no-production-logging */ + } + + if (disabledDepth < 0) { + error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); + } + } +} + +var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; +var prefix; +function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ''; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + + return '\n' + prefix + name; + } +} +var reentry = false; +var componentFrameCache; + +{ + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); +} + +function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ''; + } + + { + var frame = componentFrameCache.get(fn); + + if (frame !== undefined) { + return frame; + } + } + + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + + { + previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher.current = null; + disableLogs(); + } + + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe + + + Object.defineProperty(Fake.prototype, 'props', { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + + if (typeof Reflect === 'object' && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + + fn(); + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === 'string') { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sample.stack.split('\n'); + var controlLines = control.stack.split('\n'); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + + return _frame; + } + } while (s >= 1 && c >= 0); + } + + break; + } + } + } + } finally { + reentry = false; + + { + ReactCurrentDispatcher.current = previousDispatcher; + reenableLogs(); + } + + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + + var name = fn ? fn.displayName || fn.name : ''; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, syntheticFrame); + } + } + + return syntheticFrame; +} +function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } +} + +function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); +} + +function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + + if (type == null) { + return ''; + } + + if (typeof type === 'function') { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + + if (typeof type === 'string') { + return describeBuiltInComponentFrame(type); + } + + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame('Suspense'); + + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame('SuspenseList'); + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + + case REACT_BLOCK_TYPE: + return describeFunctionComponentFrame(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} + } + } + } + + return ''; +} + +var loggedTypeFailures = {}; +var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + +function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame.setExtraStackFrame(null); + } + } +} + +function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } +} + +var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown; +var specialPropRefWarningShown; +var didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; +} + +function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; +} + +function warnIfStringRefCannotBeAutoConverted(config, self) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); + + didWarnAboutStringRefs[componentName] = true; + } + } + } +} + +function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } +} + +function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } +} +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; +/** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + +function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.
+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + key = '' + maybeKey; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + if (hasValidRef(config)) { + ref = config.ref; + warnIfStringRefCannotBeAutoConverted(config, self); + } // Remaining properties are added to a new props object + + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } +} + +var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; +var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + +function setCurrentlyValidatingElement$1(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame$1.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame$1.setExtraStackFrame(null); + } + } +} + +var propTypesMisspellWarningShown; + +{ + propTypesMisspellWarningShown = false; +} +/** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + +function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } +} + +function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = getComponentName(ReactCurrentOwner$1.current.type); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } +} + +function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } +} +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } +} +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + +function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; + } + + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } +} +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + +function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } +} +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + +function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + +function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } +} + +function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendum(source); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + var children = props.children; + + if (children !== undefined) { + if (isStaticChildren) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); + } + + if (Object.freeze) { + Object.freeze(children); + } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); + } + } else { + validateChildKeys(children, type); + } + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } +} // These two functions exist to still get child warnings in dev + +var jsxDEV$1 = jsxWithValidation ; + +exports.jsxDEV = jsxDEV$1; + })(); +} diff --git a/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-dev-runtime.production.min.js b/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-dev-runtime.production.min.js new file mode 100644 index 000000000000..a55f6ac700aa --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-dev-runtime.production.min.js @@ -0,0 +1,9 @@ +/** @license React v17.0.0-rc.3 + * react-jsx-dev-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';require("object-assign");require("react");exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var a=Symbol.for;exports.Fragment=a("react.fragment")}exports.jsxDEV=void 0; diff --git a/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-runtime.development.js b/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-runtime.development.js new file mode 100644 index 000000000000..690bebdf5252 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-runtime.development.js @@ -0,0 +1,1221 @@ +/** @license React v17.0.0-rc.3 + * react-jsx-runtime.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +var React = require('react'); +var _assign = require('object-assign'); + +// ATTENTION +// When adding new symbols to this file, +// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var REACT_ELEMENT_TYPE = 0xeac7; +var REACT_PORTAL_TYPE = 0xeaca; +exports.Fragment = 0xeacb; +var REACT_STRICT_MODE_TYPE = 0xeacc; +var REACT_PROFILER_TYPE = 0xead2; +var REACT_PROVIDER_TYPE = 0xeacd; +var REACT_CONTEXT_TYPE = 0xeace; +var REACT_FORWARD_REF_TYPE = 0xead0; +var REACT_SUSPENSE_TYPE = 0xead1; +var REACT_SUSPENSE_LIST_TYPE = 0xead8; +var REACT_MEMO_TYPE = 0xead3; +var REACT_LAZY_TYPE = 0xead4; +var REACT_BLOCK_TYPE = 0xead9; +var REACT_SERVER_BLOCK_TYPE = 0xeada; +var REACT_FUNDAMENTAL_TYPE = 0xead5; +var REACT_SCOPE_TYPE = 0xead7; +var REACT_OPAQUE_ID_TYPE = 0xeae0; +var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; +var REACT_OFFSCREEN_TYPE = 0xeae2; +var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + +if (typeof Symbol === 'function' && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor('react.element'); + REACT_PORTAL_TYPE = symbolFor('react.portal'); + exports.Fragment = symbolFor('react.fragment'); + REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); + REACT_PROFILER_TYPE = symbolFor('react.profiler'); + REACT_PROVIDER_TYPE = symbolFor('react.provider'); + REACT_CONTEXT_TYPE = symbolFor('react.context'); + REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); + REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); + REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); + REACT_MEMO_TYPE = symbolFor('react.memo'); + REACT_LAZY_TYPE = symbolFor('react.lazy'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); +} + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + + return null; +} + +var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } +} + +// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + +var enableScopeAPI = false; // Experimental Create Event Handle API. + +function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + + if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) { + return true; + } + + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + + return false; +} + +function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); +} + +function getContextName(type) { + return type.displayName || 'Context'; +} + +function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case exports.Fragment: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return 'Profiler'; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + '.Consumer'; + + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + '.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + return getComponentName(init(payload)); + } catch (x) { + return null; + } + } + } + } + + return null; +} + +// Helpers to patch console.logs to avoid logging during side-effect free +// replaying on render function. This currently only patches the object +// lazily which won't cover if the log function was extracted eagerly. +// We could also eagerly patch the method. +var disabledDepth = 0; +var prevLog; +var prevInfo; +var prevWarn; +var prevError; +var prevGroup; +var prevGroupCollapsed; +var prevGroupEnd; + +function disabledLog() {} + +disabledLog.__reactDisabledLog = true; +function disableLogs() { + { + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 + + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + /* eslint-enable react-internal/no-production-logging */ + } + + disabledDepth++; + } +} +function reenableLogs() { + { + disabledDepth--; + + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + var props = { + configurable: true, + enumerable: true, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + log: _assign({}, props, { + value: prevLog + }), + info: _assign({}, props, { + value: prevInfo + }), + warn: _assign({}, props, { + value: prevWarn + }), + error: _assign({}, props, { + value: prevError + }), + group: _assign({}, props, { + value: prevGroup + }), + groupCollapsed: _assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: _assign({}, props, { + value: prevGroupEnd + }) + }); + /* eslint-enable react-internal/no-production-logging */ + } + + if (disabledDepth < 0) { + error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); + } + } +} + +var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; +var prefix; +function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ''; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + + return '\n' + prefix + name; + } +} +var reentry = false; +var componentFrameCache; + +{ + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); +} + +function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ''; + } + + { + var frame = componentFrameCache.get(fn); + + if (frame !== undefined) { + return frame; + } + } + + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + + { + previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher.current = null; + disableLogs(); + } + + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function () { + throw Error(); + }; // $FlowFixMe + + + Object.defineProperty(Fake.prototype, 'props', { + set: function () { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + + if (typeof Reflect === 'object' && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + + fn(); + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === 'string') { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sample.stack.split('\n'); + var controlLines = control.stack.split('\n'); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + + return _frame; + } + } while (s >= 1 && c >= 0); + } + + break; + } + } + } + } finally { + reentry = false; + + { + ReactCurrentDispatcher.current = previousDispatcher; + reenableLogs(); + } + + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + + var name = fn ? fn.displayName || fn.name : ''; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; + + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, syntheticFrame); + } + } + + return syntheticFrame; +} +function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } +} + +function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); +} + +function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + + if (type == null) { + return ''; + } + + if (typeof type === 'function') { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + + if (typeof type === 'string') { + return describeBuiltInComponentFrame(type); + } + + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame('Suspense'); + + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame('SuspenseList'); + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + + case REACT_BLOCK_TYPE: + return describeFunctionComponentFrame(type._render); + + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} + } + } + } + + return ''; +} + +var loggedTypeFailures = {}; +var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + +function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame.setExtraStackFrame(null); + } + } +} + +function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + + setCurrentlyValidatingElement(null); + } + + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + + error('Failed %s type: %s', location, error$1.message); + + setCurrentlyValidatingElement(null); + } + } + } + } +} + +var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown; +var specialPropRefWarningShown; +var didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.ref !== undefined; +} + +function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + + if (getter && getter.isReactWarning) { + return false; + } + } + } + + return config.key !== undefined; +} + +function warnIfStringRefCannotBeAutoConverted(config, self) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); + + didWarnAboutStringRefs[componentName] = true; + } + } + } +} + +function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } +} + +function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } +} +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; +/** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + +function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.
+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + key = '' + maybeKey; + } + + if (hasValidKey(config)) { + key = '' + config.key; + } + + if (hasValidRef(config)) { + ref = config.ref; + warnIfStringRefCannotBeAutoConverted(config, self); + } // Remaining properties are added to a new props object + + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } // Resolve default props + + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } +} + +var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; +var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + +function setCurrentlyValidatingElement$1(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame$1.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame$1.setExtraStackFrame(null); + } + } +} + +var propTypesMisspellWarningShown; + +{ + propTypesMisspellWarningShown = false; +} +/** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + +function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } +} + +function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = getComponentName(ReactCurrentOwner$1.current.type); + + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + + return ''; + } +} + +function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; + } +} +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + + return info; + } +} +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + +function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; + } + + setCurrentlyValidatingElement$1(element); + + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + + setCurrentlyValidatingElement$1(null); + } +} +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + +function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { + return; + } + + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } +} +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + +function validatePropTypes(element) { + { + var type = element.type; + + if (type === null || type === undefined || typeof type === 'string') { + return; + } + + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentName(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentName(type); + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + +function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + setCurrentlyValidatingElement$1(null); + break; + } + } + + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + + setCurrentlyValidatingElement$1(null); + } + } +} + +function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + + var sourceInfo = getSourceInfoErrorAddendum(source); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + if (type === null) { + typeString = 'null'; + } else if (Array.isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + + if (validType) { + var children = props.children; + + if (children !== undefined) { + if (isStaticChildren) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); + } + + if (Object.freeze) { + Object.freeze(children); + } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); + } + } else { + validateChildKeys(children, type); + } + } + } + + if (type === exports.Fragment) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + + return element; + } +} // These two functions exist to still get child warnings in dev +// even with the prod transform. This means that jsxDEV is purely +// opt-in behavior for better messages but that we won't stop +// giving you warnings if you use production apis. + +function jsxWithValidationStatic(type, props, key) { + { + return jsxWithValidation(type, props, key, true); + } +} +function jsxWithValidationDynamic(type, props, key) { + { + return jsxWithValidation(type, props, key, false); + } +} + +var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children. +// for now we can ship identical prod functions + +var jsxs = jsxWithValidationStatic ; + +exports.jsx = jsx; +exports.jsxs = jsxs; + })(); +} diff --git a/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-runtime.production.min.js b/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-runtime.production.min.js new file mode 100644 index 000000000000..09cf15e9eb5b --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-17/cjs/react-jsx-runtime.production.min.js @@ -0,0 +1,10 @@ +/** @license React v17.0.0-rc.3 + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';require("object-assign");var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0}; +function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q; diff --git a/fixtures/legacy-jsx-runtimes/react-17/jsx-dev-runtime.js b/fixtures/legacy-jsx-runtimes/react-17/jsx-dev-runtime.js new file mode 100644 index 000000000000..324eb11e5992 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-17/jsx-dev-runtime.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-dev-runtime.production.min.js'); +} else { + module.exports = require('./cjs/react-jsx-dev-runtime.development.js'); +} diff --git a/fixtures/legacy-jsx-runtimes/react-17/jsx-runtime.js b/fixtures/legacy-jsx-runtimes/react-17/jsx-runtime.js new file mode 100644 index 000000000000..0416df54291a --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-17/jsx-runtime.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-jsx-runtime.production.min.js'); +} else { + module.exports = require('./cjs/react-jsx-runtime.development.js'); +} diff --git a/fixtures/legacy-jsx-runtimes/react-17/package.json b/fixtures/legacy-jsx-runtimes/react-17/package.json new file mode 100644 index 000000000000..2808e59ffaeb --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-17/package.json @@ -0,0 +1,7 @@ +{ + "dependencies": { + "prop-types": "^15.7.2", + "react": "17.0.0-rc.3", + "react-dom": "17.0.0-rc.3" + } +} diff --git a/fixtures/legacy-jsx-runtimes/react-17/react-17.test.js b/fixtures/legacy-jsx-runtimes/react-17/react-17.test.js new file mode 100644 index 000000000000..6e47d4655c2c --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-17/react-17.test.js @@ -0,0 +1,773 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @emails react-core + */ + +// These tests are based on ReactJSXElement-test, +// ReactJSXElementValidator-test, ReactComponent-test, +// and ReactElementJSX-test. + +jest.mock('react/jsx-runtime', () => require('./jsx-runtime'), {virtual: true}); +jest.mock('react/jsx-dev-runtime', () => require('./jsx-dev-runtime'), { + virtual: true, +}); + +let React = require('react'); +let ReactDOM = require('react-dom'); +let ReactTestUtils = { + renderIntoDocument(el) { + const container = document.createElement('div'); + return ReactDOM.render(el, container); + }, +}; +let PropTypes = require('prop-types'); +let Component = class Component extends React.Component { + render() { + return
; + } +}; +let RequiredPropComponent = class extends React.Component { + render() { + return {this.props.prop}; + } +}; +RequiredPropComponent.displayName = 'RequiredPropComponent'; +RequiredPropComponent.propTypes = {prop: PropTypes.string.isRequired}; + +it('works', () => { + const container = document.createElement('div'); + ReactDOM.render(

hello

, container); + expect(container.textContent).toBe('hello'); +}); + +it('returns a complete element according to spec', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('allows a lower-case to be passed as the string type', () => { + const element =
; + expect(element.type).toBe('div'); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('allows a string to be passed as the type', () => { + const TagName = 'div'; + const element = ; + expect(element.type).toBe('div'); + expect(element.key).toBe(null); + expect(element.ref).toBe(null); + const expectation = {}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('returns an immutable element', () => { + const element = ; + if (process.env.NODE_ENV === 'development') { + expect(() => (element.type = 'div')).toThrow(); + } else { + expect(() => (element.type = 'div')).not.toThrow(); + } +}); + +it('does not reuse the object that is spread into props', () => { + const config = {foo: 1}; + const element = ; + expect(element.props.foo).toBe(1); + config.foo = 2; + expect(element.props.foo).toBe(1); +}); + +it('extracts key and ref from the rest of the props', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe('12'); + expect(element.ref).toBe('34'); + const expectation = {foo: '56'}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('coerces the key to a string', () => { + const element = ; + expect(element.type).toBe(Component); + expect(element.key).toBe('12'); + expect(element.ref).toBe(null); + const expectation = {foo: '56'}; + Object.freeze(expectation); + expect(element.props).toEqual(expectation); +}); + +it('merges JSX children onto the children prop', () => { + const a = 1; + const element = {a}; + expect(element.props.children).toBe(a); +}); + +it('does not override children if no JSX children are provided', () => { + const element = ; + expect(element.props.children).toBe('text'); +}); + +it('overrides children if null is provided as a JSX child', () => { + const element = {null}; + expect(element.props.children).toBe(null); +}); + +it('overrides children if undefined is provided as an argument', () => { + const element = {undefined}; + expect(element.props.children).toBe(undefined); + + const element2 = React.cloneElement( + , + {}, + undefined + ); + expect(element2.props.children).toBe(undefined); +}); + +it('merges JSX children onto the children prop in an array', () => { + const a = 1; + const b = 2; + const c = 3; + const element = ( + + {a} + {b} + {c} + + ); + expect(element.props.children).toEqual([1, 2, 3]); +}); + +it('allows static methods to be called using the type property', () => { + class StaticMethodComponent { + static someStaticMethod() { + return 'someReturnValue'; + } + render() { + return
; + } + } + + const element = ; + expect(element.type.someStaticMethod()).toBe('someReturnValue'); +}); + +it('identifies valid elements', () => { + expect(React.isValidElement(
)).toEqual(true); + expect(React.isValidElement()).toEqual(true); + + expect(React.isValidElement(null)).toEqual(false); + expect(React.isValidElement(true)).toEqual(false); + expect(React.isValidElement({})).toEqual(false); + expect(React.isValidElement('string')).toEqual(false); + expect(React.isValidElement(Component)).toEqual(false); + expect(React.isValidElement({type: 'div', props: {}})).toEqual(false); +}); + +it('is indistinguishable from a plain object', () => { + const element =
; + const object = {}; + expect(element.constructor).toBe(object.constructor); +}); + +it('should use default prop value when removing a prop', () => { + Component.defaultProps = {fruit: 'persimmon'}; + + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.props.fruit).toBe('mango'); + + ReactDOM.render(, container); + expect(instance.props.fruit).toBe('persimmon'); +}); + +it('should normalize props with default values', () => { + class NormalizingComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NormalizingComponent.defaultProps = {prop: 'testKey'}; + + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.props.prop).toBe('testKey'); + + const inst2 = ReactDOM.render( + , + container + ); + expect(inst2.props.prop).toBe(null); +}); + +it('warns for keys for arrays of elements in children position', () => { + expect(() => + ReactTestUtils.renderIntoDocument( + {[, ]} + ) + ).toErrorDev('Each child in a list should have a unique "key" prop.'); +}); + +it('warns for keys for arrays of elements with owner info', () => { + class InnerComponent extends React.Component { + render() { + return {this.props.childSet}; + } + } + + class ComponentWrapper extends React.Component { + render() { + return , ]} />; + } + } + + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'Each child in a list should have a unique "key" prop.' + + '\n\nCheck the render method of `InnerComponent`. ' + + 'It was passed a child from ComponentWrapper. ' + ); +}); + +it('does not warn for arrays of elements with keys', () => { + ReactTestUtils.renderIntoDocument( + {[, ]} + ); +}); + +it('does not warn for iterable elements with keys', () => { + const iterable = { + '@@iterator': function() { + let i = 0; + return { + next: function() { + const done = ++i > 2; + return { + value: done ? undefined : , + done: done, + }; + }, + }; + }, + }; + + ReactTestUtils.renderIntoDocument({iterable}); +}); + +it('does not warn for numeric keys in entry iterable as a child', () => { + const iterable = { + '@@iterator': function() { + let i = 0; + return { + next: function() { + const done = ++i > 2; + return {value: done ? undefined : [i, ], done: done}; + }, + }; + }, + }; + iterable.entries = iterable['@@iterator']; + + ReactTestUtils.renderIntoDocument({iterable}); +}); + +it('does not warn when the element is directly as children', () => { + ReactTestUtils.renderIntoDocument( + + + + + ); +}); + +it('does not warn when the child array contains non-elements', () => { + void ({[{}, {}]}); +}); + +it('should give context for PropType errors in nested components.', () => { + // In this test, we're making sure that if a proptype error is found in a + // component, we give a small hint as to which parent instantiated that + // component as per warnings about key usage in ReactElementValidator. + function MyComp({color}) { + return
My color is {color}
; + } + MyComp.propTypes = { + color: PropTypes.string, + }; + class ParentComp extends React.Component { + render() { + return ; + } + } + expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( + 'Warning: Failed prop type: ' + + 'Invalid prop `color` of type `number` supplied to `MyComp`, ' + + 'expected `string`.\n' + + ' in fn (at **)\n' + // Jest/Node issue + ' in ParentComp (at **)' + ); +}); + +it('gives a helpful error when passing null, undefined, or boolean', () => { + const Undefined = undefined; + const Null = null; + const True = true; + const Div = 'div'; + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: undefined. You likely forgot to export your ' + + "component from the file it's defined in, or you might have mixed up " + + 'default and named imports.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: null.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + expect( + () => void () + ).toErrorDev( + 'Warning: React.jsx: type is invalid -- expected a string ' + + '(for built-in components) or a class/function (for composite ' + + 'components) but got: boolean.' + + (process.env.BABEL_ENV === 'development' + ? '\n\nCheck your code at **.' + : ''), + {withoutStack: true} + ); + // No error expected + void (
); +}); + +it('should check default prop values', () => { + RequiredPropComponent.defaultProps = {prop: null}; + + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'Warning: Failed prop type: The prop `prop` is marked as required in ' + + '`RequiredPropComponent`, but its value is `null`.\n' + + ' in construct (at **)' // Jest/Node issue + ); +}); + +it('should warn on invalid prop types', () => { + // Since there is no prevalidation step for ES6 classes, there is no hook + // for us to issue a warning earlier than element creation when the error + // actually occurs. Since this step is skipped in production, we should just + // warn instead of throwing for this case. + class NullPropTypeComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NullPropTypeComponent.propTypes = { + prop: null, + }; + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'NullPropTypeComponent: prop type `prop` is invalid; it must be a ' + + 'function, usually from the `prop-types` package,' + ); +}); + +it('should warn on invalid context types', () => { + class NullContextTypeComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + NullContextTypeComponent.contextTypes = { + prop: null, + }; + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'NullContextTypeComponent: context type `prop` is invalid; it must ' + + 'be a function, usually from the `prop-types` package,' + ); +}); + +it('should warn if getDefaultProps is specified on the class', () => { + class GetDefaultPropsComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + GetDefaultPropsComponent.getDefaultProps = () => ({ + prop: 'foo', + }); + expect(() => + ReactTestUtils.renderIntoDocument() + ).toErrorDev( + 'getDefaultProps is only used on classic React.createClass definitions.' + + ' Use a static property named `defaultProps` instead.', + {withoutStack: true} + ); +}); + +it('should warn if component declares PropTypes instead of propTypes', () => { + class MisspelledPropTypesComponent extends React.Component { + render() { + return {this.props.prop}; + } + } + MisspelledPropTypesComponent.PropTypes = { + prop: PropTypes.string, + }; + expect(() => + ReactTestUtils.renderIntoDocument( + + ) + ).toErrorDev( + 'Warning: Component MisspelledPropTypesComponent declared `PropTypes` ' + + 'instead of `propTypes`. Did you misspell the property assignment?', + {withoutStack: true} + ); +}); + +it('warns for fragments with illegal attributes', () => { + class Foo extends React.Component { + render() { + return hello; + } + } + + expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( + 'Invalid prop `a` supplied to `React.Fragment`. React.Fragment ' + + 'can only have `key` and `children` props.' + ); +}); + +it('warns for fragments with refs', () => { + class Foo extends React.Component { + render() { + return ( + { + this.foo = bar; + }}> + hello + + ); + } + } + + expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( + 'Invalid attribute `ref` supplied to `React.Fragment`.' + ); +}); + +it('does not warn for fragments of multiple elements without keys', () => { + ReactTestUtils.renderIntoDocument( + <> + 1 + 2 + + ); +}); + +it('warns for fragments of multiple elements with same key', () => { + expect(() => + ReactTestUtils.renderIntoDocument( + <> + 1 + 2 + 3 + + ) + ).toErrorDev('Encountered two children with the same key, `a`.', { + withoutStack: true, + }); +}); + +it('does not call lazy initializers eagerly', () => { + let didCall = false; + const Lazy = React.lazy(() => { + didCall = true; + return {then() {}}; + }); + ; + expect(didCall).toBe(false); +}); + +it('supports classic refs', () => { + class Foo extends React.Component { + render() { + return
; + } + } + const container = document.createElement('div'); + const instance = ReactDOM.render(, container); + expect(instance.refs.inner.className).toBe('foo'); +}); + +it('should support refs on owned components', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + class Component extends React.Component { + render() { + const inner = ; + const outer = ( + + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.refs.inner.getObject()).toEqual(innerObj); + expect(this.refs.outer.getObject()).toEqual(outerObj); + } + } + + ReactTestUtils.renderIntoDocument(); +}); + +it('should support callback-style refs', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + let mounted = false; + + class Component extends React.Component { + render() { + const inner = ( + (this.innerRef = c)} /> + ); + const outer = ( + (this.outerRef = c)}> + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.innerRef.getObject()).toEqual(innerObj); + expect(this.outerRef.getObject()).toEqual(outerObj); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +it('should support object-style refs', () => { + const innerObj = {}; + const outerObj = {}; + + class Wrapper extends React.Component { + getObject = () => { + return this.props.object; + }; + + render() { + return
{this.props.children}
; + } + } + + let mounted = false; + + class Component extends React.Component { + constructor() { + super(); + this.innerRef = React.createRef(); + this.outerRef = React.createRef(); + } + render() { + const inner = ; + const outer = ( + + {inner} + + ); + return outer; + } + + componentDidMount() { + expect(this.innerRef.current.getObject()).toEqual(innerObj); + expect(this.outerRef.current.getObject()).toEqual(outerObj); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +it('should support new-style refs with mixed-up owners', () => { + class Wrapper extends React.Component { + getTitle = () => { + return this.props.title; + }; + + render() { + return this.props.getContent(); + } + } + + let mounted = false; + + class Component extends React.Component { + getInner = () => { + // (With old-style refs, it's impossible to get a ref to this div + // because Wrapper is the current owner when this function is called.) + return
(this.innerRef = c)} />; + }; + + render() { + return ( + (this.wrapperRef = c)} + getContent={this.getInner} + /> + ); + } + + componentDidMount() { + // Check .props.title to make sure we got the right elements back + expect(this.wrapperRef.getTitle()).toBe('wrapper'); + expect(this.innerRef.className).toBe('inner'); + mounted = true; + } + } + + ReactTestUtils.renderIntoDocument(); + expect(mounted).toBe(true); +}); + +it('should warn when `key` is being accessed on composite element', () => { + const container = document.createElement('div'); + class Child extends React.Component { + render() { + return
{this.props.key}
; + } + } + class Parent extends React.Component { + render() { + return ( +
+ + + +
+ ); + } + } + expect(() => ReactDOM.render(, container)).toErrorDev( + 'Child: `key` is not a prop. Trying to access it will result ' + + 'in `undefined` being returned. If you need to access the same ' + + 'value within the child component, you should pass it as a different ' + + 'prop. (https://reactjs.org/link/special-props)' + ); +}); + +it('should warn when `ref` is being accessed', () => { + const container = document.createElement('div'); + class Child extends React.Component { + render() { + return
{this.props.ref}
; + } + } + class Parent extends React.Component { + render() { + return ( +
+ +
+ ); + } + } + expect(() => ReactDOM.render(, container)).toErrorDev( + 'Child: `ref` is not a prop. Trying to access it will result ' + + 'in `undefined` being returned. If you need to access the same ' + + 'value within the child component, you should pass it as a different ' + + 'prop. (https://reactjs.org/link/special-props)' + ); +}); + +it('should warn when owner and self are different for string refs', () => { + class ClassWithRenderProp extends React.Component { + render() { + return this.props.children(); + } + } + + class ClassParent extends React.Component { + render() { + return ( + {() =>
} + ); + } + } + + const container = document.createElement('div'); + if (process.env.BABEL_ENV === 'development') { + expect(() => ReactDOM.render(, container)).toErrorDev([ + 'Warning: Component "ClassWithRenderProp" contains the string ref "myRef". ' + + 'Support for string refs will be removed in a future major release. ' + + 'This case cannot be automatically converted to an arrow function. ' + + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + + 'Learn more about using refs safely here: ' + + 'https://reactjs.org/link/strict-mode-string-ref', + ]); + } else { + ReactDOM.render(, container); + } +}); diff --git a/fixtures/legacy-jsx-runtimes/react-17/yarn.lock b/fixtures/legacy-jsx-runtimes/react-17/yarn.lock new file mode 100644 index 000000000000..becb74e0081c --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/react-17/yarn.lock @@ -0,0 +1,59 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + +react-dom@17.0.0-rc.3: + version "17.0.0-rc.3" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.0-rc.3.tgz#6254f82c62ed569a2a90dcf1c7b71d4d8d951744" + integrity sha512-rrmZ91kdXBaCVomiNUQ1WvEClb5GcmxewGurd3FnsXKJBOhFdlkGbT5MY5ZQkMXH5xnIvs5ZEEB2iBr2ZqKiqg== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + scheduler "0.20.0-rc.3" + +react-is@^16.8.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +react@17.0.0-rc.3: + version "17.0.0-rc.3" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.0-rc.3.tgz#ccb426b0146a8c10ee92c2a72d9d813a16a55806" + integrity sha512-b1vEcXBmlN2Bu+k57jq2ytEo5p28g5fdRfc02JRdnvGZKKphvlUnAfsrUHiOmUtL/6wvFIusi2zxp8t60fihfw== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + +scheduler@0.20.0-rc.3: + version "0.20.0-rc.3" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.0-rc.3.tgz#ce616ebdd4073f5026718960d7e2d0928788c626" + integrity sha512-rPwhSgPKhRqximLHdl+oJ/8HVcMS2vyZlH74OQHqKbH04ONgKNkJ13DZLPdFSYFos8FUj6+PduO9+OoRaG6QWQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" diff --git a/fixtures/legacy-jsx-runtimes/setupTests.js b/fixtures/legacy-jsx-runtimes/setupTests.js new file mode 100644 index 000000000000..85a21cc15d91 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/setupTests.js @@ -0,0 +1,318 @@ +'use strict'; + +// This is mostly copypasta from toWarnDev.js matchers +// that we use in the main repo Jest configuration. + +const expect = global.expect; + +const jestDiff = require('jest-diff').default; +const util = require('util'); + +function shouldIgnoreConsoleError(format, args) { + if (process.env.NODE_ENV !== 'production') { + if (typeof format === 'string') { + if (format.indexOf('Error: Uncaught [') === 0) { + // This looks like an uncaught error from invokeGuardedCallback() wrapper + // in development that is reported by jsdom. Ignore because it's noisy. + return true; + } + if (format.indexOf('The above error occurred') === 0) { + // This looks like an error addendum from ReactFiberErrorLogger. + // Ignore it too. + return true; + } + } + } else { + if ( + format != null && + typeof format.message === 'string' && + typeof format.stack === 'string' && + args.length === 0 + ) { + // In production, ReactFiberErrorLogger logs error objects directly. + // They are noisy too so we'll try to ignore them. + return true; + } + if ( + format.indexOf( + 'act(...) is not supported in production builds of React' + ) === 0 + ) { + // We don't yet support act() for prod builds, and warn for it. + // But we'd like to use act() ourselves for prod builds. + // Let's ignore the warning and #yolo. + return true; + } + } + // Looks legit + return false; +} + +function normalizeCodeLocInfo(str) { + if (typeof str !== 'string') { + return str; + } + // This special case exists only for the special source location in + // ReactElementValidator. That will go away if we remove source locations. + str = str.replace(/Check your code at .+?:\d+/g, 'Check your code at **'); + // V8 format: + // at Component (/path/filename.js:123:45) + // React format: + // in Component (at filename.js:123) + return str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) { + return '\n in ' + name + ' (at **)'; + }); +} + +const createMatcherFor = (consoleMethod, matcherName) => + function matcher(callback, expectedMessages, options = {}) { + if (process.env.NODE_ENV !== 'production') { + // Warn about incorrect usage of matcher. + if (typeof expectedMessages === 'string') { + expectedMessages = [expectedMessages]; + } else if (!Array.isArray(expectedMessages)) { + throw Error( + `${matcherName}() requires a parameter of type string or an array of strings ` + + `but was given ${typeof expectedMessages}.` + ); + } + if ( + options != null && + (typeof options !== 'object' || Array.isArray(options)) + ) { + throw new Error( + `${matcherName}() second argument, when present, should be an object. ` + + 'Did you forget to wrap the messages into an array?' + ); + } + if (arguments.length > 3) { + // `matcher` comes from Jest, so it's more than 2 in practice + throw new Error( + `${matcherName}() received more than two arguments. ` + + 'Did you forget to wrap the messages into an array?' + ); + } + + const withoutStack = options.withoutStack; + const logAllErrors = options.logAllErrors; + const warningsWithoutComponentStack = []; + const warningsWithComponentStack = []; + const unexpectedWarnings = []; + + let lastWarningWithMismatchingFormat = null; + let lastWarningWithExtraComponentStack = null; + + // Catch errors thrown by the callback, + // But only rethrow them if all test expectations have been satisfied. + // Otherwise an Error in the callback can mask a failed expectation, + // and result in a test that passes when it shouldn't. + let caughtError; + + const isLikelyAComponentStack = message => + typeof message === 'string' && + (message.includes('\n in ') || message.includes('\n at ')); + + const consoleSpy = (format, ...args) => { + // Ignore uncaught errors reported by jsdom + // and React addendums because they're too noisy. + if ( + !logAllErrors && + consoleMethod === 'error' && + shouldIgnoreConsoleError(format, args) + ) { + return; + } + + const message = util.format(format, ...args); + const normalizedMessage = normalizeCodeLocInfo(message); + + // Remember if the number of %s interpolations + // doesn't match the number of arguments. + // We'll fail the test if it happens. + let argIndex = 0; + format.replace(/%s/g, () => argIndex++); + if (argIndex !== args.length) { + lastWarningWithMismatchingFormat = { + format, + args, + expectedArgCount: argIndex, + }; + } + + // Protect against accidentally passing a component stack + // to warning() which already injects the component stack. + if ( + args.length >= 2 && + isLikelyAComponentStack(args[args.length - 1]) && + isLikelyAComponentStack(args[args.length - 2]) + ) { + lastWarningWithExtraComponentStack = { + format, + }; + } + + for (let index = 0; index < expectedMessages.length; index++) { + const expectedMessage = expectedMessages[index]; + if ( + normalizedMessage === expectedMessage || + normalizedMessage.includes(expectedMessage) + ) { + if (isLikelyAComponentStack(normalizedMessage)) { + warningsWithComponentStack.push(normalizedMessage); + } else { + warningsWithoutComponentStack.push(normalizedMessage); + } + expectedMessages.splice(index, 1); + return; + } + } + + let errorMessage; + if (expectedMessages.length === 0) { + errorMessage = + 'Unexpected warning recorded: ' + + this.utils.printReceived(normalizedMessage); + } else if (expectedMessages.length === 1) { + errorMessage = + 'Unexpected warning recorded: ' + + jestDiff(expectedMessages[0], normalizedMessage); + } else { + errorMessage = + 'Unexpected warning recorded: ' + + jestDiff(expectedMessages, [normalizedMessage]); + } + + // Record the call stack for unexpected warnings. + // We don't throw an Error here though, + // Because it might be suppressed by ReactFiberScheduler. + unexpectedWarnings.push(new Error(errorMessage)); + }; + + // TODO Decide whether we need to support nested toWarn* expectations. + // If we don't need it, add a check here to see if this is already our spy, + // And throw an error. + const originalMethod = console[consoleMethod]; + + // Avoid using Jest's built-in spy since it can't be removed. + console[consoleMethod] = consoleSpy; + + try { + callback(); + } catch (error) { + caughtError = error; + } finally { + // Restore the unspied method so that unexpected errors fail tests. + console[consoleMethod] = originalMethod; + + // Any unexpected Errors thrown by the callback should fail the test. + // This should take precedence since unexpected errors could block warnings. + if (caughtError) { + throw caughtError; + } + + // Any unexpected warnings should be treated as a failure. + if (unexpectedWarnings.length > 0) { + return { + message: () => unexpectedWarnings[0].stack, + pass: false, + }; + } + + // Any remaining messages indicate a failed expectations. + if (expectedMessages.length > 0) { + return { + message: () => + `Expected warning was not recorded:\n ${this.utils.printReceived( + expectedMessages[0] + )}`, + pass: false, + }; + } + + if (typeof withoutStack === 'number') { + // We're expecting a particular number of warnings without stacks. + if (withoutStack !== warningsWithoutComponentStack.length) { + return { + message: () => + `Expected ${withoutStack} warnings without a component stack but received ${warningsWithoutComponentStack.length}:\n` + + warningsWithoutComponentStack.map(warning => + this.utils.printReceived(warning) + ), + pass: false, + }; + } + } else if (withoutStack === true) { + // We're expecting that all warnings won't have the stack. + // If some warnings have it, it's an error. + if (warningsWithComponentStack.length > 0) { + return { + message: () => + `Received warning unexpectedly includes a component stack:\n ${this.utils.printReceived( + warningsWithComponentStack[0] + )}\nIf this warning intentionally includes the component stack, remove ` + + `{withoutStack: true} from the ${matcherName}() call. If you have a mix of ` + + `warnings with and without stack in one ${matcherName}() call, pass ` + + `{withoutStack: N} where N is the number of warnings without stacks.`, + pass: false, + }; + } + } else if (withoutStack === false || withoutStack === undefined) { + // We're expecting that all warnings *do* have the stack (default). + // If some warnings don't have it, it's an error. + if (warningsWithoutComponentStack.length > 0) { + return { + message: () => + `Received warning unexpectedly does not include a component stack:\n ${this.utils.printReceived( + warningsWithoutComponentStack[0] + )}\nIf this warning intentionally omits the component stack, add ` + + `{withoutStack: true} to the ${matcherName} call.`, + pass: false, + }; + } + } else { + throw Error( + `The second argument for ${matcherName}(), when specified, must be an object. It may have a ` + + `property called "withoutStack" whose value may be undefined, boolean, or a number. ` + + `Instead received ${typeof withoutStack}.` + ); + } + + if (lastWarningWithMismatchingFormat !== null) { + return { + message: () => + `Received ${ + lastWarningWithMismatchingFormat.args.length + } arguments for a message with ${ + lastWarningWithMismatchingFormat.expectedArgCount + } placeholders:\n ${this.utils.printReceived( + lastWarningWithMismatchingFormat.format + )}`, + pass: false, + }; + } + + if (lastWarningWithExtraComponentStack !== null) { + return { + message: () => + `Received more than one component stack for a warning:\n ${this.utils.printReceived( + lastWarningWithExtraComponentStack.format + )}\nDid you accidentally pass a stack to warning() as the last argument? ` + + `Don't forget warning() already injects the component stack automatically.`, + pass: false, + }; + } + + return {pass: true}; + } + } else { + // Any uncaught errors or warnings should fail tests in production mode. + callback(); + + return {pass: true}; + } + }; + +expect.extend({ + toWarnDev: createMatcherFor('warn', 'toWarnDev'), + toErrorDev: createMatcherFor('error', 'toErrorDev'), +}); diff --git a/fixtures/legacy-jsx-runtimes/yarn.lock b/fixtures/legacy-jsx-runtimes/yarn.lock new file mode 100644 index 000000000000..0311bc8df168 --- /dev/null +++ b/fixtures/legacy-jsx-runtimes/yarn.lock @@ -0,0 +1,3780 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" + integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== + dependencies: + "@babel/highlight" "^7.10.4" + +"@babel/core@^7.1.0", "@babel/core@^7.7.5": + version "7.11.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.11.6.tgz#3a9455dc7387ff1bac45770650bc13ba04a15651" + integrity sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.11.6" + "@babel/helper-module-transforms" "^7.11.0" + "@babel/helpers" "^7.10.4" + "@babel/parser" "^7.11.5" + "@babel/template" "^7.10.4" + "@babel/traverse" "^7.11.5" + "@babel/types" "^7.11.5" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.1" + json5 "^2.1.2" + lodash "^4.17.19" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@^7.11.5", "@babel/generator@^7.11.6": + version "7.11.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.11.6.tgz#b868900f81b163b4d464ea24545c61cbac4dc620" + integrity sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA== + dependencies: + "@babel/types" "^7.11.5" + jsesc "^2.5.1" + source-map "^0.5.0" + +"@babel/helper-annotate-as-pure@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz#5bf0d495a3f757ac3bda48b5bf3b3ba309c72ba3" + integrity sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA== + dependencies: + "@babel/types" "^7.10.4" + +"@babel/helper-builder-react-jsx-experimental@^7.10.4", "@babel/helper-builder-react-jsx-experimental@^7.11.5": + version "7.11.5" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx-experimental/-/helper-builder-react-jsx-experimental-7.11.5.tgz#4ea43dd63857b0a35cd1f1b161dc29b43414e79f" + integrity sha512-Vc4aPJnRZKWfzeCBsqTBnzulVNjABVdahSPhtdMD3Vs80ykx4a87jTHtF/VR+alSrDmNvat7l13yrRHauGcHVw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.10.4" + "@babel/helper-module-imports" "^7.10.4" + "@babel/types" "^7.11.5" + +"@babel/helper-builder-react-jsx@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.10.4.tgz#8095cddbff858e6fa9c326daee54a2f2732c1d5d" + integrity sha512-5nPcIZ7+KKDxT1427oBivl9V9YTal7qk0diccnh7RrcgrT/pGFOjgGw1dgryyx1GvHEpXVfoDF6Ak3rTiWh8Rg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/helper-function-name@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a" + integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ== + dependencies: + "@babel/helper-get-function-arity" "^7.10.4" + "@babel/template" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/helper-get-function-arity@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2" + integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A== + dependencies: + "@babel/types" "^7.10.4" + +"@babel/helper-member-expression-to-functions@^7.10.4": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz#ae69c83d84ee82f4b42f96e2a09410935a8f26df" + integrity sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q== + dependencies: + "@babel/types" "^7.11.0" + +"@babel/helper-module-imports@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz#4c5c54be04bd31670a7382797d75b9fa2e5b5620" + integrity sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw== + dependencies: + "@babel/types" "^7.10.4" + +"@babel/helper-module-transforms@^7.10.4", "@babel/helper-module-transforms@^7.11.0": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz#b16f250229e47211abdd84b34b64737c2ab2d359" + integrity sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg== + dependencies: + "@babel/helper-module-imports" "^7.10.4" + "@babel/helper-replace-supers" "^7.10.4" + "@babel/helper-simple-access" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.11.0" + "@babel/template" "^7.10.4" + "@babel/types" "^7.11.0" + lodash "^4.17.19" + +"@babel/helper-optimise-call-expression@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz#50dc96413d594f995a77905905b05893cd779673" + integrity sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg== + dependencies: + "@babel/types" "^7.10.4" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" + integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== + +"@babel/helper-replace-supers@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz#d585cd9388ea06e6031e4cd44b6713cbead9e6cf" + integrity sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.10.4" + "@babel/helper-optimise-call-expression" "^7.10.4" + "@babel/traverse" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/helper-simple-access@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz#0f5ccda2945277a2a7a2d3a821e15395edcf3461" + integrity sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw== + dependencies: + "@babel/template" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/helper-split-export-declaration@^7.11.0": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f" + integrity sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg== + dependencies: + "@babel/types" "^7.11.0" + +"@babel/helper-validator-identifier@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" + integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== + +"@babel/helpers@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.10.4.tgz#2abeb0d721aff7c0a97376b9e1f6f65d7a475044" + integrity sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA== + dependencies: + "@babel/template" "^7.10.4" + "@babel/traverse" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/highlight@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" + integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.10.4", "@babel/parser@^7.11.5": + version "7.11.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.5.tgz#c7ff6303df71080ec7a4f5b8c003c58f1cf51037" + integrity sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q== + +"@babel/plugin-syntax-async-generators@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-bigint@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" + integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.10.4.tgz#6644e6a0baa55a61f9e3231f6c9eeb6ee46c124c" + integrity sha512-GCSBF7iUle6rNugfURwNmCGG3Z/2+opxAMLs1nND4bhEG5PuxTIggDBoeYYSujAlLtsupzOHYJQgPS3pivwXIA== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-import-meta@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" + integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-jsx@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.10.4.tgz#39abaae3cbf710c4373d8429484e6ba21340166c" + integrity sha512-KCg9mio9jwiARCB7WAcQ7Y1q+qicILjoK8LP/VkPkEKaf5dkaZZK1EcTe91a3JJlZ3qy6L5s9X52boEYi8DM9g== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-numeric-separator@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-transform-modules-commonjs@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.10.4.tgz#66667c3eeda1ebf7896d41f1f16b17105a2fbca0" + integrity sha512-Xj7Uq5o80HDLlW64rVfDBhao6OX89HKUmb+9vWYaLXBZOma4gA6tw4Ni1O5qVDoZWUV0fxMYA0aYzOawz0l+1w== + dependencies: + "@babel/helper-module-transforms" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-simple-access" "^7.10.4" + babel-plugin-dynamic-import-node "^2.3.3" + +"@babel/plugin-transform-react-display-name@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.10.4.tgz#b5795f4e3e3140419c3611b7a2a3832b9aef328d" + integrity sha512-Zd4X54Mu9SBfPGnEcaGcOrVAYOtjT2on8QZkLKEq1S/tHexG39d9XXGZv19VfRrDjPJzFmPfTAqOQS1pfFOujw== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-transform-react-jsx-development@^7.10.4": + version "7.11.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.11.5.tgz#e1439e6a57ee3d43e9f54ace363fb29cefe5d7b6" + integrity sha512-cImAmIlKJ84sDmpQzm4/0q/2xrXlDezQoixy3qoz1NJeZL/8PRon6xZtluvr4H4FzwlDGI5tCcFupMnXGtr+qw== + dependencies: + "@babel/helper-builder-react-jsx-experimental" "^7.11.5" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-jsx" "^7.10.4" + +"@babel/plugin-transform-react-jsx-self@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.10.4.tgz#cd301a5fed8988c182ed0b9d55e9bd6db0bd9369" + integrity sha512-yOvxY2pDiVJi0axdTWHSMi5T0DILN+H+SaeJeACHKjQLezEzhLx9nEF9xgpBLPtkZsks9cnb5P9iBEi21En3gg== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-jsx" "^7.10.4" + +"@babel/plugin-transform-react-jsx-source@^7.10.4": + version "7.10.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.10.5.tgz#34f1779117520a779c054f2cdd9680435b9222b4" + integrity sha512-wTeqHVkN1lfPLubRiZH3o73f4rfon42HpgxUSs86Nc+8QIcm/B9s8NNVXu/gwGcOyd7yDib9ikxoDLxJP0UiDA== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-jsx" "^7.10.4" + +"@babel/plugin-transform-react-jsx@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.10.4.tgz#673c9f913948764a4421683b2bef2936968fddf2" + integrity sha512-L+MfRhWjX0eI7Js093MM6MacKU4M6dnCRa/QPDwYMxjljzSCzzlzKzj9Pk4P3OtrPcxr2N3znR419nr3Xw+65A== + dependencies: + "@babel/helper-builder-react-jsx" "^7.10.4" + "@babel/helper-builder-react-jsx-experimental" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-jsx" "^7.10.4" + +"@babel/plugin-transform-react-pure-annotations@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.10.4.tgz#3eefbb73db94afbc075f097523e445354a1c6501" + integrity sha512-+njZkqcOuS8RaPakrnR9KvxjoG1ASJWpoIv/doyWngId88JoFlPlISenGXjrVacZUIALGUr6eodRs1vmPnF23A== + dependencies: + "@babel/helper-annotate-as-pure" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/preset-react@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.10.4.tgz#92e8a66d816f9911d11d4cc935be67adfc82dbcf" + integrity sha512-BrHp4TgOIy4M19JAfO1LhycVXOPWdDbTRep7eVyatf174Hff+6Uk53sDyajqZPu8W1qXRBiYOfIamek6jA7YVw== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-transform-react-display-name" "^7.10.4" + "@babel/plugin-transform-react-jsx" "^7.10.4" + "@babel/plugin-transform-react-jsx-development" "^7.10.4" + "@babel/plugin-transform-react-jsx-self" "^7.10.4" + "@babel/plugin-transform-react-jsx-source" "^7.10.4" + "@babel/plugin-transform-react-pure-annotations" "^7.10.4" + +"@babel/template@^7.10.4", "@babel/template@^7.3.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278" + integrity sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/parser" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.10.4", "@babel/traverse@^7.11.5": + version "7.11.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.11.5.tgz#be777b93b518eb6d76ee2e1ea1d143daa11e61c3" + integrity sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.11.5" + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.11.0" + "@babel/parser" "^7.11.5" + "@babel/types" "^7.11.5" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.19" + +"@babel/types@^7.0.0", "@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.11.5", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.11.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.11.5.tgz#d9de577d01252d77c6800cee039ee64faf75662d" + integrity sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q== + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + +"@bcoe/v8-coverage@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" + integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== + +"@cnakazawa/watch@^1.0.3": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" + integrity sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ== + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" + integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== + +"@jest/console@^26.5.2": + version "26.5.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.5.2.tgz#94fc4865b1abed7c352b5e21e6c57be4b95604a6" + integrity sha512-lJELzKINpF1v74DXHbCRIkQ/+nUV1M+ntj+X1J8LxCgpmJZjfLmhFejiMSbjjD66fayxl5Z06tbs3HMyuik6rw== + dependencies: + "@jest/types" "^26.5.2" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^26.5.2" + jest-util "^26.5.2" + slash "^3.0.0" + +"@jest/core@^26.5.3": + version "26.5.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.5.3.tgz#712ed4adb64c3bda256a3f400ff1d3eb2a031f13" + integrity sha512-CiU0UKFF1V7KzYTVEtFbFmGLdb2g4aTtY0WlyUfLgj/RtoTnJFhh50xKKr7OYkdmBUlGFSa2mD1TU3UZ6OLd4g== + dependencies: + "@jest/console" "^26.5.2" + "@jest/reporters" "^26.5.3" + "@jest/test-result" "^26.5.2" + "@jest/transform" "^26.5.2" + "@jest/types" "^26.5.2" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.4" + jest-changed-files "^26.5.2" + jest-config "^26.5.3" + jest-haste-map "^26.5.2" + jest-message-util "^26.5.2" + jest-regex-util "^26.0.0" + jest-resolve "^26.5.2" + jest-resolve-dependencies "^26.5.3" + jest-runner "^26.5.3" + jest-runtime "^26.5.3" + jest-snapshot "^26.5.3" + jest-util "^26.5.2" + jest-validate "^26.5.3" + jest-watcher "^26.5.2" + micromatch "^4.0.2" + p-each-series "^2.1.0" + rimraf "^3.0.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + +"@jest/environment@^26.5.2": + version "26.5.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.5.2.tgz#eba3cfc698f6e03739628f699c28e8a07f5e65fe" + integrity sha512-YjhCD/Zhkz0/1vdlS/QN6QmuUdDkpgBdK4SdiVg4Y19e29g4VQYN5Xg8+YuHjdoWGY7wJHMxc79uDTeTOy9Ngw== + dependencies: + "@jest/fake-timers" "^26.5.2" + "@jest/types" "^26.5.2" + "@types/node" "*" + jest-mock "^26.5.2" + +"@jest/fake-timers@^26.5.2": + version "26.5.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.5.2.tgz#1291ac81680ceb0dc7daa1f92c059307eea6400a" + integrity sha512-09Hn5Oraqt36V1akxQeWMVL0fR9c6PnEhpgLaYvREXZJAh2H2Y+QLCsl0g7uMoJeoWJAuz4tozk1prbR1Fc1sw== + dependencies: + "@jest/types" "^26.5.2" + "@sinonjs/fake-timers" "^6.0.1" + "@types/node" "*" + jest-message-util "^26.5.2" + jest-mock "^26.5.2" + jest-util "^26.5.2" + +"@jest/globals@^26.5.3": + version "26.5.3" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.5.3.tgz#90769b40e0af3fa0b28f6d8c5bbe3712467243fd" + integrity sha512-7QztI0JC2CuB+Wx1VdnOUNeIGm8+PIaqngYsZXQCkH2QV0GFqzAYc9BZfU0nuqA6cbYrWh5wkuMzyii3P7deug== + dependencies: + "@jest/environment" "^26.5.2" + "@jest/types" "^26.5.2" + expect "^26.5.3" + +"@jest/reporters@^26.5.3": + version "26.5.3" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.5.3.tgz#e810e9c2b670f33f1c09e9975749260ca12f1c17" + integrity sha512-X+vR0CpfMQzYcYmMFKNY9n4jklcb14Kffffp7+H/MqitWnb0440bW2L76NGWKAa+bnXhNoZr+lCVtdtPmfJVOQ== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^26.5.2" + "@jest/test-result" "^26.5.2" + "@jest/transform" "^26.5.2" + "@jest/types" "^26.5.2" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.2.4" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^4.0.3" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.0.2" + jest-haste-map "^26.5.2" + jest-resolve "^26.5.2" + jest-util "^26.5.2" + jest-worker "^26.5.0" + slash "^3.0.0" + source-map "^0.6.0" + string-length "^4.0.1" + terminal-link "^2.0.0" + v8-to-istanbul "^6.0.1" + optionalDependencies: + node-notifier "^8.0.0" + +"@jest/source-map@^26.5.0": + version "26.5.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-26.5.0.tgz#98792457c85bdd902365cd2847b58fff05d96367" + integrity sha512-jWAw9ZwYHJMe9eZq/WrsHlwF8E3hM9gynlcDpOyCb9bR8wEd9ZNBZCi7/jZyzHxC7t3thZ10gO2IDhu0bPKS5g== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.2.4" + source-map "^0.6.0" + +"@jest/test-result@^26.5.2": + version "26.5.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.5.2.tgz#cc1a44cfd4db2ecee3fb0bc4e9fe087aa54b5230" + integrity sha512-E/Zp6LURJEGSCWpoMGmCFuuEI1OWuI3hmZwmULV0GsgJBh7u0rwqioxhRU95euUuviqBDN8ruX/vP/4bwYolXw== + dependencies: + "@jest/console" "^26.5.2" + "@jest/types" "^26.5.2" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + +"@jest/test-sequencer@^26.5.3": + version "26.5.3" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.5.3.tgz#9ae0ab9bc37d5171b28424029192e50229814f8d" + integrity sha512-Wqzb7aQ13L3T47xHdpUqYMOpiqz6Dx2QDDghp5AV/eUDXR7JieY+E1s233TQlNyl+PqtqgjVokmyjzX/HA51BA== + dependencies: + "@jest/test-result" "^26.5.2" + graceful-fs "^4.2.4" + jest-haste-map "^26.5.2" + jest-runner "^26.5.3" + jest-runtime "^26.5.3" + +"@jest/transform@^26.5.2": + version "26.5.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.5.2.tgz#6a0033a1d24316a1c75184d010d864f2c681bef5" + integrity sha512-AUNjvexh+APhhmS8S+KboPz+D3pCxPvEAGduffaAJYxIFxGi/ytZQkrqcKDUU0ERBAo5R7087fyOYr2oms1seg== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^26.5.2" + babel-plugin-istanbul "^6.0.0" + chalk "^4.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.2.4" + jest-haste-map "^26.5.2" + jest-regex-util "^26.0.0" + jest-util "^26.5.2" + micromatch "^4.0.2" + pirates "^4.0.1" + slash "^3.0.0" + source-map "^0.6.1" + write-file-atomic "^3.0.0" + +"@jest/types@^26.5.2": + version "26.5.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.5.2.tgz#44c24f30c8ee6c7f492ead9ec3f3c62a5289756d" + integrity sha512-QDs5d0gYiyetI8q+2xWdkixVQMklReZr4ltw7GFDtb4fuJIBCE6mzj2LnitGqCuAlLap6wPyb8fpoHgwZz5fdg== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^15.0.0" + chalk "^4.0.0" + +"@sinonjs/commons@^1.7.0": + version "1.8.1" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217" + integrity sha512-892K+kWUUi3cl+LlqEWIDrhvLgdL79tECi8JZUyq6IviKy/DNhuzCRlbHUjxK89f4ypPMMaFnFuR9Ie6DoIMsw== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" + integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== + dependencies: + "@sinonjs/commons" "^1.7.0" + +"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": + version "7.1.10" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.10.tgz#ca58fc195dd9734e77e57c6f2df565623636ab40" + integrity sha512-x8OM8XzITIMyiwl5Vmo2B1cR1S1Ipkyv4mdlbJjMa1lmuKvKY9FrBbEANIaMlnWn5Rf7uO+rC/VgYabNkE17Hw== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.2.tgz#f3d71178e187858f7c45e30380f8f1b7415a12d8" + integrity sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.0.3" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.3.tgz#b8aaeba0a45caca7b56a5de9459872dde3727214" + integrity sha512-uCoznIPDmnickEi6D0v11SBpW0OuVqHJCa7syXqQHy5uktSCreIlt0iglsCnmvz8yCb38hGcWeseA8cWJSwv5Q== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.15.tgz#db9e4238931eb69ef8aab0ad6523d4d4caa39d03" + integrity sha512-Pzh9O3sTK8V6I1olsXpCfj2k/ygO2q1X0vhhnDrEQyYLHZesWz+zMZMVcwXLCYf0U36EtmyYaFGPfXlTtDHe3A== + dependencies: + "@babel/types" "^7.3.0" + +"@types/graceful-fs@^4.1.2": + version "4.1.3" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.3.tgz#039af35fe26bec35003e8d86d2ee9c586354348f" + integrity sha512-AiHRaEB50LQg0pZmm659vNBb9f4SJ0qrAnteuzhSeAUcJKxoYgEnprg/83kppCnc2zvtCKbdZry1a5pVY3lOTQ== + dependencies: + "@types/node" "*" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" + integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== + +"@types/istanbul-lib-report@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" + integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz#508b13aa344fa4976234e75dddcc34925737d821" + integrity sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA== + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/node@*": + version "14.11.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.11.8.tgz#fe2012f2355e4ce08bca44aeb3abbb21cf88d33f" + integrity sha512-KPcKqKm5UKDkaYPTuXSx8wEP7vE9GnuaXIZKijwRYcePpZFDVuy2a57LarFKiORbHOuTOOwYzxVxcUzsh2P2Pw== + +"@types/normalize-package-data@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" + integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== + +"@types/prettier@^2.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.2.tgz#4929992f87a0129f4960a110faeb526210562e7b" + integrity sha512-IiPhNnenzkqdSdQH3ifk9LoX7oQe61ZlDdDO4+MUv6FyWdPGDPr26gCPVs3oguZEMq//nFZZpwUZcVuNJsG+DQ== + +"@types/stack-utils@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" + integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== + +"@types/yargs-parser@*": + version "15.0.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d" + integrity sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw== + +"@types/yargs@^15.0.0": + version "15.0.8" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.8.tgz#7644904cad7427eb704331ea9bf1ee5499b82e23" + integrity sha512-b0BYzFUzBpOhPjpl1wtAHU994jBeKF4TKVlT7ssFv44T617XNcPdRoG4AzHLVshLzlrF7i3lTelH7UbuNYV58Q== + dependencies: + "@types/yargs-parser" "*" + +abab@^2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" + integrity sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q== + +acorn-globals@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" + integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== + dependencies: + acorn "^7.1.1" + acorn-walk "^7.1.1" + +acorn-walk@^7.1.1: + version "7.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" + integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== + +acorn@^7.1.1: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + +ajv@^6.12.3: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^4.2.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" + integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== + dependencies: + type-fest "^0.11.0" + +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +anymatch@^3.0.3: + version "3.1.1" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" + integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +atob@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.10.1" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.1.tgz#e1e82e4f3e999e2cfd61b161280d16a111f86428" + integrity sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA== + +babel-jest@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.5.2.tgz#164f367a35946c6cf54eaccde8762dec50422250" + integrity sha512-U3KvymF3SczA3vOL/cgiUFOznfMET+XDIXiWnoJV45siAp2pLMG8i2+/MGZlAC3f/F6Q40LR4M4qDrWZ9wkK8A== + dependencies: + "@jest/transform" "^26.5.2" + "@jest/types" "^26.5.2" + "@types/babel__core" "^7.1.7" + babel-plugin-istanbul "^6.0.0" + babel-preset-jest "^26.5.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + slash "^3.0.0" + +babel-plugin-dynamic-import-node@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" + integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ== + dependencies: + object.assign "^4.1.0" + +babel-plugin-istanbul@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" + integrity sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-instrument "^4.0.0" + test-exclude "^6.0.0" + +babel-plugin-jest-hoist@^26.5.0: + version "26.5.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.5.0.tgz#3916b3a28129c29528de91e5784a44680db46385" + integrity sha512-ck17uZFD3CDfuwCLATWZxkkuGGFhMij8quP8CNhwj8ek1mqFgbFzRJ30xwC04LLscj/aKsVFfRST+b5PT7rSuw== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.0.0" + "@types/babel__traverse" "^7.0.6" + +babel-preset-current-node-syntax@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz#826f1f8e7245ad534714ba001f84f7e906c3b615" + integrity sha512-5/INNCYhUGqw7VbVjT/hb3ucjgkVHKXY7lX3ZjlN4gm565VyFmJUrJ/h+h16ECVB38R/9SF6aACydpKMLZ/c9w== + dependencies: + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-bigint" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.8.3" + "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + +babel-preset-jest@^26.5.0: + version "26.5.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-26.5.0.tgz#f1b166045cd21437d1188d29f7fba470d5bdb0e7" + integrity sha512-F2vTluljhqkiGSJGBg/jOruA8vIIIL11YrxRcO7nviNTMbbofPSHwnm8mgP7d/wS7wRSexRoI6X1A6T74d4LQA== + dependencies: + babel-plugin-jest-hoist "^26.5.0" + babel-preset-current-node-syntax "^0.1.3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +braces@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browser-process-hrtime@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" + integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== + +bser@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.0.0, camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.1.0.tgz#27dc176173725fb0adf8a48b647f4d7871944d78" + integrity sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ== + +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== + dependencies: + rsvp "^4.8.4" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +chalk@^2.0.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +char-regex@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" + integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + +collect-v8-coverage@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" + integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + dependencies: + safe-buffer "~5.1.1" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +cross-spawn@^6.0.0: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^7.0.0: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +cssom@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" + integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== + +cssom@~0.3.6: + version "0.3.8" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== + +cssstyle@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" + integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== + dependencies: + cssom "~0.3.6" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +data-urls@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" + integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== + dependencies: + abab "^2.0.3" + whatwg-mimetype "^2.3.0" + whatwg-url "^8.0.0" + +debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^4.1.0, debug@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" + integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== + dependencies: + ms "2.1.2" + +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decimal.js@^10.2.0: + version "10.2.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" + integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + +define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +detect-newline@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" + integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== + +diff-sequences@^26.5.0: + version "26.5.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.5.0.tgz#ef766cf09d43ed40406611f11c6d8d9dd8b2fefd" + integrity sha512-ZXx86srb/iYy6jG71k++wBN9P9J05UNQ5hQHQd9MtMPvcqXPx/vKU69jfHV637D00Q2gSgPk2D+jSx3l1lDW/Q== + +domexception@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" + integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== + dependencies: + webidl-conversions "^5.0.0" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +emittery@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.1.tgz#c02375a927a40948c0345cc903072597f5270451" + integrity sha512-d34LN4L6h18Bzz9xpoku2nPwKxCPlPMr3EEKTkoEBi+1/+b0lcRkRJ1UVyyZaKNeqGR3swcGl6s390DNO4YVgQ== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.17.5: + version "1.17.7" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" + integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-abstract@^1.18.0-next.0: + version "1.18.0-next.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" + integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-negative-zero "^2.0.0" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escodegen@^1.14.1: + version "1.14.3" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" + integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== + dependencies: + esprima "^4.0.1" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +esprima@^4.0.0, esprima@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +estraverse@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +exec-sh@^0.3.2: + version "0.3.4" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.4.tgz#3a018ceb526cc6f6df2bb504b2bfe8e3a4934ec5" + integrity sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A== + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +execa@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/execa/-/execa-4.0.3.tgz#0a34dabbad6d66100bd6f2c576c8669403f317f2" + integrity sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A== + dependencies: + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.0" + onetime "^5.1.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expect@^26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/expect/-/expect-26.5.3.tgz#89d9795036f7358b0a9a5243238eb8086482d741" + integrity sha512-kkpOhGRWGOr+TEFUnYAjfGvv35bfP+OlPtqPIJpOCR9DVtv8QV+p8zG0Edqafh80fsjeE+7RBcVUq1xApnYglw== + dependencies: + "@jest/types" "^26.5.2" + ansi-styles "^4.0.0" + jest-get-type "^26.3.0" + jest-matcher-utils "^26.5.2" + jest-message-util "^26.5.2" + jest-regex-util "^26.0.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +fb-watchman@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" + integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== + dependencies: + bser "2.1.1" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@^4.0.0, find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +gensync@^1.0.0-beta.1: + version "1.0.0-beta.1" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" + integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== + +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== + +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-stream@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +graceful-fs@^4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" + integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== + dependencies: + ajv "^6.12.3" + har-schema "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-symbols@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" + integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hosted-git-info@^2.1.4: + version "2.8.8" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" + integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== + +html-encoding-sniffer@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" + integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== + dependencies: + whatwg-encoding "^1.0.5" + +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +human-signals@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" + integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +import-local@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" + integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +ip-regex@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" + integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-callable@^1.1.4, is-callable@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" + integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" + integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-docker@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.1.1.tgz#4125a88e44e450d384e09047ede71adc2d144156" + integrity sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw== + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + +is-negative-zero@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.0.tgz#9553b121b0fac28869da9ed459e20c7543788461" + integrity sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE= + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-potential-custom-element-name@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397" + integrity sha1-DFLlS8yjkbssSUsh6GJtczbG45c= + +is-regex@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" + integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== + dependencies: + has-symbols "^1.0.1" + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + +is-symbol@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" + integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== + dependencies: + has-symbols "^1.0.1" + +is-typedarray@^1.0.0, is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +is-wsl@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" + +isarray@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +istanbul-lib-coverage@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" + integrity sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg== + +istanbul-lib-instrument@^4.0.0, istanbul-lib-instrument@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" + integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== + dependencies: + "@babel/core" "^7.7.5" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.0.0" + semver "^6.3.0" + +istanbul-lib-report@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" + integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^3.0.0" + supports-color "^7.1.0" + +istanbul-lib-source-maps@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9" + integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + +istanbul-reports@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" + integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + +jest-changed-files@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.5.2.tgz#330232c6a5c09a7f040a5870e8f0a9c6abcdbed5" + integrity sha512-qSmssmiIdvM5BWVtyK/nqVpN3spR5YyvkvPqz1x3BR1bwIxsWmU/MGwLoCrPNLbkG2ASAKfvmJpOduEApBPh2w== + dependencies: + "@jest/types" "^26.5.2" + execa "^4.0.0" + throat "^5.0.0" + +jest-cli@^26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.5.3.tgz#f936b98f247b76b7bc89c7af50af82c88e356a80" + integrity sha512-HkbSvtugpSXBf2660v9FrNVUgxvPkssN8CRGj9gPM8PLhnaa6zziFiCEKQAkQS4uRzseww45o0TR+l6KeRYV9A== + dependencies: + "@jest/core" "^26.5.3" + "@jest/test-result" "^26.5.2" + "@jest/types" "^26.5.2" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.4" + import-local "^3.0.2" + is-ci "^2.0.0" + jest-config "^26.5.3" + jest-util "^26.5.2" + jest-validate "^26.5.3" + prompts "^2.0.1" + yargs "^15.4.1" + +jest-config@^26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.5.3.tgz#baf51c9be078c2c755c8f8a51ec0f06c762c1d3f" + integrity sha512-NVhZiIuN0GQM6b6as4CI5FSCyXKxdrx5ACMCcv/7Pf+TeCajJhJc+6dwgdAVPyerUFB9pRBIz3bE7clSrRge/w== + dependencies: + "@babel/core" "^7.1.0" + "@jest/test-sequencer" "^26.5.3" + "@jest/types" "^26.5.2" + babel-jest "^26.5.2" + chalk "^4.0.0" + deepmerge "^4.2.2" + glob "^7.1.1" + graceful-fs "^4.2.4" + jest-environment-jsdom "^26.5.2" + jest-environment-node "^26.5.2" + jest-get-type "^26.3.0" + jest-jasmine2 "^26.5.3" + jest-regex-util "^26.0.0" + jest-resolve "^26.5.2" + jest-util "^26.5.2" + jest-validate "^26.5.3" + micromatch "^4.0.2" + pretty-format "^26.5.2" + +jest-diff@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.5.2.tgz#8e26cb32dc598e8b8a1b9deff55316f8313c8053" + integrity sha512-HCSWDUGwsov5oTlGzrRM+UPJI/Dpqi9jzeV0fdRNi3Ch5bnoXhnyJMmVg2juv9081zLIy3HGPI5mcuGgXM2xRA== + dependencies: + chalk "^4.0.0" + diff-sequences "^26.5.0" + jest-get-type "^26.3.0" + pretty-format "^26.5.2" + +jest-docblock@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-26.0.0.tgz#3e2fa20899fc928cb13bd0ff68bd3711a36889b5" + integrity sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w== + dependencies: + detect-newline "^3.0.0" + +jest-each@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.5.2.tgz#35e68d6906a7f826d3ca5803cfe91d17a5a34c31" + integrity sha512-w7D9FNe0m2D3yZ0Drj9CLkyF/mGhmBSULMQTypzAKR746xXnjUrK8GUJdlLTWUF6dd0ks3MtvGP7/xNFr9Aphg== + dependencies: + "@jest/types" "^26.5.2" + chalk "^4.0.0" + jest-get-type "^26.3.0" + jest-util "^26.5.2" + pretty-format "^26.5.2" + +jest-environment-jsdom@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.5.2.tgz#5feab05b828fd3e4b96bee5e0493464ddd2bb4bc" + integrity sha512-fWZPx0bluJaTQ36+PmRpvUtUlUFlGGBNyGX1SN3dLUHHMcQ4WseNEzcGGKOw4U5towXgxI4qDoI3vwR18H0RTw== + dependencies: + "@jest/environment" "^26.5.2" + "@jest/fake-timers" "^26.5.2" + "@jest/types" "^26.5.2" + "@types/node" "*" + jest-mock "^26.5.2" + jest-util "^26.5.2" + jsdom "^16.4.0" + +jest-environment-node@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.5.2.tgz#275a0f01b5e47447056f1541a15ed4da14acca03" + integrity sha512-YHjnDsf/GKFCYMGF1V+6HF7jhY1fcLfLNBDjhAOvFGvt6d8vXvNdJGVM7uTZ2VO/TuIyEFhPGaXMX5j3h7fsrA== + dependencies: + "@jest/environment" "^26.5.2" + "@jest/fake-timers" "^26.5.2" + "@jest/types" "^26.5.2" + "@types/node" "*" + jest-mock "^26.5.2" + jest-util "^26.5.2" + +jest-get-type@^26.3.0: + version "26.3.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" + integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== + +jest-haste-map@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.5.2.tgz#a15008abfc502c18aa56e4919ed8c96304ceb23d" + integrity sha512-lJIAVJN3gtO3k4xy+7i2Xjtwh8CfPcH08WYjZpe9xzveDaqGw9fVNCpkYu6M525wKFVkLmyi7ku+DxCAP1lyMA== + dependencies: + "@jest/types" "^26.5.2" + "@types/graceful-fs" "^4.1.2" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.4" + jest-regex-util "^26.0.0" + jest-serializer "^26.5.0" + jest-util "^26.5.2" + jest-worker "^26.5.0" + micromatch "^4.0.2" + sane "^4.0.3" + walker "^1.0.7" + optionalDependencies: + fsevents "^2.1.2" + +jest-jasmine2@^26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.5.3.tgz#baad2114ce32d16aff25aeb877d18bb4e332dc4c" + integrity sha512-nFlZOpnGlNc7y/+UkkeHnvbOM+rLz4wB1AimgI9QhtnqSZte0wYjbAm8hf7TCwXlXgDwZxAXo6z0a2Wzn9FoOg== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^26.5.2" + "@jest/source-map" "^26.5.0" + "@jest/test-result" "^26.5.2" + "@jest/types" "^26.5.2" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + expect "^26.5.3" + is-generator-fn "^2.0.0" + jest-each "^26.5.2" + jest-matcher-utils "^26.5.2" + jest-message-util "^26.5.2" + jest-runtime "^26.5.3" + jest-snapshot "^26.5.3" + jest-util "^26.5.2" + pretty-format "^26.5.2" + throat "^5.0.0" + +jest-leak-detector@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.5.2.tgz#83fcf9a4a6ef157549552cb4f32ca1d6221eea69" + integrity sha512-h7ia3dLzBFItmYERaLPEtEKxy3YlcbcRSjj0XRNJgBEyODuu+3DM2o62kvIFvs3PsaYoIIv+e+nLRI61Dj1CNw== + dependencies: + jest-get-type "^26.3.0" + pretty-format "^26.5.2" + +jest-matcher-utils@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.5.2.tgz#6aa2c76ce8b9c33e66f8856ff3a52bab59e6c85a" + integrity sha512-W9GO9KBIC4gIArsNqDUKsLnhivaqf8MSs6ujO/JDcPIQrmY+aasewweXVET8KdrJ6ADQaUne5UzysvF/RR7JYA== + dependencies: + chalk "^4.0.0" + jest-diff "^26.5.2" + jest-get-type "^26.3.0" + pretty-format "^26.5.2" + +jest-message-util@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.5.2.tgz#6c4c4c46dcfbabb47cd1ba2f6351559729bc11bb" + integrity sha512-Ocp9UYZ5Jl15C5PNsoDiGEk14A4NG0zZKknpWdZGoMzJuGAkVt10e97tnEVMYpk7LnQHZOfuK2j/izLBMcuCZw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@jest/types" "^26.5.2" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + micromatch "^4.0.2" + slash "^3.0.0" + stack-utils "^2.0.2" + +jest-mock@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.5.2.tgz#c9302e8ef807f2bfc749ee52e65ad11166a1b6a1" + integrity sha512-9SiU4b5PtO51v0MtJwVRqeGEroH66Bnwtq4ARdNP7jNXbpT7+ByeWNAk4NeT/uHfNSVDXEXgQo1XRuwEqS6Rdw== + dependencies: + "@jest/types" "^26.5.2" + "@types/node" "*" + +jest-pnp-resolver@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" + integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== + +jest-regex-util@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" + integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== + +jest-resolve-dependencies@^26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.5.3.tgz#11483f91e534bdcd257ab21e8622799e59701aba" + integrity sha512-+KMDeke/BFK+mIQ2IYSyBz010h7zQaVt4Xie6cLqUGChorx66vVeQVv4ErNoMwInnyYHi1Ud73tDS01UbXbfLQ== + dependencies: + "@jest/types" "^26.5.2" + jest-regex-util "^26.0.0" + jest-snapshot "^26.5.3" + +jest-resolve@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.5.2.tgz#0d719144f61944a428657b755a0e5c6af4fc8602" + integrity sha512-XsPxojXGRA0CoDD7Vis59ucz2p3cQFU5C+19tz3tLEAlhYKkK77IL0cjYjikY9wXnOaBeEdm1rOgSJjbZWpcZg== + dependencies: + "@jest/types" "^26.5.2" + chalk "^4.0.0" + graceful-fs "^4.2.4" + jest-pnp-resolver "^1.2.2" + jest-util "^26.5.2" + read-pkg-up "^7.0.1" + resolve "^1.17.0" + slash "^3.0.0" + +jest-runner@^26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.5.3.tgz#800787459ea59c68e7505952933e33981dc3db38" + integrity sha512-qproP0Pq7IIule+263W57k2+8kWCszVJTC9TJWGUz0xJBr+gNiniGXlG8rotd0XxwonD5UiJloYoSO5vbUr5FQ== + dependencies: + "@jest/console" "^26.5.2" + "@jest/environment" "^26.5.2" + "@jest/test-result" "^26.5.2" + "@jest/types" "^26.5.2" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.7.1" + exit "^0.1.2" + graceful-fs "^4.2.4" + jest-config "^26.5.3" + jest-docblock "^26.0.0" + jest-haste-map "^26.5.2" + jest-leak-detector "^26.5.2" + jest-message-util "^26.5.2" + jest-resolve "^26.5.2" + jest-runtime "^26.5.3" + jest-util "^26.5.2" + jest-worker "^26.5.0" + source-map-support "^0.5.6" + throat "^5.0.0" + +jest-runtime@^26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.5.3.tgz#5882ae91fd88304310f069549e6bf82f3f198bea" + integrity sha512-IDjalmn2s/Tc4GvUwhPHZ0iaXCdMRq5p6taW9P8RpU+FpG01O3+H8z+p3rDCQ9mbyyyviDgxy/LHPLzrIOKBkQ== + dependencies: + "@jest/console" "^26.5.2" + "@jest/environment" "^26.5.2" + "@jest/fake-timers" "^26.5.2" + "@jest/globals" "^26.5.3" + "@jest/source-map" "^26.5.0" + "@jest/test-result" "^26.5.2" + "@jest/transform" "^26.5.2" + "@jest/types" "^26.5.2" + "@types/yargs" "^15.0.0" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.4" + jest-config "^26.5.3" + jest-haste-map "^26.5.2" + jest-message-util "^26.5.2" + jest-mock "^26.5.2" + jest-regex-util "^26.0.0" + jest-resolve "^26.5.2" + jest-snapshot "^26.5.3" + jest-util "^26.5.2" + jest-validate "^26.5.3" + slash "^3.0.0" + strip-bom "^4.0.0" + yargs "^15.4.1" + +jest-serializer@^26.5.0: + version "26.5.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.5.0.tgz#f5425cc4c5f6b4b355f854b5f0f23ec6b962bc13" + integrity sha512-+h3Gf5CDRlSLdgTv7y0vPIAoLgX/SI7T4v6hy+TEXMgYbv+ztzbg5PSN6mUXAT/hXYHvZRWm+MaObVfqkhCGxA== + dependencies: + "@types/node" "*" + graceful-fs "^4.2.4" + +jest-snapshot@^26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.5.3.tgz#f6b4b4b845f85d4b0dadd7cf119c55d0c1688601" + integrity sha512-ZgAk0Wm0JJ75WS4lGaeRfa0zIgpL0KD595+XmtwlIEMe8j4FaYHyZhP1LNOO+8fXq7HJ3hll54+sFV9X4+CGVw== + dependencies: + "@babel/types" "^7.0.0" + "@jest/types" "^26.5.2" + "@types/babel__traverse" "^7.0.4" + "@types/prettier" "^2.0.0" + chalk "^4.0.0" + expect "^26.5.3" + graceful-fs "^4.2.4" + jest-diff "^26.5.2" + jest-get-type "^26.3.0" + jest-haste-map "^26.5.2" + jest-matcher-utils "^26.5.2" + jest-message-util "^26.5.2" + jest-resolve "^26.5.2" + natural-compare "^1.4.0" + pretty-format "^26.5.2" + semver "^7.3.2" + +jest-util@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.5.2.tgz#8403f75677902cc52a1b2140f568e91f8ed4f4d7" + integrity sha512-WTL675bK+GSSAYgS8z9FWdCT2nccO1yTIplNLPlP0OD8tUk/H5IrWKMMRudIQQ0qp8bb4k+1Qa8CxGKq9qnYdg== + dependencies: + "@jest/types" "^26.5.2" + "@types/node" "*" + chalk "^4.0.0" + graceful-fs "^4.2.4" + is-ci "^2.0.0" + micromatch "^4.0.2" + +jest-validate@^26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.5.3.tgz#eefd5a5c87059550548c5ad8d6589746c66929e3" + integrity sha512-LX07qKeAtY+lsU0o3IvfDdN5KH9OulEGOMN1sFo6PnEf5/qjS1LZIwNk9blcBeW94pQUI9dLN9FlDYDWI5tyaA== + dependencies: + "@jest/types" "^26.5.2" + camelcase "^6.0.0" + chalk "^4.0.0" + jest-get-type "^26.3.0" + leven "^3.1.0" + pretty-format "^26.5.2" + +jest-watcher@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.5.2.tgz#2957f4461007e0769d74b537379ecf6b7c696916" + integrity sha512-i3m1NtWzF+FXfJ3ljLBB/WQEp4uaNhX7QcQUWMokcifFTUQBDFyUMEwk0JkJ1kopHbx7Een3KX0Q7+9koGM/Pw== + dependencies: + "@jest/test-result" "^26.5.2" + "@jest/types" "^26.5.2" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + jest-util "^26.5.2" + string-length "^4.0.1" + +jest-worker@^26.5.0: + version "26.5.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.5.0.tgz#87deee86dbbc5f98d9919e0dadf2c40e3152fa30" + integrity sha512-kTw66Dn4ZX7WpjZ7T/SUDgRhapFRKWmisVAF0Rv4Fu8SLFD7eLbqpLvbxVqYhSgaWa7I+bW7pHnbyfNsH6stug== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^7.0.0" + +jest@^26.5.3: + version "26.5.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-26.5.3.tgz#5e7a322d16f558dc565ca97639e85993ef5affe6" + integrity sha512-uJi3FuVSLmkZrWvaDyaVTZGLL8WcfynbRnFXyAHuEtYiSZ+ijDDIMOw1ytmftK+y/+OdAtsG9QrtbF7WIBmOyA== + dependencies: + "@jest/core" "^26.5.3" + import-local "^3.0.2" + jest-cli "^26.5.3" + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.14.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" + integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +jsdom@^16.4.0: + version "16.4.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.4.0.tgz#36005bde2d136f73eee1a830c6d45e55408edddb" + integrity sha512-lYMm3wYdgPhrl7pDcRmvzPhhrGVBeVhPIqeHjzeiHN3DFmD1RBpbExbi8vU7BJdH8VAZYovR8DMt0PNNDM7k8w== + dependencies: + abab "^2.0.3" + acorn "^7.1.1" + acorn-globals "^6.0.0" + cssom "^0.4.4" + cssstyle "^2.2.0" + data-urls "^2.0.0" + decimal.js "^10.2.0" + domexception "^2.0.1" + escodegen "^1.14.1" + html-encoding-sniffer "^2.0.1" + is-potential-custom-element-name "^1.0.0" + nwsapi "^2.2.0" + parse5 "5.1.1" + request "^2.88.2" + request-promise-native "^1.0.8" + saxes "^5.0.0" + symbol-tree "^3.2.4" + tough-cookie "^3.0.1" + w3c-hr-time "^1.0.2" + w3c-xmlserializer "^2.0.0" + webidl-conversions "^6.1.0" + whatwg-encoding "^1.0.5" + whatwg-mimetype "^2.3.0" + whatwg-url "^8.0.0" + ws "^7.2.3" + xml-name-validator "^3.0.0" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +json5@^2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43" + integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA== + dependencies: + minimist "^1.2.5" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +kleur@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + +leven@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" + integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= + +lodash@^4.17.19: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + +make-dir@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= + dependencies: + tmpl "1.0.x" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + +mime-db@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" + integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.27" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" + integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== + dependencies: + mime-db "1.44.0" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= + +node-modules-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= + +node-notifier@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.0.tgz#a7eee2d51da6d0f7ff5094bc7108c911240c1620" + integrity sha512-46z7DUmcjoYdaWyXouuFNNfUo6eFa94t23c53c+lG/9Cvauk4a98rAUp9672X5dxGdQmLpPzTxzu8f/OeEPaFA== + dependencies: + growly "^1.3.0" + is-wsl "^2.2.0" + semver "^7.3.2" + shellwords "^0.1.1" + uuid "^8.3.0" + which "^2.0.2" + +normalize-package-data@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +npm-run-path@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +nwsapi@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" + integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-inspect@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" + integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== + +object-keys@^1.0.12, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.assign@^4.1.0, object.assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.1.tgz#303867a666cdd41936ecdedfb1f8f3e32a478cdd" + integrity sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.18.0-next.0" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +optionator@^0.8.1: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + +p-each-series@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.1.0.tgz#961c8dd3f195ea96c747e636b262b800a6b1af48" + integrity sha512-ZuRs1miPT4HrjFa+9fRfOFXxGJfORgelKV9f9nNOWw2gl6gVsRaVDOQP0+MI0G0wGKns1Yacsu0GjOFbTK0JFQ== + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parse-json@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.1.0.tgz#f96088cdf24a8faa9aea9a009f2d9d942c999646" + integrity sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +parse5@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" + integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +picomatch@^2.0.4, picomatch@^2.0.5: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + +pirates@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" + integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== + dependencies: + node-modules-regexp "^1.0.0" + +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +pretty-format@^26.5.2: + version "26.5.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.5.2.tgz#5d896acfdaa09210683d34b6dc0e6e21423cd3e1" + integrity sha512-VizyV669eqESlkOikKJI8Ryxl/kPpbdLwNdPs2GrbQs18MpySB5S0Yo0N7zkg2xTRiFq4CFw8ct5Vg4a0xP0og== + dependencies: + "@jest/types" "^26.5.2" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^16.12.0" + +prompts@^2.0.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.3.2.tgz#480572d89ecf39566d2bd3fe2c9fccb7c4c0b068" + integrity sha512-Q06uKs2CkNYVID0VqwfAl9mipo99zkBv/n2JtWY89Yxa3ZabWSrs0e2KTudKVa3peLUvYXMefDqIleLPVUBZMA== + dependencies: + kleur "^3.0.3" + sisteransi "^1.0.4" + +psl@^1.1.28: + version "1.8.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" + integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +punycode@^2.1.0, punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +react-is@^16.12.0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +read-pkg-up@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" + integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== + dependencies: + find-up "^4.1.0" + read-pkg "^5.2.0" + type-fest "^0.8.1" + +read-pkg@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== + dependencies: + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +request-promise-core@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" + integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== + dependencies: + lodash "^4.17.19" + +request-promise-native@^1.0.8: + version "1.0.9" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" + integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== + dependencies: + request-promise-core "1.1.4" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" + +request@^2.88.2: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== + dependencies: + resolve-from "^5.0.0" + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@^1.10.0, resolve@^1.17.0, resolve@^1.3.2: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rimraf@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +rsvp@^4.8.4: + version "4.8.5" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" + integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== + +safe-buffer@^5.0.1, safe-buffer@^5.1.2: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sane@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== + dependencies: + "@cnakazawa/watch" "^1.0.3" + anymatch "^2.0.0" + capture-exit "^2.0.0" + exec-sh "^0.3.2" + execa "^1.0.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + +saxes@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" + integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== + dependencies: + xmlchars "^2.2.0" + +"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.0.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.3.2: + version "7.3.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" + integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + +sisteransi@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" + integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.5.6: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.0, source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@^0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.6" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz#c80757383c28abf7296744998cbc106ae8b854ce" + integrity sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +stack-utils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.2.tgz#5cf48b4557becb4638d0bc4f21d23f5d19586593" + integrity sha512-0H7QK2ECz3fyZMzQ8rH0j2ykpfbnd20BFtfg/SqVC2+sCTtcw0aDTGB7dk+de4U4uUeuz6nOtJcrkFFLG1B0Rg== + dependencies: + escape-string-regexp "^2.0.0" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +stealthy-require@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= + +string-length@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.1.tgz#4a973bf31ef77c4edbceadd6af2611996985f8a1" + integrity sha512-PKyXUd0LK0ePjSOnWn34V2uD6acUWev9uy0Ft05k0E8xRW+SKcA0F7eMr7h5xlzfn+4O3N+55rduYyet3Jk+jw== + dependencies: + char-regex "^1.0.2" + strip-ansi "^6.0.0" + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +string.prototype.trimend@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913" + integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + +string.prototype.trimstart@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" + integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.0.0, supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-hyperlinks@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz#f663df252af5f37c5d49bbd7eeefa9e0b9e59e47" + integrity sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA== + dependencies: + has-flag "^4.0.0" + supports-color "^7.0.0" + +symbol-tree@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== + +terminal-link@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" + integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== + dependencies: + ansi-escapes "^4.2.1" + supports-hyperlinks "^2.0.0" + +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + +throat@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" + integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@^2.3.3, tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2" + integrity sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg== + dependencies: + ip-regex "^2.1.0" + psl "^1.1.28" + punycode "^2.1.1" + +tr46@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.0.2.tgz#03273586def1595ae08fedb38d7733cee91d2479" + integrity sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg== + dependencies: + punycode "^2.1.1" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +type-detect@4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" + integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== + +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +uri-js@^4.2.2: + version "4.4.0" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602" + integrity sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +uuid@^8.3.0: + version "8.3.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31" + integrity sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg== + +v8-to-istanbul@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-6.0.1.tgz#7ef0e32faa10f841fe4c1b0f8de96ed067c0be1e" + integrity sha512-PzM1WlqquhBvsV+Gco6WSFeg1AGdD53ccMRkFeyHRE/KRZaVacPOmQYP3EeVgDBtKD2BJ8kgynBQ5OtKiHCH+w== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^1.6.0" + source-map "^0.7.3" + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +w3c-hr-time@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" + integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== + dependencies: + browser-process-hrtime "^1.0.0" + +w3c-xmlserializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" + integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== + dependencies: + xml-name-validator "^3.0.0" + +walker@^1.0.7, walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + dependencies: + makeerror "1.0.x" + +webidl-conversions@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" + integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== + +webidl-conversions@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" + integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== + +whatwg-encoding@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== + dependencies: + iconv-lite "0.4.24" + +whatwg-mimetype@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== + +whatwg-url@^8.0.0: + version "8.4.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.4.0.tgz#50fb9615b05469591d2b2bd6dfaed2942ed72837" + integrity sha512-vwTUFf6V4zhcPkWp/4CQPr1TW9Ml6SF4lVyaIMBdJw5i6qUUJ1QWM4Z6YYVkfka0OUIzVo/0aNtGVGk256IKWw== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^2.0.2" + webidl-conversions "^6.1.0" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +which@^2.0.1, which@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== + dependencies: + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" + +ws@^7.2.3: + version "7.3.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" + integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== + +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== + +xmlchars@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== + +y18n@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + +yargs-parser@^18.1.2: + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@^15.4.1: + version "15.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.2" diff --git a/scripts/prettier/index.js b/scripts/prettier/index.js index 92c741ad6a0b..4853557640af 100644 --- a/scripts/prettier/index.js +++ b/scripts/prettier/index.js @@ -25,7 +25,7 @@ let didWarn = false; let didError = false; const files = glob - .sync('**/*.js', {ignore: '**/node_modules/**'}) + .sync('**/*.js', {ignore: ['**/node_modules/**', '**/cjs/**']}) .filter(f => !onlyChanged || changedFiles.has(f)); if (!files.length) { From 4eb589169c83ba9d5cf4ecb2cf07c1f1576bba32 Mon Sep 17 00:00:00 2001 From: Saikat Guha Date: Wed, 14 Oct 2020 23:29:05 +0530 Subject: [PATCH 0013/1603] DevTools: Handle restricted browser pages properly like new tab page, extensions page etc(only chrome and edge for now) (#20023) --- .../icons/128-restricted.png | Bin 0 -> 4792 bytes .../icons/16-restricted.png | Bin 0 -> 494 bytes .../icons/32-restricted.png | Bin 0 -> 1092 bytes .../icons/48-restricted.png | Bin 0 -> 1564 bytes .../icons/restricted.svg | 1 + .../popups/deadcode.html | 6 +-- .../popups/development.html | 6 +-- .../popups/disabled.html | 6 +-- .../popups/outdated.html | 6 +-- .../popups/production.html | 6 +-- .../popups/restricted.html | 14 ++++++ .../popups/shared.css | 7 +++ .../src/background.js | 42 ++++++++++++++---- 13 files changed, 61 insertions(+), 33 deletions(-) create mode 100644 packages/react-devtools-extensions/icons/128-restricted.png create mode 100644 packages/react-devtools-extensions/icons/16-restricted.png create mode 100644 packages/react-devtools-extensions/icons/32-restricted.png create mode 100644 packages/react-devtools-extensions/icons/48-restricted.png create mode 100644 packages/react-devtools-extensions/icons/restricted.svg create mode 100644 packages/react-devtools-extensions/popups/restricted.html create mode 100644 packages/react-devtools-extensions/popups/shared.css diff --git a/packages/react-devtools-extensions/icons/128-restricted.png b/packages/react-devtools-extensions/icons/128-restricted.png new file mode 100644 index 0000000000000000000000000000000000000000..67b1c9a31a6dfe22567ce26e385b0be06022e3c2 GIT binary patch literal 4792 zcmV;p5=ZTcP)KeLv!~X4LIOa!^NT?Z=Bo3=L7h+Lmy2H1VrM6#4V$J7x z04S-LbO8X3FWyY05ydh;CX+O=!vJ^SplT`esw%P+a)l4W&ub@Q})M@L8ZeDTE> zd#Vi#RRe$zKm2g%k|j&F%$hZ;)%H8T{r20bpMU;&&+gs3d!Bsq$)lAT>#MK6+PZ4h zs`c~d&tDn$yFdN(Q_q403!X0l5ZLuM-gx7dG|ym%z4_*wuVe{?Gz%Z(VoyEw)QTND zcAP3a09-77aECqj+;f{=yvr?0NdQ$ysppyU`IXv_~ZM-WM>jW zG#Gii&V`Qf*=L`1End8Mi|rUECMGV(cS&vG$KX`e+5a{MTQ9RargHy!F;wcaDvX?PT{R-SvE*=Y%aj<6u1R zyz@>cV>HU(3a-Y+#!kk2{P^)#0HpNY>#x6lW76?m^c;ZQ|HKnd989w_qAUiF8}#+{ zt&XF8W6s@w|NT3|6jA{C<(FUf*l-yZdF$4#dnJx=sE8QBuH_^^7zwK|iG5vBCoZ@-;p{=pUChJ^wE zELPgBufP8K3u&Iq4o4QVtEA88&Yjx@D-KRLpco$?->aE-h!J!T?DsU*1;CMXmj@nr zV0obc(B9tOA=$<*Y3S6p91mNxqN^XLCNZ6S;aSvWs{pWb-mjZ7kafNI~qeJeCuT$1-$J7_#- zQ8iF50FYR2mVR;c0_3=+9Qqd@u;k&L^K_Cz03gVYZFgr{y`ZP3XHD2Wm}!;BIWXq# zwBPXZ9ttS}qIRYWLfh}|?%o-853bot?8LKY&z`EO5-LneSeUjSv<~uO$Atwzm@nT2 z;o*x~d_M@fy1KSx8Kg0$<)T6ZAS{ySntu4}#o zk(VW~LkvLrj3^wgW6eYa1e-Q(+E}SMsbor9Rq6n)=~-=UZ5s(UI|e{&ULvt7 z05Cp2K1~GNaKjDDTs?n_At~C(L=z~Iz5_?l0!XBUxeD1zoUT$Lv1$N7!9-S?F)W*~ zZ}9KP`FG!acTJeb5zZj_B;X`bJ_K7bKx?((h%*`hRLcke=y0*SVA;}Vwq8Csgr*dd z#gul8S6y{ghYd%p6y;JHMu6u0`Sa5z*oEAeK4VuKu5%QV&=R1%lIcha8{ynE*~W&; zO!Iks^UXJXg#v)LD8WT1bZZk5=03mPz@(yCYdL}Z&OP_sv)9GA$r3g@w%=pj>|O(y zqX3MEW>ip10(xFP04TSlP`q=&T^3B-gry@hVVhBlTrGt70Nez8%yraQ7Xu!sd7lR# zd~kp8{`&g*_QG)hqj3)y00d3J<%UgP*wO41*99XLQL4!7QX(OWOD?_i(lxH%1NJ6yOT!l63h~{xV+46`Lj{vHlI6pZuERYGK;(0O!!}Umh>BZCVh|J z)V|~5I(hQs4(WHN6gl;Kh6Da3&3y1(<}{0UbLI(zP2y;w{*4fhK-Gljs4S1-fD?GO84`3NxW#RRJuQ_i+7R60GpQXKYRAI_E6X{;&2oY#A zr_4QTkn(+!ebMatzemY6Pj*EO(sqKhiP0uAtBd#1-aYuPaR8n~m*R72W7%GbM1ZD& z`&rb96DN8$Y}l~FMkY%vGUy_e+^F7t6n(^z{hqe&|65#>OA|#wD@2;BFcBx|RxiHz z;@T^(ys|q?#M<^hNF@S5rN;jJY%s32s_hcEjCYSFYW(-u>?n!b_{9_!hV8huXZfEY z?cgLF%Nu``^^~ay2$T0|<&iX*o_VF2eUp=u|F(HH-;ZO4F_AVPhV_P-g@DtwzQT8T zZ-*eTyD>~L(UhM!*Wlpb22G}Fz_Zz{+9E^|lWYTmFwP`>W((RVZVNQ#s`b6G}>5{CjM1ZG6L zc-O97>ynP!mT==nWf75PCMA<<!=&hKqc*y?isGj zs6YMmQ>%7qymV9{g*NWEg!Ucfd80+G?YLcgDz!vb5@T&LnIi$PV8MdFNnWok8XjYc z+2qLEOt>`eBm{`)2p)D1U}Qr?J&Oom7T(E^KmJ%;i-#Y6xH}a9v~FHfqa#;D55Ba! zALP4?=Nm2%S-eV|Ak44NF3l>u%X1Yj(2)uNQa3MX-@bkCWd(pun>O`^O{C544?20$ zl1&pQSUb)y?Q^62W!eq&^y$<6QjjVY0HkhS9?Q$>MVLs=07$y~^CUc<+Gkm}ok`ks zqAD9i81_9c=}yd(!gK{MmA%@iE`qHb)pUcb288_9;ta5~YMn^vy6di6uYGp=?YDPl z`P*bv2mfZ%jVu%ZhYueXlPK@J^UkiUUL;C$z2lBMBCC5`D_bKYBazP|Cn8Mov^C3; zZW<}|Oln3I3jjDdB(u!MHcm<;j)r{>7htlZo+CMxQkYr2X?A}cvn&Z|PM-q@4(v$< z0L|pXHl_sI^^35uHqINH$+mSWMGHX-M@c-sKbi|wE?89Qz`C-(W;@N#vRKFIC$`&+Cs$@2#{lv z-Ku%mY>r!5XDCe%LYtCuT+Y(&*N(NZ1-Z@QYiApf91^GDrB&o9EE$2wT-uan?fE=c zOUJeeL-T#xyhVRB%_hpJ0u%6nv6ohndJl2MC1gd%}tZSr{2qiC4<^drfsbP zV6jcu(B{JfrWWE(n#0KahGjI_<}lQxNeYe1SY-m^q*c{~#MJ$O(l`WZTyb^}JDYc4 zoc@dF$H~;u#vCk8k>-mCJqoJ7B5YbO%7hAF54VMEuGB< zY&Hv@HX|#MD;U2vXY+)GZc*r{rQ>jjD2-h@Kx%Y!bXve^U|>MBceP5PtcdrK6jl_@ zpwC|maZ@a-Srt6ru=D-QUsyng=W@_S(rn;Vu>iD8Dq*7H;Jg6Zs$q?Xu^57GWG&<@ zIWedtlH8ko-?slxT4I5;29#P{UIKFv^i&)%Ka_tlUr|M+-U()Dy`D}=!&t=5&d!at zO`k!ovC;b}52O7{Fuy)5Z$9k6$!*)VEy+4ssGWBhR+X&PG+?e#McmZX)D`DwT5Nn* z=NdRI4<}HAuRd+}@2Dfz^QsTDDG}GcYxI|cX_8cUw@*I#WV7oyM<)FN(gFclN`gbM z$&#N9YYiK+Jc<>$Y;*i8<9p^;eV0QP-jg5^RNf)0Sh%B2$WZEDCc1-}pMQ0Gi z0xeaEaCylO5*M)9jY&x3I(}A8zJiP9R=lebHUD_)t+z5yfT>uIAg?!29C??N;2^`p z!+%h`Y@0C}ouoCG3B@j!0xmA8(yd`C4gd)ZVFji|A;60DP{~El9RQx3eC@T@4i{;$ z+2z%CdU$Sq0*!22Chdma-rjX&Ba@1qw#ic7i|us`9U24lHZ<0Bf)v>u%%>ksY+3XbQ-YKUCSFdDp zddiy?AD38f)PiaN^JI3|B8L$UFr)kY0RU}nZE%5N0YEx8$77Rm$hUL)2L}h|X&Exa zE^NJLQ`~8(1SC!$O=Fr#J(3G|eEbvuT7#3D*5<_-Bc*}GISUYuqS^Z#E|qqSIJSa+ z%d_4g7XV1P{jQFWB@Il9zM*VIC9>kU;;4D)GxQS|eS9TZpQj>NHI+d&IqWt>X&Gk& zNuS}&(T;ub&KA~A8gp3<9Rz5eZSivffOJBb%LA2>^)#=LJ|mJRt1AZfvd17tGcG*Hk?J!HOS9RLEGP9#Z)EaBka@;W~_7XV0F zu-O$(U7`5)skG6;!=A#YDTaUm;JB_h(wbQ2)&4FQ0B8|0S51^)-^g+;>C~_7d)9$g z=SXOn`bJl+T?}VQ)Xi(gSpkxFZq=$)>(f3LmJj>ZLaccBf~KBV=ct9G$qu4sFY0JG z8)|83>9$ddXFLFoA3r|L&B~5Vs(isc*r~95P1&P>0}r2M=kqtRbEWp{o=D)hxUsRZ zok=+r;>5NPcE$rh>o;thx#O4hMDxhD)$;g|@rMo_T4Pg24L}G2X$~WzhWu9C0~}E( zrA#A4kE=q@B$QiLFvO14>g=P6CEyhI-FIJiRHYHmN|MLN^8sU2whkQQgAYFF(H7A= z^-D`Lb9v~-MF#+_Y}&6Joj7r#*UO{BSAe-_d%|X#qtyItTU)%~PWBGD_Wl-C`W@%^ zxETomNUOI`L#}J+u|k6w+#0{Hoyqej9$#qD9ZxX2}AYW5&;DISqxSa{yqnoQJ~FBmkHw=b^AP;Q^o& z0|jLN9sr<`ay|-27uLMqhX%kfyPTIo(3z?0cL3B(DTDmKp`4!?P5(33?==YZL8YMN z1T%i;|Dgb-R=Kg!T+ISNO1gLzz7fgfuZ{TPoT;m^1j9wS=#x`iT{ZRpFTen&T)1>{ Sp@}{K0000Q9n z-goZ3=iI!SBuOXCkEFj@Dp$d->$WD7$#u8eRVij!*4cDAy+f{2fMZX|*@dg!Zuc5R zk)5XL8!L3rfc-qrSM&M&0bj>)3=wls0G9y5nRUHD5jdOXyqYJMtE3b~;iDUd(JG2! z4e#}Omz0m=cwNQtO6YuFh($ literal 0 HcmV?d00001 diff --git a/packages/react-devtools-extensions/icons/32-restricted.png b/packages/react-devtools-extensions/icons/32-restricted.png new file mode 100644 index 0000000000000000000000000000000000000000..7c750453238885d1cba45da238abc82ae0fcfa06 GIT binary patch literal 1092 zcmV-K1iSl*P)({HVg{3dAJt$@ z#3X9$`B{(LT;F@q28zzC44$pwO_=FdH71k~AWD^z$SK%5RKNa;O|+ zRx)u+O-(&LI5-%O#bPtt+uL3Euf@BvveE$F)6>&=JiEKQOYUNYO>2;{=NA_je=ms= ziNw##Ya-!Z67CTBNa;7MfuDKL&d!1&pT^K$gdzx9TwHvC{}9G=P=a~#`ZbhdP=v;K z@8;&_JMiI|wE^%7L!K9vvN4E)%!df<@>-9z{{Ea=f;- z=I-t74at1x=jY+Fva$v}`56t!&(FVANECXf-EJRDCX>HXsnl^}W8F** zxY#NFhoaWj))~C}e7?6!OH1vD#N_1U?5!R%o1K)xu%3KVrtp`Smv?P!Y_wEVR5&db z%d>)l0;kDjx@yIqo}TZ_TUc1wK;C{qM6fR!jfP+to_ad+xDsVAM@L6HY&KgLD+56| zgvR4>zg!zutMwH;W}X|UqclY#kvbHT+0xLkM61fkJL82;g?Y8l~e6=JCWDc+r-a0}g!Zu%TD~(9GEp=JD=RApR##WstE#G;gmk4M;sNCt^F@RN{O;}Tg_@e0 z=7YhYySlpCm(`63p;v1sP7OlMm;hciKB?gDcONhsjitz=Jm1&X*NzCZwYAOH)zwWP z68%InA9&=`^xnrY<@#8j^Lo99i>EJ6m71>06ef z?tK~c)XoeMKV;<88%FxEXj!(tzMk0K-JK(k|4=vlpo_)w@bGYdXJ_YEnb+g-_{oU( z4u>N^M*jxy$jFErGVXmNdQ4KTzfyBWNu(ft{ef!C#pn4y0R{m73@I68j+emz0000< KMNUMnLSTXgoDP}* literal 0 HcmV?d00001 diff --git a/packages/react-devtools-extensions/icons/48-restricted.png b/packages/react-devtools-extensions/icons/48-restricted.png new file mode 100644 index 0000000000000000000000000000000000000000..372b6e00e88a85c08ccfa020e8db75b31b429a5b GIT binary patch literal 1564 zcmV+%2IKjOP)X|Jd>e?ZEK3(Fq>>IDf=r&l24$Pz0Ohy##{rBE=7 zFpKTHpX(RBOlH2t#%bM=MtsaS^S-yg-y6vD{4?@t`e_z>a$`hkMrg+JQp|r%)9cBt z5vTbVnE#4qfhYF{l<)KAklW}+vDcI1!?gf?eSPJ-ySqQ#+}ylLBocpKU0wZgczF0? zW@e_T9j5PLget!NLm^wK*nc{WQYJ@cWgFHu8djR2h4}<_Mvf8(p@;rXe zngFbQFt5IY<|UJ0ir1ypbZ0RyFE3xGX$9w-nF(mriIu=OEW(zt(k?8CeGtSAPmY6_ zgY^3PIy^o;ernp+*w{F+u(0r5JRUzSEG%sGdcEa1)8F6!sJpv6Y&y5NxR`wB^ZD*) zB@0znR+cBrA2DXPcXf63y}D*4G{(Tdz)nhlKvvVJlQbI)1}CBU+uPeDQ?LZZ#E2t& z;6OoX3DDWuxs)t@#l;;~`$lMhVK6c`H}`yFV`C8Oe!stm;v;A}M;WbyT{Pq4Gk}tQFWA+mHE>JME9I-rVQ~LEU>b&^1Qvh zJ%qrfpbga4*0vTD6qHw0RR!4%ph*tmXf(RSmczT_Epl6ln)RF}bISj~H_EGPwL zPxwp#X<9p9R%1hIPHM~w?@P^FDU2u1vgNe`NP>2LECW|HYr;C4^O#VE^l@3Z zq`+#1!M9{br^!J2LM9KgAXt;yU<W6s zO3%*DLex)8a}#xEaGEhY&>}bOcLAf(J3s-T=N3-;+tt7+YaQGKAG<;iuy3o|r z^th&`Cdifm%>LvSHU*o(EVR#GMryAqW6%heDx2-SrA-K1>39Rv7Qpg>Vs@Jd~IBjcE`1Vv3g^@yrcC&N%J^1-?|Q68MMcFR_A&Dp7Z)Kr z=D*nA2b^Rc-2cn|nbPNDijSxNx&Vwct^SyS7+{~L#(Wyt2$n!_TU~6ifNn3gT-{D{ zvm!e%iPyQxs#RIVS2|emMXuK+c!LlCS19$e3p0T(tVvjcGk_zQQgE9ah|C1A!~1w= z1?ce3>bxE9Nec^^f;12ae8e;d2M3|q+1Xc4E}{6ctgEZ*3Bi&MO38jgn>$XiPeyg% zfAMG5|DpiV9Ogd?0q|cR@f>6xJV)@)9=K<@Od(TWu4ta--!x+%1Q-Bvr`E+MSw)!u O0000disabled \ No newline at end of file diff --git a/packages/react-devtools-extensions/popups/deadcode.html b/packages/react-devtools-extensions/popups/deadcode.html index 4073f80bde20..5b458981e006 100644 --- a/packages/react-devtools-extensions/popups/deadcode.html +++ b/packages/react-devtools-extensions/popups/deadcode.html @@ -1,15 +1,11 @@ + +

+ This is a restricted browser page. +
+ React devtools cannot access this page. +

diff --git a/packages/react-devtools-extensions/popups/shared.css b/packages/react-devtools-extensions/popups/shared.css new file mode 100644 index 000000000000..cd3d35d00589 --- /dev/null +++ b/packages/react-devtools-extensions/popups/shared.css @@ -0,0 +1,7 @@ +html, body { + font-size: 14px; +} + +body { + margin: 8px; +} \ No newline at end of file diff --git a/packages/react-devtools-extensions/src/background.js b/packages/react-devtools-extensions/src/background.js index 1a8302c2b1df..cfe5e3c7a973 100644 --- a/packages/react-devtools-extensions/src/background.js +++ b/packages/react-devtools-extensions/src/background.js @@ -78,17 +78,43 @@ function setIconAndPopup(reactBuildType, tabId) { }); } -// Listen to URL changes on the active tab and reset the DevTools icon. -// This prevents non-disabled icons from sticking in Firefox. -// Don't listen to this event in Chrome though. -// It fires more frequently, often after onMessage() has been called. -if (IS_FIREFOX) { - chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { +function isRestrictedBrowserPage(url) { + return !url || new URL(url).protocol === 'chrome:'; +} + +function checkAndHandleRestrictedPageIfSo(tab) { + if (tab && isRestrictedBrowserPage(tab.url)) { + setIconAndPopup('restricted', tab.id); + } +} + +// update popup page of any existing open tabs, if they are restricted browser pages. +// we can't update for any other types (prod,dev,outdated etc) +// as the content script needs to be injected at document_start itself for those kinds of detection +// TODO: Show a different popup page(to reload current page probably) for old tabs, opened before the extension is installed +if (!IS_FIREFOX) { + chrome.tabs.query({}, tabs => tabs.forEach(checkAndHandleRestrictedPageIfSo)); + chrome.tabs.onCreated.addListener((tabId, changeInfo, tab) => + checkAndHandleRestrictedPageIfSo(tab), + ); +} + +// Listen to URL changes on the active tab and update the DevTools icon. +chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { + if (IS_FIREFOX) { + // We don't properly detect protected URLs in Firefox at the moment. + // However we can reset the DevTools icon to its loading state when the URL changes. + // It will be updated to the correct icon by the onMessage callback below. if (tab.active && changeInfo.status === 'loading') { setIconAndPopup('disabled', tabId); } - }); -} + } else { + // Don't reset the icon to the loading state for Chrome or Edge. + // The onUpdated callback fires more frequently for these browsers, + // often after onMessage has been called. + checkAndHandleRestrictedPageIfSo(tab); + } +}); chrome.runtime.onMessage.addListener((request, sender) => { if (sender.tab) { From 020d3aa4e8df4455274b79b29e2452ae7f430ec0 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Wed, 14 Oct 2020 21:45:54 +0200 Subject: [PATCH 0014/1603] chore: downgrade source-map-support for stack "fix" (#20026) * chore: downgrade source-map-support for stack "fix" * lint? --- fixtures/legacy-jsx-runtimes/react-17/react-17.test.js | 8 ++++---- fixtures/legacy-jsx-runtimes/yarn.lock | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fixtures/legacy-jsx-runtimes/react-17/react-17.test.js b/fixtures/legacy-jsx-runtimes/react-17/react-17.test.js index 6e47d4655c2c..a3687536499c 100644 --- a/fixtures/legacy-jsx-runtimes/react-17/react-17.test.js +++ b/fixtures/legacy-jsx-runtimes/react-17/react-17.test.js @@ -318,9 +318,9 @@ it('should give context for PropType errors in nested components.', () => { } expect(() => ReactTestUtils.renderIntoDocument()).toErrorDev( 'Warning: Failed prop type: ' + - 'Invalid prop `color` of type `number` supplied to `MyComp`, ' + - 'expected `string`.\n' + - ' in fn (at **)\n' + // Jest/Node issue + 'Invalid prop `color` of type `number` supplied to `MyComp`, ' + + 'expected `string`.\n' + + ' in color (at **)\n' + ' in ParentComp (at **)' ); }); @@ -377,7 +377,7 @@ it('should check default prop values', () => { ).toErrorDev( 'Warning: Failed prop type: The prop `prop` is marked as required in ' + '`RequiredPropComponent`, but its value is `null`.\n' + - ' in construct (at **)' // Jest/Node issue + ' in RequiredPropComponent (at **)' ); }); diff --git a/fixtures/legacy-jsx-runtimes/yarn.lock b/fixtures/legacy-jsx-runtimes/yarn.lock index 0311bc8df168..fe5d0c7955c2 100644 --- a/fixtures/legacy-jsx-runtimes/yarn.lock +++ b/fixtures/legacy-jsx-runtimes/yarn.lock @@ -3247,9 +3247,9 @@ source-map-resolve@^0.5.0: urix "^0.1.0" source-map-support@^0.5.6: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" From b5eabd543f4a6c9d950f1bb5ec73da5a1c7c5caa Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 14 Oct 2020 20:52:37 +0100 Subject: [PATCH 0015/1603] Update changelog for 16.14, 15.7, 0.14.10 (#20027) --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7882adf318b7..fa0dedf6714d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 16.14.0 (October 14, 2020) + +### React + +* Add support for the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html). ([@lunaruan](https://github.com/lunaruan) in [#18299](https://github.com/facebook/react/pull/18299)) + ## 16.13.1 (March 19, 2020) ### React DOM @@ -770,6 +776,12 @@ Starting with 16.1.0, we will no longer be publishing new releases on Bower. You - There is no `react-with-addons.js` build anymore. All compatible addons are published separately on npm, and have single-file browser versions if you need them. - The deprecations introduced in 15.x have been removed from the core package. `React.createClass` is now available as create-react-class, `React.PropTypes` as prop-types, `React.DOM` as react-dom-factories, react-addons-test-utils as react-dom/test-utils, and shallow renderer as react-test-renderer/shallow. See [15.5.0](https://reactjs.org/blog/2017/04/07/react-v15.5.0.html) and [15.6.0](https://reactjs.org/blog/2017/06/13/react-v15.6.0.html) blog posts for instructions on migrating code and automated codemods. +## 15.7.0 (October 14, 2020) + +### React + +* Backport support for the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) to 15.x. ([@lunaruan](https://github.com/lunaruan) in [#18299](https://github.com/facebook/react/pull/18299) and [@gaearon](https://github.com/gaearon) in [#20024](https://github.com/facebook/react/pull/20024)) + ## 15.6.2 (September 25, 2017) ### All Packages @@ -1221,6 +1233,11 @@ Each of these changes will continue to work as before with a new warning until t - React DOM adds a new `suppressContentEditableWarning` prop for components like [Draft.js](https://draftjs.org/) that intentionally manage `contentEditable` children with React. ([@mxstbr](https://github.com/mxstbr) in [#6112](https://github.com/facebook/react/pull/6112)) - React improves the performance for `createClass()` on complex specs. ([@sophiebits](https://github.com/sophiebits) in [#5550](https://github.com/facebook/react/pull/5550)) +## 0.14.10 (October 14, 2020) + +### React + +* Backport support for the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) to 0.14.x. ([@lunaruan](https://github.com/lunaruan) in [#18299](https://github.com/facebook/react/pull/18299) and [@gaearon](https://github.com/gaearon) in [#20024](https://github.com/facebook/react/pull/20024)) ## 0.14.8 (March 29, 2016) From d95c4938df670a8f0a13267bd89173737bb185e4 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Wed, 14 Oct 2020 23:38:57 +0100 Subject: [PATCH 0016/1603] [EventSystem] Revise onBeforeBlur propagation mechanics (#20020) --- packages/react-art/src/ReactARTHostConfig.js | 2 +- .../src/client/ReactDOMHostConfig.js | 14 +- .../src/events/DOMPluginEventSystem.js | 20 ++- .../DOMPluginEventSystem-test.internal.js | 135 ++++++++++++++++++ .../src/events/plugins/SimpleEventPlugin.js | 1 + .../src/ReactFabricHostConfig.js | 2 +- .../src/ReactNativeHostConfig.js | 2 +- .../src/ReactFiberWorkLoop.new.js | 4 +- .../src/ReactFiberWorkLoop.old.js | 4 +- .../src/ReactTestHostConfig.js | 2 +- 10 files changed, 174 insertions(+), 12 deletions(-) diff --git a/packages/react-art/src/ReactARTHostConfig.js b/packages/react-art/src/ReactARTHostConfig.js index 459f714b90cf..43a563e90aa2 100644 --- a/packages/react-art/src/ReactARTHostConfig.js +++ b/packages/react-art/src/ReactARTHostConfig.js @@ -467,7 +467,7 @@ export function makeClientIdInDEV(warnOnAccessInDEV: () => void): OpaqueIDType { throw new Error('Not yet implemented'); } -export function beforeActiveInstanceBlur() { +export function beforeActiveInstanceBlur(internalInstanceHandle: Object) { // noop } diff --git a/packages/react-dom/src/client/ReactDOMHostConfig.js b/packages/react-dom/src/client/ReactDOMHostConfig.js index 63fdb08a3ae8..8de2f2c5c7ca 100644 --- a/packages/react-dom/src/client/ReactDOMHostConfig.js +++ b/packages/react-dom/src/client/ReactDOMHostConfig.js @@ -232,10 +232,13 @@ export function prepareForCommit(containerInfo: Container): Object | null { return activeInstance; } -export function beforeActiveInstanceBlur(): void { +export function beforeActiveInstanceBlur(internalInstanceHandle: Object): void { if (enableCreateEventHandleAPI) { ReactBrowserEventEmitterSetEnabled(true); - dispatchBeforeDetachedBlur((selectionInformation: any).focusedElem); + dispatchBeforeDetachedBlur( + (selectionInformation: any).focusedElem, + internalInstanceHandle, + ); ReactBrowserEventEmitterSetEnabled(false); } } @@ -499,12 +502,17 @@ function createEvent(type: DOMEventName, bubbles: boolean): Event { return event; } -function dispatchBeforeDetachedBlur(target: HTMLElement): void { +function dispatchBeforeDetachedBlur( + target: HTMLElement, + internalInstanceHandle: Object, +): void { if (enableCreateEventHandleAPI) { const event = createEvent('beforeblur', true); // Dispatch "beforeblur" directly on the target, // so it gets picked up by the event system and // can propagate through the React internal tree. + // $FlowFixMe: internal field + event._detachedInterceptFiber = internalInstanceHandle; target.dispatchEvent(event); } } diff --git a/packages/react-dom/src/events/DOMPluginEventSystem.js b/packages/react-dom/src/events/DOMPluginEventSystem.js index 74b95dea3d4e..c43d96dcb1c9 100644 --- a/packages/react-dom/src/events/DOMPluginEventSystem.js +++ b/packages/react-dom/src/events/DOMPluginEventSystem.js @@ -658,10 +658,11 @@ export function accumulateSinglePhaseListeners( nativeEventType: string, inCapturePhase: boolean, accumulateTargetOnly: boolean, + nativeEvent: AnyNativeEvent, ): Array { const captureName = reactName !== null ? reactName + 'Capture' : null; const reactEventName = inCapturePhase ? captureName : reactName; - const listeners: Array = []; + let listeners: Array = []; let instance = targetFiber; let lastHostComponent = null; @@ -740,6 +741,23 @@ export function accumulateSinglePhaseListeners( if (accumulateTargetOnly) { break; } + // If we are processing the onBeforeBlur event, then we need to take + // into consideration that part of the React tree might have been hidden + // or deleted (as we're invoking this event during commit). We can find + // this out by checking if intercept fiber set on the event matches the + // current instance fiber. In which case, we should clear all existing + // listeners. + if (enableCreateEventHandleAPI && nativeEvent.type === 'beforeblur') { + // $FlowFixMe: internal field + const detachedInterceptFiber = nativeEvent._detachedInterceptFiber; + if ( + detachedInterceptFiber !== null && + (detachedInterceptFiber === instance || + detachedInterceptFiber === instance.alternate) + ) { + listeners = []; + } + } instance = instance.return; } return listeners; diff --git a/packages/react-dom/src/events/__tests__/DOMPluginEventSystem-test.internal.js b/packages/react-dom/src/events/__tests__/DOMPluginEventSystem-test.internal.js index 6a3662962a74..004f0bb631f3 100644 --- a/packages/react-dom/src/events/__tests__/DOMPluginEventSystem-test.internal.js +++ b/packages/react-dom/src/events/__tests__/DOMPluginEventSystem-test.internal.js @@ -2424,6 +2424,60 @@ describe('DOMPluginEventSystem', () => { expect(log).toEqual(['beforeblur', 'afterblur']); }); + // @gate experimental + it('beforeblur should skip handlers from a deleted subtree after the focused element is unmounted', () => { + const onBeforeBlur = jest.fn(); + const innerRef = React.createRef(); + const innerRef2 = React.createRef(); + const setBeforeBlurHandle = ReactDOM.unstable_createEventHandle( + 'beforeblur', + ); + const ref2 = React.createRef(); + + const Component = ({show}) => { + const ref = React.useRef(null); + + React.useEffect(() => { + const clear1 = setBeforeBlurHandle(ref.current, onBeforeBlur); + let clear2; + if (ref2.current) { + clear2 = setBeforeBlurHandle(ref2.current, onBeforeBlur); + } + + return () => { + clear1(); + if (clear2) { + clear2(); + } + }; + }); + + return ( +
+ {show && ( +
+ +
+ )} +
+
+ ); + }; + + ReactDOM.render(, container); + Scheduler.unstable_flushAll(); + + const inner = innerRef.current; + const target = createEventTarget(inner); + target.focus(); + expect(onBeforeBlur).toHaveBeenCalledTimes(0); + + ReactDOM.render(, container); + Scheduler.unstable_flushAll(); + + expect(onBeforeBlur).toHaveBeenCalledTimes(1); + }); + // @gate experimental it('beforeblur and afterblur are called after a focused element is suspended', () => { const log = []; @@ -2510,6 +2564,87 @@ describe('DOMPluginEventSystem', () => { document.body.removeChild(container2); }); + // @gate experimental + it('beforeblur should skip handlers from a deleted subtree after the focused element is suspended', () => { + const onBeforeBlur = jest.fn(); + const innerRef = React.createRef(); + const innerRef2 = React.createRef(); + const setBeforeBlurHandle = ReactDOM.unstable_createEventHandle( + 'beforeblur', + ); + const ref2 = React.createRef(); + const Suspense = React.Suspense; + let suspend = false; + let resolve; + const promise = new Promise( + resolvePromise => (resolve = resolvePromise), + ); + + function Child() { + if (suspend) { + throw promise; + } else { + return ; + } + } + + const Component = () => { + const ref = React.useRef(null); + + React.useEffect(() => { + const clear1 = setBeforeBlurHandle(ref.current, onBeforeBlur); + let clear2; + if (ref2.current) { + clear2 = setBeforeBlurHandle(ref2.current, onBeforeBlur); + } + + return () => { + clear1(); + if (clear2) { + clear2(); + } + }; + }); + + return ( +
+ +
+ +
+
+
+
+ ); + }; + + const container2 = document.createElement('div'); + document.body.appendChild(container2); + + const root = ReactDOM.createRoot(container2); + + act(() => { + root.render(); + }); + jest.runAllTimers(); + + const inner = innerRef.current; + const target = createEventTarget(inner); + target.focus(); + expect(onBeforeBlur).toHaveBeenCalledTimes(0); + + suspend = true; + act(() => { + root.render(); + }); + jest.runAllTimers(); + + expect(onBeforeBlur).toHaveBeenCalledTimes(1); + resolve(); + + document.body.removeChild(container2); + }); + // @gate experimental it('regression: does not fire beforeblur/afterblur if target is already hidden', () => { const Suspense = React.Suspense; diff --git a/packages/react-dom/src/events/plugins/SimpleEventPlugin.js b/packages/react-dom/src/events/plugins/SimpleEventPlugin.js index fafccff92014..03bf9484b2c0 100644 --- a/packages/react-dom/src/events/plugins/SimpleEventPlugin.js +++ b/packages/react-dom/src/events/plugins/SimpleEventPlugin.js @@ -200,6 +200,7 @@ function extractEvents( nativeEvent.type, inCapturePhase, accumulateTargetOnly, + nativeEvent, ); if (listeners.length > 0) { // Intentionally create event lazily. diff --git a/packages/react-native-renderer/src/ReactFabricHostConfig.js b/packages/react-native-renderer/src/ReactFabricHostConfig.js index dcdceb7a60db..636542e8d426 100644 --- a/packages/react-native-renderer/src/ReactFabricHostConfig.js +++ b/packages/react-native-renderer/src/ReactFabricHostConfig.js @@ -481,7 +481,7 @@ export function makeClientIdInDEV(warnOnAccessInDEV: () => void): OpaqueIDType { throw new Error('Not yet implemented'); } -export function beforeActiveInstanceBlur() { +export function beforeActiveInstanceBlur(internalInstanceHandle: Object) { // noop } diff --git a/packages/react-native-renderer/src/ReactNativeHostConfig.js b/packages/react-native-renderer/src/ReactNativeHostConfig.js index 0369755c136a..eba0a2b90462 100644 --- a/packages/react-native-renderer/src/ReactNativeHostConfig.js +++ b/packages/react-native-renderer/src/ReactNativeHostConfig.js @@ -534,7 +534,7 @@ export function makeClientIdInDEV(warnOnAccessInDEV: () => void): OpaqueIDType { throw new Error('Not yet implemented'); } -export function beforeActiveInstanceBlur() { +export function beforeActiveInstanceBlur(internalInstanceHandle: Object) { // noop } diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index 4f40bde18231..fffa71d20801 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -2172,7 +2172,7 @@ function commitBeforeMutationEffectsImpl(fiber: Fiber) { doesFiberContain(fiber, focusedInstanceHandle) ) { shouldFireAfterActiveInstanceBlur = true; - beforeActiveInstanceBlur(); + beforeActiveInstanceBlur(fiber); } } @@ -2206,7 +2206,7 @@ function commitBeforeMutationEffectsDeletions(deletions: Array) { if (doesFiberContain(fiber, ((focusedInstanceHandle: any): Fiber))) { shouldFireAfterActiveInstanceBlur = true; - beforeActiveInstanceBlur(); + beforeActiveInstanceBlur(fiber); } } } diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js index c0fcb9c5c09b..cece268e3d01 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js @@ -2261,7 +2261,7 @@ function commitBeforeMutationEffects() { if ((nextEffect.flags & Deletion) !== NoFlags) { if (doesFiberContain(nextEffect, focusedInstanceHandle)) { shouldFireAfterActiveInstanceBlur = true; - beforeActiveInstanceBlur(); + beforeActiveInstanceBlur(nextEffect); } } else { // TODO: Move this out of the hot path using a dedicated effect tag. @@ -2271,7 +2271,7 @@ function commitBeforeMutationEffects() { doesFiberContain(nextEffect, focusedInstanceHandle) ) { shouldFireAfterActiveInstanceBlur = true; - beforeActiveInstanceBlur(); + beforeActiveInstanceBlur(nextEffect); } } } diff --git a/packages/react-test-renderer/src/ReactTestHostConfig.js b/packages/react-test-renderer/src/ReactTestHostConfig.js index b244810736d8..a6d661d5fe9c 100644 --- a/packages/react-test-renderer/src/ReactTestHostConfig.js +++ b/packages/react-test-renderer/src/ReactTestHostConfig.js @@ -377,7 +377,7 @@ export function makeOpaqueHydratingObject( }; } -export function beforeActiveInstanceBlur() { +export function beforeActiveInstanceBlur(internalInstanceHandle: Object) { // noop } From 02da938fd51f6345ca185d571ea6628189ae81a7 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Thu, 15 Oct 2020 08:40:12 -0400 Subject: [PATCH 0017/1603] Don't double-invoke effects in legacy roots (#20028) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Large legacy applications are likely to be difficult to update to handle this feature, and it wouldn't add any value– since newer APIs that require this resilience are not legacy compatible. --- .../src/ReactFiberClassComponent.new.js | 33 +++- .../src/ReactFiberCommitWork.new.js | 8 + .../src/ReactFiberHooks.new.js | 31 +++- .../src/ReactFiberWorkLoop.new.js | 7 + .../ReactDoubleInvokeEvents-test.internal.js | 164 +++++++++++++----- .../__tests__/ReactProfiler-test.internal.js | 6 +- 6 files changed, 193 insertions(+), 56 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberClassComponent.new.js b/packages/react-reconciler/src/ReactFiberClassComponent.new.js index 4688c10998d1..663b27dfed41 100644 --- a/packages/react-reconciler/src/ReactFiberClassComponent.new.js +++ b/packages/react-reconciler/src/ReactFiberClassComponent.new.js @@ -30,7 +30,13 @@ import invariant from 'shared/invariant'; import {REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE} from 'shared/ReactSymbols'; import {resolveDefaultProps} from './ReactFiberLazyComponent.new'; -import {DebugTracingMode, StrictMode} from './ReactTypeOfMode'; +import { + BlockingMode, + ConcurrentMode, + DebugTracingMode, + NoMode, + StrictMode, +} from './ReactTypeOfMode'; import { enqueueUpdate, @@ -891,7 +897,12 @@ function mountClassInstance( } if (typeof instance.componentDidMount === 'function') { - if (__DEV__ && enableDoubleInvokingEffects) { + if ( + __DEV__ && + enableDoubleInvokingEffects && + (workInProgress.mode & (BlockingMode | ConcurrentMode)) !== NoMode + ) { + // Never double-invoke effects for legacy roots. workInProgress.flags |= MountLayoutDev | Update; } else { workInProgress.flags |= Update; @@ -965,7 +976,11 @@ function resumeMountClassInstance( // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { - if (__DEV__ && enableDoubleInvokingEffects) { + if ( + __DEV__ && + enableDoubleInvokingEffects && + (workInProgress.mode & (BlockingMode | ConcurrentMode)) !== NoMode + ) { workInProgress.flags |= MountLayoutDev | Update; } else { workInProgress.flags |= Update; @@ -1012,7 +1027,11 @@ function resumeMountClassInstance( } } if (typeof instance.componentDidMount === 'function') { - if (__DEV__ && enableDoubleInvokingEffects) { + if ( + __DEV__ && + enableDoubleInvokingEffects && + (workInProgress.mode & (BlockingMode | ConcurrentMode)) !== NoMode + ) { workInProgress.flags |= MountLayoutDev | Update; } else { workInProgress.flags |= Update; @@ -1022,7 +1041,11 @@ function resumeMountClassInstance( // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { - if (__DEV__ && enableDoubleInvokingEffects) { + if ( + __DEV__ && + enableDoubleInvokingEffects && + (workInProgress.mode & (BlockingMode | ConcurrentMode)) !== NoMode + ) { workInProgress.flags |= MountLayoutDev | Update; } else { workInProgress.flags |= Update; diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.new.js b/packages/react-reconciler/src/ReactFiberCommitWork.new.js index 4e9acfae1135..c43c6f8b1363 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.new.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.new.js @@ -2024,6 +2024,8 @@ function commitPassiveMount( function invokeLayoutEffectMountInDEV(fiber: Fiber): void { if (__DEV__ && enableDoubleInvokingEffects) { + // We don't need to re-check for legacy roots here. + // This function will not be called within legacy roots. switch (fiber.tag) { case FunctionComponent: case ForwardRef: @@ -2057,6 +2059,8 @@ function invokeLayoutEffectMountInDEV(fiber: Fiber): void { function invokePassiveEffectMountInDEV(fiber: Fiber): void { if (__DEV__ && enableDoubleInvokingEffects) { + // We don't need to re-check for legacy roots here. + // This function will not be called within legacy roots. switch (fiber.tag) { case FunctionComponent: case ForwardRef: @@ -2081,6 +2085,8 @@ function invokePassiveEffectMountInDEV(fiber: Fiber): void { function invokeLayoutEffectUnmountInDEV(fiber: Fiber): void { if (__DEV__ && enableDoubleInvokingEffects) { + // We don't need to re-check for legacy roots here. + // This function will not be called within legacy roots. switch (fiber.tag) { case FunctionComponent: case ForwardRef: @@ -2113,6 +2119,8 @@ function invokeLayoutEffectUnmountInDEV(fiber: Fiber): void { function invokePassiveEffectUnmountInDEV(fiber: Fiber): void { if (__DEV__ && enableDoubleInvokingEffects) { + // We don't need to re-check for legacy roots here. + // This function will not be called within legacy roots. switch (fiber.tag) { case FunctionComponent: case ForwardRef: diff --git a/packages/react-reconciler/src/ReactFiberHooks.new.js b/packages/react-reconciler/src/ReactFiberHooks.new.js index 67c148ddc017..bdd0bed4c759 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.new.js +++ b/packages/react-reconciler/src/ReactFiberHooks.new.js @@ -29,7 +29,12 @@ import { enableDoubleInvokingEffects, } from 'shared/ReactFeatureFlags'; -import {NoMode, BlockingMode, DebugTracingMode} from './ReactTypeOfMode'; +import { + NoMode, + BlockingMode, + ConcurrentMode, + DebugTracingMode, +} from './ReactTypeOfMode'; import { NoLane, NoLanes, @@ -485,7 +490,11 @@ export function bailoutHooks( lanes: Lanes, ) { workInProgress.updateQueue = current.updateQueue; - if (__DEV__ && enableDoubleInvokingEffects) { + if ( + __DEV__ && + enableDoubleInvokingEffects && + (workInProgress.mode & (BlockingMode | ConcurrentMode)) !== NoMode + ) { workInProgress.flags &= ~( MountPassiveDevEffect | PassiveEffect | @@ -1253,7 +1262,11 @@ function mountEffect( } } - if (__DEV__ && enableDoubleInvokingEffects) { + if ( + __DEV__ && + enableDoubleInvokingEffects && + (currentlyRenderingFiber.mode & (BlockingMode | ConcurrentMode)) !== NoMode + ) { return mountEffectImpl( MountPassiveDevEffect | PassiveEffect | PassiveStaticEffect, HookPassive, @@ -1287,7 +1300,11 @@ function mountLayoutEffect( create: () => (() => void) | void, deps: Array | void | null, ): void { - if (__DEV__ && enableDoubleInvokingEffects) { + if ( + __DEV__ && + enableDoubleInvokingEffects && + (currentlyRenderingFiber.mode & (BlockingMode | ConcurrentMode)) !== NoMode + ) { return mountEffectImpl( MountLayoutDevEffect | UpdateEffect, HookLayout, @@ -1355,7 +1372,11 @@ function mountImperativeHandle( const effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; - if (__DEV__ && enableDoubleInvokingEffects) { + if ( + __DEV__ && + enableDoubleInvokingEffects && + (currentlyRenderingFiber.mode & (BlockingMode | ConcurrentMode)) !== NoMode + ) { return mountEffectImpl( MountLayoutDevEffect | UpdateEffect, HookLayout, diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index fffa71d20801..1229ff006d41 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -2874,6 +2874,11 @@ function commitDoubleInvokeEffectsInDEV( hasPassiveEffects: boolean, ) { if (__DEV__ && enableDoubleInvokingEffects) { + // Never double-invoke effects for legacy roots. + if ((fiber.mode & (BlockingMode | ConcurrentMode)) === NoMode) { + return; + } + setCurrentDebugFiberInDEV(fiber); invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV); if (hasPassiveEffects) { @@ -2898,6 +2903,8 @@ function invokeEffectsInDev( invokeEffectFn: (fiber: Fiber) => void, ): void { if (__DEV__ && enableDoubleInvokingEffects) { + // We don't need to re-check for legacy roots here. + // This function will not be called within legacy roots. let fiber = firstChild; while (fiber !== null) { if (fiber.child !== null) { diff --git a/packages/react-reconciler/src/__tests__/ReactDoubleInvokeEvents-test.internal.js b/packages/react-reconciler/src/__tests__/ReactDoubleInvokeEvents-test.internal.js index fddc3744245a..e5136af4e240 100644 --- a/packages/react-reconciler/src/__tests__/ReactDoubleInvokeEvents-test.internal.js +++ b/packages/react-reconciler/src/__tests__/ReactDoubleInvokeEvents-test.internal.js @@ -11,17 +11,44 @@ let React; let ReactFeatureFlags; -let ReactNoop; +let ReactTestRenderer; let Scheduler; +let act; describe('ReactDoubleInvokeEvents', () => { beforeEach(() => { jest.resetModules(); React = require('react'); ReactFeatureFlags = require('shared/ReactFeatureFlags'); - ReactNoop = require('react-noop-renderer'); + ReactTestRenderer = require('react-test-renderer'); Scheduler = require('scheduler'); ReactFeatureFlags.enableDoubleInvokingEffects = __VARIANT__; + act = ReactTestRenderer.unstable_concurrentAct; + }); + + it('should not double invoke effects in legacy mode', () => { + function App({text}) { + React.useEffect(() => { + Scheduler.unstable_yieldValue('useEffect mount'); + return () => Scheduler.unstable_yieldValue('useEffect unmount'); + }); + + React.useLayoutEffect(() => { + Scheduler.unstable_yieldValue('useLayoutEffect mount'); + return () => Scheduler.unstable_yieldValue('useLayoutEffect unmount'); + }); + + return text; + } + + act(() => { + ReactTestRenderer.create(); + }); + + expect(Scheduler).toHaveYielded([ + 'useLayoutEffect mount', + 'useEffect mount', + ]); }); it('double invoking for effects works properly', () => { @@ -38,8 +65,12 @@ describe('ReactDoubleInvokeEvents', () => { return text; } - ReactNoop.act(() => { - ReactNoop.render(); + + let renderer; + act(() => { + renderer = ReactTestRenderer.create(, { + unstable_isConcurrent: true, + }); }); if (__DEV__ && __VARIANT__) { @@ -58,8 +89,8 @@ describe('ReactDoubleInvokeEvents', () => { ]); } - ReactNoop.act(() => { - ReactNoop.render(); + act(() => { + renderer.update(); }); expect(Scheduler).toHaveYielded([ @@ -69,8 +100,8 @@ describe('ReactDoubleInvokeEvents', () => { 'useEffect mount', ]); - ReactNoop.act(() => { - ReactNoop.render(null); + act(() => { + renderer.unmount(); }); expect(Scheduler).toHaveYielded([ @@ -94,8 +125,11 @@ describe('ReactDoubleInvokeEvents', () => { return text; } - ReactNoop.act(() => { - ReactNoop.render(); + let renderer; + act(() => { + renderer = ReactTestRenderer.create(, { + unstable_isConcurrent: true, + }); }); if (__DEV__ && __VARIANT__) { @@ -114,8 +148,8 @@ describe('ReactDoubleInvokeEvents', () => { ]); } - ReactNoop.act(() => { - ReactNoop.render(); + act(() => { + renderer.update(); }); expect(Scheduler).toHaveYielded([ @@ -125,8 +159,8 @@ describe('ReactDoubleInvokeEvents', () => { 'useEffect Two mount', ]); - ReactNoop.act(() => { - ReactNoop.render(null); + act(() => { + renderer.unmount(null); }); expect(Scheduler).toHaveYielded([ @@ -152,8 +186,11 @@ describe('ReactDoubleInvokeEvents', () => { return text; } - ReactNoop.act(() => { - ReactNoop.render(); + let renderer; + act(() => { + renderer = ReactTestRenderer.create(, { + unstable_isConcurrent: true, + }); }); if (__DEV__ && __VARIANT__) { @@ -172,8 +209,8 @@ describe('ReactDoubleInvokeEvents', () => { ]); } - ReactNoop.act(() => { - ReactNoop.render(); + act(() => { + renderer.update(); }); expect(Scheduler).toHaveYielded([ @@ -183,8 +220,8 @@ describe('ReactDoubleInvokeEvents', () => { 'useLayoutEffect Two mount', ]); - ReactNoop.act(() => { - ReactNoop.render(null); + act(() => { + renderer.unmount(); }); expect(Scheduler).toHaveYielded([ @@ -206,8 +243,11 @@ describe('ReactDoubleInvokeEvents', () => { return text; } - ReactNoop.act(() => { - ReactNoop.render(); + let renderer; + act(() => { + renderer = ReactTestRenderer.create(, { + unstable_isConcurrent: true, + }); }); if (__DEV__ && __VARIANT__) { @@ -224,8 +264,8 @@ describe('ReactDoubleInvokeEvents', () => { ]); } - ReactNoop.act(() => { - ReactNoop.render(); + act(() => { + renderer.update(); }); expect(Scheduler).toHaveYielded([ @@ -233,8 +273,8 @@ describe('ReactDoubleInvokeEvents', () => { 'useEffect mount', ]); - ReactNoop.act(() => { - ReactNoop.render(null); + act(() => { + renderer.unmount(); }); expect(Scheduler).toHaveYielded([]); @@ -264,8 +304,8 @@ describe('ReactDoubleInvokeEvents', () => { } } - ReactNoop.act(() => { - ReactNoop.render(); + act(() => { + ReactTestRenderer.create(, {unstable_isConcurrent: true}); }); if (__DEV__ && __VARIANT__) { @@ -298,8 +338,11 @@ describe('ReactDoubleInvokeEvents', () => { } } - ReactNoop.act(() => { - ReactNoop.render(); + let renderer; + act(() => { + renderer = ReactTestRenderer.create(, { + unstable_isConcurrent: true, + }); }); if (__DEV__ && __VARIANT__) { @@ -312,19 +355,45 @@ describe('ReactDoubleInvokeEvents', () => { expect(Scheduler).toHaveYielded(['componentDidMount']); } - ReactNoop.act(() => { - ReactNoop.render(); + act(() => { + renderer.update(); }); expect(Scheduler).toHaveYielded(['componentDidUpdate']); - ReactNoop.act(() => { - ReactNoop.render(null); + act(() => { + renderer.unmount(); }); expect(Scheduler).toHaveYielded(['componentWillUnmount']); }); + it('should not double invoke class lifecycles in legacy mode', () => { + class App extends React.PureComponent { + componentDidMount() { + Scheduler.unstable_yieldValue('componentDidMount'); + } + + componentDidUpdate() { + Scheduler.unstable_yieldValue('componentDidUpdate'); + } + + componentWillUnmount() { + Scheduler.unstable_yieldValue('componentWillUnmount'); + } + + render() { + return this.props.text; + } + } + + act(() => { + ReactTestRenderer.create(); + }); + + expect(Scheduler).toHaveYielded(['componentDidMount']); + }); + it('double flushing passive effects only results in one double invoke', () => { function App({text}) { const [state, setState] = React.useState(0); @@ -345,8 +414,10 @@ describe('ReactDoubleInvokeEvents', () => { return text; } - ReactNoop.act(() => { - ReactNoop.render(); + act(() => { + ReactTestRenderer.create(, { + unstable_isConcurrent: true, + }); }); if (__DEV__ && __VARIANT__) { @@ -410,8 +481,8 @@ describe('ReactDoubleInvokeEvents', () => { return showChild && ; } - ReactNoop.act(() => { - ReactNoop.render(); + act(() => { + ReactTestRenderer.create(, {unstable_isConcurrent: true}); }); if (__DEV__ && __VARIANT__) { @@ -430,7 +501,7 @@ describe('ReactDoubleInvokeEvents', () => { ]); } - ReactNoop.act(() => { + act(() => { _setShowChild(true); }); @@ -495,8 +566,11 @@ describe('ReactDoubleInvokeEvents', () => { ); } - ReactNoop.act(() => { - ReactNoop.render(); + let renderer; + act(() => { + renderer = ReactTestRenderer.create(, { + unstable_isConcurrent: true, + }); }); if (__DEV__ && __VARIANT__) { @@ -519,8 +593,8 @@ describe('ReactDoubleInvokeEvents', () => { ]); } - ReactNoop.act(() => { - ReactNoop.render(); + act(() => { + renderer.update(); }); expect(Scheduler).toHaveYielded([ @@ -530,8 +604,8 @@ describe('ReactDoubleInvokeEvents', () => { 'useEffect mount', ]); - ReactNoop.act(() => { - ReactNoop.render(null); + act(() => { + renderer.unmount(); }); expect(Scheduler).toHaveYielded([ diff --git a/packages/react/src/__tests__/ReactProfiler-test.internal.js b/packages/react/src/__tests__/ReactProfiler-test.internal.js index 191cec9492ce..05d73235b1b3 100644 --- a/packages/react/src/__tests__/ReactProfiler-test.internal.js +++ b/packages/react/src/__tests__/ReactProfiler-test.internal.js @@ -4180,7 +4180,11 @@ describe('Profiler', () => { const interactions = SchedulerTracing.unstable_getCurrent(); expect(interactions.size).toBe(1); interaction = Array.from(interactions)[0]; - ReactTestRenderer.create(); + ReactTestRendererAct(() => { + ReactTestRenderer.create(, { + unstable_isConcurrent: true, + }); + }); }, ); Scheduler.unstable_flushAll(); From c57fe4a2c1402acdbf31ac48cfc6a6bf336c4067 Mon Sep 17 00:00:00 2001 From: adasq Date: Thu, 15 Oct 2020 14:48:28 +0200 Subject: [PATCH 0018/1603] ReactIs.isValidElementType Unit Test extended with PureComponent case (#20033) Co-authored-by: Adam Plocieniak --- packages/react-is/src/__tests__/ReactIs-test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/react-is/src/__tests__/ReactIs-test.js b/packages/react-is/src/__tests__/ReactIs-test.js index a56c9f756a1d..cddd479c4344 100644 --- a/packages/react-is/src/__tests__/ReactIs-test.js +++ b/packages/react-is/src/__tests__/ReactIs-test.js @@ -29,6 +29,8 @@ describe('ReactIs', () => { expect(ReactIs.typeOf({})).toBe(undefined); expect(ReactIs.typeOf(null)).toBe(undefined); expect(ReactIs.typeOf(undefined)).toBe(undefined); + expect(ReactIs.typeOf(NaN)).toBe(undefined); + expect(ReactIs.typeOf(Symbol('def'))).toBe(undefined); }); it('identifies valid element types', () => { @@ -37,6 +39,11 @@ describe('ReactIs', () => { return React.createElement('div'); } } + class PureComponent extends React.PureComponent { + render() { + return React.createElement('div'); + } + } const FunctionComponent = () => React.createElement('div'); const ForwardRefComponent = React.forwardRef((props, ref) => @@ -48,6 +55,7 @@ describe('ReactIs', () => { expect(ReactIs.isValidElementType('div')).toEqual(true); expect(ReactIs.isValidElementType(Component)).toEqual(true); + expect(ReactIs.isValidElementType(PureComponent)).toEqual(true); expect(ReactIs.isValidElementType(FunctionComponent)).toEqual(true); expect(ReactIs.isValidElementType(ForwardRefComponent)).toEqual(true); expect(ReactIs.isValidElementType(LazyComponent)).toEqual(true); From 2eb3181eb4247077eafc4df98d06d7a999ecf5d8 Mon Sep 17 00:00:00 2001 From: IDrissAitHafid <31975500+IDrissAitHafid@users.noreply.github.com> Date: Thu, 15 Oct 2020 19:45:23 +0100 Subject: [PATCH 0019/1603] fixed unfound node error when Suspense is filtered (#20019) * fixed unfound node error when Suspense is filtered * added a test for filtered Suspense node --- .../storeComponentFilters-test.js.snap | 7 ++++++ .../__tests__/storeComponentFilters-test.js | 3 +++ .../src/backend/renderer.js | 22 ++++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/packages/react-devtools-shared/src/__tests__/__snapshots__/storeComponentFilters-test.js.snap b/packages/react-devtools-shared/src/__tests__/__snapshots__/storeComponentFilters-test.js.snap index cfe68aa69ecb..49035b992783 100644 --- a/packages/react-devtools-shared/src/__tests__/__snapshots__/storeComponentFilters-test.js.snap +++ b/packages/react-devtools-shared/src/__tests__/__snapshots__/storeComponentFilters-test.js.snap @@ -97,6 +97,13 @@ exports[`Store component filters should not break when Suspense nodes are filter `; +exports[`Store component filters should not break when Suspense nodes are filtered from the tree: 3: suspended 1`] = ` +[root] + ▾ + ▾ +
+`; + exports[`Store component filters should support filtering by element type: 1: mount 1`] = ` [root] ▾ diff --git a/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js b/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js index bfbf3e98210a..a8a0e151ef74 100644 --- a/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js +++ b/packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js @@ -256,5 +256,8 @@ describe('Store component filters', () => { act(() => ReactDOM.render(, container)); expect(store).toMatchSnapshot('2: resolved'); + + act(() => ReactDOM.render(, container)); + expect(store).toMatchSnapshot('3: suspended'); }); }); diff --git a/packages/react-devtools-shared/src/backend/renderer.js b/packages/react-devtools-shared/src/backend/renderer.js index c10d71bbfec2..23deda7dde25 100644 --- a/packages/react-devtools-shared/src/backend/renderer.js +++ b/packages/react-devtools-shared/src/backend/renderer.js @@ -1437,6 +1437,9 @@ export function attach( } function recordResetChildren(fiber: Fiber, childSet: Fiber) { + if (__DEBUG__) { + debug('recordResetChildren()', childSet, fiber); + } // The frontend only really cares about the displayName, key, and children. // The first two don't really change, so we are only concerned with the order of children here. // This is trickier than a simple comparison though, since certain types of fibers are filtered. @@ -1471,6 +1474,23 @@ export function attach( nextChildren.push(getFiberID(getPrimaryFiber(fiber))); } else { let child = fiber.child; + const isTimedOutSuspense = + fiber.tag === SuspenseComponent && fiber.memoizedState !== null; + if (isTimedOutSuspense) { + // Special case: if Suspense mounts in a timed-out state, + // get the fallback child from the inner fragment, + // and skip over the primary child. + const primaryChildFragment = fiber.child; + const fallbackChildFragment = primaryChildFragment + ? primaryChildFragment.sibling + : null; + const fallbackChild = fallbackChildFragment + ? fallbackChildFragment.child + : null; + if (fallbackChild !== null) { + child = fallbackChild; + } + } while (child !== null) { findReorderedChildrenRecursively(child, nextChildren); child = child.sibling; @@ -1592,7 +1612,7 @@ export function attach( if (nextFallbackChildSet != null) { mountFiberRecursively( nextFallbackChildSet, - nextFiber, + shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate, ); From 8df7b7911aa7fc3a896fb29da29e09f574e931aa Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Fri, 16 Oct 2020 08:21:58 -0500 Subject: [PATCH 0020/1603] Remove Passive flag from "before mutation" phase (#20038) We don't need to visit passive effect nodes during before mutation. The only reason we were previously was to schedule the root-level passive effect callback as early as possible, but now that `subtreeFlags` exists, we can check that instead. This should reduce the amount of traversal during the commit phase, particularly when mounting or updating large trees that contain many passive effects. --- .../react-reconciler/src/ReactFiberFlags.js | 5 ++- .../src/ReactFiberWorkLoop.new.js | 40 +++++++------------ 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberFlags.js b/packages/react-reconciler/src/ReactFiberFlags.js index 9fc29c29adb6..ed1f114e77b3 100644 --- a/packages/react-reconciler/src/ReactFiberFlags.js +++ b/packages/react-reconciler/src/ReactFiberFlags.js @@ -48,7 +48,10 @@ export const ForceUpdateForLegacySuspense = /* */ 0b000100000000000000; export const PassiveStatic = /* */ 0b001000000000000000; // Union of side effect groupings as pertains to subtreeFlags -export const BeforeMutationMask = /* */ 0b000000001100001010; +// TODO: Don't need to visit Placement during BeforeMutation phase +// TODO: Only need to visit Deletions during BeforeMutation phase if an element +// is focused. +export const BeforeMutationMask = /* */ 0b000000000100001010; export const MutationMask = /* */ 0b000000010010011110; export const LayoutMask = /* */ 0b000000000010100100; export const PassiveMask = /* */ 0b000000001000001000; diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index 1229ff006d41..ff171af0c535 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -1880,6 +1880,20 @@ function commitRootImpl(root, renderPriorityLevel) { NoFlags; if (subtreeHasEffects || rootHasEffect) { + // If there are pending passive effects, schedule a callback to process them. + if ( + (finishedWork.subtreeFlags & PassiveMask) !== NoFlags || + (finishedWork.flags & PassiveMask) !== NoFlags + ) { + if (!rootDoesHavePassiveEffects) { + rootDoesHavePassiveEffects = true; + scheduleCallback(NormalSchedulerPriority, () => { + flushPassiveEffects(); + return null; + }); + } + } + let previousLanePriority; if (decoupleUpdatePriorityFromScheduler) { previousLanePriority = getCurrentUpdateLanePriority(); @@ -1972,20 +1986,6 @@ function commitRootImpl(root, renderPriorityLevel) { markLayoutEffectsStopped(); } - // If there are pending passive effects, schedule a callback to process them. - if ( - (finishedWork.subtreeFlags & PassiveMask) !== NoFlags || - (finishedWork.flags & PassiveMask) !== NoFlags - ) { - if (!rootDoesHavePassiveEffects) { - rootDoesHavePassiveEffects = true; - scheduleCallback(NormalSchedulerPriority, () => { - flushPassiveEffects(); - return null; - }); - } - } - // Tell Scheduler to yield at the end of the frame, so the browser has an // opportunity to paint. requestPaint(); @@ -2181,18 +2181,6 @@ function commitBeforeMutationEffectsImpl(fiber: Fiber) { commitBeforeMutationEffectOnFiber(current, fiber); resetCurrentDebugFiberInDEV(); } - - if ((flags & Passive) !== NoFlags) { - // If there are passive effects, schedule a callback to flush at - // the earliest opportunity. - if (!rootDoesHavePassiveEffects) { - rootDoesHavePassiveEffects = true; - scheduleCallback(NormalSchedulerPriority, () => { - flushPassiveEffects(); - return null; - }); - } - } } function commitBeforeMutationEffectsDeletions(deletions: Array) { From f668b6c351c2654fef43e5f1ec24fd72a899d219 Mon Sep 17 00:00:00 2001 From: oltrep <34498770+oltrep@users.noreply.github.com> Date: Fri, 16 Oct 2020 08:06:08 -0700 Subject: [PATCH 0021/1603] Bump to latest eslint-config-fbjs (#20029) * bump package to latest * update files to respect lint * disable object-type-delimiter rule to work with prettier * disable rule to let flow check pass --- .eslintrc.js | 13 ++ package.json | 3 +- .../__tests__/inspectedElementContext-test.js | 2 +- .../__tests__/legacy/inspectElement-test.js | 2 +- yarn.lock | 171 +++++++++++++++++- 5 files changed, 182 insertions(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index cb2d737a12f6..591952fd3617 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -48,6 +48,7 @@ module.exports = { 'jsx-quotes': [ERROR, 'prefer-double'], 'keyword-spacing': [ERROR, {after: true, before: true}], 'no-bitwise': OFF, + 'no-console': OFF, 'no-inner-declarations': [ERROR, 'functions'], 'no-multi-spaces': ERROR, 'no-restricted-globals': [ERROR].concat(restrictedGlobals), @@ -61,6 +62,8 @@ module.exports = { 'space-before-blocks': ERROR, 'space-before-function-paren': OFF, 'valid-typeof': [ERROR, {requireStringLiterals: true}], + // Flow fails with with non-string literal keys + 'no-useless-computed-key': OFF, // We apply these settings to files that should run on Node. // They can't use JSX or ES6 modules, and must be in strict mode. @@ -74,6 +77,8 @@ module.exports = { // deal. But I turned it off because loading the plugin causes some obscure // syntax error and it didn't seem worth investigating. 'max-len': OFF, + // Prettier forces semicolons in a few places + 'flowtype/object-type-delimiter': OFF, // React & JSX // Our transforms set this automatically @@ -172,6 +177,14 @@ module.exports = { rules: { 'react-internal/no-production-logging': OFF, 'react-internal/warning-args': OFF, + + // Disable accessibility checks + 'jsx-a11y/aria-role': OFF, + 'jsx-a11y/no-noninteractive-element-interactions': OFF, + 'jsx-a11y/no-static-element-interactions': OFF, + 'jsx-a11y/role-has-required-aria-props': OFF, + 'jsx-a11y/no-noninteractive-tabindex': OFF, + 'jsx-a11y/tabindex-no-positive': OFF, }, }, { diff --git a/package.json b/package.json index 64e4430ede0a..507465c59318 100644 --- a/package.json +++ b/package.json @@ -48,11 +48,12 @@ "danger": "^9.2.10", "error-stack-parser": "^2.0.6", "eslint": "^7.7.0", - "eslint-config-fbjs": "^1.1.1", + "eslint-config-fbjs": "^3.1.1", "eslint-config-prettier": "^6.9.0", "eslint-plugin-babel": "^5.3.0", "eslint-plugin-flowtype": "^2.25.0", "eslint-plugin-jest": "^22.15.0", + "eslint-plugin-jsx-a11y": "^6.3.1", "eslint-plugin-no-for-of-loops": "^1.0.0", "eslint-plugin-no-function-declare-after-return": "^1.0.0", "eslint-plugin-react": "^6.7.1", diff --git a/packages/react-devtools-shared/src/__tests__/inspectedElementContext-test.js b/packages/react-devtools-shared/src/__tests__/inspectedElementContext-test.js index e43b925658f9..f08a3d9d6807 100644 --- a/packages/react-devtools-shared/src/__tests__/inspectedElementContext-test.js +++ b/packages/react-devtools-shared/src/__tests__/inspectedElementContext-test.js @@ -1040,7 +1040,7 @@ describe('InspectedElementContext', () => { enumerable: false, configurable: true, }, - [123]: { + 123: { value: 3, writable: true, enumerable: true, diff --git a/packages/react-devtools-shared/src/__tests__/legacy/inspectElement-test.js b/packages/react-devtools-shared/src/__tests__/legacy/inspectElement-test.js index d4f60af305cb..6ccff70c7777 100644 --- a/packages/react-devtools-shared/src/__tests__/legacy/inspectElement-test.js +++ b/packages/react-devtools-shared/src/__tests__/legacy/inspectElement-test.js @@ -505,7 +505,7 @@ describe('InspectedElementContext', () => { enumerable: false, configurable: true, }, - [123]: { + 123: { value: 3, writable: true, enumerable: true, diff --git a/yarn.lock b/yarn.lock index f6501ea3d7a6..ace507ca9bae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1407,6 +1407,14 @@ core-js "^2.6.5" regenerator-runtime "^0.13.2" +"@babel/runtime-corejs3@^7.10.2": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.12.0.tgz#e74206f51ebd69a787a6be762e26593dc3e97756" + integrity sha512-CltlJftStV4CBG4/HWVVRnBWFvLkYd22BkYO4gFgX+89JOlYiKQ5+Ji9Ovqb1o3T5DkkBn3JrVq1V/xweAaeGA== + dependencies: + core-js-pure "^3.0.0" + regenerator-runtime "^0.13.4" + "@babel/runtime@7.10.2": version "7.10.2" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.10.2.tgz#d103f21f2602497d38348a32e008637d506db839" @@ -1421,6 +1429,13 @@ dependencies: regenerator-runtime "^0.13.2" +"@babel/runtime@^7.10.2": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.0.tgz#98bd7666186969c04be893d747cf4a6c6c8fa6b0" + integrity sha512-lS4QLXQ2Vbw2ubfQjeQcn+BZgZ5+ROHW9f+DWjEp5Y+NHYmkRGKqHSJ1tuhbUauKu2nhZNTBIvsIQ8dXfY5Gjw== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/runtime@^7.11.2", "@babel/runtime@^7.8.4": version "7.11.2" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.2.tgz#f549c13c754cc40b87644b9fa9f09a6a95fe0736" @@ -2993,6 +3008,14 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +aria-query@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" + integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== + dependencies: + "@babel/runtime" "^7.10.2" + "@babel/runtime-corejs3" "^7.10.2" + arr-diff@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-1.1.0.tgz#687c32758163588fef7de7b36fabe495eb1a399a" @@ -3058,6 +3081,15 @@ array-flatten@^2.1.0: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== +array-includes@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.1.tgz#cdd67e6852bdf9c1215460786732255ed2459348" + integrity sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0" + is-string "^1.0.5" + array-map@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" @@ -3157,6 +3189,11 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= +ast-types-flow@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= + astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" @@ -3238,6 +3275,16 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== +axe-core@^3.5.4: + version "3.5.5" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-3.5.5.tgz#84315073b53fa3c0c51676c588d59da09a192227" + integrity sha512-5P0QZ6J5xGikH780pghEdbEKijCTrruK9KxtPZCFWUpef0f6GipO+xEZ5GKCb020mmqgbiNO6TcA55CriL784Q== + +axobject-query@^2.1.2: + version "2.2.0" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" + integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== + babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -4532,6 +4579,11 @@ core-js-compat@^3.6.2: browserslist "^4.8.3" semver "7.0.0" +core-js-pure@^3.0.0: + version "3.6.5" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.6.5.tgz#c79e75f5e38dbc85a662d91eea52b8256d53b813" + integrity sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA== + core-js@3.6.4, core-js@^3.6.4: version "3.6.4" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.4.tgz#440a83536b458114b9cb2ac1580ba377dc470647" @@ -4846,6 +4898,11 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= +damerau-levenshtein@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.6.tgz#143c1641cb3d85c60c32329e26899adea8701791" + integrity sha512-JVrozIeElnj3QzfUIt8tB8YMluBJom4Vw9qTPpjGYQ9fYlB3D/rb6OordUxf3xeFB35LKWs0xqcO5U6ySvBtug== + danger@^9.2.10: version "9.2.10" resolved "https://registry.yarnpkg.com/danger/-/danger-9.2.10.tgz#7b4e34ca805dd39bbbc0ca2da9025d63f4d36a85" @@ -5396,6 +5453,11 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.0.0: + version "9.1.1" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.1.1.tgz#1d5ffce26d8191e6c3f3a9d27987b1c5bba7d20a" + integrity sha512-AaWyDiNO9rbtMIcGl7tdxMcNu8SOLaDLxmQEFT5JhgKufOJzPPkYmgN2QwqTgw4doWMZZQttC6sUWVQjb+1VdA== + emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" @@ -5526,6 +5588,23 @@ es-abstract@^1.13.0: is-regex "^1.0.4" object-keys "^1.0.12" +es-abstract@^1.17.0: + version "1.17.7" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" + integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + es-abstract@^1.17.0-next.1, es-abstract@^1.17.5: version "1.17.6" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.6.tgz#9142071707857b2cacc7b89ecb670316c3e2d52a" @@ -5543,6 +5622,24 @@ es-abstract@^1.17.0-next.1, es-abstract@^1.17.5: string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" +es-abstract@^1.18.0-next.0: + version "1.18.0-next.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" + integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-negative-zero "^2.0.0" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + es-to-primitive@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" @@ -5642,10 +5739,10 @@ escodegen@^1.14.1: optionalDependencies: source-map "~0.6.1" -eslint-config-fbjs@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/eslint-config-fbjs/-/eslint-config-fbjs-1.1.1.tgz#dd29f8d912e8a755257e9eeef00bae1cce57f73a" - integrity sha1-3Sn42RLop1Ulfp7u8AuuHM5X9zo= +eslint-config-fbjs@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/eslint-config-fbjs/-/eslint-config-fbjs-3.1.1.tgz#f5b4c1df888693672116f000527a8df25d61b888" + integrity sha512-Vpyqz+ZcyLyiUGUdUfiQmZnxiQ4Nj/KDRKed/Y5qSm+xHbQJ5zcZUQwLUMWHQicpDHewsdXwlpUAblvy1DtGvg== eslint-config-prettier@^6.9.0: version "6.9.0" @@ -5675,6 +5772,23 @@ eslint-plugin-jest@^22.15.0: dependencies: "@typescript-eslint/experimental-utils" "^1.13.0" +eslint-plugin-jsx-a11y@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.3.1.tgz#99ef7e97f567cc6a5b8dd5ab95a94a67058a2660" + integrity sha512-i1S+P+c3HOlBJzMFORRbC58tHa65Kbo8b52/TwCwSKLohwvpfT5rm2GjGWzOHTEuq4xxf2aRlHHTtmExDQOP+g== + dependencies: + "@babel/runtime" "^7.10.2" + aria-query "^4.2.2" + array-includes "^3.1.1" + ast-types-flow "^0.0.7" + axe-core "^3.5.4" + axobject-query "^2.1.2" + damerau-levenshtein "^1.0.6" + emoji-regex "^9.0.0" + has "^1.0.3" + jsx-ast-utils "^2.4.1" + language-tags "^1.0.5" + eslint-plugin-no-for-of-loops@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-no-for-of-loops/-/eslint-plugin-no-for-of-loops-1.0.1.tgz#2ee3732d50c642b8d1bfacedbfe3b28f86222369" @@ -7764,6 +7878,11 @@ is-callable@^1.2.0: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.0.tgz#83336560b54a38e35e3a2df7afd0454d691468bb" integrity sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw== +is-callable@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" + integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== + is-ci@^1.0.10: version "1.2.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" @@ -7928,6 +8047,11 @@ is-negated-glob@^1.0.0: resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI= +is-negative-zero@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.0.tgz#9553b121b0fac28869da9ed459e20c7543788461" + integrity sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE= + is-npm@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" @@ -8039,7 +8163,7 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" -is-regex@^1.1.0: +is-regex@^1.1.0, is-regex@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== @@ -8073,6 +8197,11 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== +is-string@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" + integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== + is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" @@ -8870,6 +8999,14 @@ jsx-ast-utils@^1.3.4: resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" integrity sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE= +jsx-ast-utils@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.4.1.tgz#1114a4c1209481db06c690c2b4f488cc665f657e" + integrity sha512-z1xSldJ6imESSzOjd3NNkieVJKRlKYSOtMG8SFyCj2FIrvSaSuli/WjpBkEzCBoR9bYYYFgqJw61Xhu7Lcgk+w== + dependencies: + array-includes "^3.1.1" + object.assign "^4.1.0" + jszip@^2.4.0: version "2.6.1" resolved "https://registry.yarnpkg.com/jszip/-/jszip-2.6.1.tgz#b88f3a7b2e67a2a048152982c7a3756d9c4828f0" @@ -8953,6 +9090,18 @@ ky@^0.12.0: resolved "https://registry.yarnpkg.com/ky/-/ky-0.12.0.tgz#c05be95e6745ba422a6d2cc8ae964164962279f9" integrity sha512-t9b7v3V2fGwAcQnnDDQwKQGF55eWrf4pwi1RN08Fy8b/9GEwV7Ea0xQiaSW6ZbeghBHIwl8kgnla4vVo9seepQ== +language-subtag-registry@~0.3.2: + version "0.3.20" + resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.20.tgz#a00a37121894f224f763268e431c55556b0c0755" + integrity sha512-KPMwROklF4tEx283Xw0pNKtfTj1gZ4UByp4EsIFWLgBavJltF4TiYPc39k06zSTsLzxTVXXDSpbwaQXaFB4Qeg== + +language-tags@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.5.tgz#d321dbc4da30ba8bf3024e040fa5c14661f9193a" + integrity sha1-0yHbxNowuovzAk4ED6XBRmH5GTo= + dependencies: + language-subtag-registry "~0.3.2" + latest-version@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" @@ -10157,7 +10306,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.7.0: +object-inspect@^1.7.0, object-inspect@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== @@ -10184,6 +10333,16 @@ object.assign@^4.0.4, object.assign@^4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" +object.assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.1.tgz#303867a666cdd41936ecdedfb1f8f3e32a478cdd" + integrity sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.18.0-next.0" + has-symbols "^1.0.1" + object-keys "^1.1.1" + object.getownpropertydescriptors@^2.0.3: version "2.1.0" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" From b093528650db32b0112eb3adfcf9867e5f3b56d0 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Fri, 16 Oct 2020 17:07:27 +0200 Subject: [PATCH 0022/1603] test: Add regression test for hooks after error boundaries (#20002) * test: Add regression test for hooks after error boundaries * fix lint --- ...ReactErrorBoundariesHooks-test.internal.js | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 packages/react-dom/src/__tests__/ReactErrorBoundariesHooks-test.internal.js diff --git a/packages/react-dom/src/__tests__/ReactErrorBoundariesHooks-test.internal.js b/packages/react-dom/src/__tests__/ReactErrorBoundariesHooks-test.internal.js new file mode 100644 index 000000000000..078c58e0357e --- /dev/null +++ b/packages/react-dom/src/__tests__/ReactErrorBoundariesHooks-test.internal.js @@ -0,0 +1,66 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @emails react-core + */ + +'use strict'; + +let React; +let ReactDOM; + +describe('ReactErrorBoundariesHooks', () => { + beforeEach(() => { + jest.resetModules(); + ReactDOM = require('react-dom'); + React = require('react'); + }); + + it('should preserve hook order if errors are caught', () => { + function ErrorThrower() { + React.useMemo(() => undefined, []); + throw new Error('expected'); + } + + function StatefulComponent() { + React.useState(null); + return ' | stateful'; + } + + class ErrorHandler extends React.Component { + state = {error: null}; + + componentDidCatch(error) { + return this.setState({error}); + } + + render() { + if (this.state.error !== null) { + return

Handled error: {this.state.error.message}

; + } + return this.props.children; + } + } + + function App(props) { + return ( + + + + + + + ); + } + + const container = document.createElement('div'); + ReactDOM.render(, container); + + expect(() => { + ReactDOM.render(, container); + }).not.toThrow(); + }); +}); From e9f5ad2584ddb0d42a96045c9b23d0b4d9311331 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 16 Oct 2020 16:49:41 +0100 Subject: [PATCH 0023/1603] Remove Set bookkeeping for root events (#19990) * Remove dead code branch This function is only called when initializing roots/containers (where we skip non-delegated events) and in the createEventHandle path for non-DOM nodes (where we never hit this path because targetElement is null). * Move related functions close to each other * Fork listenToNativeEvent for createEventHandle It doesn't need all of the logic that's needed for normal event path. And the normal codepath doesn't use the last two arguments. * Expand test coverage for non-delegated events This changes a test to fail if we removed the event handler Sets. Previously, we didn't cover that. * Add DEV-level check that top-level events and non-delegated events do not overlap This makes us confident that they're mutually exclusive and there is no duplication between them. * Add a test verifying selectionchange deduplication This is why we still need the Set bookkeeping. Adding a test for it. * Remove Set bookkeeping for root events Root events don't intersect with non-delegated bubbled events (so no need to deduplicate there). They also don't intersect with createEventHandle non-managed events (because those don't go on the DOM elements). So we can remove the bookeeping because we already have code ensuring the eager subscriptions only run once per element. I've moved the selectionchange special case outside, and added document-level deduplication for it alone. Technically this might change the behavior of createEventHandle with selectionchange on the document, but we're not using that, and I'm not sure that behavior makes sense anyway. * Flow --- .../__tests__/ReactDOMEventListener-test.js | 107 +++++++++++++- .../src/client/ReactDOMEventHandle.js | 8 +- .../src/events/DOMPluginEventSystem.js | 139 +++++++++--------- 3 files changed, 173 insertions(+), 81 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMEventListener-test.js b/packages/react-dom/src/__tests__/ReactDOMEventListener-test.js index a6918c69197e..42e73d58f154 100644 --- a/packages/react-dom/src/__tests__/ReactDOMEventListener-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMEventListener-test.js @@ -820,19 +820,21 @@ describe('ReactDOMEventListener', () => {
, container, ); + + // Update to attach. ReactDOM.render(
+ onScroll={e => onScroll(e)} + onScrollCapture={e => onScrollCapture(e)}>
+ onScroll={e => onScroll(e)} + onScrollCapture={e => onScrollCapture(e)}>
onScroll(e)} + onScrollCapture={e => onScrollCapture(e)} ref={ref} />
@@ -850,6 +852,58 @@ describe('ReactDOMEventListener', () => { ['capture', 'child'], ['bubble', 'child'], ]); + + // Update to verify deduplication. + log.length = 0; + ReactDOM.render( +
onScroll(e)} + onScrollCapture={e => onScrollCapture(e)}> +
onScroll(e)} + onScrollCapture={e => onScrollCapture(e)}> +
onScroll(e)} + onScrollCapture={e => onScrollCapture(e)} + ref={ref} + /> +
+
, + container, + ); + ref.current.dispatchEvent( + new Event('scroll', { + bubbles: false, + }), + ); + expect(log).toEqual([ + ['capture', 'grand'], + ['capture', 'parent'], + ['capture', 'child'], + ['bubble', 'child'], + ]); + + // Update to detach. + log.length = 0; + ReactDOM.render( +
+
+
+
+
, + container, + ); + ref.current.dispatchEvent( + new Event('scroll', { + bubbles: false, + }), + ); + expect(log).toEqual([]); } finally { document.body.removeChild(container); } @@ -899,8 +953,49 @@ describe('ReactDOMEventListener', () => { ['capture', 'child'], ['bubble', 'child'], ]); + + log.length = 0; + ReactDOM.render( +
+
+
+
+
, + container, + ); + ref.current.dispatchEvent( + new Event('scroll', { + bubbles: false, + }), + ); + expect(log).toEqual([]); } finally { document.body.removeChild(container); } }); + + it('should not subscribe to selectionchange twice', () => { + const log = []; + + const originalDocAddEventListener = document.addEventListener; + document.addEventListener = function(type, fn, options) { + switch (type) { + case 'selectionchange': + log.push(options); + break; + default: + throw new Error( + `Did not expect to add a document-level listener for the "${type}" event.`, + ); + } + }; + try { + ReactDOM.render(, document.createElement('div')); + ReactDOM.render(, document.createElement('div')); + } finally { + document.addEventListener = originalDocAddEventListener; + } + + expect(log).toEqual([false]); + }); }); diff --git a/packages/react-dom/src/client/ReactDOMEventHandle.js b/packages/react-dom/src/client/ReactDOMEventHandle.js index 69a2eb4851f1..80834c32834d 100644 --- a/packages/react-dom/src/client/ReactDOMEventHandle.js +++ b/packages/react-dom/src/client/ReactDOMEventHandle.js @@ -22,9 +22,7 @@ import { addEventHandleToTarget, } from './ReactDOMComponentTree'; import {ELEMENT_NODE} from '../shared/HTMLNodeType'; -import {listenToNativeEvent} from '../events/DOMPluginEventSystem'; - -import {IS_EVENT_HANDLE_NON_MANAGED_NODE} from '../events/EventSystemFlags'; +import {listenToNativeEventForNonManagedEventTarget} from '../events/DOMPluginEventSystem'; import { enableScopeAPI, @@ -69,12 +67,10 @@ function registerReactDOMEvent( const eventTarget = ((target: any): EventTarget); // These are valid event targets, but they are also // non-managed React nodes. - listenToNativeEvent( + listenToNativeEventForNonManagedEventTarget( domEventName, isCapturePhaseListener, eventTarget, - null, - IS_EVENT_HANDLE_NON_MANAGED_NODE, ); } else { invariant( diff --git a/packages/react-dom/src/events/DOMPluginEventSystem.js b/packages/react-dom/src/events/DOMPluginEventSystem.js index c43d96dcb1c9..874fa394e5c4 100644 --- a/packages/react-dom/src/events/DOMPluginEventSystem.js +++ b/packages/react-dom/src/events/DOMPluginEventSystem.js @@ -295,6 +295,15 @@ export function listenToNonDelegatedEvent( domEventName: DOMEventName, targetElement: Element, ): void { + if (__DEV__) { + if (!nonDelegatedEvents.has(domEventName)) { + console.error( + 'Did not expect a listenToNonDelegatedEvent() call for "%s". ' + + 'This is a bug in React. Please file an issue.', + domEventName, + ); + } + } const isCapturePhaseListener = false; const listenerSet = getEventListenerSet(targetElement); const listenerSetKey = getListenerSetKey( @@ -312,88 +321,46 @@ export function listenToNonDelegatedEvent( } } -const listeningMarker = - '_reactListening' + - Math.random() - .toString(36) - .slice(2); - -export function listenToAllSupportedEvents(rootContainerElement: EventTarget) { - if ((rootContainerElement: any)[listeningMarker]) { - // Performance optimization: don't iterate through events - // for the same portal container or root node more than once. - // TODO: once we remove the flag, we may be able to also - // remove some of the bookkeeping maps used for laziness. - return; - } - (rootContainerElement: any)[listeningMarker] = true; - allNativeEvents.forEach(domEventName => { - if (!nonDelegatedEvents.has(domEventName)) { - listenToNativeEvent( +export function listenToNativeEvent( + domEventName: DOMEventName, + isCapturePhaseListener: boolean, + target: EventTarget, +): void { + if (__DEV__) { + if (nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener) { + console.error( + 'Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. ' + + 'This is a bug in React. Please file an issue.', domEventName, - false, - ((rootContainerElement: any): Element), - null, ); } - listenToNativeEvent( - domEventName, - true, - ((rootContainerElement: any): Element), - null, - ); - }); + } + + let eventSystemFlags = 0; + if (isCapturePhaseListener) { + eventSystemFlags |= IS_CAPTURE_PHASE; + } + addTrappedEventListener( + target, + domEventName, + eventSystemFlags, + isCapturePhaseListener, + ); } -export function listenToNativeEvent( +// This is only used by createEventHandle when the +// target is not a DOM element. E.g. window. +export function listenToNativeEventForNonManagedEventTarget( domEventName: DOMEventName, isCapturePhaseListener: boolean, - rootContainerElement: EventTarget, - targetElement: Element | null, - eventSystemFlags?: EventSystemFlags = 0, + target: EventTarget, ): void { - let target = rootContainerElement; - - // selectionchange needs to be attached to the document - // otherwise it won't capture incoming events that are only - // triggered on the document directly. - if ( - domEventName === 'selectionchange' && - (rootContainerElement: any).nodeType !== DOCUMENT_NODE - ) { - target = (rootContainerElement: any).ownerDocument; - } - // If the event can be delegated (or is capture phase), we can - // register it to the root container. Otherwise, we should - // register the event to the target element and mark it as - // a non-delegated event. - if ( - targetElement !== null && - !isCapturePhaseListener && - nonDelegatedEvents.has(domEventName) - ) { - // For all non-delegated events, apart from scroll, we attach - // their event listeners to the respective elements that their - // events fire on. That means we can skip this step, as event - // listener has already been added previously. However, we - // special case the scroll event because the reality is that any - // element can scroll. - // TODO: ideally, we'd eventually apply the same logic to all - // events from the nonDelegatedEvents list. Then we can remove - // this special case and use the same logic for all events. - if (domEventName !== 'scroll') { - return; - } - eventSystemFlags |= IS_NON_DELEGATED; - target = targetElement; - } + let eventSystemFlags = IS_EVENT_HANDLE_NON_MANAGED_NODE; const listenerSet = getEventListenerSet(target); const listenerSetKey = getListenerSetKey( domEventName, isCapturePhaseListener, ); - // If the listener entry is empty or we should upgrade, then - // we need to trap an event listener onto the target. if (!listenerSet.has(listenerSetKey)) { if (isCapturePhaseListener) { eventSystemFlags |= IS_CAPTURE_PHASE; @@ -408,6 +375,40 @@ export function listenToNativeEvent( } } +const listeningMarker = + '_reactListening' + + Math.random() + .toString(36) + .slice(2); + +export function listenToAllSupportedEvents(rootContainerElement: EventTarget) { + if (!(rootContainerElement: any)[listeningMarker]) { + (rootContainerElement: any)[listeningMarker] = true; + allNativeEvents.forEach(domEventName => { + // We handle selectionchange separately because it + // doesn't bubble and needs to be on the document. + if (domEventName !== 'selectionchange') { + if (!nonDelegatedEvents.has(domEventName)) { + listenToNativeEvent(domEventName, false, rootContainerElement); + } + listenToNativeEvent(domEventName, true, rootContainerElement); + } + }); + const ownerDocument = + (rootContainerElement: any).nodeType === DOCUMENT_NODE + ? rootContainerElement + : (rootContainerElement: any).ownerDocument; + if (ownerDocument !== null) { + // The selectionchange event also needs deduplication + // but it is attached to the document. + if (!(ownerDocument: any)[listeningMarker]) { + (ownerDocument: any)[listeningMarker] = true; + listenToNativeEvent('selectionchange', false, ownerDocument); + } + } + } +} + function addTrappedEventListener( targetContainer: EventTarget, domEventName: DOMEventName, From 0dd809bdfad2c2d714e369bb7f0082ce3ac34f9c Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Fri, 16 Oct 2020 11:06:55 -0500 Subject: [PATCH 0024/1603] Remove last schedulePassiveEffectCallback call (#20042) Now there's only a single place where the passive effect callback is scheduled. --- .../src/ReactFiberCommitWork.new.js | 6 -- .../src/ReactFiberWorkLoop.new.js | 56 ++++++------------- 2 files changed, 18 insertions(+), 44 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.new.js b/packages/react-reconciler/src/ReactFiberCommitWork.new.js index c43c6f8b1363..687e62de976c 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.new.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.new.js @@ -70,7 +70,6 @@ import { Update, Callback, LayoutMask, - PassiveMask, Ref, } from './ReactFiberFlags'; import getComponentName from 'shared/getComponentName'; @@ -125,7 +124,6 @@ import { captureCommitPhaseError, resolveRetryWakeable, markCommitTimeOfFallback, - schedulePassiveEffectCallback, } from './ReactFiberWorkLoop.new'; import { NoFlags as NoHookEffect, @@ -599,10 +597,6 @@ function recursivelyCommitLayoutEffects( finishedWork, ); } - - if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags) { - schedulePassiveEffectCallback(); - } break; } case ClassComponent: { diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index ff171af0c535..7eaf02ad4e3e 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -341,7 +341,6 @@ let hasUncaughtError = false; let firstUncaughtError = null; let legacyErrorBoundariesThatAlreadyFailed: Set | null = null; -let rootDoesHavePassiveEffects: boolean = false; let rootWithPendingPassiveEffects: FiberRoot | null = null; let pendingPassiveEffectsRenderPriority: ReactPriorityLevel = NoSchedulerPriority; let pendingPassiveEffectsLanes: Lanes = NoLanes; @@ -1865,6 +1864,22 @@ function commitRootImpl(root, renderPriorityLevel) { // times out. } + // If there are pending passive effects, schedule a callback to process them. + // Do this as early as possible, so it is queued before anything else that + // might get scheduled in the commit phase. (See #16714.) + const rootDoesHavePassiveEffects = + (finishedWork.subtreeFlags & PassiveMask) !== NoFlags || + (finishedWork.flags & PassiveMask) !== NoFlags; + if (rootDoesHavePassiveEffects) { + rootWithPendingPassiveEffects = root; + pendingPassiveEffectsLanes = lanes; + pendingPassiveEffectsRenderPriority = renderPriorityLevel; + scheduleCallback(NormalSchedulerPriority, () => { + flushPassiveEffects(); + return null; + }); + } + // Check if there are any effects in the whole tree. // TODO: This is left over from the effect list implementation, where we had // to check for the existence of `firstEffect` to satsify Flow. I think the @@ -1880,20 +1895,6 @@ function commitRootImpl(root, renderPriorityLevel) { NoFlags; if (subtreeHasEffects || rootHasEffect) { - // If there are pending passive effects, schedule a callback to process them. - if ( - (finishedWork.subtreeFlags & PassiveMask) !== NoFlags || - (finishedWork.flags & PassiveMask) !== NoFlags - ) { - if (!rootDoesHavePassiveEffects) { - rootDoesHavePassiveEffects = true; - scheduleCallback(NormalSchedulerPriority, () => { - flushPassiveEffects(); - return null; - }); - } - } - let previousLanePriority; if (decoupleUpdatePriorityFromScheduler) { previousLanePriority = getCurrentUpdateLanePriority(); @@ -2010,17 +2011,6 @@ function commitRootImpl(root, renderPriorityLevel) { } } - const rootDidHavePassiveEffects = rootDoesHavePassiveEffects; - - if (rootDoesHavePassiveEffects) { - // This commit has passive effects. Stash a reference to them. But don't - // schedule a callback until after flushing layout work. - rootDoesHavePassiveEffects = false; - rootWithPendingPassiveEffects = root; - pendingPassiveEffectsLanes = lanes; - pendingPassiveEffectsRenderPriority = renderPriorityLevel; - } - // Read this again, since an effect might have updated it remainingLanes = root.pendingLanes; @@ -2047,13 +2037,13 @@ function commitRootImpl(root, renderPriorityLevel) { } if (__DEV__ && enableDoubleInvokingEffects) { - if (!rootDidHavePassiveEffects) { + if (!rootDoesHavePassiveEffects) { commitDoubleInvokeEffectsInDEV(root.current, false); } } if (enableSchedulerTracing) { - if (!rootDidHavePassiveEffects) { + if (!rootDoesHavePassiveEffects) { // If there are no passive effects, then we can complete the pending interactions. // Otherwise, we'll wait until after the passive effects are flushed. // Wait to do this until after remaining work has been scheduled, @@ -2356,16 +2346,6 @@ function commitMutationEffectsDeletions( } } -export function schedulePassiveEffectCallback() { - if (!rootDoesHavePassiveEffects) { - rootDoesHavePassiveEffects = true; - scheduleCallback(NormalSchedulerPriority, () => { - flushPassiveEffects(); - return null; - }); - } -} - export function flushPassiveEffects(): boolean { // Returns whether passive effects were flushed. if (pendingPassiveEffectsRenderPriority !== NoSchedulerPriority) { From eb3181e7722905933da3b53ebff05339f12a3ba6 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Fri, 16 Oct 2020 11:49:07 -0500 Subject: [PATCH 0025/1603] Add Visibility flag for hiding/unhiding trees (#20043) * Add Visibility flag for hiding/unhiding trees There's `beforeblur` logic in the snapshot phase that needs to visit every Suspense boundary whose visibility is toggled. Right now it does that by visiting Placement and Deletion effects. That includes many unrelated nodes. By adding a new flag specifically for toggling Visibility, we will only visit the relevant Suspense (and Offscreen) boundaries, instead of all nodes that have a Placement. Potential follow-ups (not urgent): - The `beforeblur` logic also has a check to see whether the visibility was toggled on or off. It only cares about things being hidden. As a follow up, I can split the Visibility flag into separate Hide/Show flags, and only visit Hide. - Now that this is separate from Update, we can move the rest of the Suspense's layout effects (like attaching retry listeners) to the passive phase. * Gate behind createEventHandle feature flag Only need to visit deleted and hidden trees during the snapshot phase if the experimental `createEventHandle` flag is enabled. Currently, it's only used internally at Facebook, not open source. --- .../src/ReactFiberCompleteWork.new.js | 10 ++- .../react-reconciler/src/ReactFiberFlags.js | 74 +++++++++++-------- .../src/ReactFiberWorkLoop.new.js | 5 +- 3 files changed, 52 insertions(+), 37 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberCompleteWork.new.js b/packages/react-reconciler/src/ReactFiberCompleteWork.new.js index 1c7799618531..e32b0d394f5b 100644 --- a/packages/react-reconciler/src/ReactFiberCompleteWork.new.js +++ b/packages/react-reconciler/src/ReactFiberCompleteWork.new.js @@ -73,6 +73,7 @@ import { NoFlags, DidCapture, Snapshot, + Visibility, MutationMask, LayoutMask, PassiveMask, @@ -1154,8 +1155,8 @@ function completeWork( // TODO: Only schedule updates if not prevDidTimeout. if (nextDidTimeout) { // If this boundary just timed out, schedule an effect to attach a - // retry listener to the promise. This flag is also used to hide the - // primary children. + // retry listener to the promise. + // TODO: Move to passive phase workInProgress.flags |= Update; } } @@ -1167,7 +1168,7 @@ function completeWork( // primary children. In mutation mode, we also need the flag to // *unhide* children that were previously hidden, so check if this // is currently timed out, too. - workInProgress.flags |= Update; + workInProgress.flags |= Update | Visibility; } } if ( @@ -1176,6 +1177,7 @@ function completeWork( workInProgress.memoizedProps.suspenseCallback != null ) { // Always notify the callback + // TODO: Move to passive phase workInProgress.flags |= Update; } bubbleProperties(workInProgress); @@ -1523,7 +1525,7 @@ function completeWork( prevIsHidden !== nextIsHidden && newProps.mode !== 'unstable-defer-without-hiding' ) { - workInProgress.flags |= Update; + workInProgress.flags |= Update | Visibility; } } diff --git a/packages/react-reconciler/src/ReactFiberFlags.js b/packages/react-reconciler/src/ReactFiberFlags.js index ed1f114e77b3..4340131c0004 100644 --- a/packages/react-reconciler/src/ReactFiberFlags.js +++ b/packages/react-reconciler/src/ReactFiberFlags.js @@ -7,62 +7,72 @@ * @flow */ +import {enableCreateEventHandleAPI} from 'shared/ReactFeatureFlags'; + export type Flags = number; // Don't change these two values. They're used by React Dev Tools. -export const NoFlags = /* */ 0b000000000000000000; -export const PerformedWork = /* */ 0b000000000000000001; +export const NoFlags = /* */ 0b0000000000000000000; +export const PerformedWork = /* */ 0b0000000000000000001; // You can change the rest (and add more). -export const Placement = /* */ 0b000000000000000010; -export const Update = /* */ 0b000000000000000100; -export const PlacementAndUpdate = /* */ 0b000000000000000110; -export const Deletion = /* */ 0b000000000000001000; -export const ContentReset = /* */ 0b000000000000010000; -export const Callback = /* */ 0b000000000000100000; -export const DidCapture = /* */ 0b000000000001000000; -export const Ref = /* */ 0b000000000010000000; -export const Snapshot = /* */ 0b000000000100000000; -export const Passive = /* */ 0b000000001000000000; -// TODO (effects) Remove this bit once the new reconciler is synced to the old. -export const PassiveUnmountPendingDev = /* */ 0b000010000000000000; -export const Hydrating = /* */ 0b000000010000000000; -export const HydratingAndUpdate = /* */ 0b000000010000000100; +export const Placement = /* */ 0b0000000000000000010; +export const Update = /* */ 0b0000000000000000100; +export const PlacementAndUpdate = /* */ 0b0000000000000000110; +export const Deletion = /* */ 0b0000000000000001000; +export const ContentReset = /* */ 0b0000000000000010000; +export const Callback = /* */ 0b0000000000000100000; +export const DidCapture = /* */ 0b0000000000001000000; +export const Ref = /* */ 0b0000000000010000000; +export const Snapshot = /* */ 0b0000000000100000000; +export const Passive = /* */ 0b0000000001000000000; +export const Hydrating = /* */ 0b0000000010000000000; +export const HydratingAndUpdate = /* */ 0b0000000010000000100; +export const Visibility = /* */ 0b0000000100000000000; // Passive & Update & Callback & Ref & Snapshot -export const LifecycleEffectMask = /* */ 0b000000001110100100; +export const LifecycleEffectMask = /* */ 0b0000000001110100100; // Union of all host effects -export const HostEffectMask = /* */ 0b000000011111111111; +export const HostEffectMask = /* */ 0b0000000111111111111; // These are not really side effects, but we still reuse this field. -export const Incomplete = /* */ 0b000000100000000000; -export const ShouldCapture = /* */ 0b000001000000000000; -export const ForceUpdateForLegacySuspense = /* */ 0b000100000000000000; +export const Incomplete = /* */ 0b0000001000000000000; +export const ShouldCapture = /* */ 0b0000010000000000000; +// TODO (effects) Remove this bit once the new reconciler is synced to the old. +export const PassiveUnmountPendingDev = /* */ 0b0000100000000000000; +export const ForceUpdateForLegacySuspense = /* */ 0b0001000000000000000; // Static tags describe aspects of a fiber that are not specific to a render, // e.g. a fiber uses a passive effect (even if there are no updates on this particular render). // This enables us to defer more work in the unmount case, // since we can defer traversing the tree during layout to look for Passive effects, // and instead rely on the static flag as a signal that there may be cleanup work. -export const PassiveStatic = /* */ 0b001000000000000000; +export const PassiveStatic = /* */ 0b0010000000000000000; // Union of side effect groupings as pertains to subtreeFlags -// TODO: Don't need to visit Placement during BeforeMutation phase -// TODO: Only need to visit Deletions during BeforeMutation phase if an element -// is focused. -export const BeforeMutationMask = /* */ 0b000000000100001010; -export const MutationMask = /* */ 0b000000010010011110; -export const LayoutMask = /* */ 0b000000000010100100; -export const PassiveMask = /* */ 0b000000001000001000; + +export const BeforeMutationMask = + Snapshot | + (enableCreateEventHandleAPI + ? // createEventHandle needs to visit deleted and hidden trees to + // fire beforeblur + // TODO: Only need to visit Deletions during BeforeMutation phase if an + // element is focused. + Deletion | Visibility + : 0); + +export const MutationMask = /* */ 0b0000000110010011110; +export const LayoutMask = /* */ 0b0000000000010100100; +export const PassiveMask = /* */ 0b0000000001000001000; // Union of tags that don't get reset on clones. // This allows certain concepts to persist without recalculting them, // e.g. whether a subtree contains passive effects or portals. -export const StaticMask = /* */ 0b001000000000000000; +export const StaticMask = /* */ 0b0010000000000000000; // These flags allow us to traverse to fibers that have effects on mount // without traversing the entire tree after every commit for // double invoking -export const MountLayoutDev = /* */ 0b010000000000000000; -export const MountPassiveDev = /* */ 0b100000000000000000; +export const MountLayoutDev = /* */ 0b0100000000000000000; +export const MountPassiveDev = /* */ 0b1000000000000000000; diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index 7eaf02ad4e3e..33d8398fad5f 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -134,6 +134,7 @@ import { HostEffectMask, Hydrating, HydratingAndUpdate, + Visibility, BeforeMutationMask, MutationMask, LayoutMask, @@ -2155,8 +2156,10 @@ function commitBeforeMutationEffectsImpl(fiber: Fiber) { if (!shouldFireAfterActiveInstanceBlur && focusedInstanceHandle !== null) { // Check to see if the focused element was inside of a hidden (Suspense) subtree. - // TODO: Move this out of the hot path using a dedicated effect tag. if ( + // TODO: Can optimize this further with separate Hide and Show flags. We + // only care about Hide here. + (flags & Visibility) !== NoFlags && fiber.tag === SuspenseComponent && isSuspenseBoundaryBeingHidden(current, fiber) && doesFiberContain(fiber, focusedInstanceHandle) From 37cb732c59863297e48f69ac1f6e2ba1aa1886f0 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Fri, 16 Oct 2020 15:30:35 -0500 Subject: [PATCH 0026/1603] Use bitwise OR to define flag masks (#20044) Easier to read, harder to mess up. These expressions get simplified by Closure, so there's no runtime impact. --- .../react-reconciler/src/ReactFiberFlags.js | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberFlags.js b/packages/react-reconciler/src/ReactFiberFlags.js index 4340131c0004..da8255c6e8d1 100644 --- a/packages/react-reconciler/src/ReactFiberFlags.js +++ b/packages/react-reconciler/src/ReactFiberFlags.js @@ -30,10 +30,9 @@ export const Hydrating = /* */ 0b0000000010000000000; export const HydratingAndUpdate = /* */ 0b0000000010000000100; export const Visibility = /* */ 0b0000000100000000000; -// Passive & Update & Callback & Ref & Snapshot -export const LifecycleEffectMask = /* */ 0b0000000001110100100; +export const LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot; -// Union of all host effects +// Union of all commit flags (flags with the lifetime of a particular commit) export const HostEffectMask = /* */ 0b0000000111111111111; // These are not really side effects, but we still reuse this field. @@ -50,7 +49,14 @@ export const ForceUpdateForLegacySuspense = /* */ 0b0001000000000000000; // and instead rely on the static flag as a signal that there may be cleanup work. export const PassiveStatic = /* */ 0b0010000000000000000; -// Union of side effect groupings as pertains to subtreeFlags +// These flags allow us to traverse to fibers that have effects on mount +// without traversing the entire tree after every commit for +// double invoking +export const MountLayoutDev = /* */ 0b0100000000000000000; +export const MountPassiveDev = /* */ 0b1000000000000000000; + +// Groups of flags that are used in the commit phase to skip over trees that +// don't contain effects, by checking subtreeFlags. export const BeforeMutationMask = Snapshot | @@ -62,17 +68,12 @@ export const BeforeMutationMask = Deletion | Visibility : 0); -export const MutationMask = /* */ 0b0000000110010011110; -export const LayoutMask = /* */ 0b0000000000010100100; -export const PassiveMask = /* */ 0b0000000001000001000; +export const MutationMask = + Placement | Update | Deletion | ContentReset | Ref | Hydrating | Visibility; +export const LayoutMask = Update | Callback | Ref; +export const PassiveMask = Passive | Deletion; // Union of tags that don't get reset on clones. // This allows certain concepts to persist without recalculting them, // e.g. whether a subtree contains passive effects or portals. -export const StaticMask = /* */ 0b0010000000000000000; - -// These flags allow us to traverse to fibers that have effects on mount -// without traversing the entire tree after every commit for -// double invoking -export const MountLayoutDev = /* */ 0b0100000000000000000; -export const MountPassiveDev = /* */ 0b1000000000000000000; +export const StaticMask = PassiveStatic; From dfb6a403357d5ac2c0ea87aa6e5a4f947de342f8 Mon Sep 17 00:00:00 2001 From: Kai Riemann <53490304+kri@users.noreply.github.com> Date: Sat, 17 Oct 2020 18:47:52 +0200 Subject: [PATCH 0027/1603] [Fast Refresh] Fix crashes caused by rogue Proxies (#20030) (#20039) --- .../react-refresh/src/ReactFreshRuntime.js | 14 +++++++++++-- .../src/__tests__/ReactFresh-test.js | 21 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/packages/react-refresh/src/ReactFreshRuntime.js b/packages/react-refresh/src/ReactFreshRuntime.js index e6f0fb70ae5c..cd5d5a6716bf 100644 --- a/packages/react-refresh/src/ReactFreshRuntime.js +++ b/packages/react-refresh/src/ReactFreshRuntime.js @@ -178,6 +178,16 @@ function cloneSet(set: Set): Set { return clone; } +// This is a safety mechanism to protect against rogue getters and Proxies. +function getProperty(object, property) { + try { + return object[property]; + } catch (err) { + // Intentionally ignore. + return undefined; + } +} + export function performReactRefresh(): RefreshUpdate | null { if (!__DEV__) { throw new Error( @@ -322,7 +332,7 @@ export function register(type: any, id: string): void { // Visit inner types because we might not have registered them. if (typeof type === 'object' && type !== null) { - switch (type.$$typeof) { + switch (getProperty(type, '$$typeof')) { case REACT_FORWARD_REF_TYPE: register(type.render, id + '$render'); break; @@ -676,7 +686,7 @@ export function isLikelyComponentType(type: any): boolean { } case 'object': { if (type != null) { - switch (type.$$typeof) { + switch (getProperty(type, '$$typeof')) { case REACT_FORWARD_REF_TYPE: case REACT_MEMO_TYPE: // Definitely React components. diff --git a/packages/react-refresh/src/__tests__/ReactFresh-test.js b/packages/react-refresh/src/__tests__/ReactFresh-test.js index 3b6f69b13e31..da73032520c6 100644 --- a/packages/react-refresh/src/__tests__/ReactFresh-test.js +++ b/packages/react-refresh/src/__tests__/ReactFresh-test.js @@ -3612,11 +3612,26 @@ describe('ReactFresh', () => { const useStore = () => {}; expect(ReactFreshRuntime.isLikelyComponentType(useStore)).toBe(false); expect(ReactFreshRuntime.isLikelyComponentType(useTheme)).toBe(false); + const rogueProxy = new Proxy( + {}, + { + get(target, property) { + throw new Error(); + }, + }, + ); + expect(ReactFreshRuntime.isLikelyComponentType(rogueProxy)).toBe(false); // These seem like function components. const Button = () => {}; expect(ReactFreshRuntime.isLikelyComponentType(Button)).toBe(true); expect(ReactFreshRuntime.isLikelyComponentType(Widget)).toBe(true); + const ProxyButton = new Proxy(Button, { + get(target, property) { + return target[property]; + }, + }); + expect(ReactFreshRuntime.isLikelyComponentType(ProxyButton)).toBe(true); const anon = (() => () => {})(); anon.displayName = 'Foo'; expect(ReactFreshRuntime.isLikelyComponentType(anon)).toBe(true); @@ -3624,8 +3639,14 @@ describe('ReactFresh', () => { // These seem like class components. class Btn extends React.Component {} class PureBtn extends React.PureComponent {} + const ProxyBtn = new Proxy(Btn, { + get(target, property) { + return target[property]; + }, + }); expect(ReactFreshRuntime.isLikelyComponentType(Btn)).toBe(true); expect(ReactFreshRuntime.isLikelyComponentType(PureBtn)).toBe(true); + expect(ReactFreshRuntime.isLikelyComponentType(ProxyBtn)).toBe(true); expect( ReactFreshRuntime.isLikelyComponentType( createReactClass({render() {}}), From 7b6cac95229be79f4f7504f2ccd87d2a0a0f87e2 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Mon, 19 Oct 2020 09:36:00 -0400 Subject: [PATCH 0028/1603] Improved Profiler commit hooks test (#20053) Previously the tests didn't ensure that time spent during cascading render was not included in duration reported by commit hooks. --- .../src/__tests__/ReactProfiler-test.internal.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/react/src/__tests__/ReactProfiler-test.internal.js b/packages/react/src/__tests__/ReactProfiler-test.internal.js index 05d73235b1b3..180eb81b964b 100644 --- a/packages/react/src/__tests__/ReactProfiler-test.internal.js +++ b/packages/react/src/__tests__/ReactProfiler-test.internal.js @@ -1400,6 +1400,7 @@ describe('Profiler', () => { const ComponentWithEffects = ({shouldCascade}) => { const [didCascade, setDidCascade] = React.useState(false); + Scheduler.unstable_advanceTime(100000000); React.useLayoutEffect(() => { if (shouldCascade && !didCascade) { setDidCascade(true); @@ -1426,6 +1427,7 @@ describe('Profiler', () => { } } render() { + Scheduler.unstable_advanceTime(1000000000); return null; } } @@ -1447,7 +1449,7 @@ describe('Profiler', () => { expect(call[0]).toBe('mount-test'); expect(call[1]).toBe('mount'); expect(call[2]).toBe(1010); // durations - expect(call[3]).toBe(1); // commit start time (before mutations or effects) + expect(call[3]).toBe(1100000001); // commit start time (before mutations or effects) expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events call = callback.mock.calls[1]; @@ -1456,7 +1458,7 @@ describe('Profiler', () => { expect(call[0]).toBe('mount-test'); expect(call[1]).toBe('update'); expect(call[2]).toBe(130); // durations - expect(call[3]).toBe(1011); // commit start time (before mutations or effects) + expect(call[3]).toBe(1200001011); // commit start time (before mutations or effects) expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events Scheduler.unstable_advanceTime(1); @@ -1476,7 +1478,7 @@ describe('Profiler', () => { expect(call[0]).toBe('update-test'); expect(call[1]).toBe('update'); expect(call[2]).toBe(10130); // durations - expect(call[3]).toBe(1142); // commit start time (before mutations or effects) + expect(call[3]).toBe(2300001142); // commit start time (before mutations or effects) expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events call = callback.mock.calls[3]; @@ -1485,7 +1487,7 @@ describe('Profiler', () => { expect(call[0]).toBe('update-test'); expect(call[1]).toBe('update'); expect(call[2]).toBe(10000); // durations - expect(call[3]).toBe(11272); // commit start time (before mutations or effects) + expect(call[3]).toBe(3300011272); // commit start time (before mutations or effects) expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events }); @@ -1966,6 +1968,7 @@ describe('Profiler', () => { const ComponentWithEffects = () => { const [didMount, setDidMount] = React.useState(false); + Scheduler.unstable_advanceTime(1000); React.useEffect(() => { if (!didMount) { setDidMount(true); @@ -1996,7 +1999,7 @@ describe('Profiler', () => { expect(call[0]).toBe('mount-test'); expect(call[1]).toBe('mount'); expect(call[2]).toBe(10); // durations - expect(call[3]).toBe(1); // commit start time (before mutations or effects) + expect(call[3]).toBe(1001); // commit start time (before mutations or effects) expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events call = callback.mock.calls[1]; @@ -2005,7 +2008,7 @@ describe('Profiler', () => { expect(call[0]).toBe('mount-test'); expect(call[1]).toBe('update'); expect(call[2]).toBe(130); // durations - expect(call[3]).toBe(11); // commit start time (before mutations or effects) + expect(call[3]).toBe(2011); // commit start time (before mutations or effects) expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events }); From 51a3aa6afbfd9f239f3a435ff12a2da5870ab925 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Mon, 19 Oct 2020 11:20:54 -0400 Subject: [PATCH 0029/1603] DevTools 4.8.2 -> 4.9.0 bump --- packages/react-devtools-core/package.json | 2 +- .../chrome/manifest.json | 4 +- .../edge/manifest.json | 4 +- .../firefox/manifest.json | 2 +- packages/react-devtools-inline/package.json | 2 +- packages/react-devtools/CHANGELOG.md | 44 +++++++++++++++++++ packages/react-devtools/package.json | 4 +- 7 files changed, 53 insertions(+), 9 deletions(-) diff --git a/packages/react-devtools-core/package.json b/packages/react-devtools-core/package.json index 9a802f907d7c..a63724d4cfcc 100644 --- a/packages/react-devtools-core/package.json +++ b/packages/react-devtools-core/package.json @@ -1,6 +1,6 @@ { "name": "react-devtools-core", - "version": "4.8.2", + "version": "4.9.0", "description": "Use react-devtools outside of the browser", "license": "MIT", "main": "./dist/backend.js", diff --git a/packages/react-devtools-extensions/chrome/manifest.json b/packages/react-devtools-extensions/chrome/manifest.json index 60fd566a5ebd..c1e7cf3c0c12 100644 --- a/packages/react-devtools-extensions/chrome/manifest.json +++ b/packages/react-devtools-extensions/chrome/manifest.json @@ -2,8 +2,8 @@ "manifest_version": 2, "name": "React Developer Tools", "description": "Adds React debugging tools to the Chrome Developer Tools.", - "version": "4.8.2", - "version_name": "4.8.2", + "version": "4.9.0", + "version_name": "4.9.0", "minimum_chrome_version": "49", diff --git a/packages/react-devtools-extensions/edge/manifest.json b/packages/react-devtools-extensions/edge/manifest.json index 3fbb2900bd64..9c168a430e5b 100644 --- a/packages/react-devtools-extensions/edge/manifest.json +++ b/packages/react-devtools-extensions/edge/manifest.json @@ -2,8 +2,8 @@ "manifest_version": 2, "name": "React Developer Tools", "description": "Adds React debugging tools to the Microsoft Edge Developer Tools.", - "version": "4.8.2", - "version_name": "4.8.2", + "version": "4.9.0", + "version_name": "4.9.0", "minimum_chrome_version": "49", diff --git a/packages/react-devtools-extensions/firefox/manifest.json b/packages/react-devtools-extensions/firefox/manifest.json index ebe8547f10f5..d8c79b1aa647 100644 --- a/packages/react-devtools-extensions/firefox/manifest.json +++ b/packages/react-devtools-extensions/firefox/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "React Developer Tools", "description": "Adds React debugging tools to the Firefox Developer Tools.", - "version": "4.8.2", + "version": "4.9.0", "applications": { "gecko": { diff --git a/packages/react-devtools-inline/package.json b/packages/react-devtools-inline/package.json index 62f6fe1cba2f..b1f702b1354c 100644 --- a/packages/react-devtools-inline/package.json +++ b/packages/react-devtools-inline/package.json @@ -1,6 +1,6 @@ { "name": "react-devtools-inline", - "version": "4.8.2", + "version": "4.9.0", "description": "Embed react-devtools within a website", "license": "MIT", "main": "./dist/backend.js", diff --git a/packages/react-devtools/CHANGELOG.md b/packages/react-devtools/CHANGELOG.md index 9df1bd1bef48..f686c4a6d2c6 100644 --- a/packages/react-devtools/CHANGELOG.md +++ b/packages/react-devtools/CHANGELOG.md @@ -9,6 +9,50 @@ +## 4.9.0 (October 19, 2020) +#### Features +* [Improved DevTools editing interface](#improved-devtools-editing-interface) ([bvaughn](https://github.com/bvaughn) in [#19774](https://github.com/facebook/react/pull/19774)) +* Add ⎇ + arrow key navigation ([bvaughn](https://github.com/bvaughn) in [#19741](https://github.com/facebook/react/pull/19741)) +* Add checkbox toggle for boolean values ([mdaj06](https://github.com/mdaj06) in [#19714](https://github.com/facebook/react/pull/19714)) +* Show symbols used as keys in state ([omarsy](https://github.com/omarsy) in [#19786](https://github.com/facebook/react/pull/19786)) +* Add new (unstable) `SuspenseList` component type ([bpernick](https://github.com/bpernick) in [#19684](https://github.com/facebook/react/pull/19684)) + +#### Bugfix +* Show proper icon/tooltip for restricted browser pages ([sktguha](https://github.com/sktguha) in [#20023](https://github.com/facebook/react/pull/20023)) +* Fix emoji character shown in Chrome developer tools panel ([bvaughn](https://github.com/bvaughn) in [#19603](https://github.com/facebook/react/pull/19603)) +* Don't open two tabs in Firefox when clicking on troubleshooting instructions ([unbyte](https://github.com/unbyte) in [#19632](https://github.com/facebook/react/pull/19632)) +* Support inner component `_debugOwner` in memo ([bvaughn](https://github.com/bvaughn) in [#19556](https://github.com/facebook/react/pull/19556)) +* Proxied methods should be safely dehydrated for display ([@pfongkye](https://github.com/pfongkye) in [b6e1d08](https://github.com/facebook/react/commit/b6e1d08) +* Property list values should show whitespace ([sammarks](https://github.com/sammarks) in [#19640](https://github.com/facebook/react/pull/19640)) +* Fix crash when inspecting document.all ([omarsy](https://github.com/omarsy) in [#19619](https://github.com/facebook/react/pull/19619)) +* Don't call generators during inspection since they may be stateful ([todortotev](https://github.com/todortotev) in [#19831](https://github.com/facebook/react/pull/19831)) +* Fix bad null check in DevTools highlight code ([bvaughn](https://github.com/bvaughn) in [#20010](https://github.com/facebook/react/pull/20010)) +* Handled a missing suspense fiber when suspense is filtered on the profiler ([IDrissAitHafid](https://github.com/IDrissAitHafid) in [#ISSUE](https://github.com/facebook/react/pull/ISSUE)) +* Fixed unfound node error when Suspense is filtered ([IDrissAitHafid](https://github.com/IDrissAitHafid) in [#20019](https://github.com/facebook/react/pull/20019)) +* Always overrides the dispatcher when shallow rendering ([bvaughn](https://github.com/bvaughn) in [#20011](https://github.com/facebook/react/pull/20011)) +* Frevent phishing attacks ([iamwilson](https://github.com/iamwilson) in [#19934](https://github.com/facebook/react/pull/19934)) + +### Other +* Enable source maps for DevTools production builds ([jpribyl ](https://github.com/jpribyl ) in [#19773](https://github.com/facebook/react/pull/19773)) +* Drop support for IE 11 ([bvaughn](https://github.com/bvaughn) in [#19875](https://github.com/facebook/react/pull/19875)) +* Remove ReactJS.org version check "cheat" ([sktguha](https://github.com/sktguha) in [#19939](https://github.com/facebook/react/pull/19939)) +* Update outdated links and fix two broken links ([sktguha](https://github.com/sktguha) in [#19985](https://github.com/facebook/react/pull/19985)) +* Remove support for deprecated/unreleased React Flare event system ([trueadm](https://github.com/trueadm) in [#19520](https://github.com/facebook/react/pull/19520)) + +###### Improved DevTools editing interface + +**Improved parsing** +Value parsing logic has been relaxed so as to no longer require quotes around strings or double quotes: +![looser parsing logic](https://user-images.githubusercontent.com/29597/93407442-36504300-f860-11ea-90e8-5ad54c9b8b34.gif) + +**Modifying arrays** +New values can be added to array props/state/hooks now. Existing values can also be deleted: +![adding and removing values from an array](https://user-images.githubusercontent.com/29597/93407457-3ea87e00-f860-11ea-8b85-a41904e6c25f.gif) + +**Modifying objects** +New keys can be added to object props/state/hooks now. Existing keys can be renamed or deleted entirely: +![adding/renaming/removing object properties](https://user-images.githubusercontent.com/29597/93407464-449e5f00-f860-11ea-909b-49dafb56f6c5.gif) + ## 4.8.2 (July 15, 2020) #### Bugfix * Fix broken `Suspense` heuristic ([bvaughn](https://github.com/bvaughn) in [#19373](https://github.com/facebook/react/pull/19373)) diff --git a/packages/react-devtools/package.json b/packages/react-devtools/package.json index de46d6dce0a8..460e5f21340e 100644 --- a/packages/react-devtools/package.json +++ b/packages/react-devtools/package.json @@ -1,6 +1,6 @@ { "name": "react-devtools", - "version": "4.8.2", + "version": "4.9.0", "description": "Use react-devtools outside of the browser", "license": "MIT", "repository": { @@ -27,7 +27,7 @@ "electron": "^9.1.0", "ip": "^1.1.4", "minimist": "^1.2.3", - "react-devtools-core": "4.8.2", + "react-devtools-core": "4.9.0", "update-notifier": "^2.1.0" } } From 75726fadfd4ab063390805bf5baab966c8523d2c Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Mon, 19 Oct 2020 15:21:41 -0400 Subject: [PATCH 0030/1603] DevTools fix props editing for host components (#20055) --- .../src/__tests__/editing-test.js | 27 +++++++++++++++++++ .../src/backend/renderer.js | 25 ++++++++++------- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/packages/react-devtools-shared/src/__tests__/editing-test.js b/packages/react-devtools-shared/src/__tests__/editing-test.js index 156e4b1f391e..1a57927f5102 100644 --- a/packages/react-devtools-shared/src/__tests__/editing-test.js +++ b/packages/react-devtools-shared/src/__tests__/editing-test.js @@ -28,6 +28,7 @@ describe('editing interface', () => { bridge = global.bridge; store = global.store; store.collapseNodesByDefault = false; + store.componentFilters = []; PropTypes = require('prop-types'); React = require('react'); @@ -37,8 +38,10 @@ describe('editing interface', () => { describe('props', () => { let committedClassProps; let committedFunctionProps; + let inputRef; let classID; let functionID; + let hostComponentID; async function mountTestApp() { class ClassComponent extends React.Component { @@ -60,6 +63,8 @@ describe('editing interface', () => { return null; } + inputRef = React.createRef(null); + const container = document.createElement('div'); await utils.actAsync(() => ReactDOM.render( @@ -76,6 +81,7 @@ describe('editing interface', () => { shallow="initial" /> , + , container, ), @@ -83,6 +89,7 @@ describe('editing interface', () => { classID = ((store.getElementIDAtIndex(0): any): number); functionID = ((store.getElementIDAtIndex(1): any): number); + hostComponentID = ((store.getElementIDAtIndex(2): any): number); expect(committedClassProps).toStrictEqual({ array: [1, 2, 3], @@ -98,6 +105,7 @@ describe('editing interface', () => { }, shallow: 'initial', }); + expect(inputRef.current.value).toBe('initial'); } it('should have editable values', async () => { @@ -380,6 +388,25 @@ describe('editing interface', () => { object: {}, }); }); + + it('should support editing host component values', async () => { + await mountTestApp(); + + function overrideProps(id, path, value) { + const rendererID = utils.getRendererID(); + bridge.send('overrideValueAtPath', { + id, + path, + rendererID, + type: 'props', + value, + }); + flushPendingUpdates(); + } + + overrideProps(hostComponentID, ['value'], 'updated'); + expect(inputRef.current.value).toBe('updated'); + }); }); describe('state', () => { diff --git a/packages/react-devtools-shared/src/backend/renderer.js b/packages/react-devtools-shared/src/backend/renderer.js index 23deda7dde25..208615bcccbb 100644 --- a/packages/react-devtools-shared/src/backend/renderer.js +++ b/packages/react-devtools-shared/src/backend/renderer.js @@ -2888,18 +2888,25 @@ export function attach( } break; case 'props': - if (instance === null) { - if (typeof overrideProps === 'function') { - overrideProps(fiber, path, value); - } - } else { - fiber.pendingProps = copyWithSet(instance.props, path, value); - instance.forceUpdate(); + switch (fiber.tag) { + case ClassComponent: + fiber.pendingProps = copyWithSet(instance.props, path, value); + instance.forceUpdate(); + break; + default: + if (typeof overrideProps === 'function') { + overrideProps(fiber, path, value); + } + break; } break; case 'state': - setInObject(instance.state, path, value); - instance.forceUpdate(); + switch (fiber.tag) { + case ClassComponent: + setInObject(instance.state, path, value); + instance.forceUpdate(); + break; + } break; } } From c59c3dfe554dafb64864f3bbcfff6ffe51f32275 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Mon, 19 Oct 2020 16:05:00 -0400 Subject: [PATCH 0031/1603] useRef: Warn about reading or writing mutable values during render (#18545) Reading or writing a ref value during render is only safe if you are implementing the lazy initialization pattern. Other types of reading are unsafe as the ref is a mutable source. Other types of writing are unsafe as they are effectively side effects. This change also refactors useTransition to no longer use a ref hook, but instead manage its own (stable) hook state. --- .../ReactDOMServerIntegrationHooks-test.js | 18 +- .../src/ReactFiberHooks.new.js | 103 ++++- .../src/ReactFiberHooks.old.js | 103 ++++- .../ReactHooksWithNoopRenderer-test.js | 89 +---- .../src/__tests__/useRef-test.internal.js | 364 ++++++++++++++++++ packages/shared/ReactFeatureFlags.js | 2 + .../forks/ReactFeatureFlags.native-fb.js | 1 + .../forks/ReactFeatureFlags.native-oss.js | 1 + .../forks/ReactFeatureFlags.test-renderer.js | 1 + .../ReactFeatureFlags.test-renderer.native.js | 1 + .../ReactFeatureFlags.test-renderer.www.js | 1 + .../shared/forks/ReactFeatureFlags.testing.js | 1 + .../forks/ReactFeatureFlags.testing.www.js | 1 + .../forks/ReactFeatureFlags.www-dynamic.js | 1 + .../shared/forks/ReactFeatureFlags.www.js | 1 + 15 files changed, 567 insertions(+), 121 deletions(-) create mode 100644 packages/react-reconciler/src/__tests__/useRef-test.internal.js diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js index 6cb57a8560b7..397b739546dc 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js @@ -474,12 +474,12 @@ describe('ReactDOMServerHooks', () => { describe('useRef', () => { itRenders('basic render', async render => { function Counter(props) { - const count = useRef(0); - return Count: {count.current}; + const ref = useRef(); + return Hi; } const domNode = await render(); - expect(domNode.textContent).toEqual('Count: 0'); + expect(domNode.textContent).toEqual('Hi'); }); itRenders( @@ -487,18 +487,16 @@ describe('ReactDOMServerHooks', () => { async render => { function Counter(props) { const [count, setCount] = useState(0); - const ref = useRef(count); + const ref = useRef(); if (count < 3) { const newCount = count + 1; - - ref.current = newCount; setCount(newCount); } yieldValue(count); - return Count: {ref.current}; + return Count: {count}; } const domNode = await render(); @@ -513,7 +511,7 @@ describe('ReactDOMServerHooks', () => { let firstRef = null; function Counter(props) { const [count, setCount] = useState(0); - const ref = useRef(count); + const ref = useRef(); if (firstRef === null) { firstRef = ref; } else if (firstRef !== ref) { @@ -528,12 +526,12 @@ describe('ReactDOMServerHooks', () => { yieldValue(count); - return Count: {ref.current}; + return Count: {count}; } const domNode = await render(); expect(clearYields()).toEqual([0, 1, 2, 3]); - expect(domNode.textContent).toEqual('Count: 0'); + expect(domNode.textContent).toEqual('Count: 3'); }, ); }); diff --git a/packages/react-reconciler/src/ReactFiberHooks.new.js b/packages/react-reconciler/src/ReactFiberHooks.new.js index bdd0bed4c759..231b33e69bcf 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.new.js +++ b/packages/react-reconciler/src/ReactFiberHooks.new.js @@ -27,6 +27,7 @@ import { enableNewReconciler, decoupleUpdatePriorityFromScheduler, enableDoubleInvokingEffects, + enableUseRefAccessWarning, } from 'shared/ReactFeatureFlags'; import { @@ -1197,14 +1198,92 @@ function pushEffect(tag, create, destroy, deps) { return effect; } +let stackContainsErrorMessage: boolean | null = null; + +function getCallerStackFrame(): string { + const stackFrames = new Error('Error message').stack.split('\n'); + + // Some browsers (e.g. Chrome) include the error message in the stack + // but others (e.g. Firefox) do not. + if (stackContainsErrorMessage === null) { + stackContainsErrorMessage = stackFrames[0].includes('Error message'); + } + + return stackContainsErrorMessage + ? stackFrames.slice(3, 4).join('\n') + : stackFrames.slice(2, 3).join('\n'); +} + function mountRef(initialValue: T): {|current: T|} { const hook = mountWorkInProgressHook(); - const ref = {current: initialValue}; - if (__DEV__) { - Object.seal(ref); + if (enableUseRefAccessWarning) { + if (__DEV__) { + // Support lazy initialization pattern shown in docs. + // We need to store the caller stack frame so that we don't warn on subsequent renders. + let hasBeenInitialized = initialValue != null; + let lazyInitGetterStack = null; + let didCheckForLazyInit = false; + + // Only warn once per component+hook. + let didWarnAboutRead = false; + let didWarnAboutWrite = false; + + let current = initialValue; + const ref = { + get current() { + if (!hasBeenInitialized) { + didCheckForLazyInit = true; + lazyInitGetterStack = getCallerStackFrame(); + } else if (currentlyRenderingFiber !== null && !didWarnAboutRead) { + if ( + lazyInitGetterStack === null || + lazyInitGetterStack !== getCallerStackFrame() + ) { + didWarnAboutRead = true; + console.warn( + '%s: Unsafe read of a mutable value during render.\n\n' + + 'Reading from a ref during render is only safe if:\n' + + '1. The ref value has not been updated, or\n' + + '2. The ref holds a lazily-initialized value that is only set once.\n', + getComponentName(currentlyRenderingFiber.type) || 'Unknown', + ); + } + } + return current; + }, + set current(value) { + if (currentlyRenderingFiber !== null && !didWarnAboutWrite) { + if ( + hasBeenInitialized || + (!hasBeenInitialized && !didCheckForLazyInit) + ) { + didWarnAboutWrite = true; + console.warn( + '%s: Unsafe write of a mutable value during render.\n\n' + + 'Writing to a ref during render is only safe if the ref holds ' + + 'a lazily-initialized value that is only set once.\n', + getComponentName(currentlyRenderingFiber.type) || 'Unknown', + ); + } + } + + hasBeenInitialized = true; + current = value; + }, + }; + Object.seal(ref); + hook.memoizedState = ref; + return ref; + } else { + const ref = {current: initialValue}; + hook.memoizedState = ref; + return ref; + } + } else { + const ref = {current: initialValue}; + hook.memoizedState = ref; + return ref; } - hook.memoizedState = ref; - return ref; } function updateRef(initialValue: T): {|current: T|} { @@ -1591,24 +1670,24 @@ function startTransition(setPending, callback) { function mountTransition(): [(() => void) => void, boolean] { const [isPending, setPending] = mountState(false); - // The `start` method can be stored on a ref, since `setPending` - // never changes. + // The `start` method never changes. const start = startTransition.bind(null, setPending); - mountRef(start); + const hook = mountWorkInProgressHook(); + hook.memoizedState = start; return [start, isPending]; } function updateTransition(): [(() => void) => void, boolean] { const [isPending] = updateState(false); - const startRef = updateRef(); - const start: (() => void) => void = (startRef.current: any); + const hook = updateWorkInProgressHook(); + const start = hook.memoizedState; return [start, isPending]; } function rerenderTransition(): [(() => void) => void, boolean] { const [isPending] = rerenderState(false); - const startRef = updateRef(); - const start: (() => void) => void = (startRef.current: any); + const hook = updateWorkInProgressHook(); + const start = hook.memoizedState; return [start, isPending]; } diff --git a/packages/react-reconciler/src/ReactFiberHooks.old.js b/packages/react-reconciler/src/ReactFiberHooks.old.js index 972a74640278..ccd69abae6aa 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.old.js +++ b/packages/react-reconciler/src/ReactFiberHooks.old.js @@ -26,6 +26,7 @@ import { enableSchedulingProfiler, enableNewReconciler, decoupleUpdatePriorityFromScheduler, + enableUseRefAccessWarning, } from 'shared/ReactFeatureFlags'; import {NoMode, BlockingMode, DebugTracingMode} from './ReactTypeOfMode'; @@ -1175,14 +1176,92 @@ function pushEffect(tag, create, destroy, deps) { return effect; } +let stackContainsErrorMessage: boolean | null = null; + +function getCallerStackFrame(): string { + const stackFrames = new Error('Error message').stack.split('\n'); + + // Some browsers (e.g. Chrome) include the error message in the stack + // but others (e.g. Firefox) do not. + if (stackContainsErrorMessage === null) { + stackContainsErrorMessage = stackFrames[0].includes('Error message'); + } + + return stackContainsErrorMessage + ? stackFrames.slice(3, 4).join('\n') + : stackFrames.slice(2, 3).join('\n'); +} + function mountRef(initialValue: T): {|current: T|} { const hook = mountWorkInProgressHook(); - const ref = {current: initialValue}; - if (__DEV__) { - Object.seal(ref); + if (enableUseRefAccessWarning) { + if (__DEV__) { + // Support lazy initialization pattern shown in docs. + // We need to store the caller stack frame so that we don't warn on subsequent renders. + let hasBeenInitialized = initialValue != null; + let lazyInitGetterStack = null; + let didCheckForLazyInit = false; + + // Only warn once per component+hook. + let didWarnAboutRead = false; + let didWarnAboutWrite = false; + + let current = initialValue; + const ref = { + get current() { + if (!hasBeenInitialized) { + didCheckForLazyInit = true; + lazyInitGetterStack = getCallerStackFrame(); + } else if (currentlyRenderingFiber !== null && !didWarnAboutRead) { + if ( + lazyInitGetterStack === null || + lazyInitGetterStack !== getCallerStackFrame() + ) { + didWarnAboutRead = true; + console.warn( + '%s: Unsafe read of a mutable value during render.\n\n' + + 'Reading from a ref during render is only safe if:\n' + + '1. The ref value has not been updated, or\n' + + '2. The ref holds a lazily-initialized value that is only set once.\n', + getComponentName(currentlyRenderingFiber.type) || 'Unknown', + ); + } + } + return current; + }, + set current(value) { + if (currentlyRenderingFiber !== null && !didWarnAboutWrite) { + if ( + hasBeenInitialized || + (!hasBeenInitialized && !didCheckForLazyInit) + ) { + didWarnAboutWrite = true; + console.warn( + '%s: Unsafe write of a mutable value during render.\n\n' + + 'Writing to a ref during render is only safe if the ref holds ' + + 'a lazily-initialized value that is only set once.\n', + getComponentName(currentlyRenderingFiber.type) || 'Unknown', + ); + } + } + + hasBeenInitialized = true; + current = value; + }, + }; + Object.seal(ref); + hook.memoizedState = ref; + return ref; + } else { + const ref = {current: initialValue}; + hook.memoizedState = ref; + return ref; + } + } else { + const ref = {current: initialValue}; + hook.memoizedState = ref; + return ref; } - hook.memoizedState = ref; - return ref; } function updateRef(initialValue: T): {|current: T|} { @@ -1534,24 +1613,24 @@ function startTransition(setPending, callback) { function mountTransition(): [(() => void) => void, boolean] { const [isPending, setPending] = mountState(false); - // The `start` method can be stored on a ref, since `setPending` - // never changes. + // The `start` method never changes. const start = startTransition.bind(null, setPending); - mountRef(start); + const hook = mountWorkInProgressHook(); + hook.memoizedState = start; return [start, isPending]; } function updateTransition(): [(() => void) => void, boolean] { const [isPending] = updateState(false); - const startRef = updateRef(); - const start: (() => void) => void = (startRef.current: any); + const hook = updateWorkInProgressHook(); + const start = hook.memoizedState; return [start, isPending]; } function rerenderTransition(): [(() => void) => void, boolean] { const [isPending] = rerenderState(false); - const startRef = updateRef(); - const start: (() => void) => void = (startRef.current: any); + const hook = updateWorkInProgressHook(); + const start = hook.memoizedState; return [start, isPending]; } diff --git a/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js b/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js index 333e8930e734..79794bbea7ff 100644 --- a/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js +++ b/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js @@ -1536,7 +1536,7 @@ describe('ReactHooksWithNoopRenderer', () => { it('does not show a warning when a component updates a childs state from within passive unmount function', () => { function Parent() { Scheduler.unstable_yieldValue('Parent'); - const updaterRef = React.useRef(null); + const updaterRef = useRef(null); React.useEffect(() => { Scheduler.unstable_yieldValue('Parent passive create'); return () => { @@ -2612,7 +2612,7 @@ describe('ReactHooksWithNoopRenderer', () => { }); // @gate new - it('should skip unmounted boundaries and use the nearest still-mounted boundary', () => { + it('should skip unmounted boundaries and use the nearest still-mounted boundary', () => { function Conditional({showChildren}) { if (showChildren) { return ( @@ -3202,91 +3202,6 @@ describe('ReactHooksWithNoopRenderer', () => { }); }); - describe('useRef', () => { - it('creates a ref object initialized with the provided value', () => { - jest.useFakeTimers(); - - function useDebouncedCallback(callback, ms, inputs) { - const timeoutID = useRef(-1); - useEffect(() => { - return function unmount() { - clearTimeout(timeoutID.current); - }; - }, []); - const debouncedCallback = useCallback( - (...args) => { - clearTimeout(timeoutID.current); - timeoutID.current = setTimeout(callback, ms, ...args); - }, - [callback, ms], - ); - return useCallback(debouncedCallback, inputs); - } - - let ping; - function App() { - ping = useDebouncedCallback( - value => { - Scheduler.unstable_yieldValue('ping: ' + value); - }, - 100, - [], - ); - return null; - } - - act(() => { - ReactNoop.render(); - }); - expect(Scheduler).toHaveYielded([]); - - ping(1); - ping(2); - ping(3); - - expect(Scheduler).toHaveYielded([]); - - jest.advanceTimersByTime(100); - - expect(Scheduler).toHaveYielded(['ping: 3']); - - ping(4); - jest.advanceTimersByTime(20); - ping(5); - ping(6); - jest.advanceTimersByTime(80); - - expect(Scheduler).toHaveYielded([]); - - jest.advanceTimersByTime(20); - expect(Scheduler).toHaveYielded(['ping: 6']); - }); - - it('should return the same ref during re-renders', () => { - function Counter() { - const ref = useRef('val'); - const [count, setCount] = useState(0); - const [firstRef] = useState(ref); - - if (firstRef !== ref) { - throw new Error('should never change'); - } - - if (count < 3) { - setCount(count + 1); - } - - return ; - } - - ReactNoop.render(); - expect(Scheduler).toFlushAndYield(['val']); - - ReactNoop.render(); - expect(Scheduler).toFlushAndYield(['val']); - }); - }); - describe('useImperativeHandle', () => { it('does not update when deps are the same', () => { const INCREMENT = 'INCREMENT'; diff --git a/packages/react-reconciler/src/__tests__/useRef-test.internal.js b/packages/react-reconciler/src/__tests__/useRef-test.internal.js new file mode 100644 index 000000000000..ccfc6d0d4b2a --- /dev/null +++ b/packages/react-reconciler/src/__tests__/useRef-test.internal.js @@ -0,0 +1,364 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @emails react-core + * @jest-environment node + */ + +/* eslint-disable no-func-assign */ + +'use strict'; + +describe('useRef', () => { + let React; + let ReactNoop; + let Scheduler; + let act; + let useCallback; + let useEffect; + let useLayoutEffect; + let useRef; + let useState; + + beforeEach(() => { + React = require('react'); + ReactNoop = require('react-noop-renderer'); + Scheduler = require('scheduler'); + + const ReactFeatureFlags = require('shared/ReactFeatureFlags'); + ReactFeatureFlags.debugRenderPhaseSideEffectsForStrictMode = false; + + act = ReactNoop.act; + useCallback = React.useCallback; + useEffect = React.useEffect; + useLayoutEffect = React.useLayoutEffect; + useRef = React.useRef; + useState = React.useState; + }); + + function Text(props) { + Scheduler.unstable_yieldValue(props.text); + return ; + } + + it('creates a ref object initialized with the provided value', () => { + jest.useFakeTimers(); + + function useDebouncedCallback(callback, ms, inputs) { + const timeoutID = useRef(-1); + useEffect(() => { + return function unmount() { + clearTimeout(timeoutID.current); + }; + }, []); + const debouncedCallback = useCallback( + (...args) => { + clearTimeout(timeoutID.current); + timeoutID.current = setTimeout(callback, ms, ...args); + }, + [callback, ms], + ); + return useCallback(debouncedCallback, inputs); + } + + let ping; + function App() { + ping = useDebouncedCallback( + value => { + Scheduler.unstable_yieldValue('ping: ' + value); + }, + 100, + [], + ); + return null; + } + + act(() => { + ReactNoop.render(); + }); + expect(Scheduler).toHaveYielded([]); + + ping(1); + ping(2); + ping(3); + + expect(Scheduler).toHaveYielded([]); + + jest.advanceTimersByTime(100); + + expect(Scheduler).toHaveYielded(['ping: 3']); + + ping(4); + jest.advanceTimersByTime(20); + ping(5); + ping(6); + jest.advanceTimersByTime(80); + + expect(Scheduler).toHaveYielded([]); + + jest.advanceTimersByTime(20); + expect(Scheduler).toHaveYielded(['ping: 6']); + }); + + it('should return the same ref during re-renders', () => { + function Counter() { + const ref = useRef('val'); + const [count, setCount] = useState(0); + const [firstRef] = useState(ref); + + if (firstRef !== ref) { + throw new Error('should never change'); + } + + if (count < 3) { + setCount(count + 1); + } + + return ; + } + + ReactNoop.render(); + expect(Scheduler).toFlushAndYield([3]); + + ReactNoop.render(); + expect(Scheduler).toFlushAndYield([3]); + }); + + if (__DEV__) { + it('should never warn when attaching to children', () => { + class Component extends React.Component { + render() { + return null; + } + } + + function Example({phase}) { + const hostRef = useRef(); + const classRef = useRef(); + return ( + <> +
+ + + ); + } + + act(() => { + ReactNoop.render(); + }); + act(() => { + ReactNoop.render(); + }); + }); + + // @gate enableUseRefAccessWarning + it('should warn about reads during render', () => { + function Example() { + const ref = useRef(123); + let value; + expect(() => { + value = ref.current; + }).toWarnDev([ + 'Example: Unsafe read of a mutable value during render.', + ]); + return value; + } + + act(() => { + ReactNoop.render(); + }); + }); + + it('should not warn about lazy init during render', () => { + function Example() { + const ref1 = useRef(null); + const ref2 = useRef(undefined); + // Read: safe because lazy init: + if (ref1.current === null) { + ref1.current = 123; + } + if (ref2.current === undefined) { + ref2.current = 123; + } + return null; + } + + act(() => { + ReactNoop.render(); + }); + + // Should not warn after an update either. + act(() => { + ReactNoop.render(); + }); + }); + + it('should not warn about lazy init outside of render', () => { + function Example() { + // eslint-disable-next-line no-unused-vars + const [didMount, setDidMount] = useState(false); + const ref1 = useRef(null); + const ref2 = useRef(undefined); + useLayoutEffect(() => { + ref1.current = 123; + ref2.current = 123; + setDidMount(true); + }, []); + return null; + } + + act(() => { + ReactNoop.render(); + }); + }); + + // @gate enableUseRefAccessWarning + it('should warn about unconditional lazy init during render', () => { + function Example() { + const ref1 = useRef(null); + const ref2 = useRef(undefined); + + if (shouldExpectWarning) { + expect(() => { + ref1.current = 123; + }).toWarnDev([ + 'Example: Unsafe write of a mutable value during render', + ]); + expect(() => { + ref2.current = 123; + }).toWarnDev([ + 'Example: Unsafe write of a mutable value during render', + ]); + } else { + ref1.current = 123; + ref1.current = 123; + } + + // But only warn once + ref1.current = 345; + ref1.current = 345; + + return null; + } + + let shouldExpectWarning = true; + act(() => { + ReactNoop.render(); + }); + + // Should not warn again on update. + shouldExpectWarning = false; + act(() => { + ReactNoop.render(); + }); + }); + + // @gate enableUseRefAccessWarning + it('should warn about reads to ref after lazy init pattern', () => { + function Example() { + const ref1 = useRef(null); + const ref2 = useRef(undefined); + + // Read 1: safe because lazy init: + if (ref1.current === null) { + ref1.current = 123; + } + if (ref2.current === undefined) { + ref2.current = 123; + } + + let value; + expect(() => { + value = ref1.current; + }).toWarnDev(['Example: Unsafe read of a mutable value during render']); + expect(() => { + value = ref2.current; + }).toWarnDev(['Example: Unsafe read of a mutable value during render']); + + // But it should only warn once. + value = ref1.current; + value = ref2.current; + + return value; + } + + act(() => { + ReactNoop.render(); + }); + }); + + // @gate enableUseRefAccessWarning + it('should warn about writes to ref after lazy init pattern', () => { + function Example() { + const ref1 = useRef(null); + const ref2 = useRef(undefined); + // Read: safe because lazy init: + if (ref1.current === null) { + ref1.current = 123; + } + if (ref2.current === undefined) { + ref2.current = 123; + } + + expect(() => { + ref1.current = 456; + }).toWarnDev([ + 'Example: Unsafe write of a mutable value during render', + ]); + expect(() => { + ref2.current = 456; + }).toWarnDev([ + 'Example: Unsafe write of a mutable value during render', + ]); + + return null; + } + + act(() => { + ReactNoop.render(); + }); + }); + + it('should not warn about reads or writes within effect', () => { + function Example() { + const ref = useRef(123); + useLayoutEffect(() => { + expect(ref.current).toBe(123); + ref.current = 456; + expect(ref.current).toBe(456); + }, []); + useEffect(() => { + expect(ref.current).toBe(456); + ref.current = 789; + expect(ref.current).toBe(789); + }, []); + return null; + } + + act(() => { + ReactNoop.render(); + }); + + ReactNoop.flushPassiveEffects(); + }); + + it('should not warn about reads or writes outside of render phase (e.g. event handler)', () => { + let ref; + function Example() { + ref = useRef(123); + return null; + } + + act(() => { + ReactNoop.render(); + }); + + expect(ref.current).toBe(123); + ref.current = 456; + expect(ref.current).toBe(456); + }); + } +}); diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js index 836b78524ef9..dbf9f5bd2853 100644 --- a/packages/shared/ReactFeatureFlags.js +++ b/packages/shared/ReactFeatureFlags.js @@ -134,3 +134,5 @@ export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; export const enableDoubleInvokingEffects = false; + +export const enableUseRefAccessWarning = false; diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb.js b/packages/shared/forks/ReactFeatureFlags.native-fb.js index 82e8d4dcd7ba..0df33470e570 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-fb.js +++ b/packages/shared/forks/ReactFeatureFlags.native-fb.js @@ -51,6 +51,7 @@ export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; export const enableDoubleInvokingEffects = false; +export const enableUseRefAccessWarning = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.native-oss.js b/packages/shared/forks/ReactFeatureFlags.native-oss.js index 7a793d16ab33..77148d9be29b 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-oss.js +++ b/packages/shared/forks/ReactFeatureFlags.native-oss.js @@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; export const enableDoubleInvokingEffects = false; +export const enableUseRefAccessWarning = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.js index 4402523c5410..7e66eb9e75e5 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.js @@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; export const enableDoubleInvokingEffects = false; +export const enableUseRefAccessWarning = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js index a71ad45dbd46..90c4360c6d46 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js @@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; export const enableDoubleInvokingEffects = false; +export const enableUseRefAccessWarning = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js index c60072346eab..4dbd671409e3 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js @@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; export const enableDoubleInvokingEffects = false; +export const enableUseRefAccessWarning = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.testing.js b/packages/shared/forks/ReactFeatureFlags.testing.js index 90c1fa268b25..c98063376f09 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.js @@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = false; export const enableDoubleInvokingEffects = false; +export const enableUseRefAccessWarning = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.testing.www.js b/packages/shared/forks/ReactFeatureFlags.testing.www.js index 717199df1d53..362569dfb01b 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.www.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.www.js @@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false; export const enableDiscreteEventFlushingChange = true; export const enableDoubleInvokingEffects = false; +export const enableUseRefAccessWarning = false; // Flow magic to verify the exports of this file match the original version. // eslint-disable-next-line no-unused-vars diff --git a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js index 103e8adc5c72..d03ba3eadd41 100644 --- a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js +++ b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js @@ -48,3 +48,4 @@ export const enableTrustedTypesIntegration = false; export const disableSchedulerTimeoutBasedOnReactExpirationTime = false; export const enableDoubleInvokingEffects = false; +export const enableUseRefAccessWarning = __VARIANT__; diff --git a/packages/shared/forks/ReactFeatureFlags.www.js b/packages/shared/forks/ReactFeatureFlags.www.js index 58d6987495f9..f5861a2e336a 100644 --- a/packages/shared/forks/ReactFeatureFlags.www.js +++ b/packages/shared/forks/ReactFeatureFlags.www.js @@ -28,6 +28,7 @@ export const { enableDebugTracing, skipUnmountedBoundaries, enableDoubleInvokingEffects, + enableUseRefAccessWarning, } = dynamicFeatureFlags; // On WWW, __EXPERIMENTAL__ is used for a new modern build. From d1bb4d851f4956cb64ad0ae1867153c23409f971 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 20 Oct 2020 14:35:57 -0400 Subject: [PATCH 0032/1603] Profiler: Include ref callbacks in onCommit duration (#20060) --- .../src/ReactFiberCommitWork.new.js | 58 +++++++++++++++++-- .../src/ReactFiberCommitWork.old.js | 58 +++++++++++++++++-- .../__tests__/ReactProfiler-test.internal.js | 55 ++++++++++++++++++ 3 files changed, 163 insertions(+), 8 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.new.js b/packages/react-reconciler/src/ReactFiberCommitWork.new.js index 687e62de976c..3664803f2043 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.new.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.new.js @@ -194,14 +194,38 @@ function safelyDetachRef(current: Fiber, nearestMountedAncestor: Fiber) { if (ref !== null) { if (typeof ref === 'function') { if (__DEV__) { - invokeGuardedCallback(null, ref, null, null); + if ( + enableProfilerTimer && + enableProfilerCommitHooks && + current.mode & ProfileMode + ) { + startLayoutEffectTimer(); + invokeGuardedCallback(null, ref, null, null); + recordLayoutEffectDuration(current); + } else { + invokeGuardedCallback(null, ref, null, null); + } + if (hasCaughtError()) { const refError = clearCaughtError(); captureCommitPhaseError(current, nearestMountedAncestor, refError); } } else { try { - ref(null); + if ( + enableProfilerTimer && + enableProfilerCommitHooks && + current.mode & ProfileMode + ) { + try { + startLayoutEffectTimer(); + ref(null); + } finally { + recordLayoutEffectDuration(current); + } + } else { + ref(null); + } } catch (refError) { captureCommitPhaseError(current, nearestMountedAncestor, refError); } @@ -965,7 +989,20 @@ function commitAttachRef(finishedWork: Fiber) { instanceToUse = instance; } if (typeof ref === 'function') { - ref(instanceToUse); + if ( + enableProfilerTimer && + enableProfilerCommitHooks && + finishedWork.mode & ProfileMode + ) { + try { + startLayoutEffectTimer(); + ref(instanceToUse); + } finally { + recordLayoutEffectDuration(finishedWork); + } + } else { + ref(instanceToUse); + } } else { if (__DEV__) { if (!ref.hasOwnProperty('current')) { @@ -986,7 +1023,20 @@ function commitDetachRef(current: Fiber) { const currentRef = current.ref; if (currentRef !== null) { if (typeof currentRef === 'function') { - currentRef(null); + if ( + enableProfilerTimer && + enableProfilerCommitHooks && + current.mode & ProfileMode + ) { + try { + startLayoutEffectTimer(); + currentRef(null); + } finally { + recordLayoutEffectDuration(current); + } + } else { + currentRef(null); + } } else { currentRef.current = null; } diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.old.js b/packages/react-reconciler/src/ReactFiberCommitWork.old.js index e094e5bd9b5a..84ff06fe7f99 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.old.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.old.js @@ -180,14 +180,38 @@ function safelyDetachRef(current: Fiber) { if (ref !== null) { if (typeof ref === 'function') { if (__DEV__) { - invokeGuardedCallback(null, ref, null, null); + if ( + enableProfilerTimer && + enableProfilerCommitHooks && + current.mode & ProfileMode + ) { + startLayoutEffectTimer(); + invokeGuardedCallback(null, ref, null, null); + recordLayoutEffectDuration(current); + } else { + invokeGuardedCallback(null, ref, null, null); + } + if (hasCaughtError()) { const refError = clearCaughtError(); captureCommitPhaseError(current, refError); } } else { try { - ref(null); + if ( + enableProfilerTimer && + enableProfilerCommitHooks && + current.mode & ProfileMode + ) { + try { + startLayoutEffectTimer(); + ref(null); + } finally { + recordLayoutEffectDuration(current); + } + } else { + ref(null); + } } catch (refError) { captureCommitPhaseError(current, refError); } @@ -832,7 +856,20 @@ function commitAttachRef(finishedWork: Fiber) { instanceToUse = instance; } if (typeof ref === 'function') { - ref(instanceToUse); + if ( + enableProfilerTimer && + enableProfilerCommitHooks && + finishedWork.mode & ProfileMode + ) { + try { + startLayoutEffectTimer(); + ref(instanceToUse); + } finally { + recordLayoutEffectDuration(finishedWork); + } + } else { + ref(instanceToUse); + } } else { if (__DEV__) { if (!ref.hasOwnProperty('current')) { @@ -853,7 +890,20 @@ function commitDetachRef(current: Fiber) { const currentRef = current.ref; if (currentRef !== null) { if (typeof currentRef === 'function') { - currentRef(null); + if ( + enableProfilerTimer && + enableProfilerCommitHooks && + current.mode & ProfileMode + ) { + try { + startLayoutEffectTimer(); + currentRef(null); + } finally { + recordLayoutEffectDuration(current); + } + } else { + currentRef(null); + } } else { currentRef.current = null; } diff --git a/packages/react/src/__tests__/ReactProfiler-test.internal.js b/packages/react/src/__tests__/ReactProfiler-test.internal.js index 180eb81b964b..73812de49a3b 100644 --- a/packages/react/src/__tests__/ReactProfiler-test.internal.js +++ b/packages/react/src/__tests__/ReactProfiler-test.internal.js @@ -1491,6 +1491,61 @@ describe('Profiler', () => { expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events }); + it('should include time spent in ref callbacks', () => { + const callback = jest.fn(); + + const refSetter = ref => { + if (ref !== null) { + Scheduler.unstable_advanceTime(10); + } else { + Scheduler.unstable_advanceTime(100); + } + }; + + class ClassComponent extends React.Component { + render() { + return null; + } + } + + const Component = () => { + Scheduler.unstable_advanceTime(1000); + return ; + }; + + Scheduler.unstable_advanceTime(1); + + const renderer = ReactTestRenderer.create( + + + , + ); + + expect(callback).toHaveBeenCalledTimes(1); + + let call = callback.mock.calls[0]; + + expect(call).toHaveLength(enableSchedulerTracing ? 5 : 4); + expect(call[0]).toBe('root'); + expect(call[1]).toBe('mount'); + expect(call[2]).toBe(10); // durations + expect(call[3]).toBe(1001); // commit start time (before mutations or effects) + + callback.mockClear(); + + renderer.update(); + + expect(callback).toHaveBeenCalledTimes(1); + + call = callback.mock.calls[0]; + + expect(call).toHaveLength(enableSchedulerTracing ? 5 : 4); + expect(call[0]).toBe('root'); + expect(call[1]).toBe('update'); + expect(call[2]).toBe(100); // durations + expect(call[3]).toBe(1011); // commit start time (before mutations or effects) + }); + it('should bubble time spent in layout effects to higher profilers', () => { const callback = jest.fn(); From 46ed2684718d160b06cf6e4f5f5ecf70c7b8974c Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 20 Oct 2020 21:22:00 +0100 Subject: [PATCH 0033/1603] Add React 17 changelog --- CHANGELOG.md | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa0dedf6714d..cb0704775977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,88 @@ +## 17.0.0 (October 20, 2020) + +### React + +* Add `react/jsx-runtime` and `react/jsx-dev-runtime` for the [new JSX transform](https://babeljs.io/blog/2020/03/16/7.9.0#a-new-jsx-transform-11154-https-githubcom-babel-babel-pull-11154). ([@lunaruan](https://github.com/lunaruan) in [#18299](https://github.com/facebook/react/pull/18299)) +* Build component stacks from native error frames. ([@sebmarkbage](https://github.com/sebmarkbage) in [#18561](https://github.com/facebook/react/pull/18561)) +* Allow to specify `displayName` on context for improved stacks. ([@eps1lon](https://github.com/eps1lon) in [#18224](https://github.com/facebook/react/pull/18224)) +* Prevent `'use strict'` from leaking in the UMD bundles. ([@koba04](https://github.com/koba04) in [#19614](https://github.com/facebook/react/pull/19614)) +* Stop using `fb.me` for redirects. ([@cylim](https://github.com/cylim) in [#19598](https://github.com/facebook/react/pull/19598)) + +### React DOM + +* Delegate events to roots instead of `document`. ([@trueadm](https://github.com/trueadm) in [#18195](https://github.com/facebook/react/pull/18195) and [others](https://github.com/facebook/react/pulls?q=is%3Apr+author%3Atrueadm+modern+event+is%3Amerged)) +* Clean up all effects before running any next effects. ([@bvaughn](https://github.com/bvaughn) in [#17947](https://github.com/facebook/react/pull/17947)) +* Run `useEffect` cleanup functions asynchronously. ([@bvaughn](https://github.com/bvaughn) in [#17925](https://github.com/facebook/react/pull/17925)) +* Use browser `focusin` and `focusout` for `onFocus` and `onBlur`. ([@trueadm](https://github.com/trueadm) in [#19186](https://github.com/facebook/react/pull/19186)) +* Make all `Capture` events use the browser capture phase. ([@trueadm](https://github.com/trueadm) in [#19221](https://github.com/facebook/react/pull/19221)) +* Don't emulate bubbling of the `onScroll` event. ([@gaearon](https://github.com/gaearon) in [#19464](https://github.com/facebook/react/pull/19464)) +* Throw if `forwardRef` or `memo` component returns `undefined`. ([@gaearon](https://github.com/gaearon) in [#19550](https://github.com/facebook/react/pull/19550)) +* Remove event pooling. ([@trueadm](https://github.com/trueadm) in [#18969](https://github.com/facebook/react/pull/18969)) +* Stop exposing internals that won’t be needed by React Native Web. ([@necolas](https://github.com/necolas) in [#18483](https://github.com/facebook/react/pull/18483)) +* Attach all known event listeners when the root mounts. ([@gaearon](https://github.com/gaearon) in [#19659](https://github.com/facebook/react/pull/19659)) +* Disable `console` in the second render pass of DEV mode double render. ([@sebmarkbage](https://github.com/sebmarkbage) in [#18547](https://github.com/facebook/react/pull/18547)) +* Deprecate the undocumented and misleading `ReactTestUtils.SimulateNative` API. ([@gaearon](https://github.com/gaearon) in [#13407](https://github.com/facebook/react/pull/13407)) +* Rename private field names used in the internals. ([@gaearon](https://github.com/gaearon) in [#18377](https://github.com/facebook/react/pull/18377)) +* Don't call User Timing API in development. ([@gaearon](https://github.com/gaearon) in [#18417](https://github.com/facebook/react/pull/18417)) +* Disable console during the repeated render in Strict Mode. ([@sebmarkbage](https://github.com/sebmarkbage) in [#18547](https://github.com/facebook/react/pull/18547)) +* In Strict Mode, double-render components without Hooks too. ([@eps1lon](https://github.com/eps1lon) in [#18430](https://github.com/facebook/react/pull/18430)) +* Allow calling `ReactDOM.flushSync` during lifecycle methods (but warn). ([@sebmarkbage](https://github.com/sebmarkbage) in [#18759](https://github.com/facebook/react/pull/18759)) +* Add the `code` property to the keyboard event objects. ([@bl00mber](https://github.com/bl00mber) in [#18287](https://github.com/facebook/react/pull/18287)) +* Add the `disableRemotePlayback` property for `video` elements. ([@tombrowndev](https://github.com/tombrowndev) in [#18619](https://github.com/facebook/react/pull/18619)) +* Add the `enterKeyHint` property for `input` elements. ([@eps1lon](https://github.com/eps1lon) in [#18634](https://github.com/facebook/react/pull/18634)) +* Warn when no `value` is provided to ``. ([@charlie1404](https://github.com/charlie1404) in [#19054](https://github.com/facebook/react/pull/19054)) +* Warn when `memo` or `forwardRef` components return `undefined`. ([@bvaughn](https://github.com/bvaughn) in [#19550](https://github.com/facebook/react/pull/19550)) +* Improve the error message for invalid updates. ([@JoviDeCroock](https://github.com/JoviDeCroock) in [#18316](https://github.com/facebook/react/pull/18316)) +* Exclude forwardRef and memo from stack frames. ([@sebmarkbage](https://github.com/sebmarkbage) in [#18559](https://github.com/facebook/react/pull/18559)) +* Improve the error message when switching between controlled and uncontrolled inputs. ([@vcarl](https://github.com/vcarl) in [#17070](https://github.com/facebook/react/pull/17070)) +* Keep `onTouchStart`, `onTouchMove`, and `onWheel` passive. ([@gaearon](https://github.com/gaearon) in [#19654](https://github.com/facebook/react/pull/19654)) +* Fix `setState` hanging in development inside a closed iframe. ([@gaearon](https://github.com/gaearon) in [#19220](https://github.com/facebook/react/pull/19220)) +* Fix rendering bailout for lazy components with `defaultProps`. ([@jddxf](https://github.com/jddxf) in [#18539](https://github.com/facebook/react/pull/18539)) +* Fix a false positive warning when `dangerouslySetInnerHTML` is `undefined`. ([@eps1lon](https://github.com/eps1lon) in [#18676](https://github.com/facebook/react/pull/18676)) +* Fix Test Utils with non-standard `require` implementation. ([@just-boris](https://github.com/just-boris) in [#18632](https://github.com/facebook/react/pull/18632)) +* Fix `onBeforeInput` reporting an incorrect `event.type`. ([@eps1lon](https://github.com/eps1lon) in [#19561](https://github.com/facebook/react/pull/19561)) +* Fix `event.relatedTarget` reported as `undefined` in Firefox. ([@claytercek](https://github.com/claytercek) in [#19607](https://github.com/facebook/react/pull/19607)) +* Fix "unspecified error" in IE11. ([@hemakshis](https://github.com/hemakshis) in [#19664](https://github.com/facebook/react/pull/19664)) +* Fix rendering into a shadow root. ([@Jack-Works](https://github.com/Jack-Works) in [#15894](https://github.com/facebook/react/pull/15894)) +* Fix `movementX/Y` polyfill with capture events. ([@gaearon](https://github.com/gaearon) in [#19672](https://github.com/facebook/react/pull/19672)) +* Use delegation for `onSubmit` and `onReset` events. ([@gaearon](https://github.com/gaearon) in [#19333](https://github.com/facebook/react/pull/19333)) +* Improve memory usage. ([@trueadm](https://github.com/trueadm) in [#18970](https://github.com/facebook/react/pull/18970)) + +### React DOM Server + +* Make `useCallback` behavior consistent with `useMemo` for the server renderer. ([@alexmckenley](https://github.com/alexmckenley) in [#18783](https://github.com/facebook/react/pull/18783)) +* Fix state leaking when a function component throws. ([@pmaccart](https://github.com/pmaccart) in [#19212](https://github.com/facebook/react/pull/19212)) + +### React Test Renderer + +* Improve `findByType` error message. ([@henryqdineen](https://github.com/henryqdineen) in [#17439](https://github.com/facebook/react/pull/17439)) + +### Concurrent Mode (Experimental) + +* Revamp the priority batching heuristics. ([@acdlite](https://github.com/acdlite) in [#18796](https://github.com/facebook/react/pull/18796)) +* Add the `unstable_` prefix before the experimental APIs. ([@acdlite](https://github.com/acdlite) in [#18825](https://github.com/facebook/react/pull/18825)) +* Remove `unstable_discreteUpdates` and `unstable_flushDiscreteUpdates`. ([@trueadm](https://github.com/trueadm) in [#18825](https://github.com/facebook/react/pull/18825)) +* Remove the `timeoutMs` argument. ([@acdlite](https://github.com/acdlite) in [#19703](https://github.com/facebook/react/pull/19703)) +* Disable `