News for hackers. Stuff that matters.
Re:A Newly-Generated Create-React-App 2.1.5 App Has 1,568 De... by Etheryte on Monday February 18, 2019 @08:13PM (#19195940)
For context, I'm a lead frontend dev in a company of a few hundred people.

Most people don't remotely know how Webpack works. And they shouldn't have to! Same for most other developer tools. You need a few people who can dig out issues if they arise, but most of your people will be concerned with actually building things on top of those tools.

When every team starts a new project from every few months to every few years, having a boilerplate setup quickly becomes very valuable. The added benefit that third-party boilerplate has is that you don't have to maintain the whole lot yourself.

Needless to say these upsides don't come without issues, security and accountability being the big elephants in the room, but popularity helps here, too. The boilerplate is used by a lot of people, in organizations both big and small. If an issue arises, you can usually collectively work out the problem very quickly. It doesn't make the issues go away, but it gives you a good balancing point.

As a tradeoff versus either setting up every project manually or maintaining your own boilerplate project, it's definitely worth consideration — it might not match your needs, but it's a strong option.

Re:A Newly-Generated Create-React-App 2.1.5 App Has 1,568 De... by Waterluvian on Monday February 18, 2019 @08:26PM (#19195996)
Thanks for sharing. I'm not going to be one of those, "well you should learn how it works" kind of people. If people make useful, maintainable products with these tools, great.

I think maybe I just struggle with the concept of being that hands-off with the tooling. I don't think I could cede control to some one-size-fits-all solution. For example, what happens when you run into some important library that doesn't tree shake or minify properly? What do people do? Do they just pick different libraries for the wrong reason? Do they just deploy an un-optimized application?

Not knowing how the stuff you depend on works feels really scary to me. Reminds me of the Star Trek TNG episode about "The Custodian" where the colony came to depend on a tool that nobody knew how to fix, so their lives were shaped by the tool's abilities, not the people's desires.

Re:A Newly-Generated Create-React-App 2.1.5 App Has 1,568 De... by sorahn on Tuesday February 19, 2019 @02:55AM (#19197357)
The flip side of this, is I know how it all works, and I don't want to deal with it anymore. I spent 2 quarters at my last job digging through all the webpack/babel stuff just to come up with something that didn't work as well as CRA does out of the box.

And on top of that, it's all different now. I'm not as interested in trying to maintain all of that, on top of maintaining my app. CRA is a fantastic tool for this.

Re:A Newly-Generated Create-React-App 2.1.5 App Has 1,568 De... by singlow on Tuesday February 19, 2019 @12:10AM (#19196753)
That is why Create-React-App has an exit option. This results in a configured WebPack app that can be customized by hand but no longer can be re-configured with c-r-a. I learned a lot about WebPack and other dev tool configs by exiting from c-r-a to see what it produced since I hadn't used WebPack prior to react.
Re:A Newly-Generated Create-React-App 2.1.5 App Has 1,568 De... by mnm1 on Tuesday February 19, 2019 @03:09AM (#19197403)
> Most people don't remotely know how Webpack works. And they shouldn't have to!

Until it breaks down leaving the project in an unmaintainable state, you're right. Then it's a scramble to understand and update that in my experience usually results in locking that dependency down to a strict version number and hoping that won't break anything else. It's great for security as pointed out in this thread /s. Not the optimal solution, but then again, they don't pay me enough/have enough staff for the optimal solution. And this is code that isn't even part of the app! Just shitty tools preventing me from even building the app. I can relate to the people complaining on here. This is with one or two dependencies too. Try solving those issues a few thousand times. You'll wish this horrific trend of front end code compilation would just stop. The problems truly never end as soon as one has to deal with npm and js dependencies. Which is not to say other languages don't have the same problems. They do, just not on this epic scale of shit.

Re:A Newly-Generated Create-React-App 2.1.5 App Has 1,568 De... by MystK on Tuesday February 19, 2019 @09:53AM (#19199278)
From my experience, I’ve never had CRA suddenly break down all of a sudden and leave it in an unmaintainable state. The whole point of CRA is that doesn’t happen.
Re:A Newly-Generated Create-React-App 2.1.5 App Has 1,568 De... by ascorbic on Wednesday February 20, 2019 @02:33AM (#19206299)
I agree that most of the reason to use CRA is to avoid needing to set up a complicated toolchain. However I've mostly stopped using it now in favour of Parcel. That gives you the zero-config of CRA without the weight. As a test, I just tried setting up an absolutely minimal React + TypeScript app. This is what I did:

  mkdir parceldemo
  cd parceldemo
  yarn init
  vi index.html 
  vi index.tsx
  npx parcel index.html
The two index files are here: https://gist.github.com/ascorbic/3b075105b49917975326f1d31b3...

...and I have a working React app, with hot module reloading and TypeScript. Parcel installs TypeScript as a devdependency and react and react-dom as dependencies, and starts the HMR server. It took less than one minute.