--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I took Peter’s gist as a basis and made a repo out of it: https://github.com/fredcy/elm-polymer-calendar
My version uses a small bit of native code to convert the JS Date value from the calendar component (sent as a JS event) into an Elm Date value. That avoids the kluge I had before using toString
and Date.fromString
to do the conversion (with manual munging of the string necessary in between).
I spent a little time getting it to work in the latest Chrome, Firefox, and IE. I also packaged it up into a near-minimal distribution which can be seen at https://fredcy.github.io/elm-polymer-calendar/
Peter, what exactly do you mean by this:
"Now the need is for some kind of structure and way of delivering Elm products that embed this kind of web-components."
How do you deliver applications without Web Components? How do you think using WCs makes it different?
--
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/8Q2xwRh6UYc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss...@googlegroups.com.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and all its topics, send an email to elm-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
After that's done and everything hums along with the help of elm-package/elm-reactor, there comes the issue of starting to need functionality that is beyond the elm-platformThere comes a point when you start needing to install tools with npm or bower.
One starts to need makefiles (like Fred used) or gulp/webpack.
I use grunt based on how I was using grunt with angular prior to trying out Elm - but others will have different ways of building that suit their preferences. As you say, it is something beyond the elm platform. I think that feels right though, Elm is just a transpiler that spits out some javascript that I incorporate into my build, same as any other transpiler I might care to use.
I've tried your solution and at least I got to confirm a personal fear: it's scary big.
1.7MB might not seam much but... I'll be honest, I don't like artifacts this big .
The inspector says that it will take 17 seconds over a regular 3G connection to load this.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I looked at the entire dist folder as that was the actual result in my perspective. 1MB index.html with about 700k extra JS (elm.js included)
Yes, it was not minified.
The performance details are part of what I mean by integration.
Should I, the beginner, solve this or should I have some kind of help in this from Elm tools?
In other words, should I spend time figuring out how to connect tools (maybe get paralyzed by not being able to figure out if I should use grunt, gulp or webpack) OR should I invest that time in learning to use Elm?
This is how constrains liberate.
One integration solution (even if sub-optimal for some of the veteran web devs) frees the beginners from all the complexity of making that work from scratch.
I took Peter’s gist as a basis and made a repo out of it: https://github.com/fredcy/elm-polymer-calendar
If I'm reading this right, you may be able to get just the polyfills.
http://webcomponents.org/polyfills/
--
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Polymers do not work like that.
For optimizing the size, see the links I posted in the previous comment.
I have a personal exploration of polymer that tried to minimize the output:
https://github.com/pdamoc/polymer-exploration
On Wednesday, October 5, 2016 at 3:28:31 PM UTC+1, Rupert Smith wrote:On Wednesday, October 5, 2016 at 12:54:19 PM UTC+1, Peter Damoc wrote:Polymers do not work like that.
For optimizing the size, see the links I posted in the previous comment.
I have a personal exploration of polymer that tried to minimize the output:
https://github.com/pdamoc/polymer-explorationFirst hurdle, there is no polymer-paper-listbox bower package, so I guess I need to create one? Are all these bower dependencies really needed to build a functioning date picker?
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
"PolymerElements/paper-listbox#^1.1.2"
Polymers do not work like that.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I am going to give this a go, as I need an MDL styles multi-select
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This is very interesting.
Can you share some code so others can look at this?
On Wednesday, October 5, 2016 at 4:48:59 PM UTC+1, Peter Damoc wrote:This is very interesting.
Can you share some code so others can look at this?Its here:
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I have no idea what is happening there but I would sure love to see what comes up as a solution.
On Wed, Oct 5, 2016 at 7:00 PM, 'Rupert Smith' via Elm Discuss <elm-d...@googlegroups.com> wrote:
On Wednesday, October 5, 2016 at 4:59:17 PM UTC+1, Rupert Smith wrote:On Wednesday, October 5, 2016 at 4:48:59 PM UTC+1, Peter Damoc wrote:This is very interesting.
Can you share some code so others can look at this?Its here:Running here:
--
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...@googlegroups.com.
--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...@googlegroups.com.
On Tuesday, September 27, 2016 at 11:41:44 PM UTC+1, Frederick Yankowski wrote:I took Peter’s gist as a basis and made a repo out of it: https://github.com/fredcy/elm-polymer-calendar
I am going to give this a go, as I need an MDL styles multi-select:
So I can get the select box to appear, but as soon as I click on it, it vanishes. Is this where Html.Keyed helps me out somehow? I did try creating the paper-listbox and paper-item nodes as keyed nodes, but it stills dissapears....
--
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+unsubscribe@googlegroups.com.
Custom elements also work decently when the custom element takes no children but if it does, it stops working.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This works for me in both Chrome and Firefox on OS X with the 'webcomponents-lite.js'
Thanks for solving this.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
--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...@googlegroups.com.
Next challenge: how to implement Custom Elements in Elm. :)
I've heard scary things about Polymer performance, mainly on mobile browsers. What you guys think about the state of Polymer at this time?
--
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+unsubscribe@googlegroups.com.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
My view is that we don't need Polymer, just the web components standards. If you're deploying to production, that may means that you may need to serve browser poly-fills.
I was thinking more in terms of having a way to define custom components in Elm and then use them in Elm while avoiding to duplicate the runtime and the rest of the core libraries. :)
This one, I think, is a polymer component implemented with elm:
How about taking this example, and using it as a polymer component within an elm application? So elm inside polymer inside elm. Sharing the code between the two elm parts, just with two separate mains.
Yes, we just need web-components, not polymer. Polymer is prividing some convenience to experiment with web components though.
Yes, we just need web-components, not polymer. Polymer is prividing some convenience to experiment with web components though.Well... it's more than just convenience. If this gets really iron out and Elm programmers get easy access to the entirety of
https://customelements.io/
this might make Elm a lot more attractive.
customelements.io is all built on top of Polymer is it?
On Fri, Oct 7, 2016 at 4:41 PM, 'Rupert Smith' via Elm Discuss <elm-d...@googlegroups.com> wrote:customelements.io is all built on top of Polymer is it?Well, I got carried away. :)
Not all of those libraries rest on Polymer. A lot of them, however, do. :)
This is brilliant, hope someone can write this all up for reference at some stage. ;)
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The only thing that remained to be shown with code is how to implement a component in Elm and use it in Elm (yo, dawg style) .
I'm catching up on this thread...so much impressive progress! :DIt seems like:
- registerElement is enough to get node "my-component" and on "my-component-event" (with a custom decoder) working in Elm
- With the webcomponents-lite.min.js polyfill (16K gzipped), you can get registerElement working on IE11+
- Polymer components in particular...
- Require using Bower
- Reuquire at least webcomponents.min.js polyfill (36K gzipped) for Polymer components which depend on Shadow DOM
- Polymer 1.0 components that use Shady DOM should still work with the smaller webcomponents-lite polyfill
- If children are involved, you need to configure things like this or else the children will disappear on interaction
Am I missing anything from this list?This is brilliant, hope someone can write this all up for reference at some stage. ;)I'm giving a talk in Vienna in a couple weeks, and I'd love to make it around all the work you folks have done here. It's really great stuff! :)
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I have already tried doing this but have run into troubles:
Here is the topic where I have the code and the problem:
https://groups.google.com/forum/#!topic/elm-discuss/QI6G6Pd5jPU
I have already tried doing this but have run into troubles:
Here is the topic where I have the code and the problem:
https://groups.google.com/forum/#!topic/elm-discuss/QI6G6Pd5jPU
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
using attached instead of ready did the trick.
Thanks for taking the time to figure this out!
Now, the next challenge is to figure a way to declare all this in Elm and automate as much as possible the process of creating the custom components. :)On Monday, October 10, 2016 at 3:38:13 PM UTC+1, Peter Damoc wrote:I have already tried doing this but have run into troubles:
Here is the topic where I have the code and the problem:
https://groups.google.com/forum/#!topic/elm-discuss/QI6G6Pd5jPUI think you just didn't get the lifecycle quite right:I moved the embedding of the elm component to the 'attached' method instead. It seems that attribute values are not set on the properties until attached, and only have the default values when 'ready' is called.Needs some tidying up (tomorrow), but what I have checked in seems to be working:
--
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...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/8Q2xwRh6UYc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss...@googlegroups.com.
Now, the next challenge is to figure a way to declare all this in Elm and automate as much as possible the process of creating the custom components. :)
Has anyone gotten anything doing really complicated DOM stuff (in particular Google Maps comes to mind) working in Elm via web components?In theory it would Just Work, but in practice I always wonder... ;)
I'm catching up on this thread...so much impressive progress! :DIt seems like:
- registerElement is enough to get node "my-component" and on "my-component-event" (with a custom decoder) working in Elm
- With the webcomponents-lite.min.js polyfill (16K gzipped), you can get registerElement working on IE11+
- Polymer components in particular...
- Require using Bower
- Reuquire at least webcomponents.min.js polyfill (36K gzipped) for Polymer components which depend on Shadow DOM
- Polymer 1.0 components that use Shady DOM should still work with the smaller webcomponents-lite polyfill
Next up, run vulcanize to assess the size cost of full polymer and the various webcomponents.js if they are also bundled.
On Monday, October 10, 2016 at 10:40:25 PM UTC+1, Peter Damoc wrote:Now, the next challenge is to figure a way to declare all this in Elm and automate as much as possible the process of creating the custom components. :)I think rolling these Elm web components by hand should continue for a while until issues are ironed out and the pattern becomes well established.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I did however became aware of a big limitation to this approach: ports.
ports seam to be needed in order to implement triggering events in order to communicate with the outside of the component.
This limits the usefulness of the method because it bans the components from package.elm-lang.org.
what do you think about this?
On Wednesday, October 12, 2016 at 1:55:02 PM UTC+1, Peter Damoc wrote:I did however became aware of a big limitation to this approach: ports.
ports seam to be needed in order to implement triggering events in order to communicate with the outside of the component.I'll have to correct you here. The event is triggered by using an on-event on the custom components html element:onCountChanged : (Int -> msg) -> Attribute msgonCountChanged tagger =on "count-changed" <| Decode.map tagger detailCountThis is actually very neat, since ports are not needed.But the port does need to be used to push the part of the state that the component wants to make public from the Elm program, into the component as javascript, so that it can trigger an on-event to pass it to the consumer of the component.
Needing to set state on a component feels like an anti-pattern.
I think though it might make letting the consumer of the video component customize its control bar difficult. I might like to do something like thisvideo [ src "http://myvids.com/cute_cats.mpg" ][ videoControl [] [ button [ onclick Pause ] [ text "pause" ] ] ]Now how does the Pause action tell the video to pause?
This limitation means you can't have UI elements defined outside of a component affect its state. Suppose you had a video component and a video control bar compnent, you could not make those separate components, you'd always have to embed the control bar inside the video component.
I'm interested in expanding on the counter example to add more complexity - and I have a component in mind that will be useful to me - the listbox that I was working with previously.
So there is an issue with being able to change the state of the component, post initialization, from the consumer of the component. Because if there is a port used to set state on the component... which component?
Which is ok, but what I really want is for the listbox user to be able to display more than just a string in the listbox, along these lines:root : Model -> Html Msgroot model =listbox [ attrForSelect "value", onSelectedChanged SelectChanged ][ listItem [ value "1" ] [ text "one" ],listItem [ value "2" ] [ text "two" ],...]
I'm interested in expanding on the counter example to add more complexity - and I have a component in mind that will be useful to me - the listbox that I was working with previously.The areas to add more complexity to are:More complex data on initialization - for example, passing a list of items to init the list box with. This will be a List (String, String) in the Elm application -> json array of string, string -> List (String, String) in the Elm component. That is, just needs encoder/decoder written to handle it.More complex data on update - same as above really, provide a list of selected items every time it changes.More complex internal state on the component - more options on the component for things like max items to display before adding a scroll bar, the scroll bar and scroll state itself. Ability to fetch the list of items from the server, so I can configure a listbox like this <elm-listbox href="http:/.../picklists/somelist">, and have the component manage the request/response lifecycle itself.
1. Build some support into the Elm compiler for webcomponents.
FYI I got Google Maps working based on Fred's calendar repo: https://github.com/rtfeldman/elm-google-maps
--
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+unsubscribe@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/8Q2xwRh6UYc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss+unsubscribe@googlegroups.com.
--paper-dropdown-menu-button | A mixin that is applied to the internal menu button | {} |
Yes and yes! I'll post when the video is up.On Thu, Nov 3, 2016 at 3:45 PM, Peter Damoc <pda...@gmail.com> wrote:
This is pretty awesome.
Have you given the talk in Vienna?Is this part of that talk? :)
On Thu, Nov 3, 2016 at 6:54 PM, Richard Feldman <richard....@gmail.com> wrote:
FYI I got Google Maps working based on Fred's calendar repo: https://github.com/rtfeldman/elm-google-maps
--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/8Q2xwRh6UYc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss...@googlegroups.com.
--
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...@googlegroups.com.
Yes and yes! I'll post when the video is up.
On Thu, Nov 3, 2016 at 3:45 PM, Peter Damoc <pda...@gmail.com> wrote:
This is pretty awesome.
Have you given the talk in Vienna?Is this part of that talk? :)
On Thu, Nov 3, 2016 at 6:54 PM, Richard Feldman <richard....@gmail.com> wrote:
FYI I got Google Maps working based on Fred's calendar repo: https://github.com/rtfeldman/elm-google-maps
--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/8Q2xwRh6UYc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss...@googlegroups.com.
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(<h4>{name}</h4>);
}
},
attributeChangedCallback: {
value: (attrName, oldVal, newVal) => {
if (attrName == "name") {
myRender(<h4>{newVal}</h4>);
}
}
}
});
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 changeless 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