disclaimer: this post is not an attack on tooling specificly, nor an attack on anything.
Okay so let's do another rant post, I seem to be angry this week. 🙄😠 (Nobody likes a complaining developer but it's my birthday next week and I'm getting old)
Opening codesandbox and clicked on Vanilla, I wanted to just write some vanilla loose, quick and dirty old fashioned not complicated, not transpiled passed through a quantum molecular demodulation superconducting tree shape graph. I think it's called simple.
I am greeted with a Parcel configuration. "Hello parcel what are this file be?" I ask myself in the most efficient wording known to man. But before we get to that, let me remind you, I clicked vanilla! Why has JavaScript become a compiled first and interpreted second language, what we write is not what we ship, doesn't that bother you?
I have spent a while justifying the 10 or so config files to run a front end, "it's normal", everyone's doing it, it's just a part of life for a frontender, doesn't this bother you?
We are so busy going forward, has anyone looked back at old friends? gulp 4, that's not the gulp I remember but it's nice.
Okay so a task runner is not a bundler (a compiler of things) so yeah bad example, still my point stands. Why is JavaScript (browser vendors) not keeping up with demand, why must we have so much fluf between the code we wrote and the mangled and larger code that nobody really knows what's inside.
Lately it's got to the point, I found learning C++ and emscripten around the same amount of effort to setup as it was to build the "perfect Webpack" setup, that's crazzy, time-consuming.
Don't you wish you could just write JavaScript with optional static typing. Maybe even just have an official specification for a JSC (JavaScript compiler), Less new hotness tooling and more development?
So yeah I ask a lot of questions, on with the point of this post and the conclusion, Parcel, that sounds like Fusebox, 0 config bundler, yep that's not really new, bundling things that's like dynamic linking sort of, a dll, an .exe that's a bundle too, conceptually this is all old hat stuff. Makefiles, the OP bundler, the list goes on. None of those tools compiled scripting languages back to itself, is there something seriously wrong with
JavaScript today? 🧐
(He says all this then gets back to work programming the modern stack without any further thought)
Convert a project from common JS to ESmodules, with included bundler-like / task runner behaviour.
didi
A transpiler for JavaScript and Typescript, transforming CommonJS modules into distinct ES Modules
Who uses didi?
Frontend and deno developers will find didi useful.
Try it out.
didi is not ready for production however you can still take didi for a spin!
npm install -g @didi-js/client-didi-cli
# or
yarn global add @didi-js/client-didi-cli
Create a project an entry file, some installed node_modules and then require the browser dependency into your entry file using the base specifier.
constcolorThief=require('colorThief');// base specifier example, no paths needed
run didi path/to/example-project
The result should have output a new target directory within this example-project and also a server should have started on http://localhost:8086.
You may see some console errors in the browser, this is normal for this stage.
You may also notice that your import looks like this:
importcolorThieffrom"color-thief";// still no path?