-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
v2 stuff #1338
Comments
One more: warnings and errors should have |
The only one I'm slightly worried about is the new observer patterns. I'm not sure I've seen this done before, and I'm slightly worried that it's going to increase code amount and amount of if / elseif / else logic, especially in the cases where one has to distinguish between init and not init, but I won't really know until it's out the gate, so all systems go! |
Based on my experiments so far, it's unlikely that you'd end up with more app code, and certainly not significantly more. But the good news is that So you can add |
// ...everyone does this:
const { foo, bar } = this.get(); I think it's difficult to replace this case: this.fire('hide', { update: this.get('updateList') }); |
this.fire('hide', { update: this.get().updateList }); |
I've added tasks to the v2 project, and am going to make a start on them. A couple might be slightly controversial, so I'm going to list them here:
Tidying up
cascade
option — cascading is always disabledstore
option — store support is always enabledsvelte.validate
method (andsvelte.Stylesheet
) from public API — we can get validation more simply by passinggenerate: false
onrender
andonteardown
(these have been deprecated since forever)teardown
support for custom event handlerscode
,map
andcssMap
from output ofsvelte.compile
Don't typecast
See #623 —
<Foo num=0>
will create anum
property with a string value of"0"
. To pass non-string values, use curlies:<Foo num={0}>
Error/warning codes
See #474
Replace component.observe
See #1197. Still some details to iron out, but I think it's a good move, and it would be good to get it in for v2 because otherwise we'll still need to include
dispatchObservers
andprototype.observe
until v3Destructuring syntax for computed properties
See #1069. I think it's a no-brainer. It would also provide an easy solution to #1303 — we can just have a computed property like
props: state => state
, and you could do{...props}
on a component or element. Much better than{...this}
in my opinion.If we're destructuring, then we either need to rewrite that as non-destructured code, or...
...drop ES5 support
I think we're at the point where emitting ES5 code does more harm than good. If people need to support IE11 and below, it's probably reasonable to expect them to use something like Babel or Bublé. This would make the compiled code smaller, would mean we could use
class
if we were to do this, and would allow us to......change the signature of this.get()
It's been suggested that
this.get()
could take an option to exclude computed or store properties. If we were to do that, it would make sense to remove the existing string argument:I'm not suggesting we implement
this.get({ computed: false, store: false })
just yet — we can do that post-v2. This would just pave the way for that.I'm excited about this set of changes. But if you have concerns or feedback about them, please share.
The text was updated successfully, but these errors were encountered: