vobyjs / voby

A high-performance framework with fine-grained observable-based reactivity for building rich applications.
https://voby.dev
MIT License
887 stars 22 forks source link

Custom Renderer #19

Open FlatMapIO opened 1 year ago

FlatMapIO commented 1 year ago

Is it possible to implement the createRenderer API in solid in voby? This allows voby to be used in a wider range of scenarios.

fabiospampinato commented 1 year ago

Potentially possible, if one doesn't need to render to multiple targets at the same time it should be relatively easy.

Let's see how much demand there is first, from what I've seen this is a fairly niche feature that almost nobody uses in practice.

fabiospampinato commented 1 year ago

@FlatMapIO do you need multiple custom targets at the same time? And which target(s) are you most interested in?

fabiospampinato commented 1 year ago

By the way do you know where this is documented in Solid? I can't find any docs on this createRenderer function.

FlatMapIO commented 1 year ago

Less documentation:

Some usage examples may be helpful:

FlatMapIO commented 1 year ago

@FlatMapIO do you need multiple custom targets at the same time? And which target(s) are you most interested in?

My work involves a lot of data analysis and visualization, so it would be great if canvas targets were supported. Also, I would like to use jsx as a DSL for building SQL, which would avoid the ugly Jinja & macro that users use with dbt.

theSherwood commented 1 year ago

I too would be interested in custom renderer support for rendering into the terminal.

fabiospampinato commented 1 year ago

For the terminal imo an approach like this is way way simpler. Like you really want components if you need to change how children are rendered, like by centering them or something. If you don't need that kind of capability then you really don't want to use a UI framework to render that, like it can take a few KBs to make a good looking terminal app, but if you are throwing a UI framework at the problem now the terminal app will necessarily start up slower, which goes in conflict with making a good terminal app. Like if there are requirements for features that are simpler to implement with a custom renderer for a UI framework those requirements should be questioned.