From 63d76514bab20bb1270ff3904d6dfb2d848b3dff Mon Sep 17 00:00:00 2001 From: Dmitry Lepskiy Date: Thu, 4 Jul 2019 01:19:40 +0200 Subject: [PATCH 01/17] All get requests for /sockjs-node* excluded from processing by http-proxy-middleware #6720 --- packages/react-dev-utils/WebpackDevServerUtils.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/react-dev-utils/WebpackDevServerUtils.js b/packages/react-dev-utils/WebpackDevServerUtils.js index 1d7021e037c..106a9dfa6ed 100644 --- a/packages/react-dev-utils/WebpackDevServerUtils.js +++ b/packages/react-dev-utils/WebpackDevServerUtils.js @@ -361,10 +361,13 @@ function prepareProxy(proxy, appPublicFolder) { process.exit(1); } - // If proxy is specified, let it handle any request except for files in the public folder. + // If proxy is specified, let it handle any request except for + // files in the public folder and WebpackDevServer socket endpoint. function mayProxy(pathname) { const maybePublicPath = path.resolve(appPublicFolder, pathname.slice(1)); - return !fs.existsSync(maybePublicPath); + const isPublicFileRequest = fs.existsSync(maybePublicPath); + const isWdsEndpointRequest = pathname.startsWith('/sockjs-node'); // used by webpackHotDevClient + return !(isPublicFileRequest || isWdsEndpointRequest); } if (!/^http(s)?:\/\//.test(proxy)) { From 5a72c0d9e7034adcbedc55c31b4af6e17bd6d820 Mon Sep 17 00:00:00 2001 From: Dmitry Lepskiy Date: Mon, 15 Jul 2019 18:51:21 +0200 Subject: [PATCH 02/17] Update packages/react-dev-utils/WebpackDevServerUtils.js Co-Authored-By: Brody McKee --- packages/react-dev-utils/WebpackDevServerUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-dev-utils/WebpackDevServerUtils.js b/packages/react-dev-utils/WebpackDevServerUtils.js index 106a9dfa6ed..8d74e8cf131 100644 --- a/packages/react-dev-utils/WebpackDevServerUtils.js +++ b/packages/react-dev-utils/WebpackDevServerUtils.js @@ -362,7 +362,8 @@ function prepareProxy(proxy, appPublicFolder) { } // If proxy is specified, let it handle any request except for - // files in the public folder and WebpackDevServer socket endpoint. + // files in the public folder and requests to the WebpackDevServer socket endpoint. + // https://github.com/facebook/create-react-app/issues/6720 function mayProxy(pathname) { const maybePublicPath = path.resolve(appPublicFolder, pathname.slice(1)); const isPublicFileRequest = fs.existsSync(maybePublicPath); From 24e652635010b4f14166b00c6064dd5f9fa8ed33 Mon Sep 17 00:00:00 2001 From: Jon Seidel Date: Wed, 10 Jul 2019 08:56:48 -0700 Subject: [PATCH 03/17] Update minimum Node version in README (#7182) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 347d4359760..f499fdd49f6 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Just create a project, and you’re good to go. ## Creating an App -**You’ll need to have Node 8.10.0 or later on your local development machine** (but it’s not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to easily switch Node versions between different projects. +**You’ll need to have Node 8.16.0 or Node 10.16.0 or later version on your local development machine** (but it’s not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to easily switch Node versions between different projects. To create a new app, you may choose one of the following methods: From 38470e2741c8dc4aa8304cd578ed5708e3fca0ac Mon Sep 17 00:00:00 2001 From: Min ho Kim Date: Tue, 16 Jul 2019 00:12:35 +1000 Subject: [PATCH 04/17] Fix various typos (#7355) --- CHANGELOG-1.x.md | 4 ++-- azure-pipelines.yml | 4 ++-- packages/react-error-overlay/src/utils/unmapper.js | 2 +- packages/react-scripts/config/webpack.config.js | 4 ++-- tasks/e2e-installs.sh | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG-1.x.md b/CHANGELOG-1.x.md index ae2725af297..be64a067a8c 100644 --- a/CHANGELOG-1.x.md +++ b/CHANGELOG-1.x.md @@ -482,7 +482,7 @@ yarn add --exact react-scripts@1.0.16 - [#3150](https://github.com/facebook/create-react-app/pull/3150) Remove an useless negation in `registerServiceWorker.js`. ([@dunglas](https://github.com/dunglas)) - [#3158](https://github.com/facebook/create-react-app/pull/3158) Remove `output.path` from dev webpack config. ([@nikolas](https://github.com/nikolas)) - - [#3281](https://github.com/facebook/create-react-app/pull/3281) Add a workaround for Uglify incompatiblity with Safari 10.0 in the future. ([@satyavh](https://github.com/satyavh)) + - [#3281](https://github.com/facebook/create-react-app/pull/3281) Add a workaround for Uglify incompatibility with Safari 10.0 in the future. ([@satyavh](https://github.com/satyavh)) - [#3146](https://github.com/facebook/create-react-app/pull/3146) Fix `reason-react` support. ([@lpalmes](https://github.com/lpalmes)) - [#3236](https://github.com/facebook/create-react-app/pull/3236) Update `style-loader` and disable inclusion of its HMR code in builds. ([@insin](https://github.com/insin)) - [#3246](https://github.com/facebook/create-react-app/pull/3246) Update `url-loader` to 0.6.2 for mime ReDoS vulnerability. ([@d3viant0ne](https://github.com/d3viant0ne)) @@ -1443,7 +1443,7 @@ yarn add --dev --exact react-scripts@1.0.1 ## 1.0.0 (May 18, 2017) -We’ve been working on this release for the past few months, and there are many big impovements, from migrating to webpack 2 to a brand new runtime error overlay and built-in support for Progressive Web Apps. +We’ve been working on this release for the past few months, and there are many big improvements, from migrating to webpack 2 to a brand new runtime error overlay and built-in support for Progressive Web Apps. So instead of just enumerating them here, we decided to write a blog post about all the new features.
Check it out: **[What’s New in Create React App](https://facebook.github.io/react/blog/2017/05/18/whats-new-in-create-react-app.html)**. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c51be42da86..1f770cc7105 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,7 +12,7 @@ variables: NPM_CONFIG_CACHE: $(Build.SourcesDirectory)/../npm-cache # Sets TEMP to be on the same drive as the cloned source on Windows. This avoids test scripts that "cd" into a directory under TEMP from failing because this directory is on a different drive from the current directory. VSTS_OVERWRITE_TEMP: True - # Override Verdaccio package to use. This is temoporary and is needed to avoid socket timeouts on hosted Windows agent (on Azure). This also changes Verdaccio to return a 503 (service unavailable) instead of a 404 (not found) when the connection to the uplink timesout. + # Override Verdaccio package to use. This is temporary and is needed to avoid socket timeouts on hosted Windows agent (on Azure). This also changes Verdaccio to return a 503 (service unavailable) instead of a 404 (not found) when the connection to the uplink timesout. VERDACCIO_PACKAGE: https://github.com/willsmythe/verdaccio/releases/download/create-react-app/verdaccio-4.0.0-alpha.8.tgz # ****************************************************************************** @@ -67,7 +67,7 @@ jobs: # Old Node test suite # ****************************************************************************** - job: OldNode - pool: + pool: vmImage: ubuntu-16.04 steps: - task: NodeTool@0 diff --git a/packages/react-error-overlay/src/utils/unmapper.js b/packages/react-error-overlay/src/utils/unmapper.js index c61fad4fb6c..4c95ab4d7b3 100644 --- a/packages/react-error-overlay/src/utils/unmapper.js +++ b/packages/react-error-overlay/src/utils/unmapper.js @@ -12,7 +12,7 @@ import { getLinesAround } from './getLinesAround'; import path from 'path'; function count(search: string, string: string): number { - // Count starts at -1 becuse a do-while loop always runs at least once + // Count starts at -1 because a do-while loop always runs at least once let count = -1, index = -1; do { diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 771b06c94d1..7543dbbe203 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -197,7 +197,7 @@ module.exports = function(webpackEnv) { terserOptions: { parse: { // we want terser to parse ecma 8 code. However, we don't want it - // to apply any minfication steps that turns valid ecma 5 code + // to apply any minification steps that turns valid ecma 5 code // into invalid ecma 5 code. This is why the 'compress' and 'output' // sections only apply transformations that are ecma 5 safe // https://github.com/facebook/create-react-app/pull/4234 @@ -213,7 +213,7 @@ module.exports = function(webpackEnv) { comparisons: false, // Disabled because of an issue with Terser breaking valid code: // https://github.com/facebook/create-react-app/issues/5250 - // Pending futher investigation: + // Pending further investigation: // https://github.com/terser-js/terser/issues/120 inline: 2, }, diff --git a/tasks/e2e-installs.sh b/tasks/e2e-installs.sh index 27577cdef0d..f083f2dd09b 100755 --- a/tasks/e2e-installs.sh +++ b/tasks/e2e-installs.sh @@ -213,7 +213,7 @@ exists node_modules/react-scripts-fork # ****************************************************************************** cd "$temp_app_path" -# we will install a non-existing package to simulate a failed installataion. +# we will install a non-existing package to simulate a failed installation. npx create-react-app test-app-should-not-exist --scripts-version=`date +%s` || true # confirm that the project files were deleted test ! -e test-app-should-not-exist/package.json @@ -226,7 +226,7 @@ test ! -d test-app-should-not-exist/node_modules cd "$temp_app_path" mkdir test-app-should-remain echo '## Hello' > ./test-app-should-remain/README.md -# we will install a non-existing package to simulate a failed installataion. +# we will install a non-existing package to simulate a failed installation. npx create-react-app test-app-should-remain --scripts-version=`date +%s` || true # confirm the file exist test -e test-app-should-remain/README.md From 1d54ecf21dbb2b77a37585ae65e5cec03d86d209 Mon Sep 17 00:00:00 2001 From: Sudhir Mitharwal Date: Mon, 15 Jul 2019 20:24:19 +0530 Subject: [PATCH 05/17] Allow title to be set when importing SVGs (#7118) --- .github/ISSUE_TEMPLATE/bug_report.md | 15 ++++----------- .github/ISSUE_TEMPLATE/proposal.md | 4 ++-- packages/react-scripts/config/webpack.config.js | 3 ++- packages/react-scripts/package.json | 2 +- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ef59c777e7e..ac73b33e7de 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,7 +1,7 @@ --- name: Bug report about: Create a report to help us improve -labels: "issue: bug" +labels: 'issue: bug' --- diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 7543dbbe203..dae2405140b 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -388,7 +388,8 @@ module.exports = function(webpackEnv) { { loaderMap: { svg: { - ReactComponent: '@svgr/webpack?-svgo,+ref![path]', + ReactComponent: + '@svgr/webpack?-svgo,+titleProp,+ref![path]', }, }, }, diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index af92d8ab28b..7d4a3a0c43c 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -29,7 +29,7 @@ "types": "./lib/react-app.d.ts", "dependencies": { "@babel/core": "7.4.3", - "@svgr/webpack": "4.2.0", + "@svgr/webpack": "4.3.1", "@typescript-eslint/eslint-plugin": "1.10.2", "@typescript-eslint/parser": "1.10.2", "babel-eslint": "10.0.1", From 98aa82f74c85e4184fc01425e2620a49099d19e4 Mon Sep 17 00:00:00 2001 From: Sudhir Mitharwal Date: Tue, 16 Jul 2019 00:15:25 +0530 Subject: [PATCH 06/17] docs(svg): add tip for title props accessibility (#7374) --- docusaurus/docs/adding-images-fonts-and-files.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docusaurus/docs/adding-images-fonts-and-files.md b/docusaurus/docs/adding-images-fonts-and-files.md index deb6cc39f89..92704ad1f58 100644 --- a/docusaurus/docs/adding-images-fonts-and-files.md +++ b/docusaurus/docs/adding-images-fonts-and-files.md @@ -59,3 +59,5 @@ const App = () => ( ``` This is handy if you don't want to load SVG as a separate file. Don't forget the curly braces in the import! The `ReactComponent` import name is special and tells Create React App that you want a React component that renders an SVG, rather than its filename. + +> **Tip:** The imported SVG React Component accepts a `title` prop along with other props that a `svg` element accepts. Use this prop to add an accessbile title to your svg component. From 0bc4ce54ef5ebfdef6cf4aa518b5673a84dbc958 Mon Sep 17 00:00:00 2001 From: Brody McKee Date: Tue, 16 Jul 2019 12:17:52 +0300 Subject: [PATCH 07/17] Allow extending config used in eslint-loader (#7036) --- docusaurus/docs/advanced-configuration.md | 1 + docusaurus/docs/setting-up-your-editor.md | 48 +++++++++++++++---- packages/eslint-config-react-app/index.js | 2 +- .../react-scripts/config/webpack.config.js | 28 +++++++++-- packages/react-scripts/scripts/eject.js | 10 ++-- 5 files changed, 71 insertions(+), 18 deletions(-) diff --git a/docusaurus/docs/advanced-configuration.md b/docusaurus/docs/advanced-configuration.md index 9799a1ad403..ab51e951b03 100644 --- a/docusaurus/docs/advanced-configuration.md +++ b/docusaurus/docs/advanced-configuration.md @@ -22,3 +22,4 @@ You can adjust various development and production settings by setting environmen | NODE_PATH | ✅ Used | ✅ Used | Same as [`NODE_PATH` in Node.js](https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders), but only relative folders are allowed. Can be handy for emulating a monorepo setup by setting `NODE_PATH=src`. | | INLINE_RUNTIME_CHUNK | 🚫 Ignored | ✅ Used | By default, Create React App will embed the runtime script into `index.html` during the production build. When set to `false`, the script will not be embedded and will be imported as usual. This is normally required when dealing with CSP. | | IMAGE_INLINE_SIZE_LIMIT | 🚫 Ignored | ✅ Used | By default, images smaller than 10,000 bytes are encoded as a data URI in base64 and inlined in the CSS or JS build artifact. Set this to control the size limit in bytes. Setting it to 0 will disable the inlining of images. | +| EXTEND_ESLINT | ✅ Used | ✅ Used | When set to `true`, ESLint configs that extend `eslint-config-react-app` will be used by `eslint-loader`. Any rules that are set to `"error"` will stop the application from building. | diff --git a/docusaurus/docs/setting-up-your-editor.md b/docusaurus/docs/setting-up-your-editor.md index 869592d2915..844b9bc5da2 100644 --- a/docusaurus/docs/setting-up-your-editor.md +++ b/docusaurus/docs/setting-up-your-editor.md @@ -18,15 +18,7 @@ To configure the syntax highlighting in your favorite text editor, head to the [ Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint. -They are not required for linting. You should see the linter output right in your terminal as well as the browser console. However, if you prefer the lint results to appear right in your editor, there are some extra steps you can do. - -You would need to install an ESLint plugin for your editor first. Then, add a file called `.eslintrc.json` to the project root: - -```json -{ - "extends": "react-app" -} -``` +They are not required for linting. You should see the linter output right in your terminal as well as the browser console. If you prefer the lint results to appear right in your editor, please make sure you install an ESLint plugin/extension. If you're using TypeScript and Visual Studio Code, the [ESLint Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint#overview) currently [doesn't have TypeScript support enabled by default](https://github.com/Microsoft/vscode-eslint/issues/609). To enable TypeScript support in the ESLint extension, add the following to your project's Visual Studio Code settings file, located at `.vscode/settings.json` (you can create this file if it doesn't already exist): @@ -43,10 +35,46 @@ If you're using TypeScript and Visual Studio Code, the [ESLint Visual Studio Cod Now your editor should report the linting warnings. -Note that even if you edit your `.eslintrc.json` file further, these changes will **only affect the editor integration**. They won’t affect the terminal and in-browser lint output. This is because Create React App intentionally provides a minimal set of rules that find common mistakes. +Note that even if you customise your ESLint config, these changes will **only affect the editor integration**. They won’t affect the terminal and in-browser lint output. This is because Create React App intentionally provides a minimal set of rules that find common mistakes. If you want to enforce a coding style for your project, consider using [Prettier](https://github.com/jlongster/prettier) instead of ESLint style rules. +### Experimental: Extending the ESLint config + +We recognise that in some cases, further customisation is required. It is now possible to extend the base ESLint config by setting the `EXTEND_ESLINT` environment variable to `true`. See [advanced configuration](advanced-configuration.md) for more information on available environment variables. + +Note that any rules set to `"error"` will stop the project from building. + +There are a few things to remember: + +1. You must extend the base config, as removing it could introduce hard-to-find issues. +1. When working with TypeScript, you'll need to provide an `overrides` object for rules that should _only_ target TypeScript files. + +In the below example: + +- the base config has been extended by a shared ESLint config, +- a new rule has been set that applies to all JavaScript and TypeScript files, and +- a new rule has been set that only targets TypeScript files. + +```json +{ + "eslintConfig": { + "extends": ["react-app", "shared-config"], + "rules": { + "additional-rule": "warn" + }, + "overrides": [ + { + "files": ["**/*.ts?(x)"], + "rules": { + "additional-typescript-only-rule": "warn" + } + } + ] + } +} +``` + ## Debugging in the Editor **This feature is currently only supported by [Visual Studio Code](https://code.visualstudio.com) and [WebStorm](https://www.jetbrains.com/webstorm/).** diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index c06cfabfb43..df499e030e7 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -54,7 +54,7 @@ module.exports = { overrides: [ { - files: ['**/*.ts', '**/*.tsx'], + files: ['**/*.ts?(x)'], parser: '@typescript-eslint/parser', parserOptions: { ecmaVersion: 2018, diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index dae2405140b..03fd965370a 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -33,6 +33,7 @@ const getClientEnvironment = require('./env'); const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin'); const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin'); const typescriptFormatter = require('react-dev-utils/typescriptFormatter'); +const eslint = require('eslint'); // @remove-on-eject-begin const getCacheIdentifier = require('react-dev-utils/getCacheIdentifier'); // @remove-on-eject-end @@ -323,9 +324,30 @@ module.exports = function(webpackEnv) { formatter: require.resolve('react-dev-utils/eslintFormatter'), eslintPath: require.resolve('eslint'), // @remove-on-eject-begin - baseConfig: { - extends: [require.resolve('eslint-config-react-app')], - }, + baseConfig: (() => { + const eslintCli = new eslint.CLIEngine(); + let eslintConfig; + try { + eslintConfig = eslintCli.getConfigForFile(paths.appIndexJs); + } catch (e) { + // A config couldn't be found. + } + + // We allow overriding the config, only if it extends our config + // (`extends` can be a string or array of strings). + if ( + process.env.EXTEND_ESLINT && + eslintConfig && + eslintConfig.extends && + eslintConfig.extends.includes('react-app') + ) { + return eslintConfig; + } else { + return { + extends: [require.resolve('eslint-config-react-app')], + }; + } + })(), ignore: false, useEslintrc: false, // @remove-on-eject-end diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 7bad09e513c..2a494ffe24f 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -239,10 +239,12 @@ inquirer }; // Add ESlint config - console.log(` Adding ${cyan('ESLint')} configuration`); - appPackage.eslintConfig = { - extends: 'react-app', - }; + if (!appPackage.eslintConfig) { + console.log(` Adding ${cyan('ESLint')} configuration`); + appPackage.eslintConfig = { + extends: 'react-app', + }; + } fs.writeFileSync( path.join(appPath, 'package.json'), From 82e49e46fa87cf6a104f1cb3345617fa5d6ac209 Mon Sep 17 00:00:00 2001 From: Guy Romm Date: Tue, 16 Jul 2019 17:56:28 +0300 Subject: [PATCH 08/17] jsx-no-duplicate-props ignore case fix (#7230) Co-Authored-By: Ian Schmitz --- packages/eslint-config-react-app/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index df499e030e7..c4b0289e1fb 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -249,7 +249,7 @@ module.exports = { // https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules 'react/forbid-foreign-prop-types': ['warn', { allowInPropTypes: true }], 'react/jsx-no-comment-textnodes': 'warn', - 'react/jsx-no-duplicate-props': ['warn', { ignoreCase: true }], + 'react/jsx-no-duplicate-props': 'warn', 'react/jsx-no-target-blank': 'warn', 'react/jsx-no-undef': 'error', 'react/jsx-pascal-case': [ From 5f026f6706fedf0ffce192f6aafb68d4b218a930 Mon Sep 17 00:00:00 2001 From: Ivan Pegashev Date: Thu, 18 Jul 2019 21:02:39 +0500 Subject: [PATCH 09/17] Update docs to indicate dynamic imports are stage 4 (#7372) --- docusaurus/docs/code-splitting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/code-splitting.md b/docusaurus/docs/code-splitting.md index ace13fdfcce..4c453f4a638 100644 --- a/docusaurus/docs/code-splitting.md +++ b/docusaurus/docs/code-splitting.md @@ -5,7 +5,7 @@ title: Code Splitting Instead of downloading the entire app before users can use it, code splitting allows you to split your code into small chunks which you can then load on demand. -This project setup supports code splitting via [dynamic `import()`](http://2ality.com/2017/01/import-operator.html#loading-code-on-demand). Its [proposal](https://github.com/tc39/proposal-dynamic-import) is in stage 3. The `import()` function-like form takes the module name as an argument and returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which always resolves to the namespace object of the module. +This project setup supports code splitting via [dynamic `import()`](http://2ality.com/2017/01/import-operator.html#loading-code-on-demand). Its [proposal](https://github.com/tc39/proposal-dynamic-import) is in stage 4. The `import()` function-like form takes the module name as an argument and returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which always resolves to the namespace object of the module. Here is an example: From 34b8ee0a558d4b0d9b190b6c24aa1e2959d68c40 Mon Sep 17 00:00:00 2001 From: Alex Guerra Date: Thu, 18 Jul 2019 15:46:04 -0500 Subject: [PATCH 10/17] Fix CI issue on windows (#7385) * Attempt at fixing CI issue on windows * Try to debug why verdaccio isn't in the ps output * Just remove the kill call alltogether --- tasks/local-registry.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/tasks/local-registry.sh b/tasks/local-registry.sh index 715380a8a85..f19a73c4ca3 100644 --- a/tasks/local-registry.sh +++ b/tasks/local-registry.sh @@ -25,9 +25,6 @@ function stopLocalRegistry { # Restore the original NPM and Yarn registry URLs and stop Verdaccio npm set registry "$original_npm_registry_url" yarn config set registry "$original_yarn_registry_url" - - # Kill Verdaccio process - ps -ef | grep 'verdaccio' | grep -v grep | awk '{print $2}' | xargs kill -9 } function publishToLocalRegistry { From 6e8bac423adea1e2af1cd9a745f8d892aef0a5b4 Mon Sep 17 00:00:00 2001 From: Alex Guerra Date: Tue, 16 Jul 2019 15:00:50 -0500 Subject: [PATCH 11/17] Update url-loader to 2.0.1 This closes #7359 by making IMAGE_INLINE_SIZE_LIMIT=0 actually disable image inlining. We use url-loader's `limit` option to set the line at which images will be inlined, and we basically expose this option to our end users via the IMAGE_INLINE_SIZE_LIMIT environment variable. Most people using it want to disable inlining images all together (the major motivator for adding it at all was I think for strict CSP), and our documentation said setting the value to zero would do that. However, it did the opposite: url-loader treated zero as "no limit". The update to 2.x fixes this; zero means nothing gets inlined. The other changes from the version bump shouldn't affect us: - minimum node version is 8.9.x, we already require 8.10.x - the limit was "greater than", is now "greater than or equal to" --- 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 7d4a3a0c43c..3586204650a 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -75,7 +75,7 @@ "style-loader": "0.23.1", "terser-webpack-plugin": "1.2.3", "ts-pnp": "1.1.2", - "url-loader": "1.1.2", + "url-loader": "2.0.1", "webpack": "4.35.0", "webpack-dev-server": "3.2.1", "webpack-manifest-plugin": "2.0.4", From 5c9773a67eaaaaefdf4998ca2d6575dbcb97d4c3 Mon Sep 17 00:00:00 2001 From: Rudolph Gottesheim Date: Mon, 22 Jul 2019 18:14:55 +0200 Subject: [PATCH 12/17] Docs: remove note about TypeScript files requiring at least one export (#7260) --- docusaurus/docs/running-tests.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docusaurus/docs/running-tests.md b/docusaurus/docs/running-tests.md index e166c71dfd0..e33a4bf27f2 100644 --- a/docusaurus/docs/running-tests.md +++ b/docusaurus/docs/running-tests.md @@ -111,8 +111,6 @@ import Adapter from 'enzyme-adapter-react-16'; configure({ adapter: new Adapter() }); ``` -> Note: When using TypeScript with Babel, all your files need to have at least one export, otherwise you will get the error `Cannot compile namespaces when the '--isolatedModules' flag is provided.`. To fix this, you can add `export default undefined` to `src/setupTests.ts`. - > Note: Keep in mind that if you decide to "eject" before creating `src/setupTests.js`, the resulting `package.json` file won't contain any reference to it. [Read here](#initializing-test-environment) to learn how to add this after ejecting. Now you can write a smoke test with it: From da4c49fba6695f312ba12f61567b3b2044dbbe94 Mon Sep 17 00:00:00 2001 From: Ian Sutherland Date: Thu, 25 Jul 2019 10:39:34 -0600 Subject: [PATCH 13/17] Add question issue template (#7423) * Add question issue template * Fix bug report template formatting * Fix bug report template formatting * Add labels to pull request template --- .github/CODEOWNERS | 2 +- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/proposal.md | 2 +- .github/ISSUE_TEMPLATE/question.md | 13 +++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 4 ++++ 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/question.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ebb18e94002..2308496a692 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,2 @@ -packages/ @amyrlam @bugzpodder @gaearon @ianschmitz @iansu @mrmckeb @petetnt @timer +packages/ @bugzpodder @ianschmitz @iansu @mrmckeb @petetnt docusaurus/ @amyrlam @iansu diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ac73b33e7de..ac2eebaa4b9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,7 +1,7 @@ --- name: Bug report about: Create a report to help us improve -labels: 'issue: bug' +labels: 'issue: bug, needs triage' ---