coming back to js after a few years I am now facing incompatibilities between require(), import(), import as well as async function coloring. Are these non-issues or is js really falling apart?
Javascript is a script language that is being used in areas it should not be. In the context of the browser was ok. Node change the context but not the tool. When I was in the web development area it was horrible, new frameworks every week, every new one trying to fix something that javascript could not do "easily", changes with incompatibilities, etc. When you need another language (aka typescript) to fix (some) of the flaws of it...well it should mean something. I have always thought that javascript is a mess and sad that many developers grow with it.
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.
Good 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.
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.
Didn'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.
8 comments
[ 3.1 ms ] story [ 34.7 ms ] threadThe 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.
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.