Skip to content
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

Add an upgrade guide for v2 #905

Merged
merged 4 commits into from
Jul 13, 2019
Merged

Add an upgrade guide for v2 #905

merged 4 commits into from
Jul 13, 2019

Conversation

grossbart
Copy link
Collaborator

I started an upgrade guide for the v1 -> v2 transition, I hope it helps. Depending on how many questions are asked, this guide might evolve.

I hoped to do this earlier, but time is sparse at the moment, sigh …

@grossbart grossbart mentioned this pull request Jul 12, 2019
@dakom
Copy link

dakom commented Jul 12, 2019

Until it is merged - I guess it makes sense to add suggestions/questions here?

One that just bit me - seems there is no longer O.getOrElseL(), rather O.getOrElse() is always lazy?

@grossbart
Copy link
Collaborator Author

I'll add a note to the document, the discussion happened here: #823 (comment)

tl;dr having a single API is preferrable, and always lazy is more general.


### Dependencies

Make sure to always have a single version of `fp-ts` installed in your project. Multiple versions are known to cause `tsc` to hang during compilation. You can check the versions currently installed using `npm ls fp-ts`: make sure there's a single version and all the others are marked as `deduped`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this (tsc hanging) will be no longer the case with fp-ts >=2 ? I remember someone mentioning it in multiple occasions, but never verified myself. cc @gcanti

Copy link
Contributor

Choose a reason for hiding this comment

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

If all the versions you have installed at >= 2 then I think the issue will no longer occur.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think you're right, this was one of the motivations behind the removal of classes.

@dakom
Copy link

dakom commented Jul 12, 2019

Suggest mentioning (as discussed in #903) that pipe() is helpful, even with only one function, for the following reasons:

  1. type inference
  2. allows for easier migration since args don't need to be flipped around

With the class-less approach, tsc should be less prone to break.
@grossbart grossbart merged commit 8c4f933 into master Jul 13, 2019
@grossbart grossbart deleted the docs-upgrade-v2 branch July 13, 2019 07:23
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.

4 participants