weebney/tachyon

Wrap script in IIFE

Closed this issue · 4 comments

Should be rather easy to support scripts as well as modules and might be relevant for users (just make sure to wrap entire code in new scope to not leak variables to global scope)

(function(){
<tachyon-code>
}())

Is there a specific use-case you had in mind for this?

I think that the cost of "fixing" this is literally as close as possible to 0, so why not really? hard to tell what web app builders need or might do in this web jungle.. in this case it's just about wrapping your output code with a scope (I think in general code should always be wrapped in a scope so it's clear it should not leak)

Valid point. I'll put it in the milestone for the next version 👍

Closing this; already implemented for the upcoming version (timeline for which is uncertain) & stale ticket. Appreciate the suggestion @weizman !