Currently prelink and postlink are not executed when autolinking happens. That's because the linking logic moved to CocoaPods and Gradle scripts.
Hooks should be available in config already: https://github.com/react-native-community/cli/blob/7dec6541a88ba3496d43a20a832b3150166522aa/types/index.js#L123-L127
Hope @orta and @Salakar have ideas on how to support these on per-platform level.
https://github.com/react-native-community/releases/issues/116#issuecomment-502158419
I was thinking for this topic for a while recently and I'm considering killing prelink/postlink hooks in the CLI (by not supporting them in autolinking). It occurs to me that the whole concept is not so good after all, even if helpful at times. Here's the list of pain points I have with these "hooks":
Saying all that, a vast majority of the existing postlink hooks is either being obsolete with autolinking and general improvements to the CLI and default RN template or can be trimmed down in scope and quite easily swapped by a comprehensive docs, which I'm probably willing to contribute for some more popular packages. Feel free to change my mind!
In their current form and implementation, I considered them deprecated and that was one of the reasons I didn't push on implementing them as a part of autolinking which should solve the primary use-case for them.
I am generally in favour of leaving them as a thing of the past and not adding support for the future linking.
One thing that I would like to make sure though is whether consumers of the CLI, such as Ignite (CC: @jamonholmgren) are taking advantage of that and if yes, what does it look like.
We should probably come up with a better mechanism if needed to support hooking into the lifecycle.
I haven't really thought through the implications of the changes you've done, yet; right now I'm focused on the Bowser boilerplate more than Ignite CLI. I'll probably shift back sometime later this year.
Post link hooks are still useful. As far I know there is not possible autolink more then one gradle project/submodule within single react-native plugin.
Consider you have rn plugin that consist of two gradle projects/submodules. So app project using this plugin would be:
:app:
:plugin1_submodule1
:plugin1_submodule2
And plugin1_submodule1 can depend on plugin1_submodule2( but that's not relevant here). I believe currently you can only autolink one module.
In previous version, I've used postlink script and link the other submodule, using patch scripts, that were part of RN itself (now part of react-native-community).
Most helpful comment
I was thinking for this topic for a while recently and I'm considering killing prelink/postlink hooks in the CLI (by not supporting them in autolinking). It occurs to me that the whole concept is not so good after all, even if helpful at times. Here's the list of pain points I have with these "hooks":
Saying all that, a vast majority of the existing postlink hooks is either being obsolete with autolinking and general improvements to the CLI and default RN template or can be trimmed down in scope and quite easily swapped by a comprehensive docs, which I'm probably willing to contribute for some more popular packages. Feel free to change my mind!