serving outside of jupyter/nteract #96
@Casyfill That error is curious, I don’t seem to see that when I run it. Maybe a concurrency problem? Can you post an issue with the stack trace?
And unfortunately vdom is pretty basic and relies on the notebook for rendering. However I wrote idom in such a way that it would be compatible with vdom’s model specification (with the exception of event handlers, for now). As a result, you should be able to use vdom with idom, so long as you dont use event handlers from the vdom package (though I haven’t tested this recently).
EDIT: You are able to turn VDOM objects into static HTML via
You can serialize vdom to html using
In : from vdom import div, h1, p, a In : layout = div( ...: h1("Example"), ...: p("Hello ", a("world", href="http://example.com"), "!") ...: ) In : layout.to_html() Out: '<div><h1>Example</h1><p>Hello <a href="http://example.com">world</a>!</p></div>'
I can't recall if that's only on master or if we've shipped with that.
@rgbkrk it's in the latest release.
@Casyfill it probably goes without saying, but
If you do want event handlers you should be able to use
@idom.element async def MyComponent(self): return vdom.p("hello world")