What room are you in in the elmlang slack peter? Web components elements have lifecycle hooks, including hooks which will be fired when the component is attached/rendered.
https://www.webcomponents.org/community/articles/introduction-to-custom-elements They can produce any number of effects in these hooks: throw exceptions, trigger alerts, utilize random numbers, make http requests etc. To re-iterate, these effects can cause web components to break the replay functionality of elm-debugger, as the web components are repeatedly re-rendered. On Thursday, March 23, 2017 at 4:15:20 AM UTC-7, Peter Damoc wrote: > > On Thu, Mar 23, 2017 at 9:33 AM, Maxwell Gurewitz <[email protected] > <javascript:>> wrote: > >> >> > You will be able to use a web component ONLY in the view will be as >> pure as it is right now. >> >> Unless I'm misunderstanding you, I'm pretty sure this isn't true. >> > > Wonderful! Maybe you can help me with an exploration. > I'm aiming to create a proof of concept where a web-component could be > used in such a way that it behaves like a "mutation as service". (I'm > hoping to not be able to do it) > Please contact me on Slack if you are interested. > > > >> Any violation of purity that is available to native code is also >> available to web components, given that web components can execute >> arbitrary js when they render. That's why we have silly non-presentational >> web components like polymer's ajax component >> https://github.com/polymerelements/iron-ajax. >> >> > As per the above, I would love to see a proof of concept that shows this. > In JS you have an imperative way of programming and you can do certain > things that are just impossible in the Elm world. > > >> > Again, I don't think that the use of web components is encouraged. >> >> Why do you feel that way? My impression is that writing native code is >> discouraged (thus the lack of documentation, and Evan's elm-dev posts on >> native code etc.) while the use of web components is encouraged (thus >> Richard's section on web components in Elm in Action). >> > > I have spoken with Richard and this is a very sensible topic as there are > potential nasty consequences that might not be obvious from the start. > Web components do have their role to play and I'm assuming that Richard > might touch on his book on this BUT the topic has not been fully fleshed > out. > > > > -- > 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.
