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: Upgrade to v0.170 #5570

Merged
merged 1 commit into from
Dec 1, 2022
Merged

flow: Upgrade to v0.170 #5570

merged 1 commit into from
Dec 1, 2022

Conversation

chrisbobbe
Copy link
Contributor

This is the Flow version used by React Native 68.

It's a surprisingly easy upgrade this time, following the recent Expo 45 upgrade (#5507), which caused fbemitter to be bumped such that it no longer used Flow's legacy "weak" mode, removed in Flow v0.166.

@gnprice
Copy link
Member

gnprice commented Dec 1, 2022

Neat, thanks!

I'm scanning through the Flow release notes, from 0.162.1 on up to 0.170.0. Things I spot:

  • The deprecated * type is now an alias to any. You can use flow codemod replace-existentials, which is available in previous versions of Flow, to upgrade your codebase to not use *. This codemod command will not be available in the current or future versions of Flow.

    I tried this codemod out, and it didn't touch anything. To make sure I was using it right, I edited a type annotation somewhere to say * instead of a real type, and then ran the codemod:
    $ time npx flow codemod replace-existentials --write src/
    and it successfully edited the * back to the appropriate real type:

    --- a/src/compose/ComposeBox.js
    +++ b/src/compose/ComposeBox.js
    @@ -138,1 +138,1 @@ function getQuoteAndReplyText(args: {|
    -  realm: *,
    +  realm: URL,
  • Add $ObjMapConst<O, T> builtin type, alias for $ObjMap<O, () => T>.

    Seems handy. git grep -w ObjMap finds one spot that could use it.

OK, and that's it.

Scanning forward, it looks like 0.175.1 is the one that should make things more pleasant when working with TsFlower, reducing the need to do flow stop; flow start:

Fix an incremental bug which would sometimes cause Flow to choose the wrong provider for a haste module, most commonly when one of those providers is a .js.flow file.

This is the Flow version used by React Native 68.

It's a surprisingly easy upgrade this time, following the recent
Expo 45 upgrade (zulip#5507), which caused `fbemitter` to be bumped such
that it no longer used Flow's legacy "weak" mode, removed in Flow
v0.166.
@gnprice
Copy link
Member

gnprice commented Dec 1, 2022

And merged.

@chrisbobbe chrisbobbe deleted the pr-flow-170 branch December 1, 2022 00:39
@chrisbobbe
Copy link
Contributor Author

Great, thanks for the review!

@gnprice gnprice mentioned this pull request Dec 13, 2022
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.

2 participants