Slim Dependencies
See original GitHub issueBased on a previous discussion.
This is a short list of some of what can be done to reduce some of the larger items that increase the overall size of react-scripts
. Excluded are smaller, opinionated, or rejected fixes.
- Currently, three versions of
acorn
are used.4.0.3
(560 KB), used byespree
,3.3.0
(520 KB), used byacorn-jsx
andwebpack
, and ~2.7.0
~4.0.8
(560 KB), used byacorn-globals
andjsdom
.- If #183 happens, the version of
webpack
required will require the same version ofacorn
thatespree
uses. - An issue has been raised for
acorn-jsx
to bump their required version ofacorn
, but there has been no response. - The latest release of
acorn-globals
requires the same version ofacorn
thatwebpack
andacorn-jsx
require, butjsdom
uses an older version. - An issue has been raised for
espree
to bump their required version ofacorn
.
- If #183 happens, the version of
- The version of
recursive-readdir
required specifically requires"minimatch": "3.0.2"
, preventing it from deduping with the"minimatch": ">= 3.0.3"
ineslint-plugin-import
. Which normally wouldn’t be that much of a problem, butyarn
seems to putminimatch@3.0.2
in the basenode_modules
folder while placingminimatch@3.0.3
in thenode_modules
folders ofbabel-core
,eslint-plugin-import
,glob
,fstream-ignore
,multimatch
,readdirp
, andsane
, meaning the same version of a ~30 KB dependency is copied six times over. Fixed with #1560. -
browserify-zlib
packages ~110 KB of tests. A PR has been filed. -
escope
depends ones6-map
andes6-weak-map
. These two packages, along with their dependantsd
,es5-ext
,es6-iterator
,es6-set
, andes6-symbol
, andevent-emitter
take up ~560 KB. An issue has been filed on this, butescope
does not seem to be actively maintained. It seemseslint
will forkhas forkedescope
for the next version, which does not contain the polyfills. -
istanbul-reports
packages a.nyc_output
folder of ~310 KB. A PR has been filed. -
jsx-ast-utils
packages ayarn.lock
of ~110 KB. An issue has been filed. - The version of
node-notifier
currently used byjest
required includes a CLI that is not used and depends on a framework that is not used elsewhere inreact-scripts
. https://github.com/facebook/jest/pull/2718, which is included injest@19.0.0
, resolved this.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:16
- Comments:21 (14 by maintainers)
Top Results From Across the Web
Dependency Container - Slim Framework
Slim uses a dependency container to prepare, manage, and inject application dependencies. Slim supports containers that implement PSR-11 or the ...
Read more >Dependency Injection in Slim 4 - Rob Allen's DevNotes
Dependency Injection in Slim 4 ... In contrast with Slim 2 and Slim 3, Slim 4 does not ship with a DI container,...
Read more >Slim - PHP-DI - The Dependency Injection Container for humans
Slim is a micro-framework for web applications and APIs. Given the framework is compatible with PSR-11, Slim can work with any container out...
Read more >In Slim Framework, what is a container and what is it for?
Slim uses a dependency container to prepare, manage, and inject application dependencies. Unlike its previous version, Slim 4 no longer ...
Read more >Slim is a PHP micro framework that helps you quickly ... - GitHub
This will install Slim and all required dependencies. Slim requires PHP 7.4 or newer. Choose a PSR-7 Implementation & ServerRequest Creator.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
You can take a high-level view here: http://pkgsize.com/react-scripts.html
jest
,webpack
,autoprefixer
andeslint
are the four largest contributors.autoprefixer
largely due to the ever increasingcaniuse-db
: http://pkgsize.com/autoprefixer.html (isautoprefixer
really a must-have?)jest
mostly due tojest-cli
mostly due tojsdom
stuff andistanbul-api
: http://pkgsize.com/jest-cli.html… and they all include a whole bunch of
babel
libs – of whichcore-js
makes up a large part: http://pkgsize.com/babel-runtime.htmljest@19.0.0
has been released, which contains thenode-notifier
bump. It’s also about a megabyte smaller.