Re: [elm-discuss] Cannot find module "String"...
I'm curious, what happens if you remove the "import String" line altogether? String should now be imported by default. On Mon, Jan 9, 2017 at 9:00 AM, Rex van der Spuy wrote: > Hi Everyone, > > Here's a strange puzzle! > While upgrading some old 0.17 to 0.18. I received this error message: > > ``` > I cannot find module 'String'. > > Module 'Adventure' is trying to import it. > > Potential problems could be: > * Misspelled the module name > * Need to add a source directory or new dependency to elm-package.json > ``` > > Here's the section of the `Adventure` module that's trying to import > `String`: > > ``` > module Adventure exposing (..) > > import Html exposing (..) > import Html.Attributes exposing (..) > import Html.Events exposing (..) > import String > > ``` > I know that `String` is part of `core`, and checking my > `elm-stuff/exact-dependencies.json` file, I can see that the latest > version of `core` is installed: > > ``` > { > "elm-lang/animation-frame": "1.0.1", > "mdgriffith/elm-style-animation": "3.5.1", > "elm-lang/virtual-dom": "2.0.3", > "elm-lang/html": "2.0.0", > "elm-community/list-extra": "4.0.0", > "elm-lang/svg": "2.0.0", > "elm-lang/core": "5.0.0" > } > ``` > And checking the `packages/elm-lang` confirms that it's there. > > I've tried deleting `elm-stuff` and rebuilding, but that doesn't fix the > problem. > > Can anyone suggest where I should look next, or what I should try? > Thanks!! > > > -- > 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. > -- 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: Intended usage of -- comments (and elm-format)
> > elm-format needs some work in this regard. > Yeah, that's all it is. :) Elm's parser throws out comments by default, so Aaron has been having to strategically re-add them in his version of the parser, in order to support them properly. He hasn't finishing covering all the cases yet. -- 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.
Re: [elm-discuss] Re: Is it possible to programmatically start an Elm program via Native?
On Mon, Jan 9, 2017 at 5:07 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > > I don't think I have quite grokked what you are trying to do. > > Have you considered making a custom Platform.Program implementation > specifically for web components, as I suggested previously? > Yes, this is what I try to figure out how to do. If you take a look at this tentative code: https://github.com/pdamoc/elm-box/blob/master/examples/LabeledInc.elm I'm trying to implement a component that is made out of a button that when clicked increments a private counter. In the final form, I would want to be able to set the label of the button from a consumer of the component and receive some custom event from the component. -- 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.
[elm-discuss] Cannot find module "String"...
Hi Everyone, Here's a strange puzzle! While upgrading some old 0.17 to 0.18. I received this error message: ``` I cannot find module 'String'. Module 'Adventure' is trying to import it. Potential problems could be: * Misspelled the module name * Need to add a source directory or new dependency to elm-package.json ``` Here's the section of the `Adventure` module that's trying to import `String`: ``` module Adventure exposing (..) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) import String ``` I know that `String` is part of `core`, and checking my `elm-stuff/exact-dependencies.json` file, I can see that the latest version of `core` is installed: ``` { "elm-lang/animation-frame": "1.0.1", "mdgriffith/elm-style-animation": "3.5.1", "elm-lang/virtual-dom": "2.0.3", "elm-lang/html": "2.0.0", "elm-community/list-extra": "4.0.0", "elm-lang/svg": "2.0.0", "elm-lang/core": "5.0.0" } ``` And checking the `packages/elm-lang` confirms that it's there. I've tried deleting `elm-stuff` and rebuilding, but that doesn't fix the problem. Can anyone suggest where I should look next, or what I should try? Thanks!! -- 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.
Re: [elm-discuss] Re: Is it possible to programmatically start an Elm program via Native?
On Monday, January 9, 2017 at 11:49:50 AM UTC, Peter Damoc wrote: > > Thank for the reply, Rupert. > > My challenge is different. I want to be able to generate the needed code > using Native. > In other words, the code that mounts the component does not know the name > of the module. > It receives the implementation just like VirtualDom.program receives the > implementation of a regular Elm program. > > I managed to figure out how to start an independent component and now I > moved to trying to figure out how to communicate with this component. > I don't think I have quite grokked what you are trying to do. Have you considered making a custom Platform.Program implementation specifically for web components, as I suggested previously? Here is the one I wrote for server side programs: https://github.com/rupertlssmith/elm-server-side-renderer/blob/master/src/Native/ServerSidePrograms.js As you can see, the name of the module gets passed in as an argument. You could construct your web component there, and there are various ways you can obtain a reference to the Elm module that is implementing the program. For example, here: https://github.com/rupertlssmith/elm-java/blob/master/elm-render/src/main/resources/bootnashorn.js I get it through the global Elm var with Elm[moduleName]. -- 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: Isomorphic web apps with Elm?
On Monday, January 9, 2017 at 11:24:57 AM UTC, Rupert Smith wrote: > > Some or all of the page rendering is done server side, then whatever has > been rendered plus the application state is handed over to the client, and > the client displays it or completes or enhances the rendering. > A wee problem with this. I don't see how a page can be partially rendered server side then passed to the client to complete, when using a virtual dom. Suppose for example that my pages are running with Main.fullscreen(), I can't just take the DOM that was rendered on the server, set it up as the virtual dom, and then have the client make changes to it as deltas to the DOM. I could just delete all of the server rendered DOM and replace it with the client rendered one through ELM, but you will see the screen blink as this happens. I guess therefore, that we are limited to all or nothing rendering on one side or the other, for any given DOM subtree? I can see how within a page their could be multiple Elm Html.programs attached to different sections of the page, and during the server rendering they might just act as placeholders for content that will only be rendered client side. -- 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.
Re: [elm-discuss] Isomorphic web apps with Elm?
On Monday, January 9, 2017 at 2:32:43 PM UTC, Noah Hall wrote: > > It's easier to say: > > code shared between client and the server > > than > > isomorphic > > and have everyone understand you. Isomorphic means a lot of different > things to different people. Say what you mean, and more people will be > able to take part and understand :) > I do think the term 'isomorphic' may not be so well received, now that it is past the hype stage. One blog I read said that it means your best developers will be tied up trying to do something overly clever and difficult with javascript, instead of adding value to your business. -- 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.
Re: [elm-discuss] Isomorphic web apps with Elm?
It's easier to say: code shared between client and the server than isomorphic and have everyone understand you. Isomorphic means a lot of different things to different people. Say what you mean, and more people will be able to take part and understand :) On Mon, Jan 9, 2017 at 3:24 PM, 'Rupert Smith' via Elm Discuss wrote: > On Monday, January 9, 2017 at 1:55:08 PM UTC, Joel McCracken wrote: >>> >>> It was very, very nice. It allows for seemless APIs that simplified >>> the code sharing a whole bunch. >> >> >> Oh? My impression was that you thought this wasn't worth it, based upon >> comments here >> https://github.com/noredink/take-home#should-i-use-this-in-production and >> IIRC what I've read elsewhere. >> >> Incidentally, I also hate the term isomorphic for shared client-server >> code. > > > From the wikipedia page for isomorphism: > > "The interest of isomorphisms lies in the fact that two isomorphic objects > cannot be distinguished by using only the properties used to define > morphisms; thus isomorphic objects may be considered the same as long as one > considers only these properties and their consequences." > > Which sounds like a reasonable way to describe when the rendered page is > exactly the same, whether it is rendered client side or server side. As I > understand it though, it often means that some elements of the server side > rendering may be ommitted or only mocked up. Particularly interactive > elements that just won't work with a full server round trip, but will work > asm interactice UI components on the client side. > > Also, I think describing what I am trying to do with my editing mode as > 'progressive enhancement' isn't quite right either. I think the concept > behind progressive enhancement is that you start with you baseline client; > perhpas you even have to support some old version of IE, or users who will > not have javascript enabled in their browser. You code for that in the main, > but add capabilities that better browsers/environments can take advantage > of, if they are available. > > Not sure why you don't like isomorphism, has the word been poisened by too > may javascript libraries? > > -- > 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. -- 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.
Re: [elm-discuss] Isomorphic web apps with Elm?
On Monday, January 9, 2017 at 1:55:08 PM UTC, Joel McCracken wrote: > > It was very, very nice. It allows for seemless APIs that simplified >> the code sharing a whole bunch. >> > > Oh? My impression was that you thought this wasn't worth it, based upon > comments here > https://github.com/noredink/take-home#should-i-use-this-in-production and > IIRC what I've read elsewhere. > > Incidentally, I also hate the term isomorphic for shared client-server > code. > >From the wikipedia page for isomorphism: "The interest of isomorphisms lies in the fact that two isomorphic objects cannot be distinguished by using only the properties used to define morphisms; thus isomorphic objects may be considered the same as long as one considers only these properties and their consequences." Which sounds like a reasonable way to describe when the rendered page is exactly the same, whether it is rendered client side or server side. As I understand it though, it often means that some elements of the server side rendering may be ommitted or only mocked up. Particularly interactive elements that just won't work with a full server round trip, but will work asm interactice UI components on the client side. Also, I think describing what I am trying to do with my editing mode as 'progressive enhancement' isn't quite right either. I think the concept behind progressive enhancement is that you start with you baseline client; perhpas you even have to support some old version of IE, or users who will not have javascript enabled in their browser. You code for that in the main, but add capabilities that better browsers/environments can take advantage of, if they are available. Not sure why you don't like isomorphism, has the word been poisened by too may javascript libraries? -- 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.
Re: [elm-discuss] Isomorphic web apps with Elm?
It's important to separate the two ideas: being able to share code between client and the server was awesome and very nice - but writing Elm to work around node's model was not nice/reliable. On Mon, Jan 9, 2017 at 2:55 PM, Joel McCracken wrote: >> It was very, very nice. It allows for seemless APIs that simplified >> the code sharing a whole bunch. > > > Oh? My impression was that you thought this wasn't worth it, based upon > comments here > https://github.com/noredink/take-home#should-i-use-this-in-production and > IIRC what I've read elsewhere. > > Incidentally, I also hate the term isomorphic for shared client-server code. > > -- > 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. -- 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.
Re: [elm-discuss] Isomorphic web apps with Elm?
> > It was very, very nice. It allows for seemless APIs that simplified > the code sharing a whole bunch. > Oh? My impression was that you thought this wasn't worth it, based upon comments here https://github.com/noredink/take-home#should-i-use-this-in-production and IIRC what I've read elsewhere. Incidentally, I also hate the term isomorphic for shared client-server code. -- 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: Task.perform in 0.18?
On Friday, January 6, 2017 at 4:23:03 PM UTC-5, OvermindDL1 wrote: > > Ahh, see that there, the return type of `Scroll.toTop` is `Task.Task > Dom.Error ()`, this in this case also change `Task.perform` to > `Task.attempt`. :-) > > Thanks so much, that did the trick!! -- 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.
Re: [elm-discuss] Re: Is it possible to programmatically start an Elm program via Native?
Thank for the reply, Rupert. My challenge is different. I want to be able to generate the needed code using Native. In other words, the code that mounts the component does not know the name of the module. It receives the implementation just like VirtualDom.program receives the implementation of a regular Elm program. I managed to figure out how to start an independent component and now I moved to trying to figure out how to communicate with this component. On Mon, Jan 9, 2017 at 12:05 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > On Saturday, January 7, 2017 at 11:19:00 AM UTC, Peter Damoc wrote: >> >> Now, is it possible to start a potential Elm program and embed it in the >> constructor or in the onAttached handler? >> > > Peter, it most certainly is possible. Here is how I start up Elm in the > webcomponents I trialled with Polymer: > > attached() { > app = Elm.Listbox.embed(this); > > this._itemsChanged(this.items, []); > > this._initiallySelectedChanged(this.initiallySelected, []); > > app.ports.setSelected.subscribe(items => { > this.selected = items; > }); > } > > -- > 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. > -- 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.
Re: [elm-discuss] Isomorphic web apps with Elm?
Let's not use Javascript names for things here here: you mean shared code between client and the server. Like everything else in the area, I have already done this in the take-home: https://github.com/noredink/take-home#support-summary It was very, very nice. It allows for seemless APIs that simplified the code sharing a whole bunch. On Mon, Jan 9, 2017 at 12:24 PM, 'Rupert Smith' via Elm Discuss wrote: > Just wondering if there is anyone out there interested in isomorphic > applications with Elm? or has tried experimenting with isomorphic Elm? > > Now that I have the same view code running on server and client side, it > occurs to me that I am potentially getting into isomorphic web development. > If I understand it right, and isomorphic app is one which is written in > javascript in order to run the same code client or server side. Some or all > of the page rendering is done server side, then whatever has been rendered > plus the application state is handed over to the client, and the client > displays it or completes or enhances the rendering. The idea is to be able > to get the best of both worlds without having to write the code twice; once > in javascript for the client and once in some other language for the server. > > In my case, I am using server side rendering just for (relatively) static > content, so there is practically no application state. I am pretty much > there with this simple application model as far as being isomorphic goes. > > I believe there is something called the 'isomorphic hand-off' which refers > to the transfer of state from server to client, once the server rendering > has completed. I think this needs to go something like this: > > Run Elm on Server to produce HTML + a little bit of javascript to request > everything needed to complete on the client. > Show HTML on the client as quickly as possible (that is, don't download the > Elm code just yet). > Trigger the loading of the javascript needed to complete the client side > rendering (the same Elm program as was run on the server). > Start up the Elm program and request the state from the server. > Continue rendering from where the server side left off. > > I'm really not sure what exactly the difference is between isomorphic and > progressive enhancement. What I am actually trying to do is to add an > editing mode on the client side - so client and server side renderings will > be very different and more capabilities will be available in client editing > mode. For this reason, I don't think isomorphic is really what I am after, > but I can't help wondering if Elm provides a very neat starting point for > doing it. > > I think Elm might be very well suited to isomorphic, so long as you keep the > model clean and don't put any functions in it. If it is easy to > encode/decode the model, then it becomes almost trivial to write the > isomorphic hand-off? > > -- > 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. -- 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] Isomorphic web apps with Elm?
Just wondering if there is anyone out there interested in isomorphic applications with Elm? or has tried experimenting with isomorphic Elm? Now that I have the same view code running on server and client side, it occurs to me that I am potentially getting into isomorphic web development. If I understand it right, and isomorphic app is one which is written in javascript in order to run the same code client or server side. Some or all of the page rendering is done server side, then whatever has been rendered plus the application state is handed over to the client, and the client displays it or completes or enhances the rendering. The idea is to be able to get the best of both worlds without having to write the code twice; once in javascript for the client and once in some other language for the server. In my case, I am using server side rendering just for (relatively) static content, so there is practically no application state. I am pretty much there with this simple application model as far as being isomorphic goes. I believe there is something called the 'isomorphic hand-off' which refers to the transfer of state from server to client, once the server rendering has completed. I think this needs to go something like this: Run Elm on Server to produce HTML + a little bit of javascript to request everything needed to complete on the client. Show HTML on the client as quickly as possible (that is, don't download the Elm code just yet). Trigger the loading of the javascript needed to complete the client side rendering (the same Elm program as was run on the server). Start up the Elm program and request the state from the server. Continue rendering from where the server side left off. I'm really not sure what exactly the difference is between isomorphic and progressive enhancement. What I am actually trying to do is to add an editing mode on the client side - so client and server side renderings will be very different and more capabilities will be available in client editing mode. For this reason, I don't think isomorphic is really what I am after, but I can't help wondering if Elm provides a very neat starting point for doing it. I think Elm might be very well suited to isomorphic, so long as you keep the model clean and don't put any functions in it. If it is easy to encode/decode the model, then it becomes almost trivial to write the isomorphic hand-off? -- 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: Is it possible to programmatically start an Elm program via Native?
On Saturday, January 7, 2017 at 11:19:00 AM UTC, Peter Damoc wrote: > > Now, is it possible to start a potential Elm program and embed it in the > constructor or in the onAttached handler? > Peter, it most certainly is possible. Here is how I start up Elm in the webcomponents I trialled with Polymer: attached() { app = Elm.Listbox.embed(this); this._itemsChanged(this.items, []); this._initiallySelectedChanged(this.initiallySelected, []); app.ports.setSelected.subscribe(items => { this.selected = items; }); } -- 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.