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

Component rendering mutates module meta #14192

Closed
trentmwillis opened this issue Sep 2, 2016 · 3 comments
Closed

Component rendering mutates module meta #14192

trentmwillis opened this issue Sep 2, 2016 · 3 comments
Labels

Comments

@trentmwillis
Copy link
Member

We're attempting to upgrade our application to 2.7.2 and ran into an odd issue. Brief backstory, we rely on the meta.moduleName property from the compiled HTMLBars template to do some of our lookups for localization.

While attempting the upgrade, there are some tests that we have that are now failing after being run in a certain order. After a lot of debugging, the root issue is that the meta.moduleName property is being mutated which causes the value to be incorrect when we do our lookup for the translation.

The offending line of code seems to be this: https://github.com/emberjs/ember.js/blob/v2.7.2/packages/ember-htmlbars/lib/hooks/component.js#L62

I haven't narrowed down the exact circumstances under which this occurs, but in some cases it appears env.meta is the same reference as the meta property from a templates AMD module. Thus, if templateMeta.moduleName is used, the module is then mutated permanently.

cc @asakusuma @zackthehuman

@asakusuma
Copy link
Contributor

@krisselden who should this issue be assigned to?

krisselden added a commit that referenced this issue Sep 6, 2016
Ensure rerender in ComponentNodeManager passes meta
the same way as it does in render.

Remove invalid fix to above issue that caused
moduleName to be incorrectly mutated.
krisselden added a commit that referenced this issue Sep 6, 2016
Ensure rerender in ComponentNodeManager passes meta
the same way as it does in render.

Remove invalid fix to above issue that caused
moduleName to be incorrectly mutated.
rwjblue added a commit that referenced this issue Sep 6, 2016
rwjblue pushed a commit that referenced this issue Sep 6, 2016
Ensure rerender in ComponentNodeManager passes meta
the same way as it does in render.

Remove invalid fix to above issue that caused
moduleName to be incorrectly mutated.

(cherry picked from commit 4f9383d)
@pixelhandler
Copy link
Contributor

@krisselden @rwjblue this can be closed now, right?

@rwjblue
Copy link
Member

rwjblue commented Sep 9, 2016

Ya, was fixed in 2.7.3 and 2.8.0

@rwjblue rwjblue closed this as completed Sep 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants