react-navigation / redux-helpers

Redux middleware and utils for React Navigation
Other
296 stars 43 forks source link

Add dependencies to package.json #16

Closed vyshkant closed 6 years ago

vyshkant commented 6 years ago

There is a dependency used in src/reducer.js and not defined in package.json:

import { NavigationActions } from "react-navigation";

I suggest to add the dependency react-navigation to package.json.

There are also a lot of import type rows in different files. I'm not sure whether this kind of dependency should be specified in package.json:

import type {
  NavigationEventCallback,
  NavigationEventPayload,
  NavigationState,
} from 'react-navigation';
import type { Middleware } from 'redux';

import type { NavigationAction, NavigationState } from 'react-navigation';
import type { Reducer } from 'redux';

import type { NavigationContainer, NavigationState } from 'react-navigation';
Ashoat commented 6 years ago
  1. react-navigation is listed as a peer dependency, which I think is the correct type of dependency in this case, since we don't want users of the library to end up with an old react-navigation version in their bundle.
  2. The Flow type imports are handled by libdefs and as such do not need to be listed in the package.json. I manually installed the libdefs using flow-typed, which avoids including any of these packages in the bundle.

Let me know if you think this issue needs to be reopened or discussed more!