3 ms·
JS is terribly messy. There's like 5,000 ways to do the same thing and no one right way. Every framework and transpiler tries to reinvent the wheel, and now we
by solardev 4y ago
JS is terribly messy. There's like 5,000 ways to do the same thing and no one right way. Every framework and transpiler tries to reinvent the wheel, and now we have a highway with like forty thousand types of carts, each with their own wheels.
The require() stuff has fallen out of fashion as projects move to the ESM import style. React is battling it out with Vue and Svelte and HTML Web Components and native server-side components. It will keep changing very quickly for a while... no stability is in sight.
But if you're just coming back and you don't have to support legacy projects, just start with a new Next.js project and it will configure everything for you with sane defaults. It takes care of a lot of the mess you see in JS today.
If you're planning on rolling your own buildchain... eh... good luck.
For simpler sites you might not need any framework or toolchain at all. ECMAscript is pretty good since ES6, or you can use React without a toolchain too.
But yeah, it's a mess, especially if you have any experience with languages that aren't so... insane.
- futhey 4y agoGood points. Same can be said of the Vue ecosystem. If you like the Vue syntax better, it also allows you to use the defaults for any flavor of Vue you use: Vue 2 (vue-cli), Nuxt, or Vue 3 (Vite), and just ignore the shiny objects until you are comfortable, and find something you want to improve in your workflow.
- lmiller1990 4y ago> no stability is in sight I'd disagree with this point. The require/import mess is due to multiple competing standards. Now Node.js has ESM support built-in, and so do all modern browsers, there is finally a single standard that works everywhere. This should lead to stability, as least with module systems, which will allow bundlers to also focus on a module system, instead of esoteric hacks to make otherwise incompatible module systems play together.
- solardev 4y agoDidn't mean just the require vs import stuff, but the framework battle, shadow DOM vs virtual DOM vs incremental DOM, SSR vs SPA vs hybrids, serverside components, WASM, webGL, Temporal, yarn/npm/parcel/bun, webpack/babel/gulp/grunt, TS/eslint/prettier... nothing is stable, there are no best practices, no clear winners, just a bunch of competing companies and interests. It's a vibrant ecosystem, granted, just incredibly chaotic.