Page MenuHomePhabricator

[CommCoreModule] Introduce `getCodeVersion()`
ClosedPublic

Authored by atul on Feb 8 2022, 10:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 2, 4:22 AM
Unknown Object (File)
Sat, Nov 2, 4:22 AM
Unknown Object (File)
Sat, Nov 2, 4:22 AM
Unknown Object (File)
Sat, Nov 2, 4:22 AM
Unknown Object (File)
Sat, Nov 2, 4:22 AM
Unknown Object (File)
Sat, Nov 2, 4:19 AM
Unknown Object (File)
Oct 7 2024, 7:12 AM
Unknown Object (File)
Sep 14 2024, 5:45 AM

Details

Summary

JSI codegen + implementation of getCodeVersion().

Why?
We will need access to the codeVersion on the C++ side so we can include it as an argument to the NewSession(...) unary gRPC call. To avoid defining the code version in two places (persist.js and CommCoreModule.h), we'll define it in CommCoreModule.h and access it on the JS side via this JSI function.

The next diff will replace usage of codeVersion from persist.js with a call to global.CommCoreModule.getCodeVersion()

Test Plan

Able to call getCodeVersion and log the return value

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested review of this revision.Feb 8 2022, 10:56 AM

include export in persist.js

This revision is now accepted and ready to land.Feb 8 2022, 9:35 PM
native/cpp/CommonCpp/NativeModules/CommCoreModule.h
57

Shouldn't this have been a jsi::Value?

native/cpp/CommonCpp/NativeModules/CommCoreModule.h
57

I believe return value of double was determined by codegen. I can re-run and verify

native/cpp/CommonCpp/NativeModules/CommCoreModule.h
57

You're right. Even is this way in the newer version of react-native-codegen bundled into React Native 0.70. Weird...