fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

8.8K
active users

#CommonJS

0 posts0 participants0 posts today
Frontend Dogma<p>Bridging CommonJS and ESM in Node.js, by <span class="h-card" translate="no"><a href="https://mastodon.social/@joyeecheung" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>joyeecheung</span></a></span> (<span class="h-card" translate="no"><a href="https://floss.social/@webhackfest" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>webhackfest</span></a></span>):</p><p><a href="https://www.youtube.com/watch?v=YRueCer2kig" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">youtube.com/watch?v=YRueCer2ki</span><span class="invisible">g</span></a></p><p><a href="https://mas.to/tags/videos" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>videos</span></a> <a href="https://mas.to/tags/nodejs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>nodejs</span></a> <a href="https://mas.to/tags/commonjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commonjs</span></a> <a href="https://mas.to/tags/esm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esm</span></a></p>
Frontend Dogma<p>Building the Bridge: Running JavaScript Modules From Dart, by (not found on Mastodon or Bluesky):</p><p><a href="https://globe.dev/blog/building-the-bridge/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">globe.dev/blog/building-the-br</span><span class="invisible">idge/</span></a></p><p><a href="https://mas.to/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a> <a href="https://mas.to/tags/modules" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>modules</span></a> <a href="https://mas.to/tags/esm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esm</span></a> <a href="https://mas.to/tags/commonjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commonjs</span></a> <a href="https://mas.to/tags/dart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dart</span></a> <a href="https://mas.to/tags/deno" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>deno</span></a></p>
Habr<p>[Перевод] Публикация пакета npm с ESM и TypeScript</p><p>За последние 2 года поддержка ESM в TypeScript, Node.js и браузерах сильно улучшилась. В этой статье я объясню мою современную настройку, которая является относительно простой по сравнению с тем, что нам приходилось делать раньше: она предназначена для пакетов, которые могут пренебречь обратной совместимостью. Настройка хорошо работает для меня некоторое время — начиная с TS 4.7 (24.05.2022) помогает то, что Node.js теперь поддерживает require(esm) — запрос библиотек ESM из модулей CommonJS я использую только tsc , но упоминаю поддержку других инструментов в разделе "Компиляция TS с помощью других инструментов" Обратная связь приветствуется: что вы делаете по-другому? Что может быть улучшено? Пример пакета: в @rauschma/helpers используется настройка, описываемая в этой статье.</p><p><a href="https://habr.com/ru/companies/timeweb/articles/884516/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">habr.com/ru/companies/timeweb/</span><span class="invisible">articles/884516/</span></a></p><p><a href="https://zhub.link/tags/timeweb_%D1%81%D1%82%D0%B0%D1%82%D1%8C%D0%B8_%D0%BF%D0%B5%D1%80%D0%B5%D0%B2%D0%BE%D0%B4" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>timeweb_статьи_перевод</span></a> <a href="https://zhub.link/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a> <a href="https://zhub.link/tags/typescript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>typescript</span></a> <a href="https://zhub.link/tags/ts" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ts</span></a> <a href="https://zhub.link/tags/npm_package" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>npm_package</span></a> <a href="https://zhub.link/tags/npm_registry" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>npm_registry</span></a> <a href="https://zhub.link/tags/npm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>npm</span></a> <a href="https://zhub.link/tags/esm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esm</span></a> <a href="https://zhub.link/tags/commonjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commonjs</span></a> <a href="https://zhub.link/tags/%D1%80%D0%B5%D0%B5%D1%81%D1%82%D1%80_npm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>реестр_npm</span></a> <a href="https://zhub.link/tags/%D0%BF%D0%B0%D0%BA%D0%B5%D1%82_npm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>пакет_npm</span></a></p>
Mika<p><a href="https://sakurajima.social/tags/Javascript" rel="nofollow noopener" target="_blank">#Javascript</a> seems like such a fucking mess when the way you're importing libraries can somehow vary for wtv reason??? I also can never quite comprehend wth's an <a href="https://sakurajima.social/tags/ESM" rel="nofollow noopener" target="_blank">#ESM</a> or <a href="https://sakurajima.social/tags/CommonJS" rel="nofollow noopener" target="_blank">#CommonJS</a> ​:frierencrying:​</p>
Jons Mostovojs<p><span class="h-card"><a href="https://mastodon.social/@tolmasky" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>tolmasky</span></a></span> the amount of times I had to learn what is <a href="https://social.doma.dev/tags/CommonJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CommonJS</span></a> and what is <a href="https://social.doma.dev/tags/ESM" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ESM</span></a> to then forget it and get bitten again when I come to <a href="https://social.doma.dev/tags/JS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>JS</span></a> is bleak in comparison, I'm sure, but it made me make a video (mostly for myself) to later watch: <a href="https://www.youtube.com/watch?v=SIows5N4BAY" rel="nofollow noopener" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">youtube.com/watch?v=SIows5N4BA</span><span class="invisible">Y</span></a></p><p>😆</p>
🧿🪬🍄🌈🎮💻🚲🥓🎃💀🏴🛻🇺🇸<p>Want to know why <a href="https://mastodon.social/tags/CommonJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CommonJS</span></a> was a mistake?<br>One phrase. Conditional <a href="https://mastodon.social/tags/module" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>module</span></a> <a href="https://mastodon.social/tags/exports" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>exports</span></a>.</p><p>if (condition) {<br> module.exports = foo<br>} else {<br> module.exports = bar<br>}</p><p><a href="https://mastodon.social/tags/javaScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javaScript</span></a> <a href="https://mastodon.social/tags/nodejs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>nodejs</span></a> <a href="https://mastodon.social/tags/cjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cjs</span></a> <a href="https://mastodon.social/tags/js" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>js</span></a> <a href="https://mastodon.social/tags/webDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webDev</span></a> <a href="https://mastodon.social/tags/esm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esm</span></a> <a href="https://mastodon.social/tags/modules" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>modules</span></a></p>
🧿🪬🍄🌈🎮💻🚲🥓🎃💀🏴🛻🇺🇸<p>It's 2024; <a href="https://mastodon.social/tags/JavaScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>JavaScript</span></a> <a href="https://mastodon.social/tags/libraries" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>libraries</span></a> should be shipping <a href="https://mastodon.social/tags/ESModules" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ESModules</span></a> *only*</p><p><a href="https://mastodon.social/tags/webDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webDev</span></a> <a href="https://mastodon.social/tags/frontend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>frontend</span></a> <a href="https://mastodon.social/tags/js" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>js</span></a> <a href="https://mastodon.social/tags/modules" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>modules</span></a> <a href="https://mastodon.social/tags/esm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esm</span></a> <a href="https://mastodon.social/tags/commonjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commonjs</span></a> <a href="https://mastodon.social/tags/modularity" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>modularity</span></a> <a href="https://mastodon.social/tags/nodejs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>nodejs</span></a> <a href="https://mastodon.social/tags/deno" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>deno</span></a></p>
Habr<p>Управление зависимостями в Javascript заходит на новый виток? Работа с ES модулями без сборщиков</p><p>Изначально эта статья задумывалась, как рассказ о различиях и назначении полей dependencies , devDependencies и peerDependencies в package.json . Эту тему выбрали ребята в моем телеграм-канале , кстати подписывайтесь, если еще не. Однако, когда я посмотрел количество контента на эту тему, то понял, что его достаточно даже в русском сегменте. При этом я прочитал одну статью , которая показалась мне очень хорошей, а также там были мысли на тему будущего управления зависимостями. В итоге, я решил кратко пересказать вышеупомянутую статью, чтобы лучше самому усвоить тему, а также набросать проект по управлению зависимостями прямо на клиенте, через ES Modules. Так что вы можете прочитать либо оригинальную и полную статью у автора, либо сокращенную версию в первой половине этой статьи. А разбор работы ESM будет во второй половине .</p><p><a href="https://habr.com/ru/articles/825424/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">habr.com/ru/articles/825424/</span><span class="invisible"></span></a></p><p><a href="https://zhub.link/tags/npm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>npm</span></a> <a href="https://zhub.link/tags/yarn" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>yarn</span></a> <a href="https://zhub.link/tags/pnpm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pnpm</span></a> <a href="https://zhub.link/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a> <a href="https://zhub.link/tags/node" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>node</span></a> <a href="https://zhub.link/tags/esm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esm</span></a> <a href="https://zhub.link/tags/commonjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commonjs</span></a> <a href="https://zhub.link/tags/dependency_management" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dependency_management</span></a> <a href="https://zhub.link/tags/package_manager" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>package_manager</span></a></p>
🧿🪬🍄🌈🎮💻🚲🥓🎃💀🏴🛻🇺🇸<p>Is it wrong if I'm kind of enjoying the drama about <a href="https://mastodon.social/tags/ljharb" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ljharb</span></a>?<br>Burn tc39 down! Make the web anew!<br>The only standard is death comes to everything!</p><p><a href="https://mastodon.social/tags/webDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webDev</span></a> <a href="https://mastodon.social/tags/javaScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javaScript</span></a> <a href="https://mastodon.social/tags/tc39" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tc39</span></a> <a href="https://mastodon.social/tags/nodejs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>nodejs</span></a> <a href="https://mastodon.social/tags/esm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esm</span></a> <a href="https://mastodon.social/tags/esmodules" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esmodules</span></a> <a href="https://mastodon.social/tags/commonjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commonjs</span></a> <a href="https://mastodon.social/tags/cjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cjs</span></a> <a href="https://mastodon.social/tags/modules" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>modules</span></a></p>
🧿🪬🍄🌈🎮💻🚲🥓🎃💀🏴🛻🇺🇸<p>&gt; enough libraries use ES Modules that for many projects you need to either use ES Modules, or figure out how to interoperate ES Modules with your CommonJS code. At the same time, enough code still uses CommonJS that you often need to figure out how to include that legacy code in your otherwise-ES Module project.</p><p><a href="https://borischerny.com/javascript,/typescript/2024/06/19/ES-Modules-Are-A-Mess.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">borischerny.com/javascript,/ty</span><span class="invisible">pescript/2024/06/19/ES-Modules-Are-A-Mess.html</span></a></p><p><a href="https://mastodon.social/tags/javaScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javaScript</span></a> <a href="https://mastodon.social/tags/nodeJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>nodeJS</span></a> <a href="https://mastodon.social/tags/esModules" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esModules</span></a> <a href="https://mastodon.social/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://mastodon.social/tags/web" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>web</span></a> <a href="https://mastodon.social/tags/typescript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>typescript</span></a> <a href="https://mastodon.social/tags/esm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esm</span></a> <a href="https://mastodon.social/tags/cjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cjs</span></a> <a href="https://mastodon.social/tags/commonjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commonjs</span></a> <a href="https://mastodon.social/tags/package" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>package</span></a> <a href="https://mastodon.social/tags/npm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>npm</span></a></p>
industrial curiosity<p>Mixed Imports: Loading JSON Directly in TypeScript and ES Modules <a href="https://link.medium.com/GU8QNAZOeKb" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">link.medium.com/GU8QNAZOeKb</span><span class="invisible"></span></a> </p><p><a href="https://hachyderm.io/tags/typescript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>typescript</span></a> <a href="https://hachyderm.io/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a> <a href="https://hachyderm.io/tags/ecmascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ecmascript</span></a> <a href="https://hachyderm.io/tags/commonjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commonjs</span></a> <a href="https://hachyderm.io/tags/cdk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cdk</span></a></p>
🧿🪬🍄🌈🎮💻🚲🥓🎃💀🏴🛻🇺🇸<p>&gt; Support for require()ing ESM graphs is now exposed by default in Node.js 22</p><p><a href="https://openjsf.org/blog/nodejs-22-available" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">openjsf.org/blog/nodejs-22-ava</span><span class="invisible">ilable</span></a></p><p><a href="https://mastodon.social/tags/nodejs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>nodejs</span></a> <a href="https://mastodon.social/tags/webDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webDev</span></a> <a href="https://mastodon.social/tags/javaScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javaScript</span></a> <a href="https://mastodon.social/tags/esm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esm</span></a> <a href="https://mastodon.social/tags/esmodules" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esmodules</span></a> <a href="https://mastodon.social/tags/commonJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commonJS</span></a> <a href="https://mastodon.social/tags/js" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>js</span></a> <a href="https://mastodon.social/tags/web" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>web</span></a> <a href="https://mastodon.social/tags/node" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>node</span></a></p>
alf<p>Javascript / NodeJS</p><p>Did you ever get an annoying error message while trying to access __dirname in a <a href="https://freeradical.zone/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a> module running <a href="https://freeradical.zone/tags/node" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>node</span></a> ?</p><p>__dirname and __filename were global variables in the old <a href="https://freeradical.zone/tags/CommonJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CommonJS</span></a> so they never worked when using proper modern js modules. </p><p>You had to write some ugly extra helper code to get this functionality.</p><p>Well, it's now fixed! As of node version 20.11.0 you can use</p><p>import.meta.filename<br>import.meta.dirname</p><p><a href="https://www.sonarsource.com/blog/dirname-node-js-es-modules/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">sonarsource.com/blog/dirname-n</span><span class="invisible">ode-js-es-modules/</span></a></p><p><a href="https://freeradical.zone/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://freeradical.zone/tags/code" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>code</span></a> <a href="https://freeradical.zone/tags/nodejs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>nodejs</span></a></p>
洪 民憙 (Hong Minhee) 🤏🏼<p>Progress report, March 30, 2024.</p><p>I tried <a href="https://todon.eu/tags/CommonJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CommonJS</span></a> packaging, but it turned out to be quite challenging, so I decided to support <a href="https://todon.eu/tags/ESM" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ESM</span></a> only.</p><p>I got <a href="https://todon.eu/tags/Fedify" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Fedify</span></a> packaged into npm using <a href="https://todon.eu/tags/dnt" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dnt</span></a>, but it hasn't been published to npm yet.</p><p>I've made the entire unit test pass in Node.js now.</p><p>It was pre-released to JSR as version 0.5.0-dev.86+31d077e4, and you can test it out: <a href="https://jsr.io/@fedify/fedify@0.5.0-dev.86+31d077e4" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">jsr.io/@fedify/fedify@0.5.0-de</span><span class="invisible">v.86+31d077e4</span></a></p><p><a href="https://github.com/dahlia/fedify/discussions/24#discussioncomment-8958020" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/dahlia/fedify/discu</span><span class="invisible">ssions/24#discussioncomment-8958020</span></a></p>
Hexagon :github:<p>Learn to create libraries compatible with both ESM and CommonJS, as well as different runtimes like Node.js, Deno, and browsers.</p><p><a href="https://social.56k.guru/tags/deno" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>deno</span></a> <a href="https://social.56k.guru/tags/bun" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bun</span></a> <a href="https://social.56k.guru/tags/node" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>node</span></a> <a href="https://social.56k.guru/tags/esm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>esm</span></a> <a href="https://social.56k.guru/tags/commonjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commonjs</span></a> <a href="https://social.56k.guru/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a></p><p><a href="https://hexagon.56k.guru/posts/dual-mode-cross-runtime-packages/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">hexagon.56k.guru/posts/dual-mo</span><span class="invisible">de-cross-runtime-packages/</span></a></p>
Andreu Casablanca 🐀<p>A new post on how to create a React components library, although focusing on the aspects of publishing dual libraries (CJS+ESM) with types: <a href="https://blog.coderspirit.xyz/blog/2023/09/15/create-a-react-component-lib/" rel="nofollow noopener" target="_blank"><span class="invisible">https://</span><span class="ellipsis">blog.coderspirit.xyz/blog/2023</span><span class="invisible">/09/15/create-a-react-component-lib/</span></a></p><p><a href="https://hachyderm.io/tags/JavaScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>JavaScript</span></a> <a href="https://hachyderm.io/tags/TypeScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TypeScript</span></a> <a href="https://hachyderm.io/tags/ESM" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ESM</span></a> <a href="https://hachyderm.io/tags/CommonJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CommonJS</span></a></p>
lil5 :golang: 🚲 🇳🇱<p><a href="https://gist.github.com/lil5/f2163f18ba67ae51a7f67a329294ca4b" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">gist.github.com/lil5/f2163f18b</span><span class="invisible">a67ae51a7f67a329294ca4b</span></a></p><p>I finally managed to get <a href="https://fosstodon.org/tags/NodeJS" class="mention hashtag" rel="tag">#<span>NodeJS</span></a> working with <a href="https://fosstodon.org/tags/Typescript" class="mention hashtag" rel="tag">#<span>Typescript</span></a> without using <a href="https://fosstodon.org/tags/CommonJS" class="mention hashtag" rel="tag">#<span>CommonJS</span></a></p><p>This was the only resource that actually worked: <a href="https://www.youtube.com/watch?v=H91aqUHn8sE&amp;pp=ygUabm9kZW5leHQgbW9kdWxlIHJlc29sdXRpb24%3D" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://www.</span><span class="ellipsis">youtube.com/watch?v=H91aqUHn8s</span><span class="invisible">E&amp;pp=ygUabm9kZW5leHQgbW9kdWxlIHJlc29sdXRpb24%3D</span></a></p>
ndubien<p>As supporting both <a href="https://fosstodon.org/tags/CommonJS" class="mention hashtag" rel="tag">#<span>CommonJS</span></a> and <a href="https://fosstodon.org/tags/ESModules" class="mention hashtag" rel="tag">#<span>ESModules</span></a> can be wrongly done in a thousand ways, I published why and how we achieved that on fast-check. <a href="https://fosstodon.org/tags/JavaScript" class="mention hashtag" rel="tag">#<span>JavaScript</span></a> <a href="https://fosstodon.org/tags/opensource" class="mention hashtag" rel="tag">#<span>opensource</span></a> </p><p>This article is a follow-up of issues reported via <a href="https://fosstodon.org/tags/publint" class="mention hashtag" rel="tag">#<span>publint</span></a> from <span class="h-card" translate="no"><a href="https://m.webtoo.ls/@bluwy" class="u-url mention">@<span>bluwy</span></a></span> 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 <a href="https://fosstodon.org/tags/maintainers" class="mention hashtag" rel="tag">#<span>maintainers</span></a>.</p><p>Link to the article: <a href="https://fast-check.dev/blog/2023/09/04/dual-packages-or-supporting-both-cjs-and-esm/" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">fast-check.dev/blog/2023/09/04</span><span class="invisible">/dual-packages-or-supporting-both-cjs-and-esm/</span></a></p>
Davide Bucci<p><span class="h-card"><a href="https://mastodon.gamedev.place/@GabeMoralesVR" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>GabeMoralesVR</span></a></span> 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 <a href="https://mastodon.sdf.org/tags/CommonJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CommonJS</span></a> whereas browsers prefer <a href="https://mastodon.sdf.org/tags/ES6" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ES6</span></a>.</p>
🍄🌈🎮💻🚲🥓🎃💀🏴🛻🇺🇸<p>In 2009, <a href="https://mas.to/tags/CommonJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CommonJS</span></a> was exactly what <a href="https://mas.to/tags/JavaScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>JavaScript</span></a> needed. The group took a tough problem and forced through a solution that continues to be used millions of times a day.</p><p>But with <a href="https://mas.to/tags/ESM" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ESM</span></a> as the standard and the focus shifting towards cloud primitives — the edge, browsers, and <a href="https://mas.to/tags/serverless" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>serverless</span></a> 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.</p><p><a href="https://deno.com/blog/commonjs-is-hurting-javascript" rel="nofollow noopener" target="_blank"><span class="invisible">https://</span><span class="ellipsis">deno.com/blog/commonjs-is-hurt</span><span class="invisible">ing-javascript</span></a></p><p><a href="https://mas.to/tags/webDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webDev</span></a></p>