React Native V8 JSI adapter
Перейти к файлу
Yichen Yao 5efee8504f
Fix CI build break. (#214)
#213 broken CI builds. This PR attempts to fix it.
2024-09-04 15:55:28 -07:00
.ado Synchronize changes from 0.71-stable branch (#207) 2024-08-13 14:30:00 -07:00
.github/policies Onboarding to GitOps.ResourceManagement (#177) 2023-06-29 13:21:42 -07:00
docs Initial check-in (#1) 2020-01-30 09:25:49 -08:00
scripts Fix CI build break. (#214) 2024-09-04 15:55:28 -07:00
src Fix Node-API based API shutdown sequence (#211) 2024-08-27 14:21:50 -07:00
.clang-format Set clang format ColumnLimit to 120 (#52) 2021-04-15 12:37:58 -07:00
.editorconfig Complete NAPI compatibility (#64) 2021-07-23 06:08:01 +00:00
.gitignore Update to V8 10.3 (#132) 2022-06-10 16:19:57 +00:00
CODEOWNERS Create CODEOWNERS 2021-10-04 12:15:34 -07:00
LICENSE Initial check-in (#1) 2020-01-30 09:25:49 -08:00
LICENSE.jsi.md Initial check-in (#1) 2020-01-30 09:25:49 -08:00
LICENSE.napi.md Implement JSI on top of N-API (#53) 2021-04-27 07:34:34 -07:00
LICENSE.v8.md Initial check-in (#1) 2020-01-30 09:25:49 -08:00
README.md Fix Node-API based API shutdown sequence (#211) 2024-08-27 14:21:50 -07:00
ReactNative.V8Jsi.Windows.nuspec Bring in updated headers from microsoft/node-api-jsi (#185) 2023-10-13 17:58:53 -07:00
ReactNative.V8Jsi.Windows.targets Misc cleanup and improvements (#184) 2023-10-12 16:50:33 -07:00
config.json Fix Node-API based API shutdown sequence (#211) 2024-08-27 14:21:50 -07:00
localbuild.ps1 Misc cleanup and improvements (#184) 2023-10-12 16:50:33 -07:00

README.md

React Native V8 JSI adapter

A V8 adapter implemention of the JSI interface for the react-native framework.

Build Status

Building

Windows

Initial Windows Build Setup
  1. Download and Install
    Windows 10 Windows SDK:
    https://developer.microsoft.com/en-us/windows/downloads/sdk-archive
    Note: Windows SDK has to be Windows 10 version, NOT Windows 11
  2. Download and Install
    Microsoft Visual C++ Redistributable x64
    Microsoft Visual C++ Redistributable x86
    https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist
  3. Download and Install
    Visual Studio 2022
    https://visualstudio.microsoft.com/vs
    In Visual Studio Setup, Select the following Individual Components:
    • MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (Latest)
    • C++ ATL for latest v143 build tools with Spectre Mitigations (x86 & x64)
  4. Enable PowerShell script execution
    Launch Cmd as Administrator
    powershell Set-ExecutionPolicy RemoteSigned
    
  5. Perform Initial Build
    Launch Cmd as Standard user, NOT Administrator
    From V8-Jsi Repo directory:
    powershell ./localbuild.ps1
    
Windows Build

To build Win32 X64 Debug:

Launch Cmd as Standard user, NOT Administrator
From V8-Jsi Repo Directory:

powershell ./localbuild.ps1 -NoSetup

To build the specific platform and flavor, use appropriate build flags:

powershell ./localbuild.ps1 -NoSetup -Platform x86 -Configuration Release 
[EXPERIMENTAL!] Building with WSL2 on Windows 10/11
  • Enable Windows Subsystem for Linux
  • Install debian: wsl --install -d Debian
  • Install PowerShell in the Debian VM
  • Install minimal dependencies on the Debian VM: sudo apt install lsb-release
  • Make sure you have at least 15Gb of disk space on the drive where the WSL image lives (usually C:)
  • Build with pwsh ./localbuild.ps1 -AppPlatform android
  • If setup is completed successfully, build incrementally with pwsh ./localbuild.ps1 -AppPlatform android -NoSetup
[EXPERIMENTAL!] Building on macOS
  • Install PowerShell by running brew install --cask powershell
  • Build with pwsh ./localbuild.ps1 -AppPlatform mac
  • If setup is completed successfully, build incrementally with pwsh ./localbuild.ps1 -AppPlatform mac -NoSetup
  • Note: there are several test failures on macOS currently

Out-of-sync issues

Until the JSI headers find a more suitable home, they're currently duplicated between the various repos. Code in jsi\jsi should be synchronized with the matching version of JSI from react-native (from https://github.com/facebook/hermes/tree/master/API/jsi/jsi).

Build script patches

To regenerate after manual fix-ups, run:

  • git diff --output=..\..\..\scripts\patch\build.diff --ignore-cr-at-eol from \build\v8\build\.
  • git diff --output=..\..\scripts\patch\src.diff --ignore-cr-at-eol from \build\v8\.
  • git diff --output=..\..\..\..\scripts\patch\zlib.diff --ignore-cr-at-eol from \build\v8\third_party\zlib\.

Contributing

See Contributing guidelines for how to setup your fork of the repo and start a PR to contribute to React Native V8 JSI adapter.

License

The V8 JSI adapter, and all newly contributed code is provided under the MIT License. Portions of the JSI interface derived from Hermes are copyright Facebook.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.