use icon indicating copy to clipboard operation
use copied to clipboard

Consider few features?

Open tunnckoCore opened this issue 8 years ago • 9 comments

  • [x] allow passing custom plugins property, currently is just .fns - maybe opts.prop
  • [x] allow accept options to each plugin, like .use(plugin, options)
  • [x] from above needs next: allow passing function to transform/extend/merge app.options and options that comes from each plugin - something like opts.fn.call(self, self, options) in the .use method
  • [ ] allow passing custom arguments to plugin function, currently is only app - maybe something like opts.params make sense
  • [ ] allow passing not only object to .run #2, but any kind and any number of arguments

You can see all this with tests in https://github.com/tunnckoCore/use-ware :)

Let me know if you want some PRs. It would be great to merge, because I like this nesting that this package allows.

tunnckoCore avatar May 08 '16 23:05 tunnckoCore

Okay, I like these ideas, it would make .use more consistent with plugin handling in base.

How about if we split this into two issues?

  1. bullets 1-3 (let's start with this one before we do anything else, so we can evaluate these separately)
  2. The rest

Sound good?

jonschlinkert avatar May 09 '16 03:05 jonschlinkert

Great! I'll send a PR for the first 3 bullets.

tunnckoCore avatar May 09 '16 03:05 tunnckoCore

So, first three are ready with #4 merging. What about the others? :) I don't see value on forcing .run to accept only object as first argument, and only one argument.

tunnckoCore avatar May 12 '16 14:05 tunnckoCore

Would you mind doing a pr so we can review?

jonschlinkert avatar May 12 '16 15:05 jonschlinkert

Okey, that's what I wanted to hear, like it. :D I'll try.

tunnckoCore avatar May 12 '16 15:05 tunnckoCore

@jonschlinkert can we process with the last 2 bullets tonight/today? I have some time. :) I'm not sure for the last one should be implemented and how to save current behaving and decorating.

edit: about the 4th this commit to use-ware may help you to understand it better

tunnckoCore avatar Jul 19 '16 21:07 tunnckoCore

yeah that seems reasonable. @doowb?

jonschlinkert avatar Jul 19 '16 23:07 jonschlinkert

Yeah, I'd like to see a PR for discussion.

I'm not sure for the last one should be implemented and how to save current behaving and decorating.

I think you can pass the opts into the base function inside decorate and the rest of the functionality will be the same. We can try it out.

doowb avatar Jul 20 '16 02:07 doowb

Mmm. Problem is on #L73: if (!utils.isObject(val)) return; for me. And actually the whole .run, because the idea is to be able to pass different number of argument of different type. So we can just do val.use() trick and the decorating.

tunnckoCore avatar Jul 20 '16 02:07 tunnckoCore