Commit Graph

256 Commits

Author SHA1 Message Date
Peter Bengtsson
9d70c7afab Add environment variable to control image inlining threshold (#6060)
Fixes #3437
2019-06-17 21:25:39 -07:00
Maël Nison
b36d1ea1aa Adds the configuration for PnP/Typescript (#6856)
* Adds the configuration for PnP/Typescript

* Adds the header

* Bumps ts-pnp

* Bumps fork-ts-checker-webpack-plugin
2019-05-01 15:04:44 -06:00
Cory Reed
a2ae8a79c0 Remove Object.assign from MiniCssExtractPlugin options (#6854) 2019-04-29 09:31:50 -06:00
Dallon Feldner
785dd47937 Generate SVG component name in Jest fileTransform (#6706) 2019-04-25 15:35:03 -06:00
Robert van Steen
e7a2d6168a Set baseUrl from jsconfig.json/tsconfig.json (#6656)
* Set baseUrl from jsconfig.json/tsconfig.json

* Resolve the path for loading modules

* Add tests for jsconfig.json

* Add jsconfig.json

* Update packages/react-scripts/scripts/start.js

* Move baseUrl test to config folder

* Remove alias test

* Use chalk from react-dev-utils

* Add lost absolute file for typescript baseUrl test

* Update packages/react-scripts/config/modules.js

* Update other references of useTypeScript to hasTsConfig

* Fix casing of TypeScript

* Keep respecting NODE_PATH for now to support multiple module paths.

* Add test for NODE_PATH

* Add fallback if NODE_PATH is not set.

* Fix node path behavior tests

* Remove debugging code from behavior test suite

* Remove more debugging code

* Show NODE_PATH deprecation warning during build


Co-authored-by: Ian Sutherland <ian@iansutherland.ca>
Co-authored-by: Brody McKee <mrmckeb@users.noreply.github.com>
Co-authored-by: Jack Zhao <jzhao@fb.com>
2019-04-16 15:08:24 -06:00
Ian Sutherland
9048dd66a0 Move list of files under files key in asset manifest (#6821) 2019-04-15 21:35:25 -06:00
Travis Fischer
50c1884e62 Fix react-scripts peer dependencies link local issue (#6579) (#6580) 2019-04-15 20:59:12 -06:00
Hrusikesh Panda
550274e307 Adds PostCSS Normalize (#5810)
* Add postcss-normalize plugin

* Configure PostCSS Normalize

* Add documentation

* Include the doc in sidebar

* Fix the id in sidebar.json

* Update adding-css-reset.md


Co-authored-by: Jack Zhao <jzhao@fb.com>
Co-authored-by: Ian Sutherland <ian@iansutherland.ca>
2019-04-05 10:23:59 -06:00
Endilie Yacop Sucipto
3e336d91e0 fix: terser-webpack-plugin hanging on WSL (#6732)
* fix: terser-webpack-plugin hanging on WSL

* nits

* Merge branch 'master' into terser-parallel-bug-wsl

Co-authored-by: Jack Zhao <jzhao@fb.com>
2019-04-04 23:24:27 -06:00
Ian Sutherland
001c23eff4 Enable futureEmitAssets in webpack config (#6696) 2019-04-04 14:35:48 -06:00
Ian Schmitz
eee8491d57 Add TypeScript linting support (#6513)
* Initial pass adding typescript-eslint

* Add warning to shared rule set

* Add documentation for setting up VSCode extension

* Provide tsconfig path to typescript-eslitn
2019-03-14 21:17:17 -06:00
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