Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: autolinking for Android with Gradle #258
feat: autolinking for Android with Gradle #258
Changes from all commits
f5f6271
9734a8f
3ab1c46
703098f
4f17675
32da7cf
942db96
dcb0362
93090f8
4afecc2
8f947ce
4af1cfe
830e929
505e4d0
64f3f5a
933512a
9815ff2
e50001a
2b3e016
bfc9ed7
2180a5a
7abcaeb
225d739
623b643
3c7f36b
b3cbf3b
db90f50
4b67b8b
34224eb
717687b
50674d7
752104b
8a491a8
1f1da28
089669b
c2c30e7
d71658b
5c13c1a
a575d6c
7b67f2e
6005390
5941d8f
8d08a00
b6e97cd
b5869f6
6a9ecd2
5ad00b3
a7fb13b
5c3c7c9
7a7115f
108b873
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RN can technically be in monorepo so we can't make assumptions about where node_modules with cli are. That's why in iOS implementation we spawn a Node process and use its
require.resolve
to output the resolved path to stdoutThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is handled by the final arg here:
cli/packages/platform-android/native_modules.gradle
Line 178 in 7a7115f
cli/packages/platform-android/native_modules.gradle
Line 114 in 7a7115f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so it won't be seamless but at least that's supported. We need to add documentation on how the autolinking is working on how to configure it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Salakar, we already have
config.root
in our config outputted fromreact-native config
. You could use that one.Also, you can just do
console.log(require.resolve('react-native'))
script and execnode
to get the exact location. I think this is what we use on iOS.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if there's any way we can wrap an instance of
ReactPackage
here toLazyReactPackage
. By default,packageClassInstance
is e.g.new CodePushPackage()
and in order to convert it to a LazyPackage, we would have to update that package itself.Is there a way to wrap it or create our custom lazy package for each ReactPackage, that will lazily create it and return everything what's needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the
CodePushPackage
class itself would need to extendLazyReactPackage
instead ofReactPackage
for this to work? Not something we can do? 🤷♂️Would forcing every package to be lazy also cause issues for packages that are not inherently meant to be lazy, e.g. modules that have app initialization logic that must always be run?
Not 100% sure