On Tue, Mar 28, 2017 at 9:26 AM, Charles-Edouard Cady < [email protected]> wrote:
> I'm composing a single-page application from several microservices > back-ends. Each back-end should render a part of the page. > > Right now I'm considering using webcomponents: > > - main page is in Elm and subscribes to a websocket giving it the list of > microservices it can get webcomponents from > - each microservice serves an html page containing the web component & its > name > - the main page dynamically includes the webcomponent & uses its name to > create the node in the DOM > > This means that whenever I switch a microservice on the component appears > on the page & it disappears when I switch the microservice off. > > The reason I'm using webcomponents here is that I may include > microservices written by third parties who do not necessarily want to be > locked in using Elm, or any specific technology for that matter. > > I therefore need two things : > > (1) the ability to use webcomponents in Elm (I think this has already been > covered, except maybe some conflicts between Elm's virtual DOM & the > webcomponent's virtual DOM) > (2) the ability to write webcomponents in Elm. > > I'm not too sure about number 2: what I've seen in the list so far is > mainly interest in using webcomponents but not so much in writing them. > Does anybody have more information on this? Any help would be greatly > appreciated! > > Here is how you would implement a web component in regular Elm & Polymer https://github.com/kevinlebrun/elm-polymer/tree/master/counter-elm-inside-polymer You will probably need to use some kind of head manipulation for dynamically importing the web-components into your page. I have never tried to do this but my intuition tells me it might be a very bad idea. Have you seen this approach done outside of Elm? -- There is NO FATE, we are the creators. blog: http://damoc.ro/ -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
