Skip to content
This repository has been archived by the owner on Dec 20, 2017. It is now read-only.

fidel plugin system #9

Open
jgallen23 opened this issue Jul 7, 2014 · 7 comments
Open

fidel plugin system #9

jgallen23 opened this issue Jul 7, 2014 · 7 comments
Assignees
Milestone

Comments

@jgallen23
Copy link
Owner

Right now we have events for FidelPostInit, but I think there's probably a better way to extend fidel. If we build correctly, we can split the features up into their own plugins

@jgallen23 jgallen23 added this to the v3 milestone Jul 7, 2014
@jgallen23
Copy link
Owner Author

Idea 1 (data-elements example)

fidel.plugin({
  defaults: {
  },
  init: function() {
    this.getDataElements();
  },
  getDataElements: function() {
     this.find('[data-element]').forEach(function(el) {
         self.els[name] = el;
     });
  }
});

So fidel would just expose a bare bones amount of functionality, but it could be easily extended. We would have built in plugins for data elements, events, delegate actions, etc. And then we could build plugins for integration with bind-to, etc.

@jgallen23
Copy link
Owner Author

@Belelros @dawnerd let me know what you think

@Antonio-Laguna
Copy link
Collaborator

I think this is great but, on the other hand I think we would end up bloating the library a little bit just to achieve this and most of the stuff will always be included.

@jgallen23
Copy link
Owner Author

I'm hoping it wouldn't add too much bloat. Maybe we don't allow options and defaults for plugins, they are just an init, destroy and custom methods.

I don't think everything will be built in. Here are some ideas for plugins that won't be built in bind-to, template rendering, form validation, hash routing.

More than anything I think it cleans up the code and gives us the flexibility to build on Fidel without making the core lib too big.

@Antonio-Laguna
Copy link
Collaborator

Oh, I see. Now it has more sense and I think it would be really great having the ability to hand-pick some pieces of functionality here and there.

@Antonio-Laguna
Copy link
Collaborator

How this should work?

I imagine plugins being stored as they're declared internally, then on the module definition, we could have an array of plugins to use and we would extend the module with the given plugins.

Do you have anything else in mind?

@jgallen23
Copy link
Owner Author

Yep. Sounds right. Take a stab at what you are thinking in a branch

Antonio-Laguna pushed a commit to Antonio-Laguna/fidel that referenced this issue Jul 15, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants