Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add package.json version to process.version #32718

Closed
wants to merge 1 commit into from

Conversation

robertjcolley
Copy link

Summary

Expose the current react native version to the process. This came about from an issue with aws-chime-sdk-js and detect-browser which hindered web sockets in chime working correctly. I figured the simple fix would be to use process.version for react-native in detect browser, but there is nowhere where that gets set and I couldn't find out how to get the current react-native version in the runtime.

Changelog

[General] [Added] - Add polyfill for version to global.process.version

Test Plan

assert that react-native/package.json === global.process.version

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 7, 2021
@react-native-bot react-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label Dec 7, 2021
@robertjcolley
Copy link
Author

This is my first contribution here - what am I missing for the circleci checks? I'm not too familiar with flow

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 09b6903
Branch: main

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,297,184 +3,693
android hermes armeabi-v7a 7,627,682 +3,690
android hermes x86 8,767,828 +3,691
android hermes x86_64 8,706,767 +3,683
android jsc arm64-v8a 9,683,936 +2,103
android jsc armeabi-v7a 8,671,124 +2,093
android jsc x86 9,640,091 +2,095
android jsc x86_64 10,236,631 +2,103

Base commit: 09b6903
Branch: main

@NickGerleman
Copy link
Contributor

This information is already exposed via Platform.constants.reactNativeVersion. See

reactNativeVersion: {|

@robertjcolley
Copy link
Author

Yes, it is already there. I think exposing it in the navigator will allow react native to have similar behavior in the global environment like the browser navigator. I had this in mind to be able to detect the current react native version without adding react-native as a dependency to the detect-browser

@github-actions
Copy link

github-actions bot commented Jun 8, 2022

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 8, 2022
@github-actions
Copy link

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Stale There has been a lack of activity on this issue and it may be closed soon. Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants