Skip to content

Fix: Upgrade to Flow v101#3626

Closed
montogeek wants to merge 3 commits intoJedWatson:masterfrom
montogeek:fix/upgrade-flow-101
Closed

Fix: Upgrade to Flow v101#3626
montogeek wants to merge 3 commits intoJedWatson:masterfrom
montogeek:fix/upgrade-flow-101

Conversation

@montogeek
Copy link

Follow up of #3612
I fixed all errors except by 2 that I don't understand

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ flow-typed/npm/react-router-dom_v4.x.x.js:158:166

Deprecated utility. Using $Supertype types is not recommended! (deprecated-utility)

     155│     location?: Location
     156│   |}>
     157│
     158│   declare export function withRouter<Props : {}, Component: React$ComponentType<Props>>(WrappedComponent: Component) : React$ComponentType<$Diff<React$ElementConfig<$Supertype<Component>>, ContextRouterVoid>>;
     159│
     160│   declare type MatchPathOptions = {
     161│     path?: string,


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ packages/react-select/src/Select.js:446:23

Cannot assign defaultComponents(...) to this.components because:
 • property children is missing in props [1] but exists in object type [2] in property Menu.
 • property innerRef is missing in props [1] but exists in object type [2] in property Menu.

     packages/react-select/src/Select.js
     443│     document.removeEventListener('scroll', this.onScroll, true);
     444│   }
     445│   cacheComponents = (components: SelectComponents) => {
     446│     this.components = defaultComponents({ components });
     447│   };
     448│   // ==============================
     449│   // Consumer Handlers

     packages/react-select/src/components/Menu.js
 [2] 226│ export type MenuProps = MenuAndPlacerCommon & {
     227│   /** Reference to the internal element, consumed by the MenuPlacer component */
     228│   innerRef: ElementRef<*>,
     229│   /** The children to be rendered. */
     230│   children: ReactElement<*>,
     231│ };

     packages/react-select/src/components/index.js
 [1]  64│   Menu: ComponentType<MenuProps>,


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ packages/react-select/src/animated/index.js:14:10

Cannot return object literal because:
 • property children is missing in props [1] but exists in object type [2] in property Menu.
 • property innerRef is missing in props [1] but exists in object type [2] in property Menu.

     packages/react-select/src/animated/index.js
      11│ const makeAnimated = (externalComponents?: SelectComponents= {}): SelectComponents => {
      12│   const components = defaultComponents({ components: externalComponents });
      13│   const { Input, MultiValue, Placeholder, SingleValue, ValueContainer, ...rest } = components;
      14│   return {
      15│     Input: AnimatedInput(Input),
      16│     MultiValue: AnimatedMultiValue(MultiValue),
      17│     Placeholder: AnimatedPlaceholder(Placeholder),
      18│     SingleValue: AnimatedSingleValue(SingleValue),
      19│     ValueContainer: AnimatedValueContainer(ValueContainer),
      20│     ...rest,
      21│   };
      22│ };
      23│
      24│ const AnimatedComponents = makeAnimated();

     packages/react-select/src/components/Menu.js
 [2] 226│ export type MenuProps = MenuAndPlacerCommon & {
     227│   /** Reference to the internal element, consumed by the MenuPlacer component */
     228│   innerRef: ElementRef<*>,
     229│   /** The children to be rendered. */
     230│   children: ReactElement<*>,
     231│ };

     packages/react-select/src/components/index.js
 [1]  64│   Menu: ComponentType<MenuProps>,



Found 5 errors
  1. First one is by one external dependency, fixing it also means also upgrading that dependency.
  2. Other 2 errors could be fixed in one single place but I don't understand what it is.

All tests are passing without new warnings.

Latest release of Flow is generating warnings when you use any, Function or Object, I could fix them in a different PR.

@noppa
Copy link

noppa commented Jun 22, 2019

The first one is coming from external type definitions installed with flow-typed. There's no need to upgrade the actual dependency (react-router-dom), updating the type definition file is enough:

flow-typed update react-router-dom@4.x.x

@changeset-bot
Copy link

changeset-bot bot commented Oct 2, 2019

🦋 Changeset is good to go

Latest commit: bfdbe20

We got this.

Not sure what this means? Click here to learn what changesets are.

@bj00rn
Copy link

bj00rn commented Oct 31, 2019

@mitchellhamilton any progress on this?

🌹

@bladey bladey added pr/needs-review PRs that need to be reviewed to determine outcome pr/bug-fix PRs that are specifically addressing a bug and removed uncertain labels Jun 4, 2020
@bladey bladey mentioned this pull request Jun 18, 2020
@montogeek
Copy link
Author

Unfortunately I not longer work with Flow, feel free anybody to continue with this work. :)

@Methuselah96
Copy link
Collaborator

Thanks for the work on this, we've recently converted the code over to TypeScript (#4489) in preparation for v5 so the Flow types will no longer be relevant. Apologies for the lack of response up until now, we've been slowly trying to get this project back into shape after being neglected for a period of time.

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

Labels

pr/bug-fix PRs that are specifically addressing a bug pr/needs-review PRs that need to be reviewed to determine outcome

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants