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

Resolve local module linking in example apps #1286

Closed
tmeasday opened this issue Jun 15, 2017 · 11 comments
Closed

Resolve local module linking in example apps #1286

tmeasday opened this issue Jun 15, 2017 · 11 comments

Comments

@tmeasday
Copy link
Member

tmeasday commented Jun 15, 2017

With the switch to npm@5, the way that the test-cra and react-native-vanilla apps were linked (via file:// links) changed from "installs" to symlinks, similarly to lerna's behavior. See npm/npm#15900 for more info.

To start with, this sort of removes the point of test-cra as it behaves the same as cra-storybook|kitchen-sink.

However, there are some problems with symlinking our local dependencies that the file:// links solved. In particular:

  1. Jest ends up executing modules multiple times (Jest requires symlinked files twice jestjs/jest#3830), leading to issues of this form, or this form.

  2. RN cannot resolve over symlinks ([Packager] doesn't resolve modules that are symlinks facebook/react-native#637) making our example apps non-functional, and mostly pointless.

I'm not sure if/when the above issues will be solved, so we may want to consider other solutions to the problem. Here are some things that we can investigate:

A. Only supporting npm<5 for development.

B. Following the recommended fallback of npm pack-ing our packages and creating file:// links to the .tar.gz (or using a tool like https://www.npmjs.com/package/install-local to do that).

C. Investigating yarn's support for workspaces -https://github.com/yarnpkg/rfcs/blob/master/implemented/0000-workspaces-install-phase-1.md

I would appreciate thoughts on all this from anyone with experience with this kind of thing.

@shilman
Copy link
Member

shilman commented Jun 15, 2017

@tmeasday Thanks so much for investigating this. I don't have great ideas on how to move forward. In the short term, I am sidelining my RN-related example app changes and pushing forward with the react-only stuff. What a colossal pain in the ... neck.

tmeasday added a commit that referenced this issue Jun 22, 2017
As suggested by npm/npm#15900. This is a workaround until we get a better resolution of #1286
tmeasday added a commit that referenced this issue Jun 22, 2017
As suggested by npm/npm#15900. This is a workaround until we get a better resolution of #1286
@tmeasday
Copy link
Member Author

Note that we have gone with technique B. in #1332, but I'll leave this open for a longer-term solution.

@stale
Copy link

stale bot commented Nov 27, 2017

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks!

@stale stale bot added the inactive label Nov 27, 2017
@tmeasday
Copy link
Member Author

I think this problem is mostly OK now.

@Hypnosphi
Copy link
Member

Hypnosphi commented Nov 28, 2017

Not really. When testing RN, you have to do yarn bootstrap --reset --core --reactnative after each change in packages which is a nightmare

@Hypnosphi Hypnosphi reopened this Nov 28, 2017
@stale stale bot removed the inactive label Nov 28, 2017
@Hypnosphi
Copy link
Member

@danielduan does the bot ignore mentions from PRs? This issue had one 3 days ago

@dangreenisrael
Copy link
Member

@tmeasday I was working on implementing a new logger in RN, but the process of building and testing with the example was indeed a nightmare. I have some stuff I was working (haul and workspaces) for the RN example over the weekend, but probably won't have time to get to until the new year. I can push my (broken) code if you would like to take a look and/or a crack at it.

@tmeasday
Copy link
Member Author

Oh! My bad, sorry!

@tmeasday
Copy link
Member Author

And @dangreenisrael may as well post any information / branches to this issue as you can, hopefully someone can figure it out!

@stale
Copy link

stale bot commented Jan 12, 2018

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks!

@stale stale bot added the inactive label Jan 12, 2018
@stale
Copy link

stale bot commented Jan 28, 2018

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed Jan 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants