https://jsconf.jp/2024/talk/berlysia/

We recently shipped import maps in Firefox 108 and this article is the first in a series that describes what they are and the problems they can solve. In this first article, we will go through the background and basics of import maps and follow up with a second article explaining more details of import maps. Background: JavaScript Modules If you don’t know JavaScript modules, you can read the MDN
最近、色々なライブラリをCommonJS(CJS)からECMAScript Module(ESM)へとマイグレーションしています。 その際に、ESMでは__dirnameやrequireなどCommonJS特有の機能は使えなくなっています。 また、TypeScriptやBabelなど多くのツールはCJSではimport時に拡張子はなくても大丈夫ですが、ESMの場合はimport時に拡張子が必要になります。 import url from "node:url"; - import { mdEscape } from "./mdEscape"; + import { mdEscape } from "./mdEscape.js"; // ESMでは相対パスに拡張子は省略できない + const __filename = url.fileURLToPath(import.meta.url); /
rollup のような ESM を吐くツールのプレビューツールを作っていると、文字列として組み立てたコードを安全に評価したいことがあります。 方法 iframe を createObjectURL dynamic import で data uri として文字列を評価 得られた関数を実行 コード // これを評価したい const code = `export default () => { console.log("xxx") }`; // 追記:2020/06/24 ユニコード文字対応 const encoded = btoa(unescape(encodeURIComponent(code))); const blob = new Blob( [ `<!DOCTYPE html> <html> <head> </head> <body> <script type=module> im
reg is a package manager for native ES Modules. It's built to enable dependency management for Universal JavaScript (JavaScript that can run in the Browser and in Node.js w/o a compiler). This library is highly experimental and still likely to break without notice. DO NOT USE THIS IN PRODUCTION. Supporting Universal JavaScript is quite difficult as the Browser's module system has a very unique set
Buyer Protection Program When you buy a domain name at Dan.com, you’re automatically covered by our unique Buyer Protection Program. Read more about how we keep you safe on our Trust and Security page. Next to our secure domain ownership transfer process, we strictly monitor all transactions. If anything looks weird, we take immediate action. And if the seller doesn't deliver on their part of the
Seven months ago I released an experimental module loader that enabled ES modules in Node. With over a million downloads, thousands of commits, and the tremendous help of early adopters and the JavaScript community, it’s ready for its stable release! 🎉🎉🎉 Meet esm – A fast, production ready, zero-dependency ES module loader for Node 6+ that delivers an awesome developer experience to boot! As wi
Even though ES6 (ES2015) brought modules to the language, it missed one important thing - a loading method. Proper support is currently being implemented for browsers↗. To learn more about the topic, I’m interviewing Bradley Farias↗. # I am a Software Engineer at GoDaddy these days but have been at several startups before that. My childhood was mostly running around outside in the Texas heat and e
Update 2018-12-20: Warning: This blog post is outdated! Consult “ECMAScript modules in Node.js: the new plan” for the latest information. Update 2017-05-11: Complete rewrite of Sect. “Why a new filename extension for ES modules?”. This blog post describes how module specifiers (the path-like IDs of modules) change with ECMAScript modules (ESM). There are a few subtle differences, compared to the f
ES6 modules are now supported in Chrome, from 61 onwards—they also work in older versions, but you’ll have to enable the Experimental Web Platform flag in chrome:flags. Chrome now joins many other modern browsers which also include support, some behind flags. 🚩 Modules are an important part of building any web application which comprises more than trivial script. The JavaScript community has deve
ES modules are now available in browsers! They're in… Safari 10.1. Chrome 61. Firefox 60. Edge 16. <script type="module"> import { addTextToBody } from './utils.mjs'; addTextToBody('Modules are pretty cool.'); </script> // utils.mjs export function addTextToBody(text) { const div = document.createElement('div'); div.textContent = text; document.body.appendChild(div); } Live demo. All you need is t
Native ECMAScript modules: nomodule attribute for the migration Serg Hospodarets Blog In one of my previous articles Native ECMAScript modules: the new features and differences from Webpack modules we attempted to detect if the browser supported ES modules. We needed this to determine either, to execute a bundled (classic) file or a script which uses the native ECMAScript module features. We manag
We might earn a commission from partner links on Laptop Radar. Commissions do not affect our editors' opinions or evaluations. If the question often appears in your mind, “do I need a powerful laptop for programming?” you are not alone. That simply means you need the right information about the minimum requirement of a laptop that can let you code, which actually sounds easier to answer than it re
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く