-
Notifications
You must be signed in to change notification settings - Fork 782
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
Rename plugins #189
Comments
Another idea might be to simply rename plugins to "mixins" |
I would prefer |
@zaceno I like mixins too, but do mixins encompass plugins conceptually? If they do, then I think we may have a winner. I was just worried that people looking at "mixins" may think of them as a simple to structure/compose apps, but not as plugins. If that's not the case then it's good. |
@jbucaran Good question... I think mixins probably do encompass plugins but it's kind of open to interpretation. The way I see it, a mixin works by augmenting the functionality of something, whereas a plugin is more about using an interface to couple two things together. So... I guess I see mixins as one way to plug something in, and at the same time they are more broadly useful. Sorry if that sounded vague and rambling... :) |
That's okay. Mixins is a more vague concept just like hyperapp plugins are a vague feature named plugins for lack of a better name. Starting to like mixins; it sounds less harmful than plugins too 😆.
Just use a mixin for that. @dodekeract @lukejacksonn @pedroborges @itrelease What do you think? |
@jbucaran I don't really care about semantics. So for ease-of-use I'd vote to keep the current name so nobody has to change it in their sourcecode. |
@dodekeract Thanks for the feedback. I'm not happy about breaking the API either, but #190 will break it too anyway, and @zaceno's point is convincing. |
I personally feel that plugins is the right word for it. My stance on naming things overall is that it doesn't really matter, and devs are smart enough to figure it out. For reference, the Hapi ecosystem consists of plugins as well. The recommended way of building Hapi apps is to create multiple plugins (consisting of routes, server methods, etc) and compose them together. Their way of doing it is a lot more complicated, but the concept is the same. |
The reason I went with plugins in the first place is because it's a familiar term. Everyone has heard about plugins, but not everyone has heard about mixins. |
@SkaterDad Any thoughts with regards to mixins? |
@jbucaran When I hear mixins, I think of code that you sprinkle in where necessary to merge a re-usable bit of logic into something. Kind of how React used to promote the For me, I see plugins as something globally applicable (like sugar in a cake), but mixins are things you sprinkle in where needed (like sprinkles). |
Sprinkles! 😆 @zaceno Any remarks? |
Riot has mixins btw. |
@jbucaran: For me what characterizes a mixin is not so much how much you use it, as how. It comes down to the design pattern. So maybe mixins aren't the best term either, but it's broad enough to encompass many use-cases, which is why I like it. "Plugins" make me think of things like backbone-plugins. So: something exclusively for extending your framework. That's why I think this is a problem. Because when you use plugins not to extend/augment hyperapp itself, but just to structure your own code, it feels like you're doing something wrong, when you're not. |
Which one is less worse? Functionality-wise, whatever we end up going with will not modify how this feature works. Plugins is a familiar term, and familiarity is useful when teaching/learning new concepts. That's why we changed model to state, merged subs/hooks into events and also: #190. Mixins is not unheard of, but it's more obscure than plugins. I agree that the term mixins is more precise than plugins when you think about how this feature is implemented though. I also like the sound of it! Question:
|
@jbucaran It's hard to say categorically, because as you point out, it's a lot about the general perception of what things mean, or how heavy/complicated things are percieved to be (wether or not they actually are). But I'll answer as best I can:
I would consider these as both plugins and mixins because: a) They expand the framework with general functionality (= plugin) If however, I separate various concerns of my app into separate modules (like authentication, blog posts, comments, user-management...), and combine them together into a single app using the feature currently called "plugins" -- then these things are: a) Adding app-specific functionality -- NOT general (= NOT a plugin) |
I'd like to add that the one reservation I have about the word "mixin" is that it is kind of already taken. Most who know the term may believe we are talking about the OO-pattern of assigning bound functions to objects after instantiation. ... but on the other hand, unless we invent a completely new word, any term we choose will have the potential of causing confusion. We should just try to cause as little confusion as possible. I feel like we can do better than "plugins", but I'm just one guy... |
Vue does mixins as well: https://vuejs.org/v2/guide/mixins.html tl;dr Mixins are a flexible way to distribute reusable functionalities for Vue components And Vue also has Plugins! Very good descriptions in both: https://vuejs.org/v2/guide/plugins.html#ad tl;dr Plugins usually add global-level functionality to Vue. |
Well, I definitely want to go with one concept only. @selfup It's good to know that Vuejs also has mixins, I think that works as +1 for mixins. Who else is using mixins and how? |
Angular 2/3/4 seems to have Mixins as well however not officially but through typescript decorators |
A discussion here from marionette, they have |
@SkaterDad Do you see using mixin as detrimental for hyperapp? |
@jbucaran I don't see calling them mixins as detrimental, but I also don't see how it would be beneficial. If you're going through the effort to push a breaking change, maybe go bold and rename "plugins" to the Japanese translation, using the actual characters? That way people who use Google said "plugin" -> プラグイン |
Very funny. And, yes, プラグイン, that's how they're called. 😄 |
I take it back. プラグイン appears to be 15 bytes, so that's a big penalty compared to "plugins" or "mixins". |
@zaceno I like the sound of mixins and I realize mixins in hyperapp would not be the same mixins talked about in:
But they seem to have a bad reputation, so I'm not sure this change would be better than worse. |
Seems from the articles you linked, react-mixins have a bad reputation in the react community. I'm thinking of mixins more along the line of a design pattern (https://www.safaribooksonline.com/library/view/learning-javascript-design/9781449334840/ch09s13.html) -- and like all design patterns, it's sometimes good, sometimes bad. Use when appropriate :) |
That's a good reference. Let's see how people react to this: #194. |
The mechanism for plugins has proven a generally useful way to separate the concerns of your app into separate modules.
If for example, you are writing an admin interface for a blogging platform, you might want to separate your code into
auth
,posts
,comments
, et c modules, containing the state, actions, events relevant to each respective topic.By exposing each module's state, actions, events as a plugin, it becomes very convenient to bring them together in a single app using
app({ ... plugins: [auth, posts, comments], ...})
However, the word "plugins" implies it is only meant for more general, reusable things. Not as a way to structure your app. Therefore, I move that the name "plugins" be changed to something else. The question is what?
Either, we find a suitable noun, such as "modules" (except "modules" might cause some confusion), or, perhaps we don't hard-code a name into hyperapp, and instead declare the plugins with a verb, such as:
app({ ... compose: [auth, posts, comments] ...})
. Other options, besides "compose", might be "include" or "merge".If we go the "verb" route, we'll still need a noun to use instead of "plugins", for docs and discussions. But we're more free to use a longer, descriptive name, like "hyperapp-modules" for example.
At the moment, I think my vote is on:
app({ ... include: [foo, bar] ...})
and calling the includees "hyperapp-modules" in the docsThe text was updated successfully, but these errors were encountered: