Hyperapp: Should plugins allow extending view and plugins?

Created on 8 Mar 2017  ·  10Comments  ·  Source: jorgebucaran/hyperapp

Currently plugins can only extend the following app's options:

  • model
  • actions
  • subscriptions
  • hooks

Should plugins also allow extending view and plugins?

Discussion Feature

All 10 comments

Plugins wouldn't really make sense. View is possible through the onRender hook.

What about extending the view?

@jbucaran

view is possible through the onRender hook.

What else do you mean? Extracting SVG?

I meant allowing plugins to export a view prop.

But, you're right, let's _not_.

What about plugins that need UI?

An example would be a plugin that integrates hyperapp updates with https://github.com/mrdoob/stats.js/ or a debugger that includes its own UI.

These plugins could essentially have their own mounting-point, view, etc.. They'd be just like any hyperapp app.

This would also make your idea of app({}, router, stats, logger) a reality. The thing I said about this syntax implying that multiple apps are supported — I actually start to think that it makes sense.

What do you think?

@dodekeract You can create two separate apps using app and embed them in sibling containers of a single parent.

@jbucaran I'm aware of that.

Awesome! 👍

I only recently discovered that you can have more than one hyperapp on the page at one time!? See here for example. Is this just happenstance or was there some intention behind it?

I'd like to say there was a master plan behind it, but no. I use this to visually test each version also. I have one page with every single example I've created for hyperapp to date. It used to take me 5 seconds to see everything was running smoothly, now it takes me like a minute.

So, in your own words, happenstance, but it's quite obvious once you see that app can be called multiple times.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mytrill picture Mytrill  ·  4Comments

ghost picture ghost  ·  3Comments

SkaterDad picture SkaterDad  ·  3Comments

joshuahiggins picture joshuahiggins  ·  4Comments

zaceno picture zaceno  ·  3Comments