New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do things without an effects manager #46

Open
valberg opened this Issue Mar 12, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@valberg

valberg commented Mar 12, 2018

First of all: elm-phoenix is awesome! It's so easy to work with and the API just makes send - so kudos on that!

It would be very neat if it would become possible to install elm-phoenix using the normal elm package utility. This would mean that we did thinks without using an effects manager.

I have little knowledge of how this should be done, but a discussion on the elm-lang discourse it is said that it should require "minimal modifications": https://discourse.elm-lang.org/t/elm-0-19-from-a-production-perspective/815/7

I'm going to see if I can figure out how this should be done, but any help is highly appreciated

@dustinfarris

This comment has been minimized.

Show comment
Hide comment
@dustinfarris

dustinfarris Mar 14, 2018

Contributor

my guess is that this will involve heavy use of ports

Contributor

dustinfarris commented Mar 14, 2018

my guess is that this will involve heavy use of ports

@valberg

This comment has been minimized.

Show comment
Hide comment
@valberg

valberg Mar 14, 2018

@dustinfarris Right, why is that? What do we need to call through ports? I haven't looked through what the effects manager does just yet :)

valberg commented Mar 14, 2018

@dustinfarris Right, why is that? What do we need to call through ports? I haven't looked through what the effects manager does just yet :)

@dustinfarris

This comment has been minimized.

Show comment
Hide comment
@dustinfarris

dustinfarris Mar 14, 2018

Contributor

@valberg my bad — for some reason i had it in my head that this library was calling phoenix.js directly, but that is not the case.

I skimmed the code really quick, it looks like elm-phoenix is operating as an effects manager in order to internalize its state, without requiring the user to wire up a model/update

So things like this:

handleSocketsUpdate : Platform.Router msg (Msg msg) -> Dict String (Socket msg) -> InternalSocketsDict msg -> Task Never (InternalSocketsDict msg)

will need to be refactored into a bona fide update function. I don't think there will be any API changes as a result, just more initial work for the user to set things up.

Contributor

dustinfarris commented Mar 14, 2018

@valberg my bad — for some reason i had it in my head that this library was calling phoenix.js directly, but that is not the case.

I skimmed the code really quick, it looks like elm-phoenix is operating as an effects manager in order to internalize its state, without requiring the user to wire up a model/update

So things like this:

handleSocketsUpdate : Platform.Router msg (Msg msg) -> Dict String (Socket msg) -> InternalSocketsDict msg -> Task Never (InternalSocketsDict msg)

will need to be refactored into a bona fide update function. I don't think there will be any API changes as a result, just more initial work for the user to set things up.

@valberg

This comment has been minimized.

Show comment
Hide comment
@valberg

valberg Mar 14, 2018

@dustinfarris Great! That sounds doable at least ;)

valberg commented Mar 14, 2018

@dustinfarris Great! That sounds doable at least ;)

@norpan

This comment has been minimized.

Show comment
Hide comment
@norpan

norpan Aug 23, 2018

Let me know if you need any planning/coding help, testing etc.. We are trying to figure out how to upgrade to 0.19 as soon as possible, to avoid future debt.

Right now it seems we need to use ports no matter what, since there is no websocket package in 0.19.

norpan commented Aug 23, 2018

Let me know if you need any planning/coding help, testing etc.. We are trying to figure out how to upgrade to 0.19 as soon as possible, to avoid future debt.

Right now it seems we need to use ports no matter what, since there is no websocket package in 0.19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment