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

Outgoing ports do not automatically convert Maybe anymore #606

Closed
CumpsD opened this Issue May 16, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@CumpsD

CumpsD commented May 16, 2016

As of 0.17, outgoing ports do not automatically convert Maybe anymore. According to the docs at http://guide.elm-lang.org/interop/javascript.html#customs-and-border-protection and the behaviour in 0.16 they should be.

For example:

type alias Options =
   { responseType : String
   , rememberLastLogin : Maybe Bool
   , closable : Maybe Bool
   , popup : Maybe Bool
   , sso : Maybe Bool
   , callbackURL : Maybe String
   , authParams: { scope: String }
   }

and later

auth0Options : Options
auth0Options =
  { responseType = "token"
  , callbackURL = Nothing -- "http://localhost:3000"
  , rememberLastLogin = Just True
  , closable = Just False
  , popup = Just False
  , sso = Just True
  , authParams = { scope = "openid" }
  }

results in:
image

While it should result in a callbackURL of null and a closable of false

@CumpsD CumpsD changed the title from Ports do not automatically convert Maybe anymore to Outgoing ports do not automatically convert Maybe anymore May 16, 2016

@neoeinstein

This comment has been minimized.

Show comment
Hide comment
@neoeinstein

neoeinstein May 16, 2016

Confirmed that the related behavior in 0.16 would have translated the callbackUrl = Nothing to null and the closable = Just False to false.

Format of the outgoing port in this instance:

port auth0showLock : Auth0.Options -> Cmd msg

neoeinstein commented May 16, 2016

Confirmed that the related behavior in 0.16 would have translated the callbackUrl = Nothing to null and the closable = Just False to false.

Format of the outgoing port in this instance:

port auth0showLock : Auth0.Options -> Cmd msg
@neoeinstein

This comment has been minimized.

Show comment
Hide comment
@neoeinstein

neoeinstein May 16, 2016

Just did my own review of this, and things seemed to work fine for me. I saw the appropriate generated code:
screen shot 05-16-16 at 05 04 pm
screen shot 05-16-16 at 05 05 pm

And the appropriate conversion happening:
image
image

Could this possibly be due to Elm not rebuilding a dirty module? You can try deleting elm-stuff/build-artifacts and that should trigger a rebuild of all modules.

neoeinstein commented May 16, 2016

Just did my own review of this, and things seemed to work fine for me. I saw the appropriate generated code:
screen shot 05-16-16 at 05 04 pm
screen shot 05-16-16 at 05 05 pm

And the appropriate conversion happening:
image
image

Could this possibly be due to Elm not rebuilding a dirty module? You can try deleting elm-stuff/build-artifacts and that should trigger a rebuild of all modules.

@CumpsD

This comment has been minimized.

Show comment
Hide comment
@CumpsD

CumpsD May 17, 2016

I removed it all, and tried again but still have the same problem.

This is the code which causes it: https://github.com/exira/admin

git clone https://github.com/exira/admin.git
npm install
elm-package install -y
gulp

CumpsD commented May 17, 2016

I removed it all, and tried again but still have the same problem.

This is the code which causes it: https://github.com/exira/admin

git clone https://github.com/exira/admin.git
npm install
elm-package install -y
gulp
@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Sep 22, 2016

Member

Can you open this on the elm-compiler repo instead? This is not related to core libraries.

Also, is there any way you can get an http://sscce.org/ that does not require cloning a ton of files? Getting it down to something small makes it much easier to resolve, and it'll be more clear why @neoeinstein could not replicate the problem.

Member

evancz commented Sep 22, 2016

Can you open this on the elm-compiler repo instead? This is not related to core libraries.

Also, is there any way you can get an http://sscce.org/ that does not require cloning a ton of files? Getting it down to something small makes it much easier to resolve, and it'll be more clear why @neoeinstein could not replicate the problem.

@evancz evancz added the no sscce label Sep 22, 2016

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jul 10, 2017

Member

Given the state of this, I think it makes sense to close and wait for another report of the issue on elm-compiler.

Member

evancz commented Jul 10, 2017

Given the state of this, I think it makes sense to close and wait for another report of the issue on elm-compiler.

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