From bead342b516bc714276a13c62e2f388f450c8424 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Thu, 17 Jan 2019 14:54:15 +0000 Subject: [PATCH 01/62] Adds Babel plugin babel-plugin-optimize-react --- packages/babel-plugin-optimize-react/LICENSE | 21 ++ .../babel-plugin-optimize-react/README.md | 58 ++++ .../__snapshots__/createElement-test.js.snap | 30 ++ .../__snapshots__/hooks-test.js.snap | 102 +++++++ .../__tests__/createElement-test.js | 50 ++++ .../__tests__/hooks-test.js | 116 ++++++++ packages/babel-plugin-optimize-react/index.js | 277 ++++++++++++++++++ .../babel-plugin-optimize-react/package.json | 24 ++ 8 files changed, 678 insertions(+) create mode 100644 packages/babel-plugin-optimize-react/LICENSE create mode 100644 packages/babel-plugin-optimize-react/README.md create mode 100644 packages/babel-plugin-optimize-react/__tests__/__snapshots__/createElement-test.js.snap create mode 100644 packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap create mode 100644 packages/babel-plugin-optimize-react/__tests__/createElement-test.js create mode 100644 packages/babel-plugin-optimize-react/__tests__/hooks-test.js create mode 100644 packages/babel-plugin-optimize-react/index.js create mode 100644 packages/babel-plugin-optimize-react/package.json diff --git a/packages/babel-plugin-optimize-react/LICENSE b/packages/babel-plugin-optimize-react/LICENSE new file mode 100644 index 00000000000..188fb2b0bd8 --- /dev/null +++ b/packages/babel-plugin-optimize-react/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013-present, Facebook, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/babel-plugin-optimize-react/README.md b/packages/babel-plugin-optimize-react/README.md new file mode 100644 index 00000000000..dd08f9fdc63 --- /dev/null +++ b/packages/babel-plugin-optimize-react/README.md @@ -0,0 +1,58 @@ +# babel-plugin-optimize-react-hooks + +This Babel 7 plugin optimizes React hooks by transforming common patterns into more effecient output when using with tools such as [Create React App](https://github.com/facebook/create-react-app). For example, with this plugin the following output is optimized as shown: + +```js +// Original +var _useState = Object(react__WEBPACK_IMPORTED_MODULE_1_["useState"])(Math.random()), + _State2 = Object(_Users_gaearon_p_create_rreact_app_node_modules_babel_runtime_helpers_esm_sliceToArray_WEBPACK_IMPORTED_MODULE_0__["default"])(_useState, 1), + value = _useState2[0]; + +// With this plugin +var useState = react__WEBPACK_IMPORTED_MODULE_1_.useState; +var __ref__0 = useState(Math.random()); +var value = __ref__0[0]; +``` + +## Named imports to hooks get transformed + +```js +// Original +import React, {useState} from 'react'; + +// With this plugin +import React from 'react'; +const {useState} = React; +``` + +## Array destructuring transform for React's built-in hooks + +```js +// Original +const [counter, setCounter] = useState(0); + +// With this plugin +const __ref__0 = useState(0); +const counter = __ref__0[0]; +const setCounter = __ref__0[1]; +``` + +## React.createElement becomes a hoisted constant + +```js +// Original +import React from 'react'; + +function MyComponent() { + return React.createElement('div', null, 'Hello world'); +} + +// With this plugin +import React from 'react'; +const __reactCreateElement__ = React.createElement; + +function MyComponent() { + return __reactCreateElement__('div', null, 'Hello world'); +} +``` + diff --git a/packages/babel-plugin-optimize-react/__tests__/__snapshots__/createElement-test.js.snap b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/createElement-test.js.snap new file mode 100644 index 00000000000..60d3cd3c6b2 --- /dev/null +++ b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/createElement-test.js.snap @@ -0,0 +1,30 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`React createElement transforms should transform React.createElement calls #2 1`] = ` +"const React = require(\\"react\\"); + +const __reactCreateElement__ = React.createElement; +export function MyComponent() { + return __reactCreateElement__(\\"div\\", null, __reactCreateElement__(\\"span\\", null, \\"Hello world!\\")); +}" +`; + +exports[`React createElement transforms should transform React.createElement calls #3 1`] = ` +"const React = require(\\"react\\"); + +const __reactCreateElement__ = React.createElement; + +const node = __reactCreateElement__(\\"div\\", null, __reactCreateElement__(\\"span\\", null, \\"Hello world!\\")); + +export function MyComponent() { + return node; +}" +`; + +exports[`React createElement transforms should transform React.createElement calls 1`] = ` +"import React from \\"react\\"; +const __reactCreateElement__ = React.createElement; +export function MyComponent() { + return __reactCreateElement__(\\"div\\"); +}" +`; diff --git a/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap new file mode 100644 index 00000000000..9378ef695b1 --- /dev/null +++ b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Babel plugin optimize React hooks should support destructuring hooks from imports #2 1`] = ` +"import React from \\"react\\"; +const __reactCreateElement__ = React.createElement; +const { + useState +} = React; +export function MyComponent() { + const _ref_0 = useState(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`Babel plugin optimize React hooks should support destructuring hooks from imports #3 1`] = ` +"import React from \\"react\\"; +const __reactCreateElement__ = React.createElement; +const useState = React.useState; +export function MyComponent() { + const _ref_0 = useState(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`Babel plugin optimize React hooks should support destructuring hooks from imports #4 1`] = ` +"import React from \\"react\\"; +const __reactCreateElement__ = React.createElement; +const foo = React.useState; +export function MyComponent() { + const _ref_0 = foo(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`Babel plugin optimize React hooks should support destructuring hooks from imports #5 1`] = ` +"import React from \\"react\\"; +const __reactCreateElement__ = React.createElement; +const { + useState: foo +} = React; +export function MyComponent() { + const _ref_0 = foo(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`Babel plugin optimize React hooks should support destructuring hooks from imports 1`] = ` +"import React from \\"react\\"; +const __reactCreateElement__ = React.createElement; +const { + useState +} = React; +export function MyComponent() { + const _ref_0 = useState(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`Babel plugin optimize React hooks should support destructuring hooks from require calls 1`] = ` +"const React = require(\\"react\\"); + +const __reactCreateElement__ = React.createElement; +const { + useState +} = React; +export function MyComponent() { + const _ref_0 = useState(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`Babel plugin optimize React hooks should support transform hook imports 1`] = ` +"import React from \\"react\\"; +const { + useState +} = React;" +`; + +exports[`Babel plugin optimize React hooks should support transform hook imports with aliasing 1`] = ` +"import React from \\"react\\"; +const { + useState: foo +} = React;" +`; diff --git a/packages/babel-plugin-optimize-react/__tests__/createElement-test.js b/packages/babel-plugin-optimize-react/__tests__/createElement-test.js new file mode 100644 index 00000000000..b2c388834a3 --- /dev/null +++ b/packages/babel-plugin-optimize-react/__tests__/createElement-test.js @@ -0,0 +1,50 @@ +'use strict'; + +const plugin = require('../index.js'); +const babel = require('@babel/core'); + +function transform(code) { + return babel.transform(code, { + plugins: [plugin], + }).code; +} + +describe('React createElement transforms', () => { + it('should transform React.createElement calls', () => { + const test = ` + import React from "react"; + + export function MyComponent() { + return React.createElement("div"); + } + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); + + it('should transform React.createElement calls #2', () => { + const test = ` + const React = require("react"); + + export function MyComponent() { + return React.createElement("div", null, React.createElement("span", null, "Hello world!")); + } + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); + + it('should transform React.createElement calls #3', () => { + const test = ` + const React = require("react"); + + const node = React.createElement("div", null, React.createElement("span", null, "Hello world!")); + + export function MyComponent() { + return node; + } + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); +}); diff --git a/packages/babel-plugin-optimize-react/__tests__/hooks-test.js b/packages/babel-plugin-optimize-react/__tests__/hooks-test.js new file mode 100644 index 00000000000..96f8d639bbd --- /dev/null +++ b/packages/babel-plugin-optimize-react/__tests__/hooks-test.js @@ -0,0 +1,116 @@ +'use strict'; + +const plugin = require('../index.js'); +const babel = require('@babel/core'); + +function transform(code) { + return babel.transform(code, { + plugins: [plugin], + }).code; +} + +describe('Babel plugin optimize React hooks', () => { + it('should support transform hook imports', () => { + const test = ` + import React, {useState} from "react"; + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); + + it('should support transform hook imports with aliasing', () => { + const test = ` + import React, {useState as foo} from "react"; + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); + + it('should support destructuring hooks from imports', () => { + const test = ` + import React, {useState} from "react"; + + export function MyComponent() { + const [counter, setCounter] = useState(0); + + return React.createElement("div", null, counter); + } + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); + + it('should support destructuring hooks from imports #2', () => { + const test = ` + import React from "react"; + const {useState} = React; + + export function MyComponent() { + const [counter, setCounter] = useState(0); + + return React.createElement("div", null, counter); + } + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); + + it('should support destructuring hooks from imports #3', () => { + const test = ` + import React from "react"; + const useState = React.useState; + + export function MyComponent() { + const [counter, setCounter] = useState(0); + + return React.createElement("div", null, counter); + } + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); + + it('should support destructuring hooks from imports #4', () => { + const test = ` + import React from "react"; + const foo = React.useState; + + export function MyComponent() { + const [counter, setCounter] = foo(0); + + return React.createElement("div", null, counter); + } + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); + + it('should support destructuring hooks from imports #5', () => { + const test = ` + import React, {useState as foo} from "react"; + + export function MyComponent() { + const [counter, setCounter] = foo(0); + + return React.createElement("div", null, counter); + } + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); + + it('should support destructuring hooks from require calls', () => { + const test = ` + const React = require("react"); + const {useState} = React; + + export function MyComponent() { + const [counter, setCounter] = useState(0); + + return React.createElement("div", null, counter); + } + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); +}); diff --git a/packages/babel-plugin-optimize-react/index.js b/packages/babel-plugin-optimize-react/index.js new file mode 100644 index 00000000000..20e7d2235b1 --- /dev/null +++ b/packages/babel-plugin-optimize-react/index.js @@ -0,0 +1,277 @@ +'use strict'; + +const reactHooks = new Set([ + 'useCallback', + 'useContext', + 'useDebugValue', + 'useEffect', + 'useImperativeHandle', + 'useLayoutEffect', + 'useMemo', + 'useReducer', + 'useRef', + 'useState', +]); + +module.exports = function(babel) { + const { types: t } = babel; + + // Collects named imports of React hooks from the "react" package + function collectReactHooksAndRemoveTheirNamedImports(path) { + const node = path.node; + const hooks = []; + if (t.isStringLiteral(node.source) && node.source.value === 'react') { + const specifiers = path.get('specifiers'); + + for (let specifier of specifiers) { + if (t.isImportSpecifier(specifier)) { + const importedNode = specifier.node.imported; + const localNode = specifier.node.local; + + if (t.isIdentifier(importedNode) && t.isIdentifier(localNode)) { + if (reactHooks.has(importedNode.name)) { + hooks.push({ + imported: importedNode.name, + local: localNode.name, + }); + specifier.remove(); + } + } + } + } + } + return hooks; + } + + function isReactImport(path) { + if (t.isIdentifier(path)) { + const identifierName = path.node.name; + const binding = path.scope.getBinding(identifierName); + + if (binding !== undefined) { + const bindingPath = binding.path; + + if (t.isImportDefaultSpecifier(bindingPath)) { + const parentPath = bindingPath.parentPath; + + if ( + t.isImportDeclaration(parentPath) && + t.isStringLiteral(parentPath.node.source) && + parentPath.node.source.value === 'react' + ) { + return true; + } + } else if (t.isVariableDeclarator(bindingPath)) { + const init = bindingPath.get('init'); + + if ( + t.isCallExpression(init) && + t.isIdentifier(init.node.callee) && + init.node.callee.name === 'require' && + init.node.arguments.length === 1 && + t.isStringLiteral(init.node.arguments[0]) && + init.node.arguments[0].value === 'react' + ) { + return true; + } + } + } + } + return false; + } + + function isReferencingReactHook(path) { + if (t.isIdentifier(path)) { + const identifierName = path.node.name; + const binding = path.scope.getBinding(identifierName); + + if (binding !== undefined) { + const bindingPath = binding.path; + + if (t.isVariableDeclarator(bindingPath)) { + const init = bindingPath.get('init'); + const bindingId = binding.identifier; + + if (t.isIdentifier(init) && isReactImport(init)) { + if (reactHooks.has(bindingId.name)) { + return true; + } + const id = bindingPath.get('id'); + + if (t.isObjectPattern(id)) { + const properties = id.get('properties'); + + for (let property of properties) { + if ( + t.isObjectProperty(property) && + property.node.value === bindingId && + t.isIdentifier(property.node.key) && + reactHooks.has(property.node.key.name) + ) { + return true; + } + } + } + } else if (t.isMemberExpression(init)) { + const object = init.get('object'); + const property = init.get('property'); + + if ( + isReactImport(object) && + t.isIdentifier(property) && + reactHooks.has(property.node.name) + ) { + return true; + } + } + } + } + } + return false; + } + + function isUsingDestructuredArray(path) { + const parentPath = path.parentPath; + + if (t.isVariableDeclarator(parentPath)) { + const id = parentPath.get('id'); + return t.isArrayPattern(id); + } + return false; + } + + function isCreateReactElementCall(path) { + if (t.isCallExpression(path)) { + const callee = path.get('callee'); + + if (t.isMemberExpression(callee)) { + const object = callee.get('object'); + const property = callee.get('property'); + + if ( + isReactImport(object) && + t.isIdentifier(property) && + property.node.name === 'createElement' + ) { + return true; + } + } + } + } + + function createConstantCreateElementReference(reactReferencePath) { + const identifierName = reactReferencePath.node.name; + const binding = reactReferencePath.scope.getBinding(identifierName); + const createElementReference = t.identifier('__reactCreateElement__'); + const createElementDeclaration = t.variableDeclaration('const', [ + t.variableDeclarator( + createElementReference, + t.memberExpression(t.identifier('React'), t.identifier('createElement')) + ), + ]); + const bindingPath = binding.path; + + if (t.isImportDefaultSpecifier(bindingPath) || t.isVariableDeclarator(bindingPath)) { + bindingPath.parentPath.insertAfter(createElementDeclaration); + // Make sure we declare our new now so scope tracking continues to work + const reactElementDeclarationPath = bindingPath.parentPath.getNextSibling(); + reactReferencePath.scope.registerDeclaration(reactElementDeclarationPath); + } + return createElementReference; + } + + return { + name: 'babel-plugin-optimize-react', + visitor: { + ImportDeclaration(path) { + // Collect all hooks that are named imports from the React package. i.e.: + // import React, {useState} from "react"; + // As we collection them, we also remove the imports from the declaration. + + const importedHooks = collectReactHooksAndRemoveTheirNamedImports(path); + if (importedHooks.length > 0) { + // Create a destructured variable declaration. i.e.: + // const {useEffect, useState} = React; + // Then insert it below the import declaration node. + + const declarations = t.variableDeclarator( + t.objectPattern( + importedHooks.map(({ imported, local }) => + t.objectProperty( + t.identifier(imported), + t.identifier(local), + false, + imported === local + ) + ) + ), + t.identifier('React') + ); + const hookDeclarationNode = t.variableDeclaration('const', [ + declarations, + ]); + path.insertAfter(hookDeclarationNode); + // Make sure we declare our new now so scope tracking continues to work + const hookDeclarationPath = path.getNextSibling(); + path.scope.registerDeclaration(hookDeclarationPath); + } + }, + CallExpression(path, state) { + if (state.destructuredCounter === undefined) { + state.destructuredCounter = 0; + } + const calleePath = path.get('callee'); + + // Ensure we found a primitive React hook that is using a destructuring array pattern + if ( + isUsingDestructuredArray(path) && + isReferencingReactHook(calleePath) + ) { + const parentPath = path.parentPath; + + if (t.isVariableDeclarator(parentPath)) { + const id = parentPath.get('id'); + const elements = id.get('elements'); + const kind = parentPath.parentPath.node.kind; + // Replace the array destructure pattern with a reference node. + + const referenceNode = t.identifier( + '_ref_' + state.destructuredCounter++ + ); + id.replaceWith(referenceNode); + // Now insert references to the reference node, i.e.: + // const counter = __ref__[0]; + + let arrayIndex = 0; + for (let element of elements) { + const arrayAccessNode = t.variableDeclaration(kind, [ + t.variableDeclarator( + element.node, + t.memberExpression( + referenceNode, + t.numericLiteral(arrayIndex++), + true + ) + ), + ]); + parentPath.parentPath.insertAfter(arrayAccessNode); + // Make sure we declare our new now so scope tracking continues to work + const arrayAccessPath = path.getNextSibling(); + path.scope.registerDeclaration(arrayAccessPath); + } + } + } else if (isCreateReactElementCall(path)) { + const callee = path.get('callee'); + const reactReferencePath = callee.get('object'); + + if (state.createElementReference === undefined) { + state.createElementReference = createConstantCreateElementReference( + reactReferencePath + ); + } + callee.replaceWith(state.createElementReference); + } + }, + }, + }; +}; diff --git a/packages/babel-plugin-optimize-react/package.json b/packages/babel-plugin-optimize-react/package.json new file mode 100644 index 00000000000..39360d6fb1d --- /dev/null +++ b/packages/babel-plugin-optimize-react/package.json @@ -0,0 +1,24 @@ +{ + "name": "babel-plugin-optimize-react", + "version": "0.0.1", + "description": "Babel plugin for optimizing common React patterns", + "repository": "facebookincubator/create-react-app", + "license": "MIT", + "bugs": { + "url": "https://github.com/facebookincubator/create-react-app/issues" + }, + "main": "index.js", + "files": [ + "index.js" + ], + "peerDependencies": { + "@babel/core": "^7.1.0" + }, + "devDependencies": { + "jest": "^23.6.0", + "prettier": "^1.15.3" + }, + "scripts": { + "test": "jest" + } +} From 591ce2509e26d158f280dce43c3548f4d1f3ddae Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Thu, 17 Jan 2019 15:16:10 +0000 Subject: [PATCH 02/62] Typo --- packages/babel-plugin-optimize-react/__tests__/hooks-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-plugin-optimize-react/__tests__/hooks-test.js b/packages/babel-plugin-optimize-react/__tests__/hooks-test.js index 96f8d639bbd..beb15e436cb 100644 --- a/packages/babel-plugin-optimize-react/__tests__/hooks-test.js +++ b/packages/babel-plugin-optimize-react/__tests__/hooks-test.js @@ -9,7 +9,7 @@ function transform(code) { }).code; } -describe('Babel plugin optimize React hooks', () => { +describe('React hook transforms', () => { it('should support transform hook imports', () => { const test = ` import React, {useState} from "react"; From 835fcbd34fb988bb15b493dd963e05a4ff8ecd52 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Thu, 17 Jan 2019 19:00:39 +0000 Subject: [PATCH 03/62] Increase version and added fix for no default import --- .../babel-plugin-optimize-react/README.md | 2 +- .../__snapshots__/hooks-test.js.snap | 108 ++++++++++++++++++ .../__tests__/hooks-test.js | 8 ++ packages/babel-plugin-optimize-react/index.js | 9 ++ .../babel-plugin-optimize-react/package.json | 2 +- 5 files changed, 127 insertions(+), 2 deletions(-) diff --git a/packages/babel-plugin-optimize-react/README.md b/packages/babel-plugin-optimize-react/README.md index dd08f9fdc63..40ed39e0c04 100644 --- a/packages/babel-plugin-optimize-react/README.md +++ b/packages/babel-plugin-optimize-react/README.md @@ -1,4 +1,4 @@ -# babel-plugin-optimize-react-hooks +# babel-plugin-optimize-react This Babel 7 plugin optimizes React hooks by transforming common patterns into more effecient output when using with tools such as [Create React App](https://github.com/facebook/create-react-app). For example, with this plugin the following output is optimized as shown: diff --git a/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap index 9378ef695b1..2c1b42ff359 100644 --- a/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap +++ b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap @@ -100,3 +100,111 @@ const { useState: foo } = React;" `; + +exports[`React hook transforms should support destructuring hooks from imports #2 1`] = ` +"import React from \\"react\\"; +const __reactCreateElement__ = React.createElement; +const { + useState +} = React; +export function MyComponent() { + const _ref_0 = useState(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`React hook transforms should support destructuring hooks from imports #3 1`] = ` +"import React from \\"react\\"; +const __reactCreateElement__ = React.createElement; +const useState = React.useState; +export function MyComponent() { + const _ref_0 = useState(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`React hook transforms should support destructuring hooks from imports #4 1`] = ` +"import React from \\"react\\"; +const __reactCreateElement__ = React.createElement; +const foo = React.useState; +export function MyComponent() { + const _ref_0 = foo(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`React hook transforms should support destructuring hooks from imports #5 1`] = ` +"import React from \\"react\\"; +const __reactCreateElement__ = React.createElement; +const { + useState: foo +} = React; +export function MyComponent() { + const _ref_0 = foo(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`React hook transforms should support destructuring hooks from imports 1`] = ` +"import React from \\"react\\"; +const __reactCreateElement__ = React.createElement; +const { + useState +} = React; +export function MyComponent() { + const _ref_0 = useState(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`React hook transforms should support destructuring hooks from require calls 1`] = ` +"const React = require(\\"react\\"); + +const __reactCreateElement__ = React.createElement; +const { + useState +} = React; +export function MyComponent() { + const _ref_0 = useState(0); + + const setCounter = _ref_0[1]; + const counter = _ref_0[0]; + return __reactCreateElement__(\\"div\\", null, counter); +}" +`; + +exports[`React hook transforms should support transform hook imports 1`] = ` +"import React from \\"react\\"; +const { + useState +} = React;" +`; + +exports[`React hook transforms should support transform hook imports with aliasing 1`] = ` +"import React from \\"react\\"; +const { + useState: foo +} = React;" +`; + +exports[`React hook transforms should support transform hook imports with no default 1`] = ` +"import React from \\"react\\"; +const { + useState +} = React;" +`; diff --git a/packages/babel-plugin-optimize-react/__tests__/hooks-test.js b/packages/babel-plugin-optimize-react/__tests__/hooks-test.js index beb15e436cb..0cc16e441d4 100644 --- a/packages/babel-plugin-optimize-react/__tests__/hooks-test.js +++ b/packages/babel-plugin-optimize-react/__tests__/hooks-test.js @@ -113,4 +113,12 @@ describe('React hook transforms', () => { const output = transform(test); expect(output).toMatchSnapshot(); }); + + it('should support transform hook imports with no default', () => { + const test = ` + import {useState} from "react"; + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); }); diff --git a/packages/babel-plugin-optimize-react/index.js b/packages/babel-plugin-optimize-react/index.js index 20e7d2235b1..7331795f15c 100644 --- a/packages/babel-plugin-optimize-react/index.js +++ b/packages/babel-plugin-optimize-react/index.js @@ -22,6 +22,7 @@ module.exports = function(babel) { const hooks = []; if (t.isStringLiteral(node.source) && node.source.value === 'react') { const specifiers = path.get('specifiers'); + let hasDefaultSpecifier = false; for (let specifier of specifiers) { if (t.isImportSpecifier(specifier)) { @@ -37,8 +38,16 @@ module.exports = function(babel) { specifier.remove(); } } + } else if (t.isImportDefaultSpecifier(specifier)) { + hasDefaultSpecifier = true; } } + // If there is no default specifier for React, add one + if (!hasDefaultSpecifier && specifiers.length > 0) { + const defaultSpecifierNode = t.importDefaultSpecifier(t.identifier("React")); + + path.pushContainer('specifiers', defaultSpecifierNode); + } } return hooks; } diff --git a/packages/babel-plugin-optimize-react/package.json b/packages/babel-plugin-optimize-react/package.json index 39360d6fb1d..eabc1594a66 100644 --- a/packages/babel-plugin-optimize-react/package.json +++ b/packages/babel-plugin-optimize-react/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-optimize-react", - "version": "0.0.1", + "version": "0.0.2", "description": "Babel plugin for optimizing common React patterns", "repository": "facebookincubator/create-react-app", "license": "MIT", From f472a2af8bed7505af347a99a50e12a133bba752 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Thu, 17 Jan 2019 20:29:04 +0000 Subject: [PATCH 04/62] Fixed more bugs + added more tests + bumped version --- .../__snapshots__/hooks-test.js.snap | 115 +++--------------- .../__tests__/hooks-test.js | 30 ++++- packages/babel-plugin-optimize-react/index.js | 29 +++-- .../babel-plugin-optimize-react/package.json | 2 +- 4 files changed, 67 insertions(+), 109 deletions(-) diff --git a/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap index 2c1b42ff359..e2aef83464f 100644 --- a/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap +++ b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Babel plugin optimize React hooks should support destructuring hooks from imports #2 1`] = ` +exports[`React hook transforms should support destructuring hooks from imports #2 1`] = ` "import React from \\"react\\"; const __reactCreateElement__ = React.createElement; const { @@ -15,7 +15,7 @@ export function MyComponent() { }" `; -exports[`Babel plugin optimize React hooks should support destructuring hooks from imports #3 1`] = ` +exports[`React hook transforms should support destructuring hooks from imports #3 1`] = ` "import React from \\"react\\"; const __reactCreateElement__ = React.createElement; const useState = React.useState; @@ -28,7 +28,7 @@ export function MyComponent() { }" `; -exports[`Babel plugin optimize React hooks should support destructuring hooks from imports #4 1`] = ` +exports[`React hook transforms should support destructuring hooks from imports #4 1`] = ` "import React from \\"react\\"; const __reactCreateElement__ = React.createElement; const foo = React.useState; @@ -41,7 +41,7 @@ export function MyComponent() { }" `; -exports[`Babel plugin optimize React hooks should support destructuring hooks from imports #5 1`] = ` +exports[`React hook transforms should support destructuring hooks from imports #5 1`] = ` "import React from \\"react\\"; const __reactCreateElement__ = React.createElement; const { @@ -56,7 +56,7 @@ export function MyComponent() { }" `; -exports[`Babel plugin optimize React hooks should support destructuring hooks from imports 1`] = ` +exports[`React hook transforms should support destructuring hooks from imports 1`] = ` "import React from \\"react\\"; const __reactCreateElement__ = React.createElement; const { @@ -71,7 +71,7 @@ export function MyComponent() { }" `; -exports[`Babel plugin optimize React hooks should support destructuring hooks from require calls 1`] = ` +exports[`React hook transforms should support destructuring hooks from require calls 1`] = ` "const React = require(\\"react\\"); const __reactCreateElement__ = React.createElement; @@ -87,105 +87,40 @@ export function MyComponent() { }" `; -exports[`Babel plugin optimize React hooks should support transform hook imports 1`] = ` -"import React from \\"react\\"; -const { +exports[`React hook transforms should support hook CJS require with no default 1`] = ` +"const { useState -} = React;" +} = require(\\"react\\");" `; -exports[`Babel plugin optimize React hooks should support transform hook imports with aliasing 1`] = ` +exports[`React hook transforms should support hook imports with aliasing 1`] = ` "import React from \\"react\\"; const { useState: foo } = React;" `; -exports[`React hook transforms should support destructuring hooks from imports #2 1`] = ` +exports[`React hook transforms should support hook imports with no default 1`] = ` "import React from \\"react\\"; -const __reactCreateElement__ = React.createElement; const { useState -} = React; -export function MyComponent() { - const _ref_0 = useState(0); - - const setCounter = _ref_0[1]; - const counter = _ref_0[0]; - return __reactCreateElement__(\\"div\\", null, counter); -}" -`; - -exports[`React hook transforms should support destructuring hooks from imports #3 1`] = ` -"import React from \\"react\\"; -const __reactCreateElement__ = React.createElement; -const useState = React.useState; -export function MyComponent() { - const _ref_0 = useState(0); - - const setCounter = _ref_0[1]; - const counter = _ref_0[0]; - return __reactCreateElement__(\\"div\\", null, counter); -}" -`; - -exports[`React hook transforms should support destructuring hooks from imports #4 1`] = ` -"import React from \\"react\\"; -const __reactCreateElement__ = React.createElement; -const foo = React.useState; -export function MyComponent() { - const _ref_0 = foo(0); - - const setCounter = _ref_0[1]; - const counter = _ref_0[0]; - return __reactCreateElement__(\\"div\\", null, counter); -}" -`; - -exports[`React hook transforms should support destructuring hooks from imports #5 1`] = ` -"import React from \\"react\\"; -const __reactCreateElement__ = React.createElement; -const { - useState: foo -} = React; -export function MyComponent() { - const _ref_0 = foo(0); - - const setCounter = _ref_0[1]; - const counter = _ref_0[0]; - return __reactCreateElement__(\\"div\\", null, counter); -}" +} = React;" `; -exports[`React hook transforms should support destructuring hooks from imports 1`] = ` +exports[`React hook transforms should support mixed hook imports 1`] = ` "import React from \\"react\\"; -const __reactCreateElement__ = React.createElement; +import { memo } from \\"react\\"; const { useState -} = React; -export function MyComponent() { - const _ref_0 = useState(0); - - const setCounter = _ref_0[1]; - const counter = _ref_0[0]; - return __reactCreateElement__(\\"div\\", null, counter); -}" +} = React;" `; -exports[`React hook transforms should support destructuring hooks from require calls 1`] = ` -"const React = require(\\"react\\"); - -const __reactCreateElement__ = React.createElement; +exports[`React hook transforms should support mixed hook imports with no default 1`] = ` +"import React from \\"react\\"; const { useState } = React; -export function MyComponent() { - const _ref_0 = useState(0); - - const setCounter = _ref_0[1]; - const counter = _ref_0[0]; - return __reactCreateElement__(\\"div\\", null, counter); -}" +import { memo } from \\"react\\";" `; exports[`React hook transforms should support transform hook imports 1`] = ` @@ -194,17 +129,3 @@ const { useState } = React;" `; - -exports[`React hook transforms should support transform hook imports with aliasing 1`] = ` -"import React from \\"react\\"; -const { - useState: foo -} = React;" -`; - -exports[`React hook transforms should support transform hook imports with no default 1`] = ` -"import React from \\"react\\"; -const { - useState -} = React;" -`; diff --git a/packages/babel-plugin-optimize-react/__tests__/hooks-test.js b/packages/babel-plugin-optimize-react/__tests__/hooks-test.js index 0cc16e441d4..c67046e756c 100644 --- a/packages/babel-plugin-optimize-react/__tests__/hooks-test.js +++ b/packages/babel-plugin-optimize-react/__tests__/hooks-test.js @@ -18,7 +18,7 @@ describe('React hook transforms', () => { expect(output).toMatchSnapshot(); }); - it('should support transform hook imports with aliasing', () => { + it('should support hook imports with aliasing', () => { const test = ` import React, {useState as foo} from "react"; `; @@ -114,11 +114,37 @@ describe('React hook transforms', () => { expect(output).toMatchSnapshot(); }); - it('should support transform hook imports with no default', () => { + it('should support hook imports with no default', () => { const test = ` import {useState} from "react"; `; const output = transform(test); expect(output).toMatchSnapshot(); }); + + it('should support hook CJS require with no default', () => { + const test = ` + const {useState} = require("react"); + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); + + it('should support mixed hook imports', () => { + const test = ` + import React from "react"; + import {memo, useState} from "react"; + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); + + it('should support mixed hook imports with no default', () => { + const test = ` + import {useState} from "react"; + import {memo} from "react"; + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); }); diff --git a/packages/babel-plugin-optimize-react/index.js b/packages/babel-plugin-optimize-react/index.js index 7331795f15c..e42efb54eec 100644 --- a/packages/babel-plugin-optimize-react/index.js +++ b/packages/babel-plugin-optimize-react/index.js @@ -17,12 +17,14 @@ module.exports = function(babel) { const { types: t } = babel; // Collects named imports of React hooks from the "react" package - function collectReactHooksAndRemoveTheirNamedImports(path) { + function collectReactHooksAndRemoveTheirNamedImports(path, state) { const node = path.node; const hooks = []; if (t.isStringLiteral(node.source) && node.source.value === 'react') { const specifiers = path.get('specifiers'); - let hasDefaultSpecifier = false; + if (state.hasDefaultSpecifier === undefined) { + state.hasDefaultSpecifier = false; + } for (let specifier of specifiers) { if (t.isImportSpecifier(specifier)) { @@ -39,14 +41,17 @@ module.exports = function(babel) { } } } else if (t.isImportDefaultSpecifier(specifier)) { - hasDefaultSpecifier = true; + state.hasDefaultSpecifier = true; } } // If there is no default specifier for React, add one - if (!hasDefaultSpecifier && specifiers.length > 0) { - const defaultSpecifierNode = t.importDefaultSpecifier(t.identifier("React")); - + if (state.hasDefaultSpecifier === false && specifiers.length > 0) { + const defaultSpecifierNode = t.importDefaultSpecifier( + t.identifier('React') + ); + path.pushContainer('specifiers', defaultSpecifierNode); + state.hasDefaultSpecifier = true; } } return hooks; @@ -180,7 +185,10 @@ module.exports = function(babel) { ]); const bindingPath = binding.path; - if (t.isImportDefaultSpecifier(bindingPath) || t.isVariableDeclarator(bindingPath)) { + if ( + t.isImportDefaultSpecifier(bindingPath) || + t.isVariableDeclarator(bindingPath) + ) { bindingPath.parentPath.insertAfter(createElementDeclaration); // Make sure we declare our new now so scope tracking continues to work const reactElementDeclarationPath = bindingPath.parentPath.getNextSibling(); @@ -192,12 +200,15 @@ module.exports = function(babel) { return { name: 'babel-plugin-optimize-react', visitor: { - ImportDeclaration(path) { + ImportDeclaration(path, state) { // Collect all hooks that are named imports from the React package. i.e.: // import React, {useState} from "react"; // As we collection them, we also remove the imports from the declaration. - const importedHooks = collectReactHooksAndRemoveTheirNamedImports(path); + const importedHooks = collectReactHooksAndRemoveTheirNamedImports( + path, + state + ); if (importedHooks.length > 0) { // Create a destructured variable declaration. i.e.: // const {useEffect, useState} = React; diff --git a/packages/babel-plugin-optimize-react/package.json b/packages/babel-plugin-optimize-react/package.json index eabc1594a66..b51d78d4179 100644 --- a/packages/babel-plugin-optimize-react/package.json +++ b/packages/babel-plugin-optimize-react/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-optimize-react", - "version": "0.0.2", + "version": "0.0.3", "description": "Babel plugin for optimizing common React patterns", "repository": "facebookincubator/create-react-app", "license": "MIT", From d335e0bed5077c7142bcf4edf93ef0dae54451e9 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Mon, 21 Jan 2019 11:35:54 +0000 Subject: [PATCH 05/62] Adds support for more React imports and fixes a bunch of bugs --- .../babel-plugin-optimize-react/.gitignore | 1 + .../__snapshots__/createElement-test.js.snap | 11 +++ .../__snapshots__/hooks-test.js.snap | 18 ++++- .../__tests__/createElement-test.js | 14 ++++ .../__tests__/hooks-test.js | 10 +++ packages/babel-plugin-optimize-react/index.js | 78 +++++++++++++++---- .../babel-plugin-optimize-react/package.json | 2 +- 7 files changed, 117 insertions(+), 17 deletions(-) create mode 100644 packages/babel-plugin-optimize-react/.gitignore diff --git a/packages/babel-plugin-optimize-react/.gitignore b/packages/babel-plugin-optimize-react/.gitignore new file mode 100644 index 00000000000..588380aa8ac --- /dev/null +++ b/packages/babel-plugin-optimize-react/.gitignore @@ -0,0 +1 @@ +sandbox.js \ No newline at end of file diff --git a/packages/babel-plugin-optimize-react/__tests__/__snapshots__/createElement-test.js.snap b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/createElement-test.js.snap index 60d3cd3c6b2..a8f86c88946 100644 --- a/packages/babel-plugin-optimize-react/__tests__/__snapshots__/createElement-test.js.snap +++ b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/createElement-test.js.snap @@ -21,6 +21,17 @@ export function MyComponent() { }" `; +exports[`React createElement transforms should transform React.createElement calls #4 1`] = ` +"import * as React from \\"react\\"; +const __reactCreateElement__ = React.createElement; + +const node = __reactCreateElement__(\\"div\\", null, __reactCreateElement__(\\"span\\", null, \\"Hello world!\\")); + +export function MyComponent() { + return node; +}" +`; + exports[`React createElement transforms should transform React.createElement calls 1`] = ` "import React from \\"react\\"; const __reactCreateElement__ = React.createElement; diff --git a/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap index e2aef83464f..efe5d68521a 100644 --- a/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap +++ b/packages/babel-plugin-optimize-react/__tests__/__snapshots__/hooks-test.js.snap @@ -109,18 +109,32 @@ const { exports[`React hook transforms should support mixed hook imports 1`] = ` "import React from \\"react\\"; -import { memo } from \\"react\\"; +import \\"react\\"; const { + memo, useState } = React;" `; +exports[`React hook transforms should support mixed hook imports with no default #2 1`] = ` +"import React from \\"react\\"; +const { + memo, + useRef, + useState +} = React; +export const Portal = memo(() => null);" +`; + exports[`React hook transforms should support mixed hook imports with no default 1`] = ` "import React from \\"react\\"; const { useState } = React; -import { memo } from \\"react\\";" +import \\"react\\"; +const { + memo +} = React;" `; exports[`React hook transforms should support transform hook imports 1`] = ` diff --git a/packages/babel-plugin-optimize-react/__tests__/createElement-test.js b/packages/babel-plugin-optimize-react/__tests__/createElement-test.js index b2c388834a3..c7d452068ad 100644 --- a/packages/babel-plugin-optimize-react/__tests__/createElement-test.js +++ b/packages/babel-plugin-optimize-react/__tests__/createElement-test.js @@ -47,4 +47,18 @@ describe('React createElement transforms', () => { const output = transform(test); expect(output).toMatchSnapshot(); }); + + it('should transform React.createElement calls #4', () => { + const test = ` + import * as React from "react"; + + const node = React.createElement("div", null, React.createElement("span", null, "Hello world!")); + + export function MyComponent() { + return node; + } + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); }); diff --git a/packages/babel-plugin-optimize-react/__tests__/hooks-test.js b/packages/babel-plugin-optimize-react/__tests__/hooks-test.js index c67046e756c..6bc7887b111 100644 --- a/packages/babel-plugin-optimize-react/__tests__/hooks-test.js +++ b/packages/babel-plugin-optimize-react/__tests__/hooks-test.js @@ -147,4 +147,14 @@ describe('React hook transforms', () => { const output = transform(test); expect(output).toMatchSnapshot(); }); + + it('should support mixed hook imports with no default #2', () => { + const test = ` + import {memo, useRef, useState} from "react"; + + export const Portal = memo(() => null); + `; + const output = transform(test); + expect(output).toMatchSnapshot(); + }); }); diff --git a/packages/babel-plugin-optimize-react/index.js b/packages/babel-plugin-optimize-react/index.js index e42efb54eec..ceafa288e19 100644 --- a/packages/babel-plugin-optimize-react/index.js +++ b/packages/babel-plugin-optimize-react/index.js @@ -13,17 +13,47 @@ const reactHooks = new Set([ 'useState', ]); +const reactNamedImports = new Set([ + 'Children', + 'cloneElement', + 'Component', + 'ConcurrentMode', + 'createContext', + 'createElement', + 'createFactory', + 'forwardRef', + 'Fragment', + 'isValidElement', + 'lazy', + 'memo', + 'Profiler', + 'PureComponent', + 'StrictMode', + 'Suspense', + 'useCallback', + 'useContext', + 'useDebugValue', + 'useEffect', + 'useImperativeHandle', + 'useLayoutEffect', + 'useMemo', + 'useReducer', + 'useRef', + 'useState', + 'version', +]); + module.exports = function(babel) { const { types: t } = babel; - // Collects named imports of React hooks from the "react" package - function collectReactHooksAndRemoveTheirNamedImports(path, state) { + // Collects named imports from the "react" package + function collectAllReactImportalsAndRemoveTheirNamedImports(path, state) { const node = path.node; const hooks = []; if (t.isStringLiteral(node.source) && node.source.value === 'react') { const specifiers = path.get('specifiers'); - if (state.hasDefaultSpecifier === undefined) { - state.hasDefaultSpecifier = false; + if (state.hasDefaultOrNamespaceSpecifier === undefined) { + state.hasDefaultOrNamespaceSpecifier = false; } for (let specifier of specifiers) { @@ -32,7 +62,7 @@ module.exports = function(babel) { const localNode = specifier.node.local; if (t.isIdentifier(importedNode) && t.isIdentifier(localNode)) { - if (reactHooks.has(importedNode.name)) { + if (reactNamedImports.has(importedNode.name)) { hooks.push({ imported: importedNode.name, local: localNode.name, @@ -41,17 +71,33 @@ module.exports = function(babel) { } } } else if (t.isImportDefaultSpecifier(specifier)) { - state.hasDefaultSpecifier = true; + const local = specifier.get('local'); + + if (t.isIdentifier(local) && local.node.name === 'React') { + state.hasDefaultOrNamespaceSpecifier = true; + } + } else if (t.isImportNamespaceSpecifier(specifier)) { + const local = specifier.get('local'); + + if (t.isIdentifier(local) && local.node.name === 'React') { + state.hasDefaultOrNamespaceSpecifier = true; + } } } // If there is no default specifier for React, add one - if (state.hasDefaultSpecifier === false && specifiers.length > 0) { + if ( + state.hasDefaultOrNamespaceSpecifier === false && + specifiers.length > 0 + ) { const defaultSpecifierNode = t.importDefaultSpecifier( t.identifier('React') ); - path.pushContainer('specifiers', defaultSpecifierNode); - state.hasDefaultSpecifier = true; + // We unshift so it goes to the beginning + path.unshiftContainer('specifiers', defaultSpecifierNode); + state.hasDefaultOrNamespaceSpecifier = true; + // Make sure we register the binding, so tracking continues to work + path.scope.registerDeclaration(path); } } return hooks; @@ -65,7 +111,10 @@ module.exports = function(babel) { if (binding !== undefined) { const bindingPath = binding.path; - if (t.isImportDefaultSpecifier(bindingPath)) { + if ( + t.isImportDefaultSpecifier(bindingPath) || + t.isImportNamespaceSpecifier(bindingPath) + ) { const parentPath = bindingPath.parentPath; if ( @@ -187,6 +236,7 @@ module.exports = function(babel) { if ( t.isImportDefaultSpecifier(bindingPath) || + t.isImportNamespaceSpecifier(bindingPath) || t.isVariableDeclarator(bindingPath) ) { bindingPath.parentPath.insertAfter(createElementDeclaration); @@ -205,18 +255,18 @@ module.exports = function(babel) { // import React, {useState} from "react"; // As we collection them, we also remove the imports from the declaration. - const importedHooks = collectReactHooksAndRemoveTheirNamedImports( + const reactNamedImports = collectAllReactImportalsAndRemoveTheirNamedImports( path, state ); - if (importedHooks.length > 0) { + if (reactNamedImports.length > 0) { // Create a destructured variable declaration. i.e.: - // const {useEffect, useState} = React; + // const {memo, useEffect, useState} = React; // Then insert it below the import declaration node. const declarations = t.variableDeclarator( t.objectPattern( - importedHooks.map(({ imported, local }) => + reactNamedImports.map(({ imported, local }) => t.objectProperty( t.identifier(imported), t.identifier(local), diff --git a/packages/babel-plugin-optimize-react/package.json b/packages/babel-plugin-optimize-react/package.json index b51d78d4179..7e6c1fa0b03 100644 --- a/packages/babel-plugin-optimize-react/package.json +++ b/packages/babel-plugin-optimize-react/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-optimize-react", - "version": "0.0.3", + "version": "0.0.4", "description": "Babel plugin for optimizing common React patterns", "repository": "facebookincubator/create-react-app", "license": "MIT", From b22c4b38fea63f21d08fb76cdb8e9f307a3a13dd Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Mon, 21 Jan 2019 11:38:51 +0000 Subject: [PATCH 06/62] Updated README.md --- packages/babel-plugin-optimize-react/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/babel-plugin-optimize-react/README.md b/packages/babel-plugin-optimize-react/README.md index 40ed39e0c04..222e9c364fd 100644 --- a/packages/babel-plugin-optimize-react/README.md +++ b/packages/babel-plugin-optimize-react/README.md @@ -14,15 +14,15 @@ var __ref__0 = useState(Math.random()); var value = __ref__0[0]; ``` -## Named imports to hooks get transformed +## Named imports for React get transformed ```js // Original -import React, {useState} from 'react'; +import React, {memo, useState} from 'react'; // With this plugin import React from 'react'; -const {useState} = React; +const {memo, useState} = React; ``` ## Array destructuring transform for React's built-in hooks From e1e660fb0b6aa3c0cbe5e1f49b1c2bb232bd0a21 Mon Sep 17 00:00:00 2001 From: Brody McKee Date: Sat, 16 Nov 2019 22:00:25 +0200 Subject: [PATCH 07/62] Add Lighthouse audit command --- packages/react-scripts/bin/react-scripts.js | 9 ++- packages/react-scripts/package.json | 2 + packages/react-scripts/scripts/audit.js | 75 +++++++++++++++++++++ packages/react-scripts/scripts/init.js | 1 + 4 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 packages/react-scripts/scripts/audit.js diff --git a/packages/react-scripts/bin/react-scripts.js b/packages/react-scripts/bin/react-scripts.js index 7e6e290251a..44896ed4d1f 100755 --- a/packages/react-scripts/bin/react-scripts.js +++ b/packages/react-scripts/bin/react-scripts.js @@ -19,12 +19,17 @@ const spawn = require('react-dev-utils/crossSpawn'); const args = process.argv.slice(2); const scriptIndex = args.findIndex( - x => x === 'build' || x === 'eject' || x === 'start' || x === 'test' + x => + x === 'build' || + x === 'eject' || + x === 'start' || + x === 'test' || + x === 'audit' ); const script = scriptIndex === -1 ? args[0] : args[scriptIndex]; const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : []; -if (['build', 'eject', 'start', 'test'].includes(script)) { +if (['build', 'eject', 'start', 'test', 'audit'].includes(script)) { const result = spawn.sync( 'node', nodeArgs diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 5a879b5815f..4edc0d7a6e1 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -58,6 +58,7 @@ "jest-environment-jsdom-fourteen": "0.1.0", "jest-resolve": "24.9.0", "jest-watch-typeahead": "0.4.2", + "lighthouse": "^5.6.0", "mini-css-extract-plugin": "0.8.0", "optimize-css-assets-webpack-plugin": "5.0.3", "pnp-webpack-plugin": "1.5.0", @@ -71,6 +72,7 @@ "resolve": "1.12.0", "resolve-url-loader": "3.1.1", "sass-loader": "8.0.0", + "serve-handler": "^6.1.2", "semver": "6.3.0", "style-loader": "1.0.0", "terser-webpack-plugin": "2.2.1", diff --git a/packages/react-scripts/scripts/audit.js b/packages/react-scripts/scripts/audit.js new file mode 100644 index 00000000000..9eefb4a51b2 --- /dev/null +++ b/packages/react-scripts/scripts/audit.js @@ -0,0 +1,75 @@ +// @remove-file-on-eject +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict'; + +const { createServer } = require('http'); +const { writeFileSync } = require('fs'); +const { join } = require('path'); +const { choosePort } = require('react-dev-utils/WebpackDevServerUtils'); +const open = require('open'); +const handler = require('serve-handler'); +const lighthouse = require('lighthouse'); +const chromeLauncher = require('chrome-launcher'); +const paths = require('../config/paths'); + +const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000; +const HOST = process.env.HOST || '0.0.0.0'; + +// https://github.com/GoogleChrome/lighthouse/blob/master/docs/readme.md#using-programmatically +const launchChromeAndRunLighthouse = (url, opts) => { + return chromeLauncher + .launch({ chromeFlags: opts.chromeFlags }) + .then(chrome => { + opts.port = chrome.port; + return lighthouse(url, opts).then(results => { + return chrome.kill().then(() => results.report); + }); + }); +}; + +const server = createServer((request, response) => + handler(request, response, { + renderSingle: true, + public: paths.appBuild, + }) +); + +choosePort(HOST, DEFAULT_PORT) + .then(() => choosePort(HOST, DEFAULT_PORT)) + .then(port => { + if (port == null) { + console.log('Unable to find a free port'); + process.exit(1); + } + + server.listen(port); + + console.log('Server started, beginning audit...'); + + return launchChromeAndRunLighthouse(`http://${HOST}:${port}`, { + output: 'html', + }); + }) + .then(report => { + console.log('Audit finished, writing report...'); + + const reportPath = join(paths.appPath, 'lighthouse-audit.html'); + writeFileSync(reportPath, report); + + console.log('Opening report in browser...'); + + open(reportPath, { url: true }); + + console.log('Exiting...'); + + server.close(); + }) + .catch(() => { + console.log('Something went wrong, exiting...'); + server.close(); + }); diff --git a/packages/react-scripts/scripts/init.js b/packages/react-scripts/scripts/init.js index fb3490617c4..56fa03e37c0 100644 --- a/packages/react-scripts/scripts/init.js +++ b/packages/react-scripts/scripts/init.js @@ -114,6 +114,7 @@ module.exports = function( build: 'react-scripts build', test: 'react-scripts test', eject: 'react-scripts eject', + lighthouse: 'react-scripts audit', }; // Setup the eslint config From c2a87e061b3c78653bff126e55d2c0c0f3519635 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2020 21:56:53 +0000 Subject: [PATCH 08/62] Bump elliptic from 6.5.2 to 6.5.3 in /docusaurus/website Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3) Signed-off-by: dependabot[bot] --- docusaurus/website/yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docusaurus/website/yarn.lock b/docusaurus/website/yarn.lock index dee1365ea76..a752d21a327 100644 --- a/docusaurus/website/yarn.lock +++ b/docusaurus/website/yarn.lock @@ -1748,9 +1748,9 @@ bluebird@^3.5.5, bluebird@^3.7.1: integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== + version "4.11.9" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" + integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== body-parser@1.19.0: version "1.19.0" @@ -3150,9 +3150,9 @@ electron-to-chromium@^1.3.247, electron-to-chromium@^1.3.322: integrity sha512-Tc8JQEfGQ1MzfSzI/bTlSr7btJv/FFO7Yh6tanqVmIWOuNCu6/D1MilIEgLtmWqIrsv+o4IjpLAhgMBr/ncNAA== elliptic@^6.0.0: - version "6.5.2" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762" - integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw== + version "6.5.3" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" + integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw== dependencies: bn.js "^4.4.0" brorand "^1.0.1" From 3830f151f1b1d0985845671c15817bb1d4b4133a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2020 21:57:41 +0000 Subject: [PATCH 09/62] Bump websocket-extensions from 0.1.3 to 0.1.4 in /docusaurus/website Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4. - [Release notes](https://github.com/faye/websocket-extensions-node/releases) - [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md) - [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4) Signed-off-by: dependabot[bot] --- docusaurus/website/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docusaurus/website/yarn.lock b/docusaurus/website/yarn.lock index dee1365ea76..8cbbf825681 100644 --- a/docusaurus/website/yarn.lock +++ b/docusaurus/website/yarn.lock @@ -9137,9 +9137,9 @@ websocket-driver@>=0.5.1: websocket-extensions ">=0.1.1" websocket-extensions@>=0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" - integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg== + version "0.1.4" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" + integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== whatwg-url@^7.0.0: version "7.1.0" From 929d86d73f3d7b62b427cc2c72804a2b87393d78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2020 21:58:23 +0000 Subject: [PATCH 10/62] Bump lodash from 4.17.15 to 4.17.19 in /docusaurus/website Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] --- docusaurus/website/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docusaurus/website/yarn.lock b/docusaurus/website/yarn.lock index dee1365ea76..53f45013e2d 100644 --- a/docusaurus/website/yarn.lock +++ b/docusaurus/website/yarn.lock @@ -5219,9 +5219,9 @@ lodash.uniq@4.5.0, lodash.uniq@^4.5.0: integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.5: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + version "4.17.19" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" + integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== loglevel@^1.6.4: version "1.6.6" From 8f2237a7a261d9d578f543d12cb995c69f66d685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 19:05:30 -0300 Subject: [PATCH 11/62] Create workflows --- .github/workflows/node.js.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 00000000000..673bd331773 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,29 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build --if-present + - run: npm test From 7a7f18f24ed2d5e2c93ea05dd9420f5a2a886aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 20:00:58 -0300 Subject: [PATCH 12/62] Google Files Add to google --- .github/workflows/google.yml | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/google.yml diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml new file mode 100644 index 00000000000..b8d10795278 --- /dev/null +++ b/.github/workflows/google.yml @@ -0,0 +1,75 @@ +# This workflow will build a docker container, publish it to Google Container Registry, and deploy it to GKE when a release is created +# +# To configure this workflow: +# +# 1. Ensure that your repository contains the necessary configuration for your Google Kubernetes Engine cluster, including deployment.yml, kustomization.yml, service.yml, etc. +# +# 2. Set up secrets in your workspace: GKE_PROJECT with the name of the project, GKE_EMAIL with the service account email, GKE_KEY with the Base64 encoded JSON service account key (https://github.com/GoogleCloudPlatform/github-actions/tree/docs/service-account-key/setup-gcloud#inputs). +# +# 3. Change the values for the GKE_ZONE, GKE_CLUSTER, IMAGE, REGISTRY_HOSTNAME and DEPLOYMENT_NAME environment variables (below). + +name: Build and Deploy to GKE + +on: + release: + types: [created] + +# Environment variables available to all jobs and steps in this workflow +env: + GKE_PROJECT: ${{ secrets.GKE_PROJECT }} + GKE_EMAIL: ${{ secrets.GKE_EMAIL }} + GITHUB_SHA: ${{ github.sha }} + GKE_ZONE: us-west1-a + GKE_CLUSTER: example-gke-cluster + IMAGE: gke-test + REGISTRY_HOSTNAME: gcr.io + DEPLOYMENT_NAME: gke-test + +jobs: + setup-build-publish-deploy: + name: Setup, Build, Publish, and Deploy + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v2 + + # Setup gcloud CLI + - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master + with: + version: '270.0.0' + service_account_email: ${{ secrets.GKE_EMAIL }} + service_account_key: ${{ secrets.GKE_KEY }} + + # Configure docker to use the gcloud command-line tool as a credential helper + - run: | + # Set up docker to authenticate + # via gcloud command-line tool. + gcloud auth configure-docker + + # Build the Docker image + - name: Build + run: | + docker build -t "$REGISTRY_HOSTNAME"/"$GKE_PROJECT"/"$IMAGE":"$GITHUB_SHA" \ + --build-arg GITHUB_SHA="$GITHUB_SHA" \ + --build-arg GITHUB_REF="$GITHUB_REF" . + + # Push the Docker image to Google Container Registry + - name: Publish + run: | + docker push $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:$GITHUB_SHA + + # Set up kustomize + - name: Set up Kustomize + run: | + curl -o kustomize --location https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64 + chmod u+x ./kustomize + + # Deploy the Docker image to the GKE cluster + - name: Deploy + run: | + gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT + ./kustomize edit set image $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:${GITHUB_SHA} + ./kustomize build . | kubectl apply -f - + kubectl rollout status deployment/$DEPLOYMENT_NAME + kubectl get services -o wide From 0f85a6907b91e11822f1da5ef72f053035715f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 20:19:08 -0300 Subject: [PATCH 13/62] Security MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Teste de segurança --- SECURITY.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000000..034e8480320 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. From 95d7970232a4c7650730b3cad87338b2e6d8f300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 20:32:00 -0300 Subject: [PATCH 14/62] =?UTF-8?q?Atualiza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Atualização --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 034e8480320..95f2ac9f212 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,9 +8,9 @@ currently being supported with security updates. | Version | Supported | | ------- | ------------------ | | 5.1.x | :white_check_mark: | -| 5.0.x | :x: | +| 5.0.x | :white_check_mark: | | 4.0.x | :white_check_mark: | -| < 4.0 | :x: | +| < 4.0 | :white_check_mark: | ## Reporting a Vulnerability From 1f0d52563544827a49fe6a2b892778a2e08262d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 21:41:51 -0300 Subject: [PATCH 15/62] =?UTF-8?q?Bot=20de=20Depend=C3=AAncias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Depende --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..b2aaf22780a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" From ac08b64e4b2ea2d1b782a113a6daf58c7b7640dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 21:54:30 -0300 Subject: [PATCH 16/62] Azure Conect --- .github/workflows/azure.yml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/azure.yml diff --git a/.github/workflows/azure.yml b/.github/workflows/azure.yml new file mode 100644 index 00000000000..a638c4cb3e1 --- /dev/null +++ b/.github/workflows/azure.yml @@ -0,0 +1,46 @@ +# This workflow will build and push a node.js application to an Azure Web App when a release is created. +# +# This workflow assumes you have already created the target Azure App Service web app. +# For instructions see https://docs.microsoft.com/azure/app-service/app-service-plan-manage#create-an-app-service-plan +# +# To configure this workflow: +# +# 1. Set up a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE with the value of your Azure publish profile. +# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret +# +# 2. Change the values for the AZURE_WEBAPP_NAME, AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables (below). +# +# For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions +# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples +on: + release: + types: [created] + +env: + AZURE_WEBAPP_NAME: your-app-name # set this to your application's name + AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root + NODE_VERSION: '10.x' # set this to the node version to use + +jobs: + build-and-deploy: + name: Build and Deploy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: npm install, build, and test + run: | + # Build and test the project, then + # deploy to Azure Web App. + npm install + npm run build --if-present + npm run test --if-present + - name: 'Deploy to Azure WebApp' + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} From 7c9476bfc7fdd05d83be41691d4878be896b19a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 21:58:11 -0300 Subject: [PATCH 17/62] Create greetings.yml --- .github/workflows/greetings.yml | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 00000000000..d2c0d718f27 --- /dev/null +++ b/.github/workflows/greetings.yml @@ -0,0 +1,41 @@ +name: Greetings + +on: [pull_request, issues] + +jobs: + greeting: + runs-on: ubuntu-latest + steps: + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: 'Message that will be displayed on users'' first issue' + pr-message: 'Message that will be displayed on users'' first pr' + +- name: Cache + uses: actions/cache@v2.1.0 + with: + # A list of files, directories, and wildcard patterns to cache and restore + path: + # An explicit key for restoring and saving the cache + key: + # An ordered list of keys to use for restoring the cache if no cache hit occurred for key + restore-keys: # optional + +- name: Setup Node.js environment + uses: actions/setup-node@v2.1.1 + with: + # Set always-auth in npmrc + always-auth: # optional, default is false + # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0 + node-version: # optional + # Set this option if you want the action to check for the latest available version that satisfies the version spec + check-latest: # optional + # Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN + registry-url: # optional + # Optional scope for authenticating against scoped registries + scope: # optional + # Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. + token: # optional, default is ${{ github.token }} + # Deprecated. Use node-version instead. Will not be supported after October 1, 2019 + version: # optional From 87f655ddd6c186e35a182382e1afde35359c47d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:55:56 +0000 Subject: [PATCH 18/62] Bump actions/setup-node from v1 to v2.1.1 Bumps [actions/setup-node](https://github.com/actions/setup-node) from v1 to v2.1.1. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v1...321b6ccb03083caa2ad22b27dc4b45335212e824) Signed-off-by: dependabot[bot] --- .github/workflows/azure.yml | 2 +- .github/workflows/node.js.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure.yml b/.github/workflows/azure.yml index a638c4cb3e1..746e411f760 100644 --- a/.github/workflows/azure.yml +++ b/.github/workflows/azure.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v2.1.1 with: node-version: ${{ env.NODE_VERSION }} - name: npm install, build, and test diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 673bd331773..5b6046c8e85 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v2.1.1 with: node-version: ${{ matrix.node-version }} - run: npm ci From fe961784fee93f5ae5e0a8964fbcd29d54995067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 22:36:44 -0300 Subject: [PATCH 19/62] Update greetings.yml --- .github/workflows/greetings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index d2c0d718f27..604d47c8e8e 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -12,7 +12,7 @@ jobs: issue-message: 'Message that will be displayed on users'' first issue' pr-message: 'Message that will be displayed on users'' first pr' -- name: Cache +name: Cache uses: actions/cache@v2.1.0 with: # A list of files, directories, and wildcard patterns to cache and restore From 39edc14f8a04a9cb6640cc99b2f3d9fa65e0e435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 22:42:57 -0300 Subject: [PATCH 20/62] =?UTF-8?q?Nova=20Vers=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/greethinks.yml | 20 ++++++++++++++++ .github/workflows/greetings.yml | 41 -------------------------------- 2 files changed, 20 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/greethinks.yml delete mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greethinks.yml b/.github/workflows/greethinks.yml new file mode 100644 index 00000000000..8fb3d07ebdf --- /dev/null +++ b/.github/workflows/greethinks.yml @@ -0,0 +1,20 @@ +name: Cumprimentar a Todos +# Este fluxo de trabalho é acionado em pushes para o repositório. +on: [push] + +jobs: + build: + # o nome do trabalho é greeting (cumprimentar) + name: Greeting + # Este trabalho executa no Linux + runs-on: ubuntu-latest + steps: + # Esta etapa usa hello-world-javascript-action do GitHub: https://github.com/actions/hello-world-javascript-action + - name: Hello world + uses: actions/hello-world-javascript-action@v1 + with: + who-to-greet: 'Mona the Octocat' + id: hello + # Esta etapa imprime uma saída (tempo) da ação da etapa anterior. + - name: Echo the greeting's time + run: echo 'The time was ${{ steps.hello.outputs.time }}. diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml deleted file mode 100644 index 604d47c8e8e..00000000000 --- a/.github/workflows/greetings.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Greetings - -on: [pull_request, issues] - -jobs: - greeting: - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Message that will be displayed on users'' first issue' - pr-message: 'Message that will be displayed on users'' first pr' - -name: Cache - uses: actions/cache@v2.1.0 - with: - # A list of files, directories, and wildcard patterns to cache and restore - path: - # An explicit key for restoring and saving the cache - key: - # An ordered list of keys to use for restoring the cache if no cache hit occurred for key - restore-keys: # optional - -- name: Setup Node.js environment - uses: actions/setup-node@v2.1.1 - with: - # Set always-auth in npmrc - always-auth: # optional, default is false - # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0 - node-version: # optional - # Set this option if you want the action to check for the latest available version that satisfies the version spec - check-latest: # optional - # Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN - registry-url: # optional - # Optional scope for authenticating against scoped registries - scope: # optional - # Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. - token: # optional, default is ${{ github.token }} - # Deprecated. Use node-version instead. Will not be supported after October 1, 2019 - version: # optional From 515d0a1204462debe5f657fdd10125b68bac760d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 23:41:51 -0300 Subject: [PATCH 21/62] Update running-tests.md (#10) Co-authored-by: Andy C <7357845+andycanderson@users.noreply.github.com> --- docusaurus/docs/running-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/running-tests.md b/docusaurus/docs/running-tests.md index 14244ae275e..ed401cd0f13 100644 --- a/docusaurus/docs/running-tests.md +++ b/docusaurus/docs/running-tests.md @@ -197,7 +197,7 @@ Similar to `enzyme` you can create a `src/setupTests.js` file to avoid boilerpla import '@testing-library/jest-dom'; ``` -Here's an example of using `react-testing-library` and `jest-dom` for testing that the `` component renders "Welcome to React". +Here's an example of using `react-testing-library` and `jest-dom` for testing that the `` component renders "Learn React". ```js import React from 'react'; From 59368eb7207647827e336209a31cda3d4205eba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 23:47:21 -0300 Subject: [PATCH 22/62] Delete azure.yml --- .github/workflows/azure.yml | 46 ------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 .github/workflows/azure.yml diff --git a/.github/workflows/azure.yml b/.github/workflows/azure.yml deleted file mode 100644 index 746e411f760..00000000000 --- a/.github/workflows/azure.yml +++ /dev/null @@ -1,46 +0,0 @@ -# This workflow will build and push a node.js application to an Azure Web App when a release is created. -# -# This workflow assumes you have already created the target Azure App Service web app. -# For instructions see https://docs.microsoft.com/azure/app-service/app-service-plan-manage#create-an-app-service-plan -# -# To configure this workflow: -# -# 1. Set up a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE with the value of your Azure publish profile. -# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret -# -# 2. Change the values for the AZURE_WEBAPP_NAME, AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables (below). -# -# For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions -# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples -on: - release: - types: [created] - -env: - AZURE_WEBAPP_NAME: your-app-name # set this to your application's name - AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root - NODE_VERSION: '10.x' # set this to the node version to use - -jobs: - build-and-deploy: - name: Build and Deploy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2.1.1 - with: - node-version: ${{ env.NODE_VERSION }} - - name: npm install, build, and test - run: | - # Build and test the project, then - # deploy to Azure Web App. - npm install - npm run build --if-present - npm run test --if-present - - name: 'Deploy to Azure WebApp' - uses: azure/webapps-deploy@v2 - with: - app-name: ${{ env.AZURE_WEBAPP_NAME }} - publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} From 04f895fa83cd4be51c4da80a16233ee866332eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 23:47:40 -0300 Subject: [PATCH 23/62] Delete google.yml --- .github/workflows/google.yml | 75 ------------------------------------ 1 file changed, 75 deletions(-) delete mode 100644 .github/workflows/google.yml diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml deleted file mode 100644 index b8d10795278..00000000000 --- a/.github/workflows/google.yml +++ /dev/null @@ -1,75 +0,0 @@ -# This workflow will build a docker container, publish it to Google Container Registry, and deploy it to GKE when a release is created -# -# To configure this workflow: -# -# 1. Ensure that your repository contains the necessary configuration for your Google Kubernetes Engine cluster, including deployment.yml, kustomization.yml, service.yml, etc. -# -# 2. Set up secrets in your workspace: GKE_PROJECT with the name of the project, GKE_EMAIL with the service account email, GKE_KEY with the Base64 encoded JSON service account key (https://github.com/GoogleCloudPlatform/github-actions/tree/docs/service-account-key/setup-gcloud#inputs). -# -# 3. Change the values for the GKE_ZONE, GKE_CLUSTER, IMAGE, REGISTRY_HOSTNAME and DEPLOYMENT_NAME environment variables (below). - -name: Build and Deploy to GKE - -on: - release: - types: [created] - -# Environment variables available to all jobs and steps in this workflow -env: - GKE_PROJECT: ${{ secrets.GKE_PROJECT }} - GKE_EMAIL: ${{ secrets.GKE_EMAIL }} - GITHUB_SHA: ${{ github.sha }} - GKE_ZONE: us-west1-a - GKE_CLUSTER: example-gke-cluster - IMAGE: gke-test - REGISTRY_HOSTNAME: gcr.io - DEPLOYMENT_NAME: gke-test - -jobs: - setup-build-publish-deploy: - name: Setup, Build, Publish, and Deploy - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - # Setup gcloud CLI - - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master - with: - version: '270.0.0' - service_account_email: ${{ secrets.GKE_EMAIL }} - service_account_key: ${{ secrets.GKE_KEY }} - - # Configure docker to use the gcloud command-line tool as a credential helper - - run: | - # Set up docker to authenticate - # via gcloud command-line tool. - gcloud auth configure-docker - - # Build the Docker image - - name: Build - run: | - docker build -t "$REGISTRY_HOSTNAME"/"$GKE_PROJECT"/"$IMAGE":"$GITHUB_SHA" \ - --build-arg GITHUB_SHA="$GITHUB_SHA" \ - --build-arg GITHUB_REF="$GITHUB_REF" . - - # Push the Docker image to Google Container Registry - - name: Publish - run: | - docker push $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:$GITHUB_SHA - - # Set up kustomize - - name: Set up Kustomize - run: | - curl -o kustomize --location https://github.com/kubernetes-sigs/kustomize/releases/download/v3.1.0/kustomize_3.1.0_linux_amd64 - chmod u+x ./kustomize - - # Deploy the Docker image to the GKE cluster - - name: Deploy - run: | - gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT - ./kustomize edit set image $REGISTRY_HOSTNAME/$GKE_PROJECT/$IMAGE:${GITHUB_SHA} - ./kustomize build . | kubectl apply -f - - kubectl rollout status deployment/$DEPLOYMENT_NAME - kubectl get services -o wide From f19bf2fdcec4c4031daeac485ac5c0fe86907ee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 23:47:54 -0300 Subject: [PATCH 24/62] Delete greethinks.yml --- .github/workflows/greethinks.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/greethinks.yml diff --git a/.github/workflows/greethinks.yml b/.github/workflows/greethinks.yml deleted file mode 100644 index 8fb3d07ebdf..00000000000 --- a/.github/workflows/greethinks.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Cumprimentar a Todos -# Este fluxo de trabalho é acionado em pushes para o repositório. -on: [push] - -jobs: - build: - # o nome do trabalho é greeting (cumprimentar) - name: Greeting - # Este trabalho executa no Linux - runs-on: ubuntu-latest - steps: - # Esta etapa usa hello-world-javascript-action do GitHub: https://github.com/actions/hello-world-javascript-action - - name: Hello world - uses: actions/hello-world-javascript-action@v1 - with: - who-to-greet: 'Mona the Octocat' - id: hello - # Esta etapa imprime uma saída (tempo) da ação da etapa anterior. - - name: Echo the greeting's time - run: echo 'The time was ${{ steps.hello.outputs.time }}. From e57b2d27dd44605ce8a3dd455ca52a66f21e36b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 23:48:17 -0300 Subject: [PATCH 25/62] Delete node.js.yml --- .github/workflows/node.js.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index 5b6046c8e85..00000000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,29 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Node.js CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [10.x, 12.x, 14.x] - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2.1.1 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npm run build --if-present - - run: npm test From edb809835091fcba2ca60c9d794663b549728561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Fri, 31 Jul 2020 23:53:11 -0300 Subject: [PATCH 26/62] feat: exit on outdated create-react-app version (#9) Co-authored-by: Brody McKee From 1a3f1ba241c547f1ae1261f0bd5c0cd2b4bcd70d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 03:23:19 +0000 Subject: [PATCH 27/62] Bump escape-string-regexp from 2.0.0 to 4.0.0 Bumps [escape-string-regexp](https://github.com/sindresorhus/escape-string-regexp) from 2.0.0 to 4.0.0. - [Release notes](https://github.com/sindresorhus/escape-string-regexp/releases) - [Commits](https://github.com/sindresorhus/escape-string-regexp/compare/v2.0.0...v4.0.0) Signed-off-by: dependabot-preview[bot] --- packages/react-dev-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index e6815eed7ab..5cc5f72e205 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -58,7 +58,7 @@ "chalk": "2.4.2", "cross-spawn": "7.0.3", "detect-port-alt": "1.1.6", - "escape-string-regexp": "2.0.0", + "escape-string-regexp": "4.0.0", "filesize": "6.1.0", "find-up": "4.1.0", "fork-ts-checker-webpack-plugin": "4.1.6", From 1d1fa19751fe4a918db2d6ffdecdd6096c346891 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:26:39 -0300 Subject: [PATCH 28/62] Bump escape-string-regexp from 2.0.0 to 4.0.0 (#11) Bumps [escape-string-regexp](https://github.com/sindresorhus/escape-string-regexp) from 2.0.0 to 4.0.0. - [Release notes](https://github.com/sindresorhus/escape-string-regexp/releases) - [Commits](https://github.com/sindresorhus/escape-string-regexp/compare/v2.0.0...v4.0.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/react-dev-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index e6815eed7ab..5cc5f72e205 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -58,7 +58,7 @@ "chalk": "2.4.2", "cross-spawn": "7.0.3", "detect-port-alt": "1.1.6", - "escape-string-regexp": "2.0.0", + "escape-string-regexp": "4.0.0", "filesize": "6.1.0", "find-up": "4.1.0", "fork-ts-checker-webpack-plugin": "4.1.6", From bb8c246e412848a04ae8d25f7db73b93bbe02f3a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:28:30 -0300 Subject: [PATCH 29/62] Bump @babel/runtime from 7.10.5 to 7.11.0 (#13) Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.10.5 to 7.11.0. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.11.0/packages/babel-runtime) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/babel-preset-react-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-react-app/package.json b/packages/babel-preset-react-app/package.json index 7bcff4e136f..badb89e1f39 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -33,7 +33,7 @@ "@babel/preset-env": "7.10.4", "@babel/preset-react": "7.10.4", "@babel/preset-typescript": "7.10.4", - "@babel/runtime": "7.10.5", + "@babel/runtime": "7.11.0", "babel-plugin-macros": "2.8.0", "babel-plugin-transform-react-remove-prop-types": "0.4.24" } From 9e4540863945a2196e5dc0354caca7a600210886 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:28:55 -0300 Subject: [PATCH 30/62] Bump css-loader from 3.6.0 to 4.2.0 (#12) Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 3.6.0 to 4.2.0. - [Release notes](https://github.com/webpack-contrib/css-loader/releases) - [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/css-loader/compare/v3.6.0...v4.2.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/react-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 83ab56ed2a2..75842fdbf44 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -41,7 +41,7 @@ "bfj": "^7.0.2", "camelcase": "^6.0.0", "case-sensitive-paths-webpack-plugin": "2.3.0", - "css-loader": "3.6.0", + "css-loader": "4.2.0", "dotenv": "8.2.0", "dotenv-expand": "5.1.0", "eslint": "^7.5.0", From 20e2cd32d9b52a5e3ac9e86704cbcec72a28c39f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:37:36 -0300 Subject: [PATCH 31/62] Bump flow-bin from 0.116.1 to 0.130.0 (#19) Bumps [flow-bin](https://github.com/flowtype/flow-bin) from 0.116.1 to 0.130.0. - [Release notes](https://github.com/flowtype/flow-bin/releases) - [Commits](https://github.com/flowtype/flow-bin/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/react-error-overlay/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-error-overlay/package.json b/packages/react-error-overlay/package.json index 14bf3f49b99..f8f4967e0d1 100644 --- a/packages/react-error-overlay/package.json +++ b/packages/react-error-overlay/package.json @@ -51,7 +51,7 @@ "eslint-plugin-jsx-a11y": "^6.3.1", "eslint-plugin-react": "^7.20.3", "eslint-plugin-react-hooks": "^4.0.8", - "flow-bin": "^0.116.0", + "flow-bin": "^0.130.0", "html-entities": "1.3.1", "jest": "26.1.0", "jest-fetch-mock": "2.1.2", From 728dd9f89c306e5cb24ac7b508137b27cd9ad937 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:38:44 -0300 Subject: [PATCH 32/62] Bump commander from 4.1.0 to 6.0.0 (#21) Bumps [commander](https://github.com/tj/commander.js) from 4.1.0 to 6.0.0. - [Release notes](https://github.com/tj/commander.js/releases) - [Changelog](https://github.com/tj/commander.js/blob/master/CHANGELOG.md) - [Commits](https://github.com/tj/commander.js/compare/v4.1.0...v6.0.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/create-react-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-react-app/package.json b/packages/create-react-app/package.json index 013968b725d..66e5d0bb41f 100644 --- a/packages/create-react-app/package.json +++ b/packages/create-react-app/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "chalk": "4.1.0", - "commander": "4.1.0", + "commander": "6.0.0", "cross-spawn": "7.0.3", "envinfo": "7.5.1", "fs-extra": "9.0.1", From f751536aeb3018d7cd887ca4e60f515da2b1ab39 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:41:33 -0300 Subject: [PATCH 33/62] Bump jest-circus from 26.1.0 to 26.2.2 (#17) Bumps [jest-circus](https://github.com/facebook/jest/tree/HEAD/packages/jest-circus) from 26.1.0 to 26.2.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v26.2.2/packages/jest-circus) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/react-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 75842fdbf44..bb2049c47c9 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -59,7 +59,7 @@ "jest-environment-jsdom-fourteen": "0.1.0", "lighthouse": "^5.6.0", "jest": "26.1.0", - "jest-circus": "26.1.0", + "jest-circus": "26.2.2", "jest-resolve": "26.1.0", "jest-watch-typeahead": "0.6.0", "mini-css-extract-plugin": "0.9.0", From b3a4b7f29d0d2a4e4c75f78eee1869d5be929875 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:45:11 -0300 Subject: [PATCH 34/62] Bump lerna from 3.20.2 to 3.22.1 (#23) Bumps [lerna](https://github.com/lerna/lerna/tree/HEAD/core/lerna) from 3.20.2 to 3.22.1. - [Release notes](https://github.com/lerna/lerna/releases) - [Changelog](https://github.com/lerna/lerna/blob/master/core/lerna/CHANGELOG.md) - [Commits](https://github.com/lerna/lerna/commits/v3.22.1/core/lerna) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4f3c9bee078..42b186723c4 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "globby": "^11.0.0", "husky": "^4.2.5", "jest": "26.1.0", - "lerna": "3.20.2", + "lerna": "3.22.1", "lerna-changelog": "~0.8.2", "lint-staged": "^10.2.2", "meow": "^6.1.1", From 2ebc7dcf8c37267677e804fd763918ac8c1ff210 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:45:55 -0300 Subject: [PATCH 35/62] Bump babel-plugin-tester from 8.0.1 to 9.2.0 (#22) Bumps [babel-plugin-tester](https://github.com/babel-utils/babel-plugin-tester) from 8.0.1 to 9.2.0. - [Release notes](https://github.com/babel-utils/babel-plugin-tester/releases) - [Changelog](https://github.com/babel-utils/babel-plugin-tester/blob/master/CHANGELOG.md) - [Commits](https://github.com/babel-utils/babel-plugin-tester/compare/v8.0.1...v9.2.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/babel-plugin-named-asset-import/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-plugin-named-asset-import/package.json b/packages/babel-plugin-named-asset-import/package.json index 7991d324d68..041fb701749 100644 --- a/packages/babel-plugin-named-asset-import/package.json +++ b/packages/babel-plugin-named-asset-import/package.json @@ -19,7 +19,7 @@ "@babel/core": "^7.1.0" }, "devDependencies": { - "babel-plugin-tester": "^8.0.1", + "babel-plugin-tester": "^9.2.0", "jest": "26.1.0" }, "scripts": { From 7647746c14b3a20d92115035b101187681edc99f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:46:19 -0300 Subject: [PATCH 36/62] Bump envinfo from 7.5.1 to 7.7.2 (#20) Bumps [envinfo](https://github.com/tabrindle/envinfo) from 7.5.1 to 7.7.2. - [Release notes](https://github.com/tabrindle/envinfo/releases) - [Commits](https://github.com/tabrindle/envinfo/compare/7.5.1...7.7.2) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/create-react-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-react-app/package.json b/packages/create-react-app/package.json index 66e5d0bb41f..0fe2ca1cd8f 100644 --- a/packages/create-react-app/package.json +++ b/packages/create-react-app/package.json @@ -29,7 +29,7 @@ "chalk": "4.1.0", "commander": "6.0.0", "cross-spawn": "7.0.3", - "envinfo": "7.5.1", + "envinfo": "7.7.2", "fs-extra": "9.0.1", "hyperquest": "2.1.3", "inquirer": "7.3.2", From 2f5712953878a99e22305ee4c19cc28be8e5a310 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:46:43 -0300 Subject: [PATCH 37/62] Bump webpack from 4.43.0 to 4.44.1 (#18) Bumps [webpack](https://github.com/webpack/webpack) from 4.43.0 to 4.44.1. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v4.43.0...v4.44.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/react-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index bb2049c47c9..90de4494cdf 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -81,7 +81,7 @@ "terser-webpack-plugin": "3.0.7", "ts-pnp": "1.2.0", "url-loader": "4.1.0", - "webpack": "4.43.0", + "webpack": "4.44.1", "webpack-dev-server": "3.11.0", "webpack-manifest-plugin": "2.2.0", "workbox-webpack-plugin": "5.1.3" From 29615ce3788860d6a0a88dc19009b0bc88663fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:47:04 -0300 Subject: [PATCH 38/62] Bump escape-string-regexp from 2.0.0 to 4.0.0 (#16) Bumps [escape-string-regexp](https://github.com/sindresorhus/escape-string-regexp) from 2.0.0 to 4.0.0. - [Release notes](https://github.com/sindresorhus/escape-string-regexp/releases) - [Commits](https://github.com/sindresorhus/escape-string-regexp/compare/v2.0.0...v4.0.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> From 1a5f372d657106b6a951812a10a567fab86e44a0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:54:41 -0300 Subject: [PATCH 39/62] Bump jest-resolve from 26.1.0 to 26.2.2 (#14) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [jest-resolve](https://github.com/facebook/jest/tree/HEAD/packages/jest-resolve) from 26.1.0 to 26.2.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v26.2.2/packages/jest-resolve) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Josué Junior <51888984+phibosGit@users.noreply.github.com> --- packages/react-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 90de4494cdf..501602e2813 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -59,8 +59,8 @@ "jest-environment-jsdom-fourteen": "0.1.0", "lighthouse": "^5.6.0", "jest": "26.1.0", + "jest-resolve": "26.2.2", "jest-circus": "26.2.2", - "jest-resolve": "26.1.0", "jest-watch-typeahead": "0.6.0", "mini-css-extract-plugin": "0.9.0", "optimize-css-assets-webpack-plugin": "5.0.3", From 52fdafe0964e29510d788995ebcf12bf54af7679 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:58:30 -0300 Subject: [PATCH 40/62] Bump jest from 23.6.0 to 26.2.2 (#15) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [jest](https://github.com/facebook/jest) from 23.6.0 to 26.2.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v23.6.0...v26.2.2) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Josué Junior <51888984+phibosGit@users.noreply.github.com> --- package.json | 2 +- packages/babel-plugin-named-asset-import/package.json | 2 +- packages/babel-plugin-optimize-react/package.json | 2 +- packages/confusing-browser-globals/package.json | 2 +- packages/react-dev-utils/package.json | 2 +- packages/react-error-overlay/package.json | 2 +- packages/react-scripts/package.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 42b186723c4..437b83ec6d9 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "get-port": "^5.1.1", "globby": "^11.0.0", "husky": "^4.2.5", - "jest": "26.1.0", + "jest": "26.2.2", "lerna": "3.22.1", "lerna-changelog": "~0.8.2", "lint-staged": "^10.2.2", diff --git a/packages/babel-plugin-named-asset-import/package.json b/packages/babel-plugin-named-asset-import/package.json index 041fb701749..0dc988c2cc5 100644 --- a/packages/babel-plugin-named-asset-import/package.json +++ b/packages/babel-plugin-named-asset-import/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "babel-plugin-tester": "^9.2.0", - "jest": "26.1.0" + "jest": "26.2.2" }, "scripts": { "test": "jest" diff --git a/packages/babel-plugin-optimize-react/package.json b/packages/babel-plugin-optimize-react/package.json index 7e6c1fa0b03..ce4a1fad3cb 100644 --- a/packages/babel-plugin-optimize-react/package.json +++ b/packages/babel-plugin-optimize-react/package.json @@ -15,7 +15,7 @@ "@babel/core": "^7.1.0" }, "devDependencies": { - "jest": "^23.6.0", + "jest": "^26.2.2", "prettier": "^1.15.3" }, "scripts": { diff --git a/packages/confusing-browser-globals/package.json b/packages/confusing-browser-globals/package.json index c25da3f44a4..e199252a50f 100644 --- a/packages/confusing-browser-globals/package.json +++ b/packages/confusing-browser-globals/package.json @@ -20,6 +20,6 @@ "index.js" ], "devDependencies": { - "jest": "26.1.0" + "jest": "26.2.2" } } diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index 5cc5f72e205..e00078a6c8d 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -79,7 +79,7 @@ }, "devDependencies": { "cross-env": "^7.0.2", - "jest": "26.1.0" + "jest": "26.2.2" }, "scripts": { "test": "cross-env FORCE_COLOR=true jest" diff --git a/packages/react-error-overlay/package.json b/packages/react-error-overlay/package.json index f8f4967e0d1..0b43aabd73a 100644 --- a/packages/react-error-overlay/package.json +++ b/packages/react-error-overlay/package.json @@ -53,7 +53,7 @@ "eslint-plugin-react-hooks": "^4.0.8", "flow-bin": "^0.130.0", "html-entities": "1.3.1", - "jest": "26.1.0", + "jest": "26.2.2", "jest-fetch-mock": "2.1.2", "object-assign": "4.1.1", "promise": "8.1.0", diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 501602e2813..0187f7f3d0d 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -58,7 +58,7 @@ "identity-obj-proxy": "3.0.0", "jest-environment-jsdom-fourteen": "0.1.0", "lighthouse": "^5.6.0", - "jest": "26.1.0", + "jest": "26.2.2", "jest-resolve": "26.2.2", "jest-circus": "26.2.2", "jest-watch-typeahead": "0.6.0", From c772ab5434b46ce30583e75aded896f045f64664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Sat, 1 Aug 2020 01:53:48 -0300 Subject: [PATCH 41/62] Create node.js.yml --- .github/workflows/node.js.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 00000000000..673bd331773 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,29 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build --if-present + - run: npm test From a7bd086bbc81a5f03e495bc7949af22c105ef07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Junior?= <51888984+phibosGit@users.noreply.github.com> Date: Sat, 1 Aug 2020 01:56:56 -0300 Subject: [PATCH 42/62] Azure Workflow --- azure.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 azure.yml diff --git a/azure.yml b/azure.yml new file mode 100644 index 00000000000..d6783e2188e --- /dev/null +++ b/azure.yml @@ -0,0 +1,33 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. From 6be467763353970310c9420f4470356944a32f3d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 15:51:38 -0300 Subject: [PATCH 43/62] Bump puppeteer from 3.3.0 to 5.2.1 (#26) Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 3.3.0 to 5.2.1. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Commits](https://github.com/puppeteer/puppeteer/compare/v3.3.0...v5.2.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 437b83ec6d9..2c4522ca1d5 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "meow": "^6.1.1", "multimatch": "^4.0.0", "prettier": "2.0.5", - "puppeteer": "^3.0.2", + "puppeteer": "^5.2.1", "strip-ansi": "^6.0.0", "svg-term-cli": "^2.1.1", "tempy": "^0.2.1", From 1716d1499996c17ccf318a797dbff26d153652bf Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 15:52:19 -0300 Subject: [PATCH 44/62] Bump @babel/core from 7.10.5 to 7.11.0 (#29) Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.10.5 to 7.11.0. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.11.0/packages/babel-core) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/babel-preset-react-app/package.json | 2 +- packages/react-error-overlay/package.json | 2 +- packages/react-scripts/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/babel-preset-react-app/package.json b/packages/babel-preset-react-app/package.json index badb89e1f39..05fb58ef003 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -21,7 +21,7 @@ "test.js" ], "dependencies": { - "@babel/core": "7.10.5", + "@babel/core": "7.11.0", "@babel/plugin-proposal-class-properties": "7.10.4", "@babel/plugin-proposal-decorators": "7.10.5", "@babel/plugin-proposal-nullish-coalescing-operator": "7.10.4", diff --git a/packages/react-error-overlay/package.json b/packages/react-error-overlay/package.json index 0b43aabd73a..cb72fef251b 100644 --- a/packages/react-error-overlay/package.json +++ b/packages/react-error-overlay/package.json @@ -35,7 +35,7 @@ ], "devDependencies": { "@babel/code-frame": "7.10.4", - "@babel/core": "7.10.5", + "@babel/core": "7.11.0", "anser": "1.4.9", "babel-eslint": "^10.1.0", "babel-jest": "^26.0.1", diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 0187f7f3d0d..a2b74790a09 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -28,7 +28,7 @@ }, "types": "./lib/react-app.d.ts", "dependencies": { - "@babel/core": "7.10.5", + "@babel/core": "7.11.0", "@pmmmwh/react-refresh-webpack-plugin": "0.4.1", "@svgr/webpack": "5.4.0", "@typescript-eslint/eslint-plugin": "^3.3.0", From ac8a7fe39784dddc6cf1265f4c4224f8ef20c059 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 15:53:00 -0300 Subject: [PATCH 45/62] Bump @babel/plugin-proposal-optional-chaining from 7.10.4 to 7.11.0 (#28) Bumps [@babel/plugin-proposal-optional-chaining](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-optional-chaining) from 7.10.4 to 7.11.0. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.11.0/packages/babel-plugin-proposal-optional-chaining) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/babel-preset-react-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-react-app/package.json b/packages/babel-preset-react-app/package.json index 05fb58ef003..29370fc1619 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -26,7 +26,7 @@ "@babel/plugin-proposal-decorators": "7.10.5", "@babel/plugin-proposal-nullish-coalescing-operator": "7.10.4", "@babel/plugin-proposal-numeric-separator": "7.10.4", - "@babel/plugin-proposal-optional-chaining": "7.10.4", + "@babel/plugin-proposal-optional-chaining": "7.11.0", "@babel/plugin-transform-flow-strip-types": "7.10.4", "@babel/plugin-transform-react-display-name": "7.10.4", "@babel/plugin-transform-runtime": "7.10.5", From 3d07f070d17ffd6634dbb4b25a476798529c059e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 15:54:12 -0300 Subject: [PATCH 46/62] Bump source-map from 0.5.6 to 0.7.3 (#30) Bumps [source-map](https://github.com/mozilla/source-map) from 0.5.6 to 0.7.3. - [Release notes](https://github.com/mozilla/source-map/releases) - [Changelog](https://github.com/mozilla/source-map/blob/master/CHANGELOG.md) - [Commits](https://github.com/mozilla/source-map/compare/0.5.6...0.7.3) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/react-error-overlay/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-error-overlay/package.json b/packages/react-error-overlay/package.json index cb72fef251b..ab86df3b209 100644 --- a/packages/react-error-overlay/package.json +++ b/packages/react-error-overlay/package.json @@ -63,7 +63,7 @@ "react-dom": "^16.12.0", "rimraf": "^3.0.0", "settle-promise": "1.0.0", - "source-map": "0.5.6", + "source-map": "0.7.3", "terser-webpack-plugin": "3.0.7", "webpack": "^4.35.0" }, From dc3a902a210720a0dcf4a3b64b91880b308569e8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 15:54:59 -0300 Subject: [PATCH 47/62] Bump @babel/preset-env from 7.10.4 to 7.11.0 (#31) Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.10.4 to 7.11.0. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.11.0/packages/babel-preset-env) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/babel-preset-react-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-react-app/package.json b/packages/babel-preset-react-app/package.json index 29370fc1619..2ec2220da91 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -30,7 +30,7 @@ "@babel/plugin-transform-flow-strip-types": "7.10.4", "@babel/plugin-transform-react-display-name": "7.10.4", "@babel/plugin-transform-runtime": "7.10.5", - "@babel/preset-env": "7.10.4", + "@babel/preset-env": "7.11.0", "@babel/preset-react": "7.10.4", "@babel/preset-typescript": "7.10.4", "@babel/runtime": "7.11.0", From b6fc0a21e501789f5421509c18098acfd1be852e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 18:55:13 +0000 Subject: [PATCH 48/62] Bump meow from 6.1.1 to 7.0.1 Bumps [meow](https://github.com/sindresorhus/meow) from 6.1.1 to 7.0.1. - [Release notes](https://github.com/sindresorhus/meow/releases) - [Commits](https://github.com/sindresorhus/meow/compare/v6.1.1...v7.0.1) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c4522ca1d5..64ecaa8839d 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "lerna": "3.22.1", "lerna-changelog": "~0.8.2", "lint-staged": "^10.2.2", - "meow": "^6.1.1", + "meow": "^7.0.1", "multimatch": "^4.0.0", "prettier": "2.0.5", "puppeteer": "^5.2.1", From 15ec991faa59ae3ac43f86ff495bc87cb1abd763 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 18:58:59 +0000 Subject: [PATCH 49/62] Bump lighthouse from 5.6.0 to 6.1.1 Bumps [lighthouse](https://github.com/GoogleChrome/lighthouse) from 5.6.0 to 6.1.1. - [Release notes](https://github.com/GoogleChrome/lighthouse/releases) - [Changelog](https://github.com/GoogleChrome/lighthouse/blob/v6.1.1/changelog.md) - [Commits](https://github.com/GoogleChrome/lighthouse/compare/v5.6.0...v6.1.1) Signed-off-by: dependabot-preview[bot] --- packages/react-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 0187f7f3d0d..385718a08c0 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -57,7 +57,7 @@ "html-webpack-plugin": "4.3.0", "identity-obj-proxy": "3.0.0", "jest-environment-jsdom-fourteen": "0.1.0", - "lighthouse": "^5.6.0", + "lighthouse": "^6.1.1", "jest": "26.2.2", "jest-resolve": "26.2.2", "jest-circus": "26.2.2", From 4d7c4b752eeb11d7178a752a6e2df022f8445028 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 17:26:17 -0300 Subject: [PATCH 50/62] Bump immer from 1.10.0 to 7.0.7 (#34) Bumps [immer](https://github.com/immerjs/immer) from 1.10.0 to 7.0.7. - [Release notes](https://github.com/immerjs/immer/releases) - [Commits](https://github.com/immerjs/immer/compare/v1.10.0...v7.0.7) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- packages/react-dev-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index e00078a6c8d..6e89b62f341 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -65,7 +65,7 @@ "global-modules": "2.0.0", "globby": "11.0.1", "gzip-size": "5.1.1", - "immer": "1.10.0", + "immer": "7.0.7", "inquirer": "7.3.2", "is-root": "2.1.0", "loader-utils": "2.0.0", From 299e73dc5de8aed139f4ff83bf7dfaf03924a487 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 20:30:44 +0000 Subject: [PATCH 51/62] Bump @babel/plugin-transform-runtime from 7.10.5 to 7.11.0 Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.10.5 to 7.11.0. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.11.0/packages/babel-plugin-transform-runtime) Signed-off-by: dependabot-preview[bot] --- packages/babel-preset-react-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-react-app/package.json b/packages/babel-preset-react-app/package.json index 2ec2220da91..cf22e77e0d0 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -29,7 +29,7 @@ "@babel/plugin-proposal-optional-chaining": "7.11.0", "@babel/plugin-transform-flow-strip-types": "7.10.4", "@babel/plugin-transform-react-display-name": "7.10.4", - "@babel/plugin-transform-runtime": "7.10.5", + "@babel/plugin-transform-runtime": "7.11.0", "@babel/preset-env": "7.11.0", "@babel/preset-react": "7.10.4", "@babel/preset-typescript": "7.10.4", From 2dae428cfa984fae187c867a07777b78fd1fc1b3 Mon Sep 17 00:00:00 2001 From: Rafael Quijada Date: Sat, 1 Aug 2020 16:27:24 -0500 Subject: [PATCH 52/62] Updated README.md Templates to Follow ESLint Markdown Rules (#9241) --- .../template/README.md | 12 ++++++---- packages/cra-template/template/README.md | 24 ++++++++++--------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/packages/cra-template-typescript/template/README.md b/packages/cra-template-typescript/template/README.md index 74735dc6626..b87cb00449e 100644 --- a/packages/cra-template-typescript/template/README.md +++ b/packages/cra-template-typescript/template/README.md @@ -1,3 +1,5 @@ +# Getting Started with Create React App + This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts @@ -6,23 +8,23 @@ In the project directory, you can run: ### `npm start` -Runs the app in the development mode.
+Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. -The page will reload if you make edits.
+The page will reload if you make edits.\ You will also see any lint errors in the console. ### `npm test` -Launches the test runner in the interactive watch mode.
+Launches the test runner in the interactive watch mode.\ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. ### `npm run build` -Builds the app for production to the `build` folder.
+Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. -The build is minified and the filenames include the hashes.
+The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. diff --git a/packages/cra-template/template/README.md b/packages/cra-template/template/README.md index 54ef09430b1..0c83cde2ce7 100644 --- a/packages/cra-template/template/README.md +++ b/packages/cra-template/template/README.md @@ -1,3 +1,5 @@ +# Getting Started with Create React App + This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts @@ -6,23 +8,23 @@ In the project directory, you can run: ### `npm start` -Runs the app in the development mode.
+Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. -The page will reload if you make edits.
+The page will reload if you make edits.\ You will also see any lint errors in the console. ### `npm test` -Launches the test runner in the interactive watch mode.
+Launches the test runner in the interactive watch mode.\ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. ### `npm run build` -Builds the app for production to the `build` folder.
+Builds the app for production to the `build` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. -The build is minified and the filenames include the hashes.
+The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. @@ -45,24 +47,24 @@ To learn React, check out the [React documentation](https://reactjs.org/). ### Code Splitting -This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting +This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) ### Analyzing the Bundle Size -This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size +This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) ### Making a Progressive Web App -This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app +This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) ### Advanced Configuration -This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration +This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) ### Deployment -This section has moved here: https://facebook.github.io/create-react-app/docs/deployment +This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) ### `npm run build` fails to minify -This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify +This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) From 36d2aa4ddd6891c2826e66bbc72c2ca2f2ad1727 Mon Sep 17 00:00:00 2001 From: Sakito Mukai Date: Sun, 2 Aug 2020 06:28:25 +0900 Subject: [PATCH 53/62] [Doc] fix React Testing Library example (#9245) --- docusaurus/docs/running-tests.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docusaurus/docs/running-tests.md b/docusaurus/docs/running-tests.md index ed401cd0f13..e6b2ec5b980 100644 --- a/docusaurus/docs/running-tests.md +++ b/docusaurus/docs/running-tests.md @@ -201,12 +201,12 @@ Here's an example of using `react-testing-library` and `jest-dom` for testing th ```js import React from 'react'; -import { render } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import App from './App'; it('renders welcome message', () => { - const { getByText } = render(); - expect(getByText('Learn React')).toBeInTheDocument(); + render(); + expect(screen.getByText('Learn React')).toBeInTheDocument(); }); ``` From 52f75fba16f482446d86430a62f75a5d68c8f574 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2020 18:28:39 +0000 Subject: [PATCH 54/62] Bump actions/setup-node from v1 to v2.1.1 Bumps [actions/setup-node](https://github.com/actions/setup-node) from v1 to v2.1.1. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v1...321b6ccb03083caa2ad22b27dc4b45335212e824) Signed-off-by: dependabot[bot] --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 673bd331773..5b6046c8e85 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v2.1.1 with: node-version: ${{ matrix.node-version }} - run: npm ci From 360df984949cc1ba8db03002ebfaf5c86fb19a1f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 2 Aug 2020 14:00:09 +0000 Subject: [PATCH 55/62] Bump inquirer from 7.3.2 to 7.3.3 Bumps [inquirer](https://github.com/SBoudrias/Inquirer.js) from 7.3.2 to 7.3.3. - [Release notes](https://github.com/SBoudrias/Inquirer.js/releases) - [Commits](https://github.com/SBoudrias/Inquirer.js/compare/inquirer@7.3.2...inquirer@7.3.3) Signed-off-by: dependabot-preview[bot] --- packages/create-react-app/package.json | 2 +- packages/react-dev-utils/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/create-react-app/package.json b/packages/create-react-app/package.json index 0fe2ca1cd8f..b397f443fdc 100644 --- a/packages/create-react-app/package.json +++ b/packages/create-react-app/package.json @@ -32,7 +32,7 @@ "envinfo": "7.7.2", "fs-extra": "9.0.1", "hyperquest": "2.1.3", - "inquirer": "7.3.2", + "inquirer": "7.3.3", "semver": "7.3.2", "tar-pack": "3.4.1", "tmp": "0.2.1", diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index 6e89b62f341..41159c2f0dc 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -66,7 +66,7 @@ "globby": "11.0.1", "gzip-size": "5.1.1", "immer": "7.0.7", - "inquirer": "7.3.2", + "inquirer": "7.3.3", "is-root": "2.1.0", "loader-utils": "2.0.0", "open": "^7.0.2", From 3de9f33c75fba935a64485593787496653f78fd3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 2 Aug 2020 14:02:32 +0000 Subject: [PATCH 56/62] Bump tempy from 0.2.1 to 0.6.0 Bumps [tempy](https://github.com/sindresorhus/tempy) from 0.2.1 to 0.6.0. - [Release notes](https://github.com/sindresorhus/tempy/releases) - [Commits](https://github.com/sindresorhus/tempy/compare/v0.2.1...v0.6.0) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 64ecaa8839d..3e2c0c945f1 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "puppeteer": "^5.2.1", "strip-ansi": "^6.0.0", "svg-term-cli": "^2.1.1", - "tempy": "^0.2.1", + "tempy": "^0.6.0", "wait-for-localhost": "^3.1.0", "web-vitals": "^0.2.2" }, From 3dba6e01c017ccbaec56429875b69e3a67408e1b Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 2 Aug 2020 14:06:08 +0000 Subject: [PATCH 57/62] Bump jest-environment-jsdom-fourteen from 0.1.0 to 1.0.1 Bumps [jest-environment-jsdom-fourteen](https://github.com/ianschmitz/jest-environment-jsdom-fourteen) from 0.1.0 to 1.0.1. - [Release notes](https://github.com/ianschmitz/jest-environment-jsdom-fourteen/releases) - [Changelog](https://github.com/ianschmitz/jest-environment-jsdom-fourteen/blob/master/CHANGELOG.md) - [Commits](https://github.com/ianschmitz/jest-environment-jsdom-fourteen/compare/v0.1.0...v1.0.1) Signed-off-by: dependabot-preview[bot] --- packages/react-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 599b290a3ff..39037063dea 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -56,7 +56,7 @@ "fs-extra": "^9.0.0", "html-webpack-plugin": "4.3.0", "identity-obj-proxy": "3.0.0", - "jest-environment-jsdom-fourteen": "0.1.0", + "jest-environment-jsdom-fourteen": "1.0.1", "lighthouse": "^6.1.1", "jest": "26.2.2", "jest-resolve": "26.2.2", From b5624ea887b31045a1d4134000426b4f2eea5cf6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 2 Aug 2020 14:08:32 +0000 Subject: [PATCH 58/62] Bump sass-loader from 8.0.2 to 9.0.2 Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 8.0.2 to 9.0.2. - [Release notes](https://github.com/webpack-contrib/sass-loader/releases) - [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/sass-loader/compare/v8.0.2...v9.0.2) Signed-off-by: dependabot-preview[bot] --- packages/react-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 599b290a3ff..bb7e83e0a26 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -75,7 +75,7 @@ "react-refresh": "^0.8.3", "resolve": "1.17.0", "resolve-url-loader": "3.1.1", - "sass-loader": "8.0.2", + "sass-loader": "9.0.2", "semver": "7.3.2", "style-loader": "1.2.1", "terser-webpack-plugin": "3.0.7", From 2bb9de4e41d10a86f934db3450e7479b64f04796 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 2 Aug 2020 14:09:55 +0000 Subject: [PATCH 59/62] Bump fork-ts-checker-webpack-plugin from 4.1.6 to 5.0.13 Bumps [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin) from 4.1.6 to 5.0.13. - [Release notes](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/releases) - [Changelog](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/compare/v4.1.6...v5.0.13) Signed-off-by: dependabot-preview[bot] --- packages/react-dev-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index 6e89b62f341..5e0fa358803 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -61,7 +61,7 @@ "escape-string-regexp": "4.0.0", "filesize": "6.1.0", "find-up": "4.1.0", - "fork-ts-checker-webpack-plugin": "4.1.6", + "fork-ts-checker-webpack-plugin": "5.0.13", "global-modules": "2.0.0", "globby": "11.0.1", "gzip-size": "5.1.1", From a4000ac3b52d707385a9d3fef540d18aca7f8a17 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2020 13:57:31 +0000 Subject: [PATCH 60/62] Bump lerna-changelog from 0.8.3 to 1.0.1 Bumps [lerna-changelog](https://github.com/lerna/lerna-changelog) from 0.8.3 to 1.0.1. - [Release notes](https://github.com/lerna/lerna-changelog/releases) - [Changelog](https://github.com/lerna/lerna-changelog/blob/master/CHANGELOG.md) - [Commits](https://github.com/lerna/lerna-changelog/compare/v0.8.3...v1.0.1) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 64ecaa8839d..b379d6545f2 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "husky": "^4.2.5", "jest": "26.2.2", "lerna": "3.22.1", - "lerna-changelog": "~0.8.2", + "lerna-changelog": "~1.0.1", "lint-staged": "^10.2.2", "meow": "^7.0.1", "multimatch": "^4.0.0", From 88c9b983a9a43acb14a50dcbe54213d96e485ef1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2020 14:04:56 +0000 Subject: [PATCH 61/62] Bump postcss-normalize from 8.0.1 to 9.0.0 Bumps [postcss-normalize](https://github.com/csstools/postcss-normalize) from 8.0.1 to 9.0.0. - [Release notes](https://github.com/csstools/postcss-normalize/releases) - [Changelog](https://github.com/csstools/postcss-normalize/blob/master/CHANGELOG.md) - [Commits](https://github.com/csstools/postcss-normalize/commits/9.0.0) Signed-off-by: dependabot-preview[bot] --- packages/react-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 599b290a3ff..aea85809841 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -67,7 +67,7 @@ "pnp-webpack-plugin": "1.6.4", "postcss-flexbugs-fixes": "4.2.1", "postcss-loader": "3.0.0", - "postcss-normalize": "8.0.1", + "postcss-normalize": "9.0.0", "postcss-preset-env": "6.7.0", "postcss-safe-parser": "4.0.2", "react-app-polyfill": "^1.0.6", From afe1cdfd175249ebb31fa4e6d43f1403f3b669a2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2020 14:11:40 +0000 Subject: [PATCH 62/62] Bump jest-fetch-mock from 2.1.2 to 3.0.3 Bumps [jest-fetch-mock](https://github.com/jefflau/jest-fetch-mock) from 2.1.2 to 3.0.3. - [Release notes](https://github.com/jefflau/jest-fetch-mock/releases) - [Commits](https://github.com/jefflau/jest-fetch-mock/commits) Signed-off-by: dependabot-preview[bot] --- packages/react-error-overlay/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-error-overlay/package.json b/packages/react-error-overlay/package.json index ab86df3b209..a9c7bff7bfe 100644 --- a/packages/react-error-overlay/package.json +++ b/packages/react-error-overlay/package.json @@ -54,7 +54,7 @@ "flow-bin": "^0.130.0", "html-entities": "1.3.1", "jest": "26.2.2", - "jest-fetch-mock": "2.1.2", + "jest-fetch-mock": "3.0.3", "object-assign": "4.1.1", "promise": "8.1.0", "raw-loader": "^4.0.1",