3 ms·
You seem to confuse "normal" with "required". dvt (correctly) states that "it's normal now to have like 3-4 compilation/transpilation" which is indeed true for
by capableweb 7y ago
You seem to confuse "normal" with "required". dvt (correctly) states that "it's normal now to have like 3-4 compilation/transpilation" which is indeed true for most React codebases (open source and not) I've came across. In fact, I don't think I've come across a single React application that is seriously built without using JSX and without a bundler (like including react.js in the beginning of HTML).
While not required, most people use JSX + bundler, at least for anything that resembles a serious application.
- TomMarius 7y agoBut what's so hard/bad? Literally zero config and two commands: npm install -g parcel-bundler parcel ./index.html
- goliatone 7y agoIt adds complexity. Software rots faster. You are more likely to git clone a 7 year old front end project and be able to run it successfully than a 7 month old project. It’s hard to find projects that successfully pin versions down so that you can build them after regular work on them has stopped.
- TomMarius 7y agoI have projects from 7 years ago that got dependencies stuck on an old major (that's the default) and the webpack I put there in 2013 still successfully builds. The original versions are noted in package.json, so all you might need to do is fix it to the minor/patch (1min task with search/replace). I wouldn't be afraid of parcel - you can do the same thing.
- capableweb 7y agoThose two commands are not just "zero config and two commands", think about the entire stack you're pulling down behind the scenes. Sure, it's easy when you want to render "hello world" but there is so much context and abstraction happening here, that is hidden. Then we haven't even started thinking about HOCs, SSR and lifecycle hooks, none of them addressed by your terminal snippet.
- TomMarius 7y agoActually everything is done after this. This is the way I am building a huge SaaS project. Of course it downloads some code, or would you argue that using Javascript is not simple because it needs to run in a browser? Server rendering is trivial to set up with Parcel, but I don't see the point of your remark - you don't have any option of server side rendering with Jquery.
- osdiab 7y agoPeople who use React tend to want to use modern browser capabilities - and anyone who does will need transpilation because browsers have different API support - the cost of not having an all-controlling monopoly. People developing on other platforms love to complain about the build tools on the web, but those same people only have the luxury of simpler build pipelines because they have greater control over the machines their code will be run on. I don’t see React as having caused this problem in any way (feel free to include React via a script tag from a CDN and worry about the compatibility of your code yourself), and I also don’t see this as a problem that will go away any time soon for web development. That all said, I do think it’s getting better - all the major browsers have switched to be auto-updating, so it’s feasible for many projects to drop support for IE altogether and only support ES6; if you manage your CSS in JS, you don’t need to downcompile languages like SCSS; the two of those together mitigates a lot of the need for sophisticated build tools.
- baddox 7y agoCouldn’t that simply be because bundlers/compilers are really nice and that’s why people choose to use them despite the fact that they’re optional?