Commit Graph

245 Commits

Author SHA1 Message Date
Kelvin Jin
88d6f029bd Add empty mock for http2 (#5686) 2019-03-13 19:50:19 -06:00
Ian Schmitz
1a04b96795 Type check JSON files (#6615) 2019-03-11 10:20:00 -06:00
Ian Sutherland
1548a0a92e Reapply "Speed up TypeScript v2 (#6406)" (#6586)
This reverts commit b2cf28b7f1 and reapplies #6406.
2019-03-06 17:46:38 -07:00
Ian Sutherland
b2cf28b7f1 Revert "Speed up TypeScript v2 (#6406)" (#6585)
This reverts commit 6a5b3cdaaa.
2019-03-06 17:33:17 -07:00
Ian Schmitz
6c8e2e53c5 Use contenthash instead of chunkhash for better long-term caching (#6387) 2019-02-20 18:24:19 -08:00
Jack Zhao
28f5427979 revert css sourcemaps in development (#6472)
This fixes #6399.
2019-02-20 16:16:18 -05:00
Ian Schmitz
6a5b3cdaaa Speed up TypeScript v2 (#6406)
* Revert "Revert "Speed up TypeScript projects (#5903)""

This reverts commit 544a5943ce.

* Move fork-ts-checker dep to react-dev-utils

* Convert WebpackDevServerUtils.createCompiler to take in options arg

* Update README.md for react-dev-utils
2019-02-18 16:31:44 -08:00
Ian Schmitz
09def49be5 Revert "Switch to eval-source-map (#5060)" (#6444)
This reverts commit 773d103986.
2019-02-18 06:50:16 -05:00
Gasim Gasimzada
319cf9b9e1 Add forward ref to SVG Component (#5457)
* Add forward ref to SVG component

* Write proper component for the ref test

* Add ref to jest svg transform and fix tests

* Fix SVG file location

* Use proper `ref` instead of svgRef in tests

* Add ref to svgr loader
2019-02-14 12:20:39 -07:00
Ian Schmitz
544a5943ce Revert "Speed up TypeScript projects (#5903)"
This reverts commit 5ce09db2b3.
2019-02-11 08:10:33 -08:00
Ian Schmitz
72c49ac807 Revert "Move fork-ts-checker-webpack-plugin dependency to react-dev-utils (#6395)"
This reverts commit c2b715847c.
2019-02-11 08:10:10 -08:00
X.L
c2b715847c Move fork-ts-checker-webpack-plugin dependency to react-dev-utils (#6395) 2019-02-11 07:41:55 -08:00
zhuoli99
18d5e87b75 Sass source map for dev (#5713)
Sass source map for dev
2019-02-07 21:18:50 -08:00
Tomáš Szabo
5ce09db2b3 Speed up TypeScript projects (#5903)
As a lot of [people](https://hackernoon.com/why-i-no-longer-use-typescript-with-react-and-why-you-shouldnt-either-e744d27452b4) is complaining about TypeScript performance in CRA, I decided to enable `async` mode in TypeScript checker.

These changes basically brings the JS compilation times to TS projects. So, recompilation took less than 1 second instead of 3 seconds in medium size project.

The problem with async mode is that type-errors are reported after Webpack ends up recompilation as TypeScript could be slower than Babel. PR allows to emit files compiled by Babel immediately and then wait for TS and show type errors in terminal later. Also, if there was no compilation errors and any type error occurs, we trigger a hot-reload with new errors to show error overlay in browser.

Also, I wanted to start a discussion about `skipLibCheck: false` option in default `tsconfig.json`. This makes recompilations really slow and we should consider to set it to `true` or at least give users a big warning to let them know that it could be really slow.

The following video is showing the updated workflow with a forced 2.5 second delay for type-check to give you an idea how it works.

![nov-26-2018 15-47-01](https://user-images.githubusercontent.com/5549148/49021284-9446fe80-f192-11e8-952b-8f83d77d5fbc.gif)


I'm pretty sure that PR needs some polishing and improvements but it should works as it is. Especially a "hack" with reloading the browser after type-check looks ugly to me.

cc @brunolemos as he is an initiator of an original TypeScript PR.

Should fix https://github.com/facebook/create-react-app/issues/5820
2019-02-07 19:34:52 -08:00
Charles Pritchard
bacb440748 Add empty mock for dns (#6292) 2019-02-05 09:38:52 +02:00
Dotan Simha
34e5029c54 Add empty mock for module (#5798) 2019-01-16 11:26:24 +02:00
Adam Laycock
8174eed5b3 Upgrade @svgr/webpack to 4.1.0 (#5816)
* Upgrade svgr to 4.0.3

* Upgrade svgr to 4.0.4

* Remove unnecessary prettier option

* Update to 4.1.0
2019-01-11 22:45:32 -05:00
Jason Laster
773d103986 Switch to eval-source-map (#5060)
Switches to eval-source-map, which is easier for webpack to recompute
when a file changes and has column based mappings, which lets firefox
devtools show original variable in the debugger and evaluate original
expressions in the console.
2019-01-06 22:42:05 -05:00
Ian Schmitz
005ee5b952 Bump eslint-plugin-react version and update webpack config (#6132)
* Bump eslint-plugin-react version

* Move eslint-plugin-react settings into eslint-config-react-app

* Add react/no-typos rule
2019-01-06 15:05:14 -08:00
shawtung
1aca3cc416 Fix comment typo (#6036) 2018-12-30 18:45:05 -08:00
Ian Schmitz
49e258b4a6 Support setupTests.ts (#5698) 2018-11-22 21:14:25 -08:00
Joe Haddad
30ee52cf3b Merge webpack configuration (#5722)
* Rename production configuration

* Upgrade lint staged

* Merge mode, bail, devtool, and entry

* Merge output settings

* Remove old comment

* Merge some trivial differences

* Disable minimize in development mode

* Only minify html and generate SW in production

* Adjust comment

* Toggle development plugins

* Add missing imports

* Scope settings

* Delete development config

* Use new config file

* Remove unnecessary config import
2018-11-07 22:11:20 -05:00
Joe Haddad
6364bbf6dc Remove react-scripts type reference on eject (#5611)
* Remove react-scripts type reference on eject

* Check for env file

* Check eject for typescript

* Shuffle appTypeDeclarations

* Append internal types on eject

* Ensure lib is published for types

* Adjust comment

* Don't add a bunch of new lines

* File should exist and not be deleted

* Add debug

* Set file explicitly

* Revert "Set file explicitly"

This reverts commit bcd58a36cbd08a71af50b037d8f1fae6c595fb4e.

* Copy file before destroying ourselves

* Revert "Add debug"

This reverts commit 0068ba81c6d79d99788877c9e1b618acd7412dce.
2018-10-29 23:15:52 -04:00
Bruno Lemos
feea693f63 Ignore json files from TypeScript type checking (#5614)
Fix #5613
2018-10-29 10:33:57 -04:00
Joe Haddad
3403f05e93 Ignore test files from reported type errors (#5608)
* Ignore test files from reported type errors

* Ignore setup proxy & test files
2018-10-28 15:24:12 -04:00
Joe Haddad
9747480f19 Turn on certain TypeScript options (#5607) 2018-10-28 14:47:06 -04:00
Joe Haddad
eca0ec0d52 Refine how TypeScript env types are handled (#5593)
* Specify types in package

* Do not remove types file on eject

* Stop copying types into generated project

* Reference react and react-dom

* Reference node types

* Install node types as well

* Restore copying

* Add Node to the list of installed types

* Reference Jest types

* Remove jest types from install

* Remove jest from CRA install

* Remove Jest reference and let user do this themselves

* Stop copying types file

* Add types key to package.json

* Add appTypeDeclarations and create when missing

* Rename declarations file

* Add Jest back to install instructions

* Minimize diff
2018-10-27 22:11:47 -07:00
Bruno Lemos
418e6ee6ff Fix process.env types (#5589)
Fix #5576
2018-10-26 12:07:01 -07:00
Bruno Lemos
68a37351d5 Add typings for process.env (#5557) 2018-10-24 15:26:00 -04:00
Bruno Lemos
dc7cdf4a26 Change import syntax from typescript declaration (#5559) 2018-10-24 13:32:32 -04:00
Joe Haddad
5ead915b73 Automatically setup TypeScript when detected (#5549)
* Don't resolve TS files if it's not detected in the project

* Automatically create tsconfig.json file for user

* Remove always false check

* Add missing file

* Don't filter paths too early
2018-10-24 00:59:26 -04:00
Bruno Lemos
4c558d7c26 Enable TypeScript json module resolver (#5531)
* Enable TypeScript json module resolver

* Update verifyTypeScriptSetup.js
2018-10-22 14:49:56 -04:00
Joe Haddad
5410da0bfc Add TypeScript error formatting (#5529) 2018-10-22 13:29:18 -04:00
Joe Haddad
680cf9371a Validate tsconfig when using TypeScript (#5524)
* Sanity check TypeScript config

* Check more options

* Set all defaults and suggestions

* Update docs

* Update doc notes

* Automatically copy react app declared types to project on start

* Remove note about loaders.d.ts
2018-10-22 08:15:41 -04:00
Joe Haddad
c019942bf9 Always type check TypeScript when being used (#5515)
* Always type check TypeScript when being used

* Use alternate version
2018-10-21 18:24:33 -04:00
Bruno Lemos
88aef1100f TypeScript syntax support (#4837) 2018-10-21 12:03:26 -04:00
Alex Forbes-Reed
9971653775 Add environment variable to optionaly disable inlining of chunks (#5354)
* Add environment variable to optionaly disable inlining of chunks

* Changed env var to `process.env.INLINE_RUNTIME_CHUNK `

* Added env var to Advanced Configuration in docs

* Drop implied behavior

* Tweak working to match other descriptions
2018-10-08 12:48:15 -04:00
Ben Brandt
183efedb42 Remove unused require for getCacheIdentifier after ejecting (#5317) 2018-10-05 13:01:52 -04:00
Joe Haddad
f166144557 Disable inline 3 option (#5281) 2018-10-03 15:43:37 -04:00
Joe Haddad
736561fa8b Add .mjs support back to webpack (#5258)
* Add `.mjs` support back to webpack, because webpack was not the problem

* Continue toggling `.mjs` to `javascript/auto` mode

* Be more inline with the specification

* Bump old Node to 6
2018-10-03 00:03:51 -04:00
Crux
d624f25df3 Fix GENERATE_SOURCEMAP env not working for css (#5246) 2018-10-02 10:37:42 -04:00
Maël Nison
9e074bbf08 Plug'n'Play support (#5136)
* Adds the PnP plugin for Webpack to find dependencies when working under PnP

* Adds configuration for jest

* Adds an e2e test for when using PnP

* Avoids cra from crashing at the engine check

* Avoids cra from crashing when initializing react-scripts

* Makes the ownPath portable

* Fixes linting

* Bumps to pnp-webpack-plugin@1.1.0, removes symlinks: false

* Adds a --use-pnp option

* Pin version
2018-10-01 15:53:07 +01:00
Dan Abramov
4a96247bf0 Treat .css and .sass/.scss as side effectful (#5197) 2018-10-01 15:07:09 +01:00
Dan Abramov
53e4c0ac0e Format SVG React snapshots as <svg> tag with props (#5196)
* Format SVG React snapshots as <svg> tag with props

* Keep output simpler
2018-10-01 14:50:23 +01:00
Joe Haddad
70b3110a75 Use Workbox CDN as default (#5180) 2018-09-30 17:58:40 -04:00
Joe Haddad
7b1a32be6e Polish webpack message output (#5174)
* Only install react-scripts in CI mode

* Link locally

* Re-enable all output tests

* 💄 Polish webpack output

* Test sass support message

* Add more tests, but disabled

* Format missing default export error

* Format aliased import

* Why was node-sass required? Odd

* Format webpack rejection error

* Re-enable unknown package test

* Format file not found error and catch module scope plugin error

* Re-disable case sensitive paths

* Intercept and format case sensitive path errors

* Test out of scope message formatting

* Run behavior on macOS

* Run behavior on Node 8 and 10, only Node 8 for macOS

* Add some debugging

* Update matcher

* Only check stderr

* Remove old snapshot

* More debug

* Remove debug

* Add new debug

* Disable test on linux

* Add comment for future
2018-09-30 17:44:49 -04:00
Joe Haddad
5abff641a9 Remove thread-loader (#5170)
* Remove thread-loader
After the cache is warm, it is possible for thread-loader to hurt speed

* Disable babel output formatting
2018-09-29 18:30:28 -04:00
Joe Haddad
232e892754 Drop comment 2018-09-28 23:05:53 -04:00
Joe Haddad
42026a01f7 Correctly lookup assets when using a relative build directory (#5163)
* Correctly lookup assets when using a relative build directory

* Hah, var ...

* Add e2e test for relative paths

* Format svg
2018-09-28 23:03:48 -04:00
Maël Nison
97c7131d12 Forwards args through thread-loader (#5157)
* Forwards args through thread-loader

* Comments & dev
2018-09-28 16:21:58 +01:00