Storybook: Fix dev setup for React Native

Created on 17 Jun 2017  路  9Comments  路  Source: storybookjs/storybook

why

Our dev setup for React Native is messed up right now:

  1. Facebook's react-native packager doesn't currently work with link-style dependencies.
  2. As a workaround, we are using file: dependencies for RN examples, which copies the directory instead of linking to it. However:

    1. file: links are no longer handled in the same way in npm5, which creates links instead and is deprecating this type of dependency

    2. It is also inconsistent with lerna bootstrap, which we are using the manage deps for the rest of our projects, which creates links.

what

It would be cleaner/simpler to use lerna bootstrap across the board. One option is to use the haul packager, support for which has been introduced in: https://github.com/storybooks/storybook/pull/1294

NOTE: I have prototyped this on my local machine and verified that it works with lerna bootstrap

Another option is to revert to npm@4 and keep our current setup, but this doesn't solve the lerna bootstrap inconsistency.

react-native maintenance

Most helpful comment

From a long term perspective, I think yarn workspaces are eventually what you're after - but that's not fully baked yet, so using haul seems like a reasonable answer for right now

All 9 comments

Thoughts @tmeasday @ndelangen @orta @gongreg @ajwhite @slorber @ericwooley ? Did I get this all right?

From a long term perspective, I think yarn workspaces are eventually what you're after - but that's not fully baked yet, so using haul seems like a reasonable answer for right now

This is an issue worth tracking if your hitting these pain points https://github.com/facebook/metro-bundler/issues/1#issuecomment-309068531

This issue is also covered by https://github.com/storybooks/storybook/issues/1286 -- symlinks are similarly a problem for Jest. Still, a solution for RN is great!

@tmeasday To clarify, are you saying that even if we fix the RN issue, we are still going to have problems with Jest?

@shilman: correct

Yea, it's a huge problem. It has to do with node haste. See the issue linked above.

Hopefully with yarn workspaces, facebook will have some incentive to fix the issue. It's not easy to solve

Interesting workaround we could consider: https://github.com/facebook/metro-bundler/issues/1#issuecomment-309990663

This feels like it's been fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

purplecones picture purplecones  路  3Comments

shilman picture shilman  路  3Comments

xogeny picture xogeny  路  3Comments

tirli picture tirli  路  3Comments

sakulstra picture sakulstra  路  3Comments