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

Add an ability to run in incremental/decremental mode #10

Open
iyegoroff opened this issue Dec 16, 2018 · 3 comments
Open

Add an ability to run in incremental/decremental mode #10

iyegoroff opened this issue Dec 16, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@iyegoroff
Copy link

iyegoroff commented Dec 16, 2018

When I run following commands:

$ react-native-asset ./node_modules/A/Resources
$ react-native-asset ./node_modules/B/Resources

it will end up linking only resources from module B and all resources from A will be unlinked.

So right now is impossible to use react-native-asset properly when developing third party react-native modules whose assets need to be linked. My suggestion is to add a key CLI parameter:

"rnpm": {
  "commands": {
    // relink only resources marked with "A" and mark these new resources with "A"
    "postlink": "npx react-native-asset ./node_modules/A/Resources -key A",
    // unlink only resources marked with "A"
    "postunlink": "npx react-native-asset -key A"
   }
}
@unimonkiez
Copy link
Owner

Why not simply use multiple folders per linking?
Like so

react-native-asset -a ./node_modules/A/Resources ./node_modules/B/Resources

@iyegoroff
Copy link
Author

Some context for this issue:
https://github.com/iyegoroff/react-native-image-filter-kit/blob/3700e1e45217d169471ff412793f01d2d3d06db2/package.json#L98-L103
https://github.com/iyegoroff/react-native-image-filter-kit/blob/3700e1e45217d169471ff412793f01d2d3d06db2/examples/CustomNativeFilter/local_modules/react-native-image-filter-kit-haze-removal/package.json#L41-L46

I'm using react-native-asset with separate RN modules - not apps. Each module is responsible for its own resources, so when module "A" is being unlinked I need to remove only resources associated with "A" and left everything else untouched.

@unimonkiez
Copy link
Owner

Introducing keys sounds like an over-kill for your problem..
So when a developer links react-native-image-filter-kit, automatically you link for them the resources react-native-image-filter-kit needs?

If that's the case, adding non-required manifest-path option might be better!
Instead of using (or creating) their link-assets-manifest.json, create your own and call it image-filter-kit-link-assets-manifest.json.

the command line could look like this

npx react-native-asset ./node_modules/A/Resources --manifest-path ./A-link-assets-manifest.json

@unimonkiez unimonkiez added the enhancement New feature or request label Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants