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

Make font packages responsible for font copying #1711

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

johnf
Copy link
Collaborator

@johnf johnf commented Feb 9, 2025

No description provided.

Copy link
Contributor

@vonovak vonovak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I took a brief look and I like it!

One thing that afaict can be simplified is the amount of kotlin code - most of the native files don't provide any value. So in theory these could be removed:

  • packages/ant-design/android/src/main/java/VectorIconsAntDesignPackage.kt and therefore I don't think you need even
  • packages/ant-design/android/src/main/java/VectorIconsAntDesignModule.kt
  • packages/ant-design/android/src/main/java/VectorIconsAntDesignSpec.kt

That being said I'm not sure what is needed to get autolinking to work (so that the build.gradle is included), maybe you'll be able to make it work without much native code and just some cli configuration here: https://github.com/react-native-community/cli/blob/main/docs/dependencies.md

@johnf
Copy link
Collaborator Author

johnf commented Feb 10, 2025

@vonovak Thanks

In my experimentation it was the Kotlin files that seemed to kick off the autolinking.
I'll see if I can get it to work via some react-native.config.js instead. Thanks for the pointer to the docs

@vonovak
Copy link
Contributor

vonovak commented Feb 10, 2025

@johnf I might be wrong here but would be nice to get the amount of code reduced.

@johnf
Copy link
Collaborator Author

johnf commented Feb 16, 2025

@vonovak I looked into this further, unfortunately, react-native-config goes globbing for Package.kt files https://github.com/react-native-community/cli/blob/main/packages/cli-config-android/src/config/findPackageClassName.ts#L14-L29

So As much as I don't like it I don't think we have a good way at the moment to reduce the boiler plate

@vonovak
Copy link
Contributor

vonovak commented Feb 17, 2025

hi!
thanks for investigating.
Okay, so let's say that VectorIconsAntDesignPackage.kt is needed. I still believe there's no need to have VectorIconsAntDesignModule.kt and VectorIconsAntDesignSpec.kt (and the corresponding JS spec file).

And with regards to VectorIconsAntDesignPackage.kt, it might be possible that the mere presence of the file (and the file could be empty, or could have code that's commented out) would trigger autolinking. This would be a bit of a hack so maybe not the nicest way to do it, but could work. :)

Let me know if you want some assistance 👍 . Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants