News for hackers. Stuff that matters.
Re:A modern “Hello, World” program requires more than just code by Waterluvian on Thursday March 05, 2020 @11:20PM (#22500963)
I've never fully understood Create React App. Is it for people who just churn out generic apps at a rate that the time to set up the dev env is a meaningful cost? I'm not sure I've found setting up webpack or whatnot to be all that time consuming.

My bigger concern is that I don't want to become a passenger rather than the driver of my environment and build pipeline.

Re:A modern “Hello, World” program requires more than just code by robjan on Friday March 06, 2020 @12:22AM (#22501178)
If many people are doing roughly the same "thing" then surely it makes sense to automate that "thing". It's much like how we don't build and develop software for every business process: we look for an existing solution that is general enough to fit our requirements (usually Excel).
Re:A modern “Hello, World” program requires more than just code by jblz on Thursday March 05, 2020 @11:26PM (#22500990)
It's a great way to get started building a "modern web app" for folks who aren't comfortable rolling their own e.g. webpack / babel configs.

If you ever want to have more control, you can "eject" & customize however you like.

Re:A modern “Hello, World” program requires more than just code by pldr2244 on Friday March 06, 2020 @04:25AM (#22502165)
Facebook offers an opinionated, production ready, battle tested framework for bootstrapping a modern React application with tooling/batteries included (with dependencies automatically maintained if you need to version bump to latest via react-scripts as a magical dependency).

Unless you’re doing something so completely customised (and even then, ejecting from CRA is a blessed path), why WOULND’T you use CRA?

Re:A modern “Hello, World” program requires more than just code by ng12 on Friday March 06, 2020 @03:38PM (#22507100)
> why WOULND’T you use CRA?

It's worth noting that CRA is pretty complicated. My home-rolled webpack configs are significantly simpler than ejected CRA apps. If you're going to be making significant changes to the configs it's going to be a lot easier with a custom project.

Re:A modern “Hello, World” program requires more than just code by The_rationalist on Friday March 06, 2020 @03:25AM (#22501870)
It can do a lot of smart default that you don't necessarily know, especially for typescript support.
Re:A modern “Hello, World” program requires more than just code by sbilstein on Thursday March 05, 2020 @11:31PM (#22501012)
Honestly the defaults are really nice. I rolled my own for several projects and then just used create react app for this startup and forgot about my build pipeline.

Once I ejected it took a little hacking to get the index.html to work with handlebars cause I like to render a bunch of data and other stuff server side for speed optimizations.

Now I use the same web pack pipeline CRA ships with and just point my server to serve static files from the build folder. I’ve removed the server component and now just have the script watch and build. I don’t believe in SSR for react and prefer handlebars for most things server side so this workflow suits me well.