Skip to content

Update client to PureScript 0.15.2 #278

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

Merged
merged 9 commits into from
Jun 10, 2022
Merged

Update client to PureScript 0.15.2 #278

merged 9 commits into from
Jun 10, 2022

Conversation

JordanMartinez
Copy link
Contributor

Description of the change

Fixes #264. Now that 0.15.2 is deployed to production, we can test the client out on the actual server via npm run serve:production.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0 by @)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

_ ->
Left "Tag must be one of: OtherError, CompilerErrors"
j ->
Left $ AtKey "tag" $ UnexpectedValue $ encodeJson j
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we preserve the detail in the error message using Tagged from codec-argonaut?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to do that. Can you clarify?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant Named from Argonaut-codecs 😅 It lets you annotate an error, like:

Named “Message” $ UnexpectedValue …

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. It’s not really the right one, though, because it’s more for annotating structure. There’s not really a proper error type for this, other than maybe TypeMismatch. But I think it’s useful to show what the allowed constructors are in the error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why I don't like JsonDecodeError. You can't provide error messages that have actionable "how to fix it" instructions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, how should I address this issue?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I don't love it either. Wish I hadn't added it to argonaut proper.

One option is this:

AtKey "tag" $ TypeMismatch "Expected tag to be one of 'OtherError, CompilerErrors'"

but I'm fine leaving it with what you've written here, too. Your call :)

_ ->
Left "Tag must be one of: OtherError, CompilerErrors"
j ->
Left $ AtKey "tag" $ UnexpectedValue $ encodeJson $ "- Expected a value of `OtherError` or `CompilerErrors` but got '" <> j <> "'"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encodeJson FTW! 😄

@JordanMartinez JordanMartinez merged commit faa95bb into purescript:master Jun 10, 2022
@JordanMartinez JordanMartinez deleted the update-client branch June 10, 2022 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Introduce esbuild for Try PureScript
3 participants