-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Feature]: drop the requirement to install @react-native-vector-icons/common #1682
Comments
i think they'd be a great fit for a separate package related to font handling, such as expo-font. one change we could make here that would be less disruptive is to move them to a react-native-vector-icons subpackage like |
I like this general idea as it solves for the 99%. @oblador Any thoughts? I might have a go at making this work over xmas. We haven't sent any general announcements about the new release yet so we could squeeze this in before we do that. |
Fun fact, when I originally wrote this lib one of my goal was not requiring a native library - which is still the case only autolinking kinda made this an opt out rather than opt in. Question is, for non-expo cases, we kinda still want it for ease of integration right @johnf? For the API part, I think we can keep it as is but using an optional import and throwing an error if not present, just like we do if native module isn’t linked. |
@oblador I had a quick look the other day and the only native code still left is
|
@vonovak @brentvatne I was thinking about this some more this week, and I realised I forgot something, so I'm not convinced this is a good idea anymore. The This functionality is essential for most use cases, especially on Android, as it makes the whole setup zero-touch once you install the packages. Thoughts? |
@johnf - could each icon package be responsible for copying its own font? |
That's an excellent point. The only downside is that they become a "native module", but that's not a huge deal. I'll give this a whirl over the weekend. |
awesome! sorry for the delayed response, most of the expo team were ooo during holidays and we just got back on monday! |
hello @johnf, just wondering if there's any news on your opinion on each icon package being responsible for copying its own font? We can help with getting that done. Thanks :) |
@vonovak Thanks for the reminder, it encouraged me to work on this for the past few days. I have the start of a pull request at #1711 Current status:
It would be great if you could review. |
Is your feature request related to a problem?
My suggestion is to simplify installation instructions by not requiring to install the
common
package.Describe the solution you'd like
Current state
The
common
package exposes two utility functions which are available on the individualIcon
components. Historically (if I remember correctly), these would mostly be used with legacy components in React Native core which no longer exists such as ToolbarAndroid and TabBarIOS.AFAICT, the use cases for these functions are limited these days, and 99% of users don't need them. The functions could be extracted into another package where people who do need them could use them from there.
Pros and cons
The benefit of doing this is removal of native code from the typical usage path, and not requiring users to install the extra package - the individual icon packages would still depend on it, and package manager would install it. (The reason it's not done this way already now is probably because React Native CLI tooling links only the native modules which are listed in the root package.json file - so installing it explicitly is now a requirement.). This would make usage easier.
The only downside AFAICT is that it's a breaking change on an API that has been around for a long time.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: