mirror of
https://github.com/zoriya/nitro.git
synced 2026-10-13 00:05:23 +00:00
* feat: Create `HybridNitroModulesProxy` * feat: Create `InstallNitro` * docs: Create `entry-point.md` docs * fix: Create `JSIConverter<HostObject>` (for BoxedHybridObject) * Update NitroModulesProxy.ts * feat: Refactor JS for new module * feat: Refactor JS again * feat: Create iOS TurboModule that installs Nitro * feat: Implement `install()` for old arch (iOS) * chore: Format * feat: Implement TurboModule `install()` on Android * fix: Use `CallInvokerHolderImpl` * feat: Add CI that tests the build for old architecture * fix: Fix iOS CI * fix: Fix CI * fix: Exclude RN `.so` libraries (like `libjsi.so`) from `packagingOptions`
29 lines
808 B
C++
29 lines
808 B
C++
//
|
|
// InstallNitro.cpp
|
|
// NitroModules
|
|
//
|
|
// Created by Marc Rousavy on 05.10.24
|
|
//
|
|
|
|
#include "InstallNitro.hpp"
|
|
#include "HybridNitroModulesProxy.hpp"
|
|
|
|
namespace margelo::nitro {
|
|
|
|
void install(jsi::Runtime& runtime, std::shared_ptr<Dispatcher> dispatcher) {
|
|
// Registers a Dispatcher for Nitro to call back into the JS Runtime.
|
|
// This allows creating Promises and calling back to JS.
|
|
Dispatcher::installRuntimeGlobalDispatcher(runtime, dispatcher);
|
|
|
|
// Installs NitroModulesProxy itself into the Runtime's global.
|
|
install(runtime);
|
|
}
|
|
|
|
void install(jsi::Runtime& runtime) {
|
|
// Installs global.NitroModulesProxy
|
|
auto proxy = std::make_shared<HybridNitroModulesProxy>();
|
|
runtime.global().setProperty(runtime, "NitroModulesProxy", proxy->toObject(runtime));
|
|
}
|
|
|
|
} // namespace margelo::nitro
|