Conversation
|
|
|
As @pushkine states, one of the mainstays of Svelte is that it remains valid javascript, parseable with standard tooling. For this reason, thank you for this PR but it cannot be added to Svelte in its current incarnation. The best way to add a language feature is to first create an RFC where this sort of issue can be weeded out. If you need spread binding for props it may be worth creating this RFC to discuss the proposal (however, needing to bind loads of things at once like this is indicative that it would be better to use a store, and the context API). Please don't be discouraged from contributing however, for what it is worth, your PR looks great, has tests and docs, and is otherwise great :) |
|
ahh, I wasn't aware of the valid js requirement. thanks for the RFC pointer! I wasn't sure if this needed it since the issues i snooped around didn't seem to have much discussion. I could think of a few more scenarios other than bind forwarding (namespaced bound variables in the parent, the ability to iterate through the namespace, etc), just overall from an angle of "spread on steroids". (and wouldn't stores/context API not solve this, since binds have the ability to travel upstream, thus requiring a parent scope to house all childrens' stores and defeat the point of the scoped API in the first place?) |
|
Here's what I've got so far sveltejs/rfcs#57, do put any comments you might have on it, or find me on twitter if ya'd just like to chat (: |
This implements #5137, and makes it one step closer to solve #2226
I'm pretty new to the svelte codebase, so it would be nice if there were pointers to if I did something tragically wrong. I added docs & test cases as well.
Here's a small test repo too, which code I adapted into the docs: https://github.com/Sxxov/svelte-spread-bind-test-case