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

Compiled files missing runtime (i.e. $traceurRuntime is not defined) #777

Closed
chirayuk opened this issue Feb 17, 2014 · 5 comments
Closed

Comments

@chirayuk
Copy link

The Bug

According to the Wiki on Compiling Offline, one does not need to include traceur-runtime.js.

If I don't include traceur-runtime.js, I get the console error $traceurRuntime is not defined (the very first line of compiled file is $traceurRuntime.ModuleStore.registerModule(…)) (using master/HEAD)

Original bug

issue 288 was fixed in commit 106c4203915f6bc77d570246761bd61b9ec9aa73

Regression

commit 0575566752ec48f8c36edae0c614c8a55eb31d78 changed the test for running the compiled class (introduced in the earlier bugfix) from executeFile to executeFileWithRuntime.  This now passes because it's including the runtime.

Since this addressed issue 501: Separate the runtime functions into a file built independent of the compiled output, is one always required to include traceur-runtime.js somewhere and the Compiling Offline wiki is just out of date and needs updating?

@arv
Copy link
Collaborator

arv commented Feb 18, 2014

You now need the runtime in almost all cases.

The second change is that the command line compiler now compiles the input as modules by default.

I'll try to clean up the wiki page a little.

@arv
Copy link
Collaborator

arv commented Feb 18, 2014

Updated wiki.

Also note that traceur-runtime.js is fubared #780

@arv
Copy link
Collaborator

arv commented Feb 18, 2014

@johnjbarton

@johnjbarton
Copy link
Contributor

A runtime is always needed.
The procedure outlined in the Compiling Offline Wiki page creates a compiled file without the runtime and then adds the runtime by including bin/traceur-runtime.js.
Alternatively the runtime can be compiled into the compiled file using the same procedure we use for bin/traceur.js: the runtime source files are fed to the compiler before the application files. I guess we could document this, but it has been a moving target recently.

Thanks for the information about the out-of-date Wiki page.

@chirayuk
Copy link
Author

Sweet.  Thanks for the information and fixes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants