Skip to content

Instantly share code, notes, and snippets.

@traviskaufman
Created February 22, 2017 16:30
Show Gist options
  • Save traviskaufman/dde99ece379136c84fae63e776b4c9d0 to your computer and use it in GitHub Desktop.
Save traviskaufman/dde99ece379136c84fae63e776b4c9d0 to your computer and use it in GitHub Desktop.
MDC-Web Closure Compatibility

material-components/material-components-web#134

Closure Compiler Support

Google Closure Compiler support is required in order to support the Google projects and properties which are built around this toolchain. Concretely, MDC-Web must be able to compile with ADVANCED_OPTIMIZATIONS enabled, and produce no errors or warnings. There are implications for internal support as well, but that is outside the scope of this issue.

Goals

  • Full compilation of MDC-Web using ADVANCED_OPTIMIZATIONS
  • Test infrastructure to verify both compilation, as well as runtime correctness, e.g. our closurized code behaves correctly
  • Babel compatibility:
    • Our introduced constructs for closure must not increase code size for our external bundles
    • Ensure that output is completely compilable by babel, even without plugins
  • Documentation:
    • Establish baseline conventions for using closure within our codebase
    • Community documentation on how to write closurized code for MDC-Web.
    • Contributing documentation on getting set up and testing builds
    • Any babel-specific tweaks for transforming our code need to be documented (e.g. use of certain plugins, etc.)
  • Fix any major outstanding closure issues:
    • Using this inside of getter/setter methods
    • (low-priority) export aliasing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment