[elm-discuss] Elm Debugger Survey

2017-05-31 Thread Luke Westby
Hey friends! We're looking to start ramping up on pushing the debugger forward 
pretty soon and if you could take some time to fill out this survey that would 
be a great help.

http://tinyurl.com/elm-debugger-survey-2017

-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] Re: Integrating Elm with Web Components / Polymer

2017-05-31 Thread Simon


One interesting thing I found as I experimented this morning is that React 
components can be wrapped up 
 to be web 
components, which might make react components more accessible from Elm (at 
present it is not straightforward 
). 
Here’s a basic example of the pattern. My experience of React is very 
limited, so I’m wondering how scalable this example could be for the react 
components people get excited about (not sure which those are though)?

import React from 'react';
import ReactDOM from 'react-dom';

var mountPoint = document.createElement('div');

const proto = Object.create(HTMLElement.prototype, {
attachedCallback: {
value: function() {
this.createShadowRoot().appendChild(mountPoint);

const name = this.getAttribute('name');
myRender({name});
}
},
attributeChangedCallback: {
value: (attrName, oldVal, newVal) => {
if (attrName == "name") {
myRender({newVal});
}
}
}
});

function myRender(s) {
ReactDOM.render(s, mountPoint);
}

document.registerElement('x-hello', {prototype: proto});

On Friday, 23 September 2016 14:28:06 UTC+2, Peter Damoc wrote:

I've been trying to get this to work but I don't have enough knowledge. 
>
> The main problem I'm facing seams to be one of setup/deployment. 
>
> Can someone help with a simple example that uses paper-date-picker
> https://customelements.io/bendavis78/paper-date-picker/
>
> I'm looking for the following:
>
> - a file structure/setup for the project that allows development of an Elm 
> program using paper-date-picker where one can see the same output in both 
> Chrome and Firefox
> - a way capture a notification for the date change
>
> less important but useful: 
> - a way to create some kind of a deliverable (something that one can put 
> on some webhosting and have it work)  
>
> Regarding the event from the component I've found 
> https://github.com/kevinlebrun/elm-polymer
> but I was unable to transfer the knowledge shown there for how to listen 
> to changes inside the web component. 
>
> Setting the date value with attribute (counter-polymer-inside-elm) 
> actually proved to be very easy and it worked without needing the port. 
> Getting informed about the date change happening inside the widget 
> however, did not work. 
>
> I tried replacing "value" with "date" in the event attribute and the json 
> decoder  (replacing Json.int with Json.string) but... it did not work. 
>
> Here are the files I have so far: 
> https://gist.github.com/pdamoc/48c6f7dd2f7fec44bdd3262f269f635c
>
>
>
>
> -- 
> 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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.