Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Support "advanced" Closure compilation #311

Open
@ochafik

Description

@ochafik

Note that DDC supports basic type annotations (when --closure is set #286), but Closure doesn't currently accept DDC's output, not even in SIMPLE mode (#312).

Here are some of the the ADVANCED mode-specific blockers:

  • Minification: need to take care of string vs. identifier mismatches (can use JSCompiler_renameProperty to create renamable strings, see branch closure-annotations-rename-properties)
  • Generics: DDC's pattern isn't recognized (Closure looses track of types). We could:
    • Skip generics altogether (see branch closure-annotations-no-generics)
    • Change the way we build generics (pass optional params in constructor?), which seems rather fiddly.
    • Write a DDC-specific Closure pass that would magically fix things (unclear how, see stubbed pass in branch closure-pass).
  • JS Runtime: right now DDC has a mix of hand-written and compiled code. To get them all to follow the Closure limitations / settings, we'd need to write all of the runtime in Dart (Write all of the runtime in Dart. #310) and probably be able to generate a different runtime on the fly (& cache it).
  • Module system: probably need to use goog.module (see integrate with existing JS module systems #284) to let Closure connect classes accross files.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions