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

[3.13.0-beta.1] Nested key dependency warning now throws an error #18235

Closed
patocallaghan opened this issue Aug 8, 2019 · 6 comments
Closed

Comments

@patocallaghan
Copy link
Contributor

I'm not sure if this is a regression but I wanted to raise it anyway as others upgrading may encounter the issue. Feel free to close if you think it isn't a problem.

In ember-source 3.12 and earlier, having a computed property which has invalid nested key dependencies resulted in a warning, but in ember-source 3.13.0-beta.1 it results in an error.

Take the following example where using @each with items.id is invalid

badNestedDependency: computed('items.@each.subitems.id', function() {
  // ... snip ...
}),

In 3.12 and lower

image

In 3.13 beta

image

I encountered this as currently our app has several instances of these invalid keys (which we definitely will be fixing!) but when trying out the beta our app broke and didn't render (in development).

My understanding was that to start throwing error assertions it needed to go through a deprecation cycle but it doesn't appear the nested key warning has. It was never explicitly named as a deprecation warning when introduced.

The error assertion appeared with the new @tracked work.

Reproduction

Code Sandbox Ember 3.12
Code Sandbox Ember 3.13 beta
Look in the console for the warning vs error, and the nested key code is in app/components/nested-key-component.js

Copy link
Member

rwjblue commented Aug 9, 2019

@pzuraq - Do you recall why we moved the warning to an assertion? Can we migrate back?

@patocallaghan
Copy link
Contributor Author

@rwjblue @pzuraq any update here? Is this an expected change?

@pzuraq
Copy link
Contributor

pzuraq commented Aug 16, 2019

Ah, I'd just thought that this was an invalid use case in general. We can add it back 👍

@rwjblue
Copy link
Member

rwjblue commented Aug 16, 2019

Chatted a bit with @pzuraq offline, I think we want to make this a deprecation (instead of an assert) which mitigates the immediate issue in 3.13. Since this was never documented (or even functional) the deprecation can be an intimate API one and the moved back to an assertion in 3.17 or later.

@patocallaghan
Copy link
Contributor Author

Closing as this has now become a proper deprecation warning instead. Thanks!

Copy link
Member

rwjblue commented Oct 7, 2019

Thanks for double checking!

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