Skip to content

Commit

Permalink
Reflect Hermes release version from HermesBadge
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[General] - Reflect Hermes release version from HermesBadge

It was a common footgun that an unexpected version of Hermes
engine is used in a RN app. To help with indicating this from
the runtime, Hermes exposes its OSS release version from
`HermesInternal.getRuntimeProperties()` Starting from 0.8.0.

This diff updates the `HermesBadge` used by `NewAppScreen`
header to reflect the version.

Reviewed By: nadiia

Differential Revision: D24436609

fbshipit-source-id: 8ba45be598a7d5af0e38f5044f9370fc7e1eb9a1
  • Loading branch information
Huxpro authored and facebook-github-bot committed Apr 30, 2021
1 parent 9e020ef commit c54aecc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Libraries/NewAppScreen/components/HermesBadge.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import Colors from './Colors';

const HermesBadge = (): Node => {
const isDarkMode = useColorScheme() === 'dark';
const version =
global.HermesInternal?.getRuntimeProperties?.()['OSS Release Version'] ??
'';
return global.HermesInternal ? (
<View style={styles.badge}>
<Text
Expand All @@ -24,7 +27,7 @@ const HermesBadge = (): Node => {
color: isDarkMode ? Colors.light : Colors.dark,
},
]}>
Engine: Hermes
{`Engine: Hermes ${version}`}
</Text>
</View>
) : null;
Expand Down

0 comments on commit c54aecc

Please sign in to comment.