React Native has only static library targets. Any reason why there are no dynamic framework targets as well?

I understand why this was done from the start, as RN supported iOS 7 (and possibly below) at some point, but since the project now has a deployment target of iOS 8, there really is nothing to prevent dynamic frameworks on the surface. Any underlying technical issues in supporting it?
Adding dynamic framework targets will finally allow stopping the HEADER_SEARCH_PATHS hell of sub-projects. Working with Swift projects will also be much simpler.
There are two solutions I can think of; add dynamic frameworks targets directly and include all source files there, all headers in the headers phase. Or, create a dynamic framework wrapper that links with the static libs, but still exposes the headers in a headers phase. The former is more elegant, but the latter can be a little bit less work to maintain.
CC @javache @emilsjolander
There were some serious leaks (JSC wouldn't get cleaned up) when switching to a dynamic framework, anyone who tries to switch over should make sure to do a thorough audit and try it out in production before switching everyone else over.
@ide Why would memory management / JSC GC be affected by how RN is linked into the binary?
I'm not sure why but it was.
The native code for RN should be pretty small. What would you gain by moving to frameworks?
I've also just redone how we export headers from the core libs, which should make integrating other libraries easier hopefully https://github.com/facebook/react-native/commit/59407f36608f52d4402d742d916f78acd3ca7152
@javache Yes, your change will improve things considerably - for main RN projects only. However, an issue still remains for projects which extend the main project. For instance, including an open source component in the main project as a sub-project; since the sub-project cannot be linked against RN, a header search path hell still occurs for that sub-project. The headers phase is important, but not enough.
If there were dynamic framework targets, each sub-project could be linked directly with RN, enjoying the same improved header management as the main project, while finally all linking against a single RN framework at the end.
I am not sure what @ide means, but it sounds unrelated to how RN is linked. It is worth investigating, of course, since it is most likely an underlying issue.
@javache Please see this article:
http://landonf.bikemonkey.org/code/ios/Radar_15800975_iOS_Frameworks.20140112.html
Would you be interested in a PR for this?
Or, create a dynamic framework wrapper that links with the static libs, but still exposes the headers in a headers phase.
@LeoNatan Could you elaborate this? Is it possible to include static lib as a part of a dynamic framework?
@kanekin Yes, it is possible. You create a dynamic framework target, link the static framework, and add -ObjC -all_load to your OTHER_LDFLAGS (other linker flags).
As for exposing the headers, you can either manually add the static framework headers to the dynamic framework's Copy Headers Phase, or write a script that exports them as expected. The former is seemingly easier, but becomes maintenance hell if your static framework is actively changing (as is the case with React Native).
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
The unfortunate part of this is, this feature request is so awesome and there has been some deal of people voting here but nobody bothered voting in canary: https://react-native.canny.io/feature-requests/p/why-are-there-no-dynamic-framework-targets-for-react-native
I would love to see this happen. This way I could cache the whole RN dependency as a Carthage Framework.
I already tried building a dynamic framework wrapper around the static lib but got stack exporting the headers in the correct way aswell as making the dynamic framework usable with swift (not objc) apps.
Most helpful comment
@kanekin Yes, it is possible. You create a dynamic framework target, link the static framework, and add
-ObjC -all_loadto yourOTHER_LDFLAGS(other linker flags).As for exposing the headers, you can either manually add the static framework headers to the dynamic framework's Copy Headers Phase, or write a script that exports them as expected. The former is seemingly easier, but becomes maintenance hell if your static framework is actively changing (as is the case with React Native).