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
<elm-discuss@googlegroups.com> 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.

Reply via email to