Understanding it all (from @paulirish)
the web more and in different places.
Why does it matter?
From 4/13 to 4/14, httparchive.org
Now for a 5-minute Overview of the Raging
“My framework is better than yours.”
“My build tool is better than yours.”
“I prefer to write in _____(A)______, it makes
creating _____(B)______ easier.”
(*)script Battlefield #3 (2010-present)
“My dependency management tool is better than yours.”
favorite package: https://www.npmjs.org/package/debowerify
The easiest way to have a 30-minute
We’ve all chosen sides.
• Many dependency managers for libraries.
• Build tools that use dependency managers (written in
JS or another language).
• Many dependencies of the build tools (that might use
another dependency manager)
• Many source languages.
• Many different types of target platforms.
“Just the essential libraries”
PagerDuty Mobile, https://m.pagerduty.com
Here’s the ones PagerDuty uses with gulp.
Plugin-ify your JS build tools (2012-present)
When you realize you need to make it work in mobile web views.
browsers or embedded in native apps.
The mobile (web) frontier (2007-present)
Put all the things in git (or any VCS)
• well understood workflow (just commit!)
• “easy” mobile builds - git clone to see JS source
• git submodule purgatory (whoops, I forgot!)
• merge conflict hell (Pull Requests broken)
• compiled, concatenated, transformed code in VCS (not
Some cool kids are doing it.
This is a popular approach for many JS libraries
Well… how about using ?
• well-understood workflow (npm install FTW)
• represents an ideal of JS dependency management
• gives us a way to avoid git submodules and get
*.min.js files out of source control
kudos: npm mentions it in the docs
“The advantage of doing [compilation, transformation,
etc] at prepublish time instead of preinstall or install
time is that they can be done once, in a single place,
and thus greatly reduce complexity and variability.
Additionally, this means that:
You can depend on coffee-script as a devDependency,
and thus your users don't need to have it installed.”
Warning! May not do what you expect!
(Since we were working with private code)
npm module from private github repo
(we cheated and tried to use git)
^ package.json in our XCode project that pulls our JS app code
npm that pulls a package from git didn’t get us
all the way there
• we need to check in the transformed JS code (and
css, and HTML)
• we introduce lots of complexity into (native) builds
processes. XCode suddenly needs to know how to
gulp (or grunt).
If we want simple native application build….
If we don’t want to check in transformed code…
Overly simplified misleading diagram.
Is there another way?
build artifact (n) - one of many kinds of tangible
by-products produced during the development
Build artifacts are happiest in build artifact
The app needs a home
Github Release API as a pseudo-artifact
Attempt #3 - success!
• A “release” in GitHub is just a tag and an collection of
binary blobs stored on S3.
• API Access Only (need to generate a token).
• simplifies native mobile builds (only curl and unzip
Uploading a ZIP archive with a single
index.html to GitHub’s Release API
No (gulp||grunt) plugin? Stream-ify it.
The node.js streaming API is incredible.
Then, add a build step in XCode/Android Studio that
fetches build artifacts
^ Thanks to @alperkokmen
Is there (or should there be) a better tool out
It’s a decent option for hybrid apps
* Sonatype Nexus -> NPM bridge
* Private NPM/“CommonJS Repositories” that are
optimized for build artifacts?
* [insert your solution here]