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

v0.9 -> v0.10: adding warning in unscoped methods #3229

Open
dagnelies opened this issue Apr 24, 2018 · 2 comments
Open

v0.9 -> v0.10: adding warning in unscoped methods #3229

dagnelies opened this issue Apr 24, 2018 · 2 comments

Comments

@dagnelies
Copy link
Contributor

dagnelies commented Apr 24, 2018

Hi,

I noticed that a recent update from https://cdn.jsdelivr.net/npm/ractive (I assume it's "latest" and gone from 0.9 to 0.10) changed how event methods are handled.

Following snippet:

<button on-click="doSomething(this)"></button>

doesn't work anymore and just throws a cryptic exception.
Instead it should apparently now be replaced with the more unambiguous:

<button on-click="@this.doSomething(this)"></button>

Due to the widespread usage of calls like on-click="set('my.key.path', 'foo')", I think placing a warning if such methods don't start with a @... would be very helpful. Otherwise, people have no clue what's going on when updating.

@fskreuz
Copy link
Contributor

fskreuz commented Apr 24, 2018

That's due to resolveInstanceMembers now defaulting to false. See migration notes. TL;DR: All instance members will, by default, explicitly need to be accessed via @this/@.

@dagnelies
Copy link
Contributor Author

I figured it out the way. I'd be nice to avoid this hassle using a warning for the others.
Same for computations still using $.

I'd be like a pre-flight check, just to indicate where people use deprecated stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants