witheve / Eve

Better tools for thought

Home Page:http://witheve.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Components/Widgets integration

wilk opened this issue · comments

This issue is derived from the #729

In my Eve application I need to use some widgets that are already built using other libs and frameworks (think about projects like material design, a set of ready-to-use HTML components/widgets).
How can I import Javascript libs (for HTML custom components) in an Eve application?
Do they work just by adding records like [#my-custom-component attr: "value"] or Eve needs to know how to interpret that particular record?

Discussion on the ML: https://groups.google.com/forum/#!msg/eve-talk/vR-4y2kJv4Q/TaJXgsaSFAAJ

Hey @wilk:

Unfortunately the list of html tags the current renderer supports is white-listed. In the new client renderer, we're making a lower level HTML API available that allows you to manually construct custom elements (something like [#html/element tagname: "my-custom-component" attr: "value"]). Note that unless the events the custom component dispatches are very similar to normal HTML events, you'll likely still need to make the component Eve aware or build a lightweight watcher that listens for the appropriate event(s) on your custom element(s) and translates them into Eve facts. We're working on making the latter quick and easy, so that in practice you can write a few lines of JS to wrap vanilla JS components to make their functionality accessible to Eve.

@joshuafcole that sounds great 💪
Thanks!