https://www.youtube.com/watch?v=H91aqUHn8sE&pp=ygUabm9kZW5leHQgbW9kdWxlIHJlc29sdXRpb24%3D
I finally managed to get #NodeJS working with #Typescript without using #CommonJS
This was the only resource that actually worked
As supporting both #CommonJS and #ESModules can be wrongly done in a thousand ways, I published why and how we achieved that on fast-check. #JavaScript #opensource
This article is a follow-up of issues reported via #publint from @bluwy and fixed thank to @AndaristRake. As making the package right was not an easy game at first glance, I thought that a how-we-do article could help other #maintainers.
https://fast-check.dev/blog/2023/09/04/dual-packages-or-supporting-both-cjs-and-esm/
#CommonJS #esmodules #javascript #opensource #publint #maintainers
@GabeMoralesVR I am a complete newbie of Javascript. Modules have created a lot of difficulties as I do not yet understand how they work and the documentation is confusing as some Emscripten exemples refer to #CommonJS whereas browsers prefer #ES6.
In 2009, #CommonJS was exactly what #JavaScript needed. The group took a tough problem and forced through a solution that continues to be used millions of times a day.
But with #ESM as the standard and the focus shifting towards cloud primitives โ the edge, browsers, and #serverless compute โ and CommonJS simply doesnโt cut it. ESM is a better solution for developers, as they can write browser-compliant code โ and for users who get a better end experience.
#webdev #serverless #esm #javascript #CommonJS
npm packages: Share of ESM vs. CommonJS?
https://github.com/wooorm/npm-esm-vs-cjs
#ES_Next_News #ECMAScript #JavaScript #ESM #CommonJS #npm
#es_next_news #ecmascript #javascript #esm #CommonJS #npm
I'm playing with #Eleventy, so I'm also working in a #NodeJS container for the first time in ages, and whoop whoop, integrated #testing with #Tap.
After all the #Jest, #Mocha and #Jasmine crap of my latter working days, I had completely forgotten that writing tests does not actually have to suck.
Eleventy is nice, but after also using #CommonJS for the first time in said ages, that makes me a very ๐ ๐ผ
#eleventy #nodejs #testing #tap #jest #mocha #jasmine #CommonJS
#nodejs is really a mess, with #commonjs, #esm and #typescript. It's like a dinosaur trying to be pretty.
#nodejs #CommonJS #esm #typescript
2/ If a CommonJS module follows this rule, its exports can be name-imported from ESM modules: https://2ality.com/2022/10/commonjs-named-exports.html
#JavaScript #CommonJS #ESM #NodeJS
#javascript #CommonJS #esm #nodejs
1/ Happy to see that ESM modules have become popular in current code bases (*):
โ Mostly ESM: 68%
โ Mostly CommonJS: 17%
โ A mix: 12%
โ (No answer: 3%)
In my own (relatively simple) ESM-based Node.js projects I was delighted that I usually couldnโt even tell if a dependency was ESM or CommonJS.
(*) https://fosstodon.org/@rauschma/109824102084164590
#JavaScript #CommonJS #ESM #NodeJS
#javascript #CommonJS #esm #nodejs
Anyone know something about ESM, CommonJS, Typescript and how they interact?
Stuck on a problem, posted on Stack overflow:
https://stackoverflow.com/questions/75354770/isomorphic-dirname-in-esm-and-commonjs
#CommonJS #esm #typescript #node
Today I was navigating many different build tools and methods on how to publish a single #TypeScript package to #NPM while also keeping compatibility with #ESM and #CommonJS and bundling it with minified versions.
Finally settled on a solution with #Rollup by looking at many examples I had found using #GitHub advanced search and this "Awesome TypeScript" catalogue: https://github.com/dzharii/awesome-typescript
#typescript #npm #esm #CommonJS #rollup #github
Bellamy
Experimental Drupal 9 theme
Demo: https://bellamy.midala.net/
Project page: https://drupal.org/project/bellamy
Source code: https://git.drupalcode.org/project/bellamy
#freesoftware #CommonJS #drupal9 #drupal
CommonJS โ ECMAScript Modules (ESM) in Node.js
I hope this post with my experiences from yesterdayโs refactor are helpful for you if and when you undertake a similar task.
#javascript #js #nodejs #ECMAScriptModules #esm #CommonJS