google / traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
Apache License 2.0
8.18k stars 578 forks source link

Import runtime modules in dependency order. #2030

Closed johnjbarton closed 8 years ago

johnjbarton commented 8 years ago

Some runtime files use classes, but do not explicitly import classes.js. When compiling with --modules=inline, the order of import is order of evaluation. Here we reorder the imports and stop sorting them in to alphabetical order.

arv commented 8 years ago

LGTM

Do you know why we sorted these in the past?

Another option might be to do the import from the runtime files that depends on the feature in question. Might be bad though since I want us to be able to create runtimes that do not require classes.js because most browsers supports classes now.

johnjbarton commented 8 years ago

Looks like we sorted to get a stable order to avoid extra diffs back when we where committing bin/traceur.js https://github.com/google/traceur-compiler/issues/423

https://github.com/google/traceur-compiler/commit/0c53d7b853cdb79508f2388cf58bea935c4153ce

arv commented 8 years ago

OK. Thanks for the archaeology... Since we no longer commit bin/traceur.js the stable order is no longer important.

karendolan commented 6 years ago

Sorry to comment on a closed ticket... I notice that traceur changes changes the javascript source module order each time it is run, even though nothing has changed in the source files. Is there any way to get a consistent ordering each time traceur is run on a set of source files?