Profile picture
, 34 tweets, 3 min read Read on Twitter
Ejecting react-create-app shows just how horribly and hoplessly complicated #Javascript infrastructure has become
I mean, besides the sheer number of moving parts, a third of configuration is about fighting bugs and behaviour in another third
Literally half of the code is "why the EFF isn't this default behaviour?"
Another half of the code is "how do you even discover this configuration, much less make sure it works correctly?"
This is absolute sheer insanity, and *everyone is not just ok with it, but praises this, and cheers this on*
Every single line in webpack.*.js by create-react-app is documented, otherwise you have no chance in hell understanding what is going on
Don't forget about ~150 LOC build/run/test scripts that spend half of their time fighting each other and other tools
Because *of course* you need to write your own webpack message formatter
Because *of course* you need to manually copy your public folder
Because *of course* you have to manually set up listeners for SIGINT and SIGTERM to tear down the dev server
Because *of course* you have to manually write a module resolution helper that basically replicates node's resolution mechanism
Because *of course* you have to manually write code that provides env variables to your code
Because *of course* dev server spits tons of crap, so you silence it and manually write a custom message emitter
Because *of course* you have to write your own error overlay for a dev server
Because *of course* you have to pretend your structured folders are flat for some tools, and you have to write manual overrides
Because *of course* source map generation may OOM, and you have to protect against that
Because *of course* you have to manually prevent people from importing stuff outside your project, or things "will be confusing"
Literally a third of comments are basically "this is a workaround, see issue #<three-four-digit-number>"
"Exclude .js files in file loader to keep css loader working". Process this sentence. Come back when you regain your will to live
You have to manually tell the caching plugin not to bust the cache of already cached paths, cached by the tool the plugin is written for
You have to manually create a list of your assets, otherwise you'd have to parse the html file to get them
Note, all of those "have to" are "*of course* you have to"
"By default ... this is confusing" is a thing that you really want to read in configuration code that overrides default behaviour
Of *course* you have to manually make sure that symlinks are resolved
*Of course* you have to manually read environment variables
and make sure they have been read be fore anything is built/started
And, of course, if something breaks, there's no chance in hell you'll be able to figure out what breaks
I mean, if something breaks in any of the tools.
Any tool that lets you transpile and bundle your stuff without jumping through hoops made of burning shit will take the world by storm
Well, all the CLI tools (angular-cli, react-create-app etc.) are quite popular just because they hide all this insanity
The amount of work people end up pouring into this (both as developers *and* users) is just insane
I feel really sorry for the developers of react-create-app. I cannot imaging the number of tableflips they go through at each iteration
Anyway. This was my rant of the day. I wanted to setup yet another side project. I'll just go ahead and gouge my eyes out with a rusty spoon
/end rant
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Dmitrii
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member and get exclusive features!

Premium member ($3.00/month or $30.00/year)

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!