Make package name required for "link"
When you don't pass a package name to the "react-native link", it will try to look for all packages to link from your node_modules.
This is causing us a lot of issues, such as linking wrong packages or the ones that someone doesn't want to link (e.g. decided to use a different way of linking that is out of scope for this command).
We should simply stick to requiring package name.
Maybe having a
react-native link assetscommand so we could link fonts would be good?
And what will happen when one installs a package named "assets"? boom
Maybe let link without arguments link assets by default, and simply stop linking all other things. That seems most sensual to me
Sensible*... Phones.
If you look closely into the PR (https://github.com/react-native-community/react-native-cli/pull/101) it already introduces link-assets command.
@vandervidi it was just an example. I agree that link-assets is better.
I did link all because I needed to reset my project since I'm upgrading from a somewhat old version.
agree with @sm1th link-assets is a better option
It shouldn't be deprecated. The current commands are better. Those who want to to link any specific packages can link individually, while others could do it all at once with a single command.
Why to deprecate? We have the option if someone want to link particular package then he/she can do that also.
If you have 30 libraries and you want to link them all in one go then you can do it with react-native link and if you want specific then you can do that also, then what is the need of removal?????
For Assets i feel there should be option, if someone only want to link assets.
We decided not to introduce this change because the link command will be deprecated soon in favor of autolinking feature. Right now we are working on it, and it should be available in 0.60.0.
I use it because some things need to be linked but I never really know what
When you have a react native project and have to migrate to a new installation one run react-native link to link all dependencies, imagine if you have to linked them all manually, or when you want to copy bunch of package from an old package.json to a new package.json and some of them need to be linked, react-native link is a great tool
for a most of my new react native project i add a bunch of dependency which is some of that require to linking after that i just one time use react native link and it resolve all native issues.
expect that we are linking custom font with react native link. how can be link custom font with package name ??
如果移除了,那么 react-native-template 项目怎么办
@Esemesek what's the path moving forward for autolinking?
I'm having linking issues with local fonts, could be a race condition in 0.59.8.
I get a lot of, changes font file names listed on every run
debug Error: EBUSY: resource busy or locked, unlink
I double checked, 0.59.X and higher give me race conditions when linking on Windows.
0.58.X has the pathing bug on windows that causes Windows paths (\) to be linked.
@skhameneh whole you're investigating that, would you mind sending a PR with a fix? We don't use Windows for development unfortunately and that would much appreciated
@thymikee I don't have a fix at the moment.
I found killing adb.exe releases some of the file locks on my fonts.
Here's some extra info for possible repro:
$ adb --version
Android Debug Bridge version 1.0.41
Version 28.0.3-5475833
$ react-native --version
react-native-cli: 2.0.1
react-native: 0.59.8
react-native link doesn't link fonts for now. react-native: 0.59.8
@justynasowinska can you share a minimal repro so we can investigate what's the issue?