-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Ember.warn transpilation error #184
Comments
Under the hood, the new debug macros are being transformed by this babel plugin: https://github.com/chadhietala/babel-plugin-debug-macros The plugin strips all of the debug helpers at build time in production builds, so its behavior is different than other modules which are compiled. Based on this, and a quick glance at the tests for that transform, I'm not sure it took renaming imports into account. It is also probably breaking transpilation of spread. To be fair, chances are wrapper functions like the ones in the linked issue aren't necessary, so I wouldn't say this is a super high priority bug, but it should probably be fixed at some point |
@pzuraq thanks for pointing out that babel plugin. I was thinking it had to do with debug stripping, but was not aware of the actual plugin... Seems this is actually a duplicate of ember-cli/babel-plugin-debug-macros#47, so closing this here now!
Does not happen only with renamed imports, see the linked issue above! |
Minor fix on line 56
When
Ember.warn
is imported with the new module API, something weird happens during transpilation. Not sure if it's related to some babel plugin, and if so which, so created the issue here for now...Here is a reproduction repo: https://github.com/simonihmig/ember-warn-transpilation.
It contains two examples of
Ember.warn
usage, one with the new imports, and one (warn2
) with globals: https://github.com/simonihmig/ember-warn-transpilation/tree/master/app/utilsThese files transpile as follows:
The interesting part is this:
(true && Ember.emberWarn(...arguments));
:Ember.emberWarn
is not a thingtrue &&
???Because of the spread usage, the whole app breaks with a syntax error in older browsers (IE11).
The globals based module transpiles correctly though...
The text was updated successfully, but these errors were encountered: