JavaScript Modules: Welcome to My Emo Hellscape

https://twitter.com/trek/status/529809528615747585

Communities of browser JavaScript developers

1. Front End

2. Full Stack

3. Full Frontal

Authorship and Consumption

Library Consumer

Library Author

Source Code vs Executable Code

Dependency Granularity

Coarse Grained

cli-tool install lodash

Fine Grained

var _ = require('lodash');
import {clone, random} from "lodash";

Constraints and Trade-offs

Modularity

The Browser JavaScript Package Manager

Authoring occurs in the author’s preferred module format

Consuming occurs in the consumer’s preferred module format

{
'module': 'cjs'
}
cli-tool install packageA packageB packageC --module=es6

Conversion from authoring format to consumer format occurs on publish

Builds are hosted

Clearly delineate server, build, and client packages in manifest and directory structure to minimize confusion.

.
├── browser_modules
│ ├── mocha
│ ├── react
│ └── underscore
└── node_modules
├── express
├── mocha
└── underscore
.
└── node_modules
├── express
├── mocha
├── react
└── underscore

Flatten the dependency tree, Let consumers resolve version conflicts

Offer a web-based build tool/package bundler for “front end developers”

The extras

Abandon All Hope

--

--

I helped start @workantile, coupon queen’d at @GrouponEng. Doing the startup thing at Flash Recruit. @emberjs core emeritu. @paul_irish once called me ‘a hero’

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store