Skip to content

Add Windows Platform Release constant#16156

Closed
vivekjm wants to merge 1 commit into
microsoft:mainfrom
vivekjm:vivekjm/platform-release-constant
Closed

Add Windows Platform Release constant#16156
vivekjm wants to merge 1 commit into
microsoft:mainfrom
vivekjm:vivekjm/platform-release-constant

Conversation

@vivekjm
Copy link
Copy Markdown
Contributor

@vivekjm vivekjm commented May 19, 2026

Description

Type of Change

  • New feature (non-breaking change which adds functionality)

Why

Platform.constants['Release'] is currently undefined on Windows, while React Native Android exposes a Release string for the OS release version. This adds the Windows equivalent so callers can read the OS release from Platform.constants.

Resolves #11012

What

  • Added Release to the Windows PlatformConstants Flow spec and JS platform types.
  • Populated Release in the native Windows PlatformConstants module from AnalyticsInfo.VersionInfo.DeviceFamilyVersion(), formatted as major.minor.build.revision.
  • Left the existing numeric osVersion API contract value unchanged.

Screenshots

Not applicable.

Testing

  • ./node_modules/.bin/prettier --plugin=prettier-plugin-hermes-parser --check vnext/src-win/src/private/specs_DEPRECATED/modules/NativePlatformConstantsWindows.js vnext/src-win/Libraries/Utilities/Platform.windows.js vnext/src-win/Libraries/Utilities/PlatformTypes.js
  • ./../node_modules/.bin/react-native-windows-codegen --files 'src/**/*Native*.js' --namespace Microsoft::ReactNativeSpecs --libraryName rnwcore --componentsWindows --modulesWindows --internalComponents --modulesCxx --test from vnext
  • ./node_modules/.bin/eslint vnext/src-win/src/private/specs_DEPRECATED/modules/NativePlatformConstantsWindows.js vnext/src-win/Libraries/Utilities/Platform.windows.js vnext/src-win/Libraries/Utilities/PlatformTypes.js
  • git diff --check

I also tried npx just-scripts codegen:check, but this macOS checkout could not load vnext/just-task.js because pwsh.exe/dotnet tooling was unavailable. I tried flow check from vnext; it failed on existing repository-wide missing-module and unused-suppression errors unrelated to these files.

Changelog

Should this change be included in the release notes: yes

Add Platform.constants.Release on Windows with the OS release version string.

Microsoft Reviewers: Open in CodeFlow

@vivekjm vivekjm force-pushed the vivekjm/platform-release-constant branch from 7c7c4c1 to 7428966 Compare May 20, 2026 06:37
@vivekjm
Copy link
Copy Markdown
Contributor Author

vivekjm commented May 20, 2026

Closing this because it overlaps with existing similar work and should not compete for maintainer review.

@vivekjm vivekjm closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Platform.constants['Release']

1 participant