kisstkondoros / gutter-preview

Other
158 stars 37 forks source link

Support for js image files import #67

Closed ghost closed 4 years ago

ghost commented 5 years ago

Using react-native, my use of images will be mostly like this :

          <Image source={Icons.arrowRight} />

With exported files like this :

// Icon file
export const arrowRight = require('./ArrowRight/arrow-right.png');

// index.js
import * as Icons from './Icons';

And preview won't work this way. Would supporting this would be acceptable ? I would be happy to submit a PR supporting this. Just wanted to know if this subject was heavily discussed before or maybe already in development by somebody before I start to work on it.

kisstkondoros commented 5 years ago

Thanks for opening an issue for discussing this! Something similar was requested already in #60. This caused severe performance problems for languages where reference lookups are expensive, so was put behind a feature flag gutterpreview.enableReferenceLookup. You could try if it works for your use case, and if you have the mood you could also improve on its implementation (e.g by using some sort of caching mechanism) or choosing a completely different approach (I'm open for suggestions)

Oh, and PRs are always welcomed :)

kisstkondoros commented 4 years ago

I'll close this due to inactivity.