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

Can't use hermes with the Microsoft.ReactNative NuGet packages #11251

Closed
jonthysell opened this issue Feb 21, 2023 · 0 comments · Fixed by #12321
Closed

Can't use hermes with the Microsoft.ReactNative NuGet packages #11251

jonthysell opened this issue Feb 21, 2023 · 0 comments · Fixed by #12321

Comments

@jonthysell
Copy link
Contributor

Problem Description

Microsoft.ReactNative must be built with UseHermes set so the proper #definess include the code necessary for Hermes to work.

However the Microsoft.ReactNative NuGet packages aren't built with that flag, so even if you set the correct properties, Hermes won't be used.

Steps To Reproduce

  1. Create a new RNW app using the experimental NuGets and Hermes npx react-native-windows-init --overwrite --useHermes --experimentalNuGetDependency
  2. Run the app with npx react-native run-windows

Expected Results

The app builds and runs with Hermes

CLI version

npx react-native --version

Environment

info Fetching system and libraries information...
System:
    OS: Windows 10 10.0.25300
    CPU: (24) x64 AMD Ryzen Threadripper PRO 3945WX 12-Cores
    Memory: 51.33 GB / 63.86 GB
  Binaries:
    Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowDevelopmentWithoutDevLicense: Enabled
      AllowAllTrustedApps: Enabled
      Versions: 10.0.18362.0, 10.0.19041.0, 10.0.22000.0, 10.0.22621.0
  IDEs:
    Android Studio: Not Found
    Visual Studio: 16.11.33214.272 (Visual Studio Enterprise 2019), 17.4.33213.308 (Visual Studio Enterprise 2022)
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.0 => 0.71.0
    react-native-windows: 0.71.1 => 0.71.1
  npmGlobalPackages:
    *react-native*: Not Found

Target Platform Version

10.0.19041

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

Snack, code example, screenshot, or link to a repository

No response

@jonthysell jonthysell added the bug label Feb 21, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Feb 21, 2023
@chrisglein chrisglein added Scenario: NuGet Area: JavaScript Engine and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Feb 23, 2023
@chrisglein chrisglein added this to the 0.72 milestone Feb 23, 2023
@chrisglein chrisglein added enhancement Area: Tests Area: Fabric Support Facebook Fabric and removed enhancement Area: Tests Area: Fabric Support Facebook Fabric labels Feb 27, 2023
@chiaramooney chiaramooney modified the milestones: 0.72, 0.73 May 5, 2023
@YajurG YajurG added the Recommend: Backlog Recommend that issue should be given Backlog milestone. label Aug 28, 2023
@chiaramooney chiaramooney removed the Recommend: Backlog Recommend that issue should be given Backlog milestone. label Sep 19, 2023
jonthysell added a commit that referenced this issue Nov 9, 2023
## Description

This PR makes Hermes the default JS engine for RNW going forward.

For now, this is still managed by setting the `<UseHermes>` MSBuild property. However, if the property is not explicitly set, the default value in `JSEngine.props` will now be `true` instead of `false`.

The property will remain exposed (and now set to `true`) in project's `ExperimentalFeatures.props` files. This will be done for new projects created with the `npx react-native-windows-init` command targeting versions with this change. (Use or omission of the `--useHermes` flag will no longer be recognized at project creation time). Hermes will also be the default for projects created with the new `npx react-native init-windows` CLI command.

Current users attempting to *upgrade* their existing projects with these tools will be given a warning if they were previously using the Chakra engine, and instructions to revert back to using Chakra if necessary. However, support for Chakra will be deprecated in the future, so best to migrate sooner rather than later.

In addition, this PR should also enable Hermes use when consuming the official (experimental) NuGet package binaries.

Finally, this PR updates our CI infrastructure to instead denote "Chakra" (rather than "Hermes") for builds and tests.

### Type of Change
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- This change requires a documentation update

### Why
Hermes is the officially supported and maintained JS engine for React Native, and as time goes on, the cost of maintain Chakra (which hasn't been updated in years) only increases. The "new" architecture includes Hermes.

Resolves #11251 

### What
See above

## Screenshots
N/A

## Testing
Ran existing tests

## Changelog
Should this change be included in the release notes: yes

Hermes is now the default JS engine for all new projects and will eventually be the only supported JS engine.
jonthysell added a commit to jonthysell/react-native-windows that referenced this issue Nov 9, 2023
This PR backports microsoft#12321 to 0.73.

This PR makes Hermes the default JS engine for RNW going forward.

For now, this is still managed by setting the `<UseHermes>` MSBuild property. However, if the property is not explicitly set, the default value in `JSEngine.props` will now be `true` instead of `false`.

The property will remain exposed (and now set to `true`) in project's `ExperimentalFeatures.props` files. This will be done for new projects created with the `npx react-native-windows-init` command targeting versions with this change. (Use or omission of the `--useHermes` flag will no longer be recognized at project creation time). Hermes will also be the default for projects created with the new `npx react-native init-windows` CLI command.

Current users attempting to *upgrade* their existing projects with these tools will be given a warning if they were previously using the Chakra engine, and instructions to revert back to using Chakra if necessary. However, support for Chakra will be deprecated in the future, so best to migrate sooner rather than later.

In addition, this PR should also enable Hermes use when consuming the official (experimental) NuGet package binaries.

Finally, this PR updates our CI infrastructure to instead denote "Chakra" (rather than "Hermes") for builds and tests.

- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- This change requires a documentation update

Hermes is the officially supported and maintained JS engine for React Native, and as time goes on, the cost of maintain Chakra (which hasn't been updated in years) only increases. The "new" architecture includes Hermes.

Resolves microsoft#11251

See above

N/A

Ran existing tests

Should this change be included in the release notes: yes

Hermes is now the default JS engine for all new projects and will eventually be the only supported JS engine.
jonthysell added a commit that referenced this issue Nov 10, 2023
This PR backports #12321 to 0.73.

## Description

This PR makes Hermes the default JS engine for RNW going forward.

For now, this is still managed by setting the `<UseHermes>` MSBuild property. However, if the property is not explicitly set, the default value in `JSEngine.props` will now be `true` instead of `false`.

The property will remain exposed (and now set to `true`) in project's `ExperimentalFeatures.props` files. This will be done for new projects created with the `npx react-native-windows-init` command targeting versions with this change. (Use or omission of the `--useHermes` flag will no longer be recognized at project creation time). Hermes will also be the default for projects created with the new `npx react-native init-windows` CLI command.

Current users attempting to *upgrade* their existing projects with these tools will be given a warning if they were previously using the Chakra engine, and instructions to revert back to using Chakra if necessary. However, support for Chakra will be deprecated in the future, so best to migrate sooner rather than later.

In addition, this PR should also enable Hermes use when consuming the official (experimental) NuGet package binaries.

Finally, this PR updates our CI infrastructure to instead denote "Chakra" (rather than "Hermes") for builds and tests.

### Type of Change
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- This change requires a documentation update

### Why
Hermes is the officially supported and maintained JS engine for React Native, and as time goes on, the cost of maintain Chakra (which hasn't been updated in years) only increases. The "new" architecture includes Hermes.

Resolves #11251 

### What
See above

## Screenshots
N/A

## Testing
Ran existing tests

## Changelog
Should this change be included in the release notes: yes

Hermes is now the default JS engine for all new projects and will eventually be the only supported JS engine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants