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

[Cleanup] Introduce a tiny bit more debugging data to warnings about CP dependencies #15106

Merged
merged 1 commit into from
Apr 4, 2017
Merged

[Cleanup] Introduce a tiny bit more debugging data to warnings about CP dependencies #15106

merged 1 commit into from
Apr 4, 2017

Conversation

trek
Copy link
Member

@trek trek commented Apr 4, 2017

I ran across this updating an app from 2.4LTS to 2.5.

We started with code a bit like this:

const foos = 'abc';
computed('model.@each', foos, function() {})

And mutated to:

const foos = ['abc', 'def'];
// !!! -> `foos` not properly tracking because it is now an array, not a string. 
computed('model.@each', foos, function() {})

Then we started the 2.4 -> 2.5 update in our app.

In 2.5, Ember started protecting from this error by checking typeof for dependencies and asserting if you passed other types. It was a little rough to track down with only "A computed property key must be a string" as a guide.

This PR updates the assertion with a tiny bit more debugging data.

@trek trek requested a review from rwjblue April 4, 2017 14:09
@trek trek changed the title Introduce a tiny bit more debugging data to warnings about CP dependencies [Cleanup] Introduce a tiny bit more debugging data to warnings about CP dependencies Apr 4, 2017
@rwjblue rwjblue merged commit 6fe9719 into emberjs:master Apr 4, 2017
@rwjblue rwjblue deleted the tell-you-what-you-passed branch April 4, 2017 15:19
@rwjblue
Copy link
Member

rwjblue commented Apr 4, 2017

Awesome, thank you @trek!

@trek
Copy link
Member Author

trek commented Apr 4, 2017

👋 long time no commit.

@locks
Copy link
Contributor

locks commented Apr 4, 2017

Such emeritus 😘

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

Successfully merging this pull request may close these issues.

3 participants