react-native-storybook-loader icon indicating copy to clipboard operation
react-native-storybook-loader copied to clipboard

Consider using macros

Open slorber opened this issue 7 years ago • 2 comments

Hi,

Using babel macros would be handy for this: it allows babel to generate require statements you need at transpilation time. The advantage would be to avoid running the cli everytime you want to update your story list.

Here is an example: https://github.com/kentcdodds/import-all.macro

slorber avatar Nov 14 '18 17:11 slorber

@slorber iirc, using macros creates a problem that you have brought up previously elsewhere: https://github.com/facebook/metro/issues/105 Has anything changed that would allow this now?

karanjthakkar avatar Dec 20 '18 09:12 karanjthakkar

@karanjthakkar actually you are right using macros can be a problem due to metro caching. I didn't really dig more into this problem or the getCacheKey option so not sure macros are yet suitable for this problem

slorber avatar Dec 20 '18 10:12 slorber