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

Replace hasteResolvers with relative imports #513

Closed
boxfoot opened this issue Feb 19, 2020 · 4 comments · Fixed by #519
Closed

Replace hasteResolvers with relative imports #513

boxfoot opened this issue Feb 19, 2020 · 4 comments · Fixed by #519
Milestone

Comments

@boxfoot
Copy link
Contributor

boxfoot commented Feb 19, 2020

This project uses a custom "hasteResolver" defined in build_helpers\resolvers.js to allow simplified imports like import FixedDataTableStore from 'FixedDataTableStore'; instead of relative imports like import FixedDataTableStore from './FixedDataTableStore';

While this works, as a newcomer to the project I found it unintuitive and confusing. Also, my IDE can't understand the webpack resolution behavior, and is constantly warning me that it can't find these modules.

I'm curious about the decision not to use relative imports, and am wondering whether you'd be open to a PR to remove the custom resolver in favor of relative imports.

@wcjordan
Copy link
Member

I'd be open to a fix to use relative imports. It was this way when forked from FBook, but I agree, it's not as good as following the JS standards of relative imports. @pradeepnschrodinger do you have any concerns?

@pradeepnschrodinger
Copy link
Collaborator

Nope, relative imports sounds good.
Also how good/bad are absolute imports (which we use in LD) in comparison to relative?
I find absolute imports easier to copy and paste, and sometimes also to read. But besides that, I'm fine with both.

@wcjordan
Copy link
Member

Could you send an email to Joe M w/ me CC'd about LD. I think we should discuss there rather than here.

@pradeepnschrodinger
Copy link
Collaborator

Hi @boxfoot ,
We're open to your suggestion to not use the haste resolver, and instead make use of relative/absolute imports everywhere.
Do you have a PR in mind?

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 a pull request may close this issue.

3 participants