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

Broken flow typings in mobx@4.0.0 #1392

Closed
andrew--r opened this issue Mar 12, 2018 · 2 comments
Closed

Broken flow typings in mobx@4.0.0 #1392

andrew--r opened this issue Mar 12, 2018 · 2 comments

Comments

@andrew--r
Copy link
Contributor

andrew--r commented Mar 12, 2018

Hi! Thanks for mobx 4, flow decorator really simplifies async actions 👍

I have an issue with mobx@4.0.0 flow typings. I updated mobx from 3 to 4, ran flow and got these errors:

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/mobx/lib/mobx.js.flow:3:65

Cannot resolve name IDepTreeNode.

     1│ // @flow
     2│
     3│ declare export function getAtom(thing: any, property?: string): IDepTreeNode
     4│ declare export function getDebugName(thing: any, property?: string): string
     5│ declare export function getDependencyTree(thing: any, property?: string): IDependencyTree
     6│ declare export function getObserverTree(thing: any, property?: string): IObserverTree


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/mobx/lib/mobx.js.flow:5:75

Cannot resolve name IDependencyTree.

     2│
     3│ declare export function getAtom(thing: any, property?: string): IDepTreeNode
     4│ declare export function getDebugName(thing: any, property?: string): string
     5│ declare export function getDependencyTree(thing: any, property?: string): IDependencyTree
     6│ declare export function getObserverTree(thing: any, property?: string): IObserverTree
     7│
     8│ export type IObservableMapInitialValues<K, V> = IMapEntries<K, V> | KeyValueMap<V> | IMap<K, V>


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/mobx/lib/mobx.js.flow:6:73

Cannot resolve name IObserverTree.

     3│ declare export function getAtom(thing: any, property?: string): IDepTreeNode
     4│ declare export function getDebugName(thing: any, property?: string): string
     5│ declare export function getDependencyTree(thing: any, property?: string): IDependencyTree
     6│ declare export function getObserverTree(thing: any, property?: string): IObserverTree
     7│
     8│ export type IObservableMapInitialValues<K, V> = IMapEntries<K, V> | KeyValueMap<V> | IMap<K, V>
     9│


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ source/stores/auth/index.js:2:40

Cannot import reaction because there is no reaction export in mobx. Did you mean Reaction?

     1│ // @flow
     2│ import { observable, action, computed, reaction, runInAction } from 'mobx';
     3│ import apiAdapter from '~/api';
     4│ import localStorage from '~/utils/local-storage';
     5│ import type {

It seems like IDepTreeNode, IDependencyTree and IObserverTree are used before their definition, and reaction type annotation is missing.

I'd make a PR with fixes if it's ok.

@mweststrate
Copy link
Member

mweststrate commented Mar 12, 2018 via email

@mweststrate
Copy link
Member

Released in 4.0.1, thanks for the PR!

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

No branches or pull requests

2 participants