Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closure Compiler Advanced Compilation and Externs Generation #4014

Closed
DartBot opened this issue Jul 6, 2012 · 13 comments
Closed

Closure Compiler Advanced Compilation and Externs Generation #4014

DartBot opened this issue Jul 6, 2012 · 13 comments
Labels
closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug web-dart2js

Comments

@DartBot
Copy link

DartBot commented Jul 6, 2012

This issue was originally filed by wessels...@gmail.com


What steps will reproduce the problem?

  1. Export Dart Project to JavaScript
  2. Try to compile it with Google Closure Compiler in Advanced Compilation Mode.
  3. See that there are lots of issues.

What is the expected output?

Uncompressed and unminifiable JavaScript, not suitable for production.

What do you see instead?

Wish to see a clean and tidy JavaScript Output that can easily and automatically be compiled with Google Closure in Advanced Mode.

It would also be great to have a way to generate Externs for the Google Closure Compiler.

@kasperl
Copy link

kasperl commented Jul 6, 2012

Added Area-Dart2JS, Triaged labels.

@kasperl
Copy link

kasperl commented Sep 3, 2012

Added this to the Later milestone.

@kasperl
Copy link

kasperl commented Sep 3, 2012

Issue #4489 has been merged into this issue.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Removed this from the Later milestone.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Added this to the Later milestone.

@kasperl
Copy link

kasperl commented May 23, 2013

Added TriageForM5 label.

@kasperl
Copy link

kasperl commented May 28, 2013

Removed Type-Defect, TriageForM5 labels.
Added Type-Enhancement label.

@DartBot
Copy link
Author

DartBot commented Jul 19, 2013

This comment was originally written by brrkzr...@gmail.com


I found out that, in a small project, calling dart2js with the '--minify' option and further compacting the result by applying Closure Compiler with the '--compilation_level SIMPLE_OPTIMIZATIONS' option produces code that is similar to using the ADVANCED_OPTIMIZATIONS option. At least with the dart2js that comes with Dart Editor 0.6.5_r25017.

@peter-ahe-google
Copy link
Contributor

The Closure Compiler should not be able to further optimize minified dart2js output.

If it can, it means that there is a bug in dart2js that it doesn't optimize well enough.

@DartBot
Copy link
Author

DartBot commented Jul 19, 2013

This comment was originally written by brr...@gmail.com


Closure removes line breaks and the comment at the beginning. In my case the output of dart2js --minify is 109982 bytes. After Closure it becomes 102362 bytes.

@peter-ahe-google
Copy link
Contributor

Most of the line breaks dart2js emit in minified will have to be replaced by semicolons. A line break is one byte, and a semicolon is one byte. So the difference shouldn't be so large, but it is as there are still some superfluous line breaks in dart2js output. That's a bug in dart2js.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug web-dart2js
Projects
None yet
Development

No branches or pull requests

5 participants