Building a Better Web
June 11–12, 2018: Training
June 12–14, 2018: Tutorials & Conference
San Jose, CA

The future of JavaScript modules

C J Silverio (npm)
9:00am–9:40am Thursday, June 14, 2018
Future JS and Functional
Location: 210 B/F Level: Intermediate
Secondary topics:  Developer Experience Track: Tools, Platforms, and Techniques, High-level, Technical

Who is this presentation for?

  • Web developers

Prerequisite knowledge

  • A basic understanding of JavaScript development workflows, either targeting the backend with Node.js or targeting the browser
  • A working knowledge of using npm packages, JavaScript bundling, and transpilation tools like Babel

What you'll learn

  • Learn how ECMAScript modules differ from CommonJS modules, how the JavaScript language is changing to accommodate a new module system, key ways in which the systems differ from each other, and how to use code written in the old system in the new system

Description

Until now, JavaScript has not had an official module system defined as part of the language, although it’s had several unofficial ones, including Node.js’s CommonJS module system. JavaScript developers have nearly universally adopted Node.js as the platform of choice for their tooling. Web application frameworks all use command-line tools written in Node.js, pulling shared code from the npm registry to build applications that run on the browser. While CommonJS modules do not work in the browser, bundling tools like browserify and webpack have allowed CommonJS modules to be built into browser-ready code.

But JavaScript in browsers has a new module system: ES modules. With the arrival of browser support for ES modules, developers now expect to be able to write ESM code and have it work everywhere. Early implementations of ES modules rely on the CommonJS module system under the hood with Babel transpiling ESM syntax into CommonJS syntax. The two module systems are incompatible in several interesting ways, but Babel has hidden the differences.

Join CJ Silverio to explore ES modules and learn what’s new, what you need to know about how to use the new system, and what you need to know to use all the JavaScript that already exists from your new code.

Photo of C J Silverio

C J Silverio

npm

CJ Silverio is the CTO of npm. Her work allows JavaScript developers all over the world to share code and build modern web applications.

Leave a Comment or Question

Help us make this conference the best it can be for you. Have questions you'd like this speaker to address? Suggestions for issues that deserve extra attention? Feedback that you'd like to share with the speaker and other attendees?

Join the conversation here (requires login)