In our most recent Supercharged Livestream we implemented code splitting and route-based chunking. With HTTP/2 and native ES6 modules, these techniques will become essential to enabling efficient loading and caching of script resources. Miscellaneous tips & tricks in this episode asyncFunction().catch() with error.stack: 9:55 Modules and nomodule attribute on <script> tags: 7:30 promisify() in Nod
This post is part of a series of three: Current approaches: “Setting up multi-platform npm packages” Motivating a new approach: “Transpiling dependencies with Babel” Implementing the new approach: “Delivering untranspiled source code via npm” The idea of babel-preset-env is brilliant: write JavaScript with stage 4 features (or earlier stages, if you want to take that risk) and transpile it so that
Recently, there was a lot of fuss on Twitter regarding the current state of ES modules, especially in Node.js, which decided to introduce *.mjs as file extension. The fear and uncertainty is understandable since the topic is complex and following the discussions takes a high degree of effort and dedication. An ancient fearMost frontend developers still remember the dark days of JavaScript dependen
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 typ
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
All the major browsers shipped the native JavaScript modules support out of the box: which means, the time we can use them without module bundlers/transpilers has come. To understand better how we come to this point let’s start from the JS modules history and then take a look at the current Native ES modules features. ...
Warning: This blog post is outdated. Instead, read section “Loading modules dynamically via import()” in “JavaScript for impatient programmers”. The ECMAScript proposal “import()” by Domenic Denicola is at stage 4 and part of ECMAScript 2020. It enables dynamic loading of ECMAScript modules and is explained in this blog post. ECMAScript modules are static # ECMAScript modules are completely stati
Before we get into the differences between ES5 and ES6 handling of cyclic dependencies, let’s first talk about what that means because it isn’t the most common thing and is something I have only recently learned about as well. Cyclical dependencies means that you have 2 files which imports one another. A.js imports B.js, and B.js imports A.js . This isn’t a design pattern that is recommended howev
I'm the ES modules proposal person. Churning out some AMA on the current state of things both in ECMA262 (JS spec), and Node spec. I can also answer some (probably not all) questions about browser specs (HTML and Loader). Anything you want to ask about ES modules, or the module system internals in general. Your ideas, your concerns, your desires, whatever you want to know. I should note, some mino
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く