-
Notifications
You must be signed in to change notification settings - Fork 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
Expose bare minimum to add effects dynamically. #3460
Conversation
a98837f
to
6de4515
Compare
37e987f
to
93644d4
Compare
Hey @kaste this is super great and very exciting -- I for one have wanted this feature for quite a while, it opens up the door for all kinds of dynamic element creation while being able to take advantage of the built in data-binding behaviors of polymer! Thanks for the PR |
All issues that are fixed by this PR must be included in the PR description. Also they should all be prepended with Fixes. For more information see https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md#submitting-pull-requests |
@TimvdLippe Updated the decription. |
I have tried the pull request with Array splices and can say it worked.
Appart from your nice, working solution, the array observation is just so unhandy, that you can loose joy and spoil the delight for yourself and there could be a nicer implementation for array-collections. |
@fooloomanzii Isn't this what you want: ❓
|
@kaste I wasn't aware of |
93644d4
to
2a02678
Compare
👍 This is an exciting PR. |
The general concept for this feature is good. We are doing explorations around a re-layering of Polymer that would expose the underlying machinery of the data system to end-users to enable better customization, and being able to add property effects to instances is definitely something we plan to include in that, so we're on the same wavelength here. As far as adding this feature to the 1.0 codebase, the
@kaste I would say that if you're willing to consider & adjust based on the feedback above to go for it and we can take another look. As I said we are definitely planning to expose API for instance-time property effect management in the next major version where it will hopefully be a more fully-considered system, but that's still a little further down the road. |
Currently The side effect of having prestored effects here is that I need the Regarding the The straightforward implementation for this is as follows::
This is described here https://dom.spec.whatwg.org/#events |
2a02678
to
0ee70ac
Compare
#3573 has some of the suggested changes. Implementing a linked list is not among them ;-) |
0ee70ac
to
658e6d8
Compare
Renamed API to |
@@ -274,10 +274,12 @@ | |||
var fx$ = this._propertyEffects && this._propertyEffects[model]; | |||
if (fx$) { | |||
for (var i=0, fx; (i<fx$.length) && (fx=fx$[i]); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Must prestore length just like in accessors!
Anyone know when this PR is going to be merged and released? It really is a huge improvement. Thanks @kaste. |
Note: B/c Templatizer makes some fu with propertyEffects I had to fight f9d64e1#diff-65d1593d7f79b51a64ac3cfc9465a1f4L330 to make instance property effects ( |
@btelles The coupling between Templatizer and the Polymer.Bind system, and my veto on removing the disabled flag, -> they need to meet. |
I would greatly benefit from being able to do this! Any time estimates at this point? Thanks. |
Ping. This is now undecided for half a year. It adds value to the 1.x branch and is a non breaking change. You should prefer #3573 of course. On top that ‘linkPath‘ and ‘notifyPathUp‘ can be easily reimplemented as I have shown in other PRs, which will make Polymer faster for everyone. |
Sorry for the very late response. Based on this PR and the numerous community requests, this API actually shipped in Polymer 2. You can try it out yourself in http://jsbin.com/toholosuhu/edit?html,console,output For a full documentation of the API you check out the docs: https://www.polymer-project.org/2.0/docs/api/mixins/Polymer.PropertyEffects#method-addPropertyEffect |
Adds methods to add and remove property effects. Basically:
Reference issue #3456
Fixes #3420, fixes #1796, fixes #2131, fixes #2638, fixes #1778.