material-motion-js icon indicating copy to clipboard operation
material-motion-js copied to clipboard

Bundle and publish to Google Hosted Libraries

Open appsforartists opened this issue 6 years ago • 2 comments

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.

appsforartists avatar Nov 22 '18 02:11 appsforartists

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.

appsforartists avatar Nov 25 '18 18:11 appsforartists

I spent too much time today fighting pundle-dev, which has reminded me why I wanted to try Bazel in the first place.

appsforartists avatar Nov 29 '18 08:11 appsforartists