-
Notifications
You must be signed in to change notification settings - Fork 22
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
Not possible to stack plugins #17
Comments
What use case do you have in mind @mitar ? |
I had this plugin. And I wanted to combine it with
But it does not work. :-( So now I had to manually merged it into one. Not good for code reuse. |
How would it work though? The plugin is responsible for actually inserting/removing the element. I think we'd need a different API in order for composing plugins to make sense. My guess is such a fully featured package is different from momentum (or extends on momentum), which is intended to be pretty close to the |
I have no idea how this would work. :-) I am just opening it here because for end programmers it would be amazing if it would work out of the box. But don't most plugins call insert/remove at the end? This could be replaced with call to done() and done() would then do it? From what I am seeing we often mostly want to do some things before and after the insert, but at the end we do insert. One other options is to make plugins themselves extendable. I am doing this through CoffeeScript classes for my plugins. Then one could extend the class, and call |
Yeah, I was thinking the same thing. Although for an insert plugin you want to call something at the beginning I think. Or halfway through sometimes. So it's complicated :) |
Oh, by "But don't most plugins call insert/remove at the end?" I didn't mean that they insert at the end of the logic, but at the end of the day, they are all mostly just inserting the DOM, but doing some logic before and after it. Can then we see all this (before + insert + after) as insert itself and use it another plugin to do (something more before + (before + insert + after) + something more after). So such extensions are quite useful to do through OOP. We define Just brainstorming here. |
Hmm, yeah that would make sense. Perhaps a plugin can define I think calling the helper twice is kind of ugly though. Perhaps it should just be:
|
That is syntactic sugar. But we should also support plugin work when nested. Because if I do:
Thins should still work, no? So imagine that this rally becomes wide-spread. We should find a way that it is nicely composable. |
It is not possible to stack plugins. The inner one wins currently.
The text was updated successfully, but these errors were encountered: