Update various configuration/repo setup
ClosedPublic

Authored by skevy on Aug 10 2017, 4:57 AM.

Details

Summary
  • Runs Flow in CI
  • Saves unit test coverage (for use with some coverage tool)
  • Adds watch command
  • Adds lint-staged to ensure files are prettiered
  • Makes rollup config longer, but easier to understand (imo)

One key change -- I'm still publishing into the dist/module dir...but I'm also including a standalone ES build (but transpiled much less than it was before...no polyfills, helpers). The idea is that you should still be able to get the benefits of dead code elimination using webpack, etc even if you're not transpiling node_modules (which would be required when using the stuff inside dist/module. I think this is the right move.

Test Plan

No test plan

Diff Detail

Repository
R51 wobble
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
skevy created this revision.Aug 10 2017, 4:57 AM
Restricted Application failed to build Restricted Buildable!Aug 10 2017, 4:59 AM

I'm confused about "even if you're not transpiling node_modules". If you're using a tool that walks package.module, what's the advantage of using the rollup build vs. the remove_types one? I don't think you're using any features that need polyfilling in an environment that supports ES modules.

I'm confused about "even if you're not transpiling node_modules". If you're using a tool that walks package.module, what's the advantage of using the rollup build vs. the remove_types one? I don't think you're using any features that need polyfilling in an environment that supports ES modules.

Say you're using webpack >= 2, which understands ES modules. Generally though, you're not running Babel at all on your node_modules folder. Webpack is too slow for that. So if you just point it at the dist/modules dir -- there's definitely going to be things it doesn't understand, depending on your version of Node...such as class properties. And then it's also going to choke when you actually go to use your Webpack build in a browser -- if it's not the most recent Chrome (say IE11), it just won't work and will throw syntax errors.

So actually, as I look at this more, it seems prudent to ship the same transpilation level for the ES module build as the CJS build -- because it will work in any modern env. If you have more stringent packaging needs (and want to transpile certain node_modules), you'd want to just point your packager at the dist/module dir manually -- but it would be up to you as far as how you'd want to do that.

appsforartists accepted this revision.Aug 10 2017, 12:51 PM

I've been looking at TypeScript so long I forgot that properties were still in TC39 stage #whatever.

This revision is now accepted and ready to land.Aug 10 2017, 12:51 PM
This revision was automatically updated to reflect the committed changes.