Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow the use of another rendering than DOMΒ #399

Description

@Swizz

I discussed a lot about this feature on Slack, and now I come to you with some real news and experiences.

At the moment, Hyperapp is used as "a JavaScript library for building frontend applications" (from the readme).
But I was fall in love about Hyperapp, and I think it can allow a lot more.

Thinking about it Hyperapp is a store (state/actions management) with a render on update feature.
Now Hyperapp is rendering on the DOM through its VDOM logics. But I am not asking to remove it.

What I am asking is to permit user to use the view function for something else than rendering into the DOM.

I found a pretty clean solution to do that in less than 10 Bytes (min+gzip). Swizz@3109c46

But this one is not really good and work only in a node context, because in a node context you are able to override document.body.

Another solution could be to do not call the patch function if appView() to do not return anything.
Swizz@d9608af

And this one make sense too, as returning nothing from a view may cause an error. https://github.com/hyperapp/hyperapp/blob/fragment-state/src/app.js#L209

I dont know what I am supposed to write to convince you so I made a pretty simple example of a terminal app using Hyperapp.

demo
repo : https://github.com/Swizz/hyperapp-term-poc
app : https://github.com/Swizz/hyperapp-term-poc/blob/master/src/app.js

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions