material-motion-js
material-motion-js copied to clipboard
Bundle and publish to Google Hosted Libraries
After views-dom is merged into core, it's worth investigating putting together a Rollup distribution and adding it to Google Hosted Libraries to make throwing open a Codepen with Material Motion really easy to do.
It looks like Rollup is supported by Bazel:
https://blog.mgechev.com/2018/11/19/introduction-bazel-typescript-tutorial/
I'm a bit skeptical of using Bazel (even though I've experimented with adding it to this repo). I like that it's a supported toolchain, and that there could be overlap when mirrored into Piper. I don't know enough about how much mental overhead it adds when developing. (It does look like there's ts_auto_deps
to automatically generate BUILD files.) It looks like code coverage is in progress, but not available yet.
My biggest hesitations are:
- Does it increase contributor friction? Even if bazel itself is distributed on NPM, it still requires the JVM.
- Does it paint us into a corner for how to distribute? My null hypothesis is that we should distribute individual JS files in
/dist
to allow authors' bundlers to handle tree-shaking/minification. I believe if we use Bazel, it's going to want us to distribute a single Rollup-processed file. I'm not sure how easy it is for downstream authors to tree-shake a bundled file vs. a bunch fo loose ones.
I spent too much time today fighting pundle-dev, which has reminded me why I wanted to try Bazel in the first place.