-
Notifications
You must be signed in to change notification settings - Fork 1.7k
cosmetic changes to the generated JS? #27306
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
Comments
From @devoncarew on January 22, 2016 20:5 This is:
W/ the de-indent change, this file will also be slightly smaller. |
We haven't done anything to tweak the module boilerplate, because it will be fixed by generating much much cleaner ES6 modules. Or even just following one of the ES5 module patterns, so the code looks like what humans write for ES5. That's covered by dart-archive/dev_compiler#285, dart-archive/dev_compiler#284, dart-archive/dev_compiler#34.
|
I think this is covered by those other issues, but let me know if I missed anything. |
From @devoncarew on January 22, 2016 20:10 Ah, properly pretty much covered then. Here's one more tweak to the format (which doesn't try and change the module header format): // Compiled from web/entry.dart.
dart_library.library('entry', null, /* Imports */[
'dart/_runtime',
'logging/logging',
'dart/core',
'atom/atom',
'atom_flutter/flutter'
], /* Lazy imports */[
], function(exports, dart, logging, core, atom, flutter) {
'use strict';
let dartx = dart.dartx;
function main() {
logging.Logger.root.level = logging.Level.INFO;
logging.Logger.root.onRecord.listen(dart.fn(r => {
let tag = `[${r.loggerName} ${r.level.name[dartx.toLowerCase]()}: `;
core.print(`${tag} ${r.message}`);
if (r.error != null) core.print(`${tag} ${r.error}`);
if (r.stackTrace != null) core.print(`${tag} ${r.stackTrace}`);
}, dart.void, [logging.LogRecord]));
atom.registerPackageDDC(new flutter.FlutterDevPackage());
}
dart.fn(main);
exports.main = main;
});
//# sourceMappingURL=entry.js.map |
I don't think we're likely to make cosmetic improvements at this point. |
From @devoncarew on January 22, 2016 20:0
Here's the current generated JS for a sample dart file:
Here is the sample file with some tweaks:
Copied from original issue: dart-archive/dev_compiler#425
The text was updated successfully, but these errors were encountered: