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

Flow v.0.84.0 explicit inexact objects #2876

Closed
jbrown215 opened this issue Oct 23, 2018 · 10 comments
Closed

Flow v.0.84.0 explicit inexact objects #2876

jbrown215 opened this issue Oct 23, 2018 · 10 comments
Labels
cli Related to CLI tool

Comments

@jbrown215
Copy link
Contributor

jbrown215 commented Oct 23, 2018

We will be releasing flow 0.84.0 this week, which includes the ... syntax for inexact objects (for more info, see the blog post). AFAIK, flow-typed doesn't require babel support to land before we can start upgrading the syntax here. I'm aiming to have the flow-upgrade command ready end of week to help you guys move through this as quickly as possible.

I'm opening this issue as a request for help, as I am not able to see this through myself. I imagine a script can be written with the following logic:

for each flow-typed library definition:
  copy the folder to one for flow v0.84.0
  run `flow-upgrade` in that new folder
@villesau
Copy link
Member

villesau commented Oct 24, 2018

Thanks for the headsup @jbrown215! Do you have exact date in mind? When flow-upgrade is released? Would be good if we would be prepared when 0.84.0 is released.
Yeah babel support is not needed, we rely completely on flow executable when testing libdefs.

@marudor do you have some secret scripts to do this kind of changes? We need to bump the version for practically every libdef. I think we are a bit of in a hurry with this.

@jbrown215
Copy link
Contributor Author

jbrown215 commented Oct 24, 2018

flow-upgrade is blocked on the new flow parser being deployed, which should happen today or tomorrow. As soon as that happens, I'll make sure everything is ok with flow-upgrade and release.

I've noticed a few bugs in the tools flow-upgrade relies on, so I'm fixing those as I find them. A notable such example is that recast doesn't traverse opaque types.

The good news is that this change is not breaking-- we are still parsing anything with just curly braces {} as inexact objects, so you have at the very least 2 weeks from when the new version of flow is released to make sure this gets done.

Edit: bug blocking flow-upgrade benjamn/ast-types#290

@villesau
Copy link
Member

Ok, that's good to know! 2 weeks should be enough for us to migrate the libdefs to new format. Eaxct by default change is great BTW! :)

@jbrown215
Copy link
Contributor Author

Thanks for the help here! it would be useless if it broke all of the types our community has made until now

@jbrown215
Copy link
Contributor Author

jbrown215 commented Oct 26, 2018

We just published the codemod in flow-upgrade v1.1.0. You'll want to run flow-upgrade 0.83.0 0.84.0 --all to only run the upgrades for inexact objects.

The last set of codemods we released were for 0.54.0, which changed the way react types work in Flow. If you want to also run those, make the first version lower then 0.54.0.

We're not publicizing it much yet because babel support hasn't landed. Let me know if you run into any issues and I'll fix them as quickly as I can!

@villesau
Copy link
Member

villesau commented Oct 28, 2018

@jbrown215 Turns out latest release is not stable on our Travis: #2916

We might need to disable checks for 0.84.0, which means that we can't migrate libdefs to 0.84 either: We can't test with 0.84.0 at the moment.

@jbrown215
Copy link
Contributor Author

No worries. A lot of things have to go right on our side before we're ready to parse objects as exact by default. You'll likely have a few releases to get this done. As soon as the change lands in master I'll update you here if this issue is still open.

@villesau
Copy link
Member

Ok, good! And thanks for keeping us updated! We started to skip 0.84.0 to get tests succeed again. Looks like it worked.

@gantoine gantoine added the cli Related to CLI tool label Oct 30, 2018
@villesau
Copy link
Member

villesau commented Jan 26, 2019

An idea that came to my mind is that it could make sense to turn all the libdefs to be exact by default regardless how they are defined now. I'm pretty sure that in most cases it would be more accurate and inexact definition is just laziness or ignorance.

The issue might be that some libdefs might not have all the props defined which will cause errors.

@Brianzchen
Copy link
Member

Closed by #3467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to CLI tool
Projects
None yet
Development

No branches or pull requests

4 participants