Page MenuHomePhabricator

[CommCoreModule] Introduce `getCodeVersion()`
ClosedPublic

Authored by atul on Feb 8 2022, 10:51 AM.
Tags
None
Referenced Files
F3306783: D3138.id9405.diff
Mon, Nov 18, 10:28 PM
F3306774: D3138.id9464.diff
Mon, Nov 18, 10:24 PM
F3306557: D3138.diff
Mon, Nov 18, 8:30 PM
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

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
Branch
landfeb8 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

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 ↗(On Diff #9465)

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

native/cpp/CommonCpp/NativeModules/CommCoreModule.h
57 ↗(On Diff #9465)

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

native/cpp/CommonCpp/NativeModules/CommCoreModule.h
57 ↗(On Diff #9465)

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