Using modular JavaScript for front-end development
Node Summit, 2018-07-25
COO & co-founder, npm Inc.
@seldo
Taking Back Control
Taking Back Control
Top 5 languages on GitHub
by number of pull requests opened
Upgrade right now!
npm install npm -g
npm ci
You can use
anywhere you used to use
npm install
and it will be twice as fast
Secure your npm account in 30 seconds:
A bunch of new features
Just run npm install!
Yikes!
Just run in your current project:
npm audit
Learn more:
Just run in your current project:
npm audit fix
or
npm audit fix --force
for the adventurous
links = n(n-1)/2
exports = function() {
...
}
var mod = require('filename')
Define:
Use:
The commit where npm was bundled with node:
2011: browserify
So obviously we need to change everything.
Why are you like this, JavaScript?
require()
import()
export function square(x) {
return x * x;
}
import {square} from 'filename'
Define:
Use:
<script type="module"></script>
import './lib'
vs
import 'lib'
Webpack + Babel | ES Modules | |
---|---|---|
ES6 syntax | Yes | Yes |
Static analysis | Yes | Yes |
Code splitting | Hard | Hard |
Transpilation | Required | Required* |
Bundling | Required | Recommended |
* for real-world applications
A proposal:
Because developers are addicted to libraries
You already know how.
by writing some really terrible software
Remember XHTML 2.0?
It's only a website.
@seldo
These slides
Talk to me