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

Module dependency graph for reloading #5

Closed
orta opened this issue Dec 28, 2016 · 8 comments
Closed

Module dependency graph for reloading #5

orta opened this issue Dec 28, 2016 · 8 comments

Comments

@orta
Copy link
Collaborator

orta commented Dec 28, 2016

This is something handled by a Haste Map in Jest.

That said - flow does have something for this:

npm run flow -- get-imports app/containers/artist/index.js

> relational-theory@0.0.1 flow /Users/orta/dev/js/apps/relational-theory
> flow "get-imports" "app/containers/artist/index.js"

Imports for module 'app/containers/artist/index.js':
	/Users/orta/dev/js/apps/relational-theory/data/graphql-export.flow.js@/Users/orta/dev/js/apps/relational-theory/app/containers/artist/index.js:6:33,6:67
	/Users/orta/dev/js/apps/relational-theory/app/containers/artist/components/header.js@/Users/orta/dev/js/apps/relational-theory/app/containers/artist/index.js:5:26,5:46
	react-relay@/Users/orta/dev/js/apps/relational-theory/app/containers/artist/index.js:4:19,4:31
	react@/Users/orta/dev/js/apps/relational-theory/app/containers/artist/index.js:13:7,13:11
@orta
Copy link
Collaborator Author

orta commented Dec 28, 2016

And flow is compiled to JS as a npm module, so you may be able to do ^ without the process call - not 100% on that

@orta
Copy link
Collaborator Author

orta commented Dec 28, 2016

This above only works if you have @flow in every file, which I have a branch of now

@orta
Copy link
Collaborator Author

orta commented Dec 28, 2016

orta@b3140ad

@alloy
Copy link
Owner

alloy commented Dec 28, 2016

Dope. Normally I’d probably go for using Jest’s HasteMap because it probably has less dependencies than flow, but we already depend on both, they’re only needed in development, and the API seems complicated whereas maybe Flow’s is simple? Let’s go with whichever of the two has the simplest API and less impact in our source.

@alloy
Copy link
Owner

alloy commented Dec 28, 2016

PS I assume you’ll PR that flow branch?

@orta
Copy link
Collaborator Author

orta commented Dec 28, 2016

yes

@orta
Copy link
Collaborator Author

orta commented Dec 28, 2016

soon

@alloy
Copy link
Owner

alloy commented Jan 1, 2017

Closing this in response to #10.

@alloy alloy closed this as completed Jan 1, 2017
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