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

Drop support for var-ed globals #82

Open
matthewp opened this issue May 25, 2017 · 3 comments
Open

Drop support for var-ed globals #82

matthewp opened this issue May 25, 2017 · 3 comments

Comments

@matthewp
Copy link
Member

The reason the global -> AMD format is so gross is because some globals define themselves with a var; like so:

var MooTools = {};

This means that we have to run eval() on the source, rather than just inlining it in a module. Other globals that set themselves on the window object will work fine.

This will be a breaking change, so next major release.

@justinbmeyer
Copy link
Contributor

Couldn't we detect this fairly easily via the ast?

@matthewp
Copy link
Member Author

I don't know about easily, but it would be possible. Not sure it's worth the time though.

@justinbmeyer
Copy link
Contributor

I think it's very easy to see if there is a global var statement. Transpile already does a bunch of stuff like this (like checking for require function calls). Id imagine it would be just the same.

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

2 participants