-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[0.66] Migrate NodeApiJsiRuntime from V8-JSI (#8663)
* Migrate NapiJsiRuntime from V8-JSI (#8617) * Add NapiJsiRuntime source and headers * Implement up to NapiJsiRuntime::JsiHostFunctionCallback * Change files * Finished Shared NAPI wrappers * Implemented miscellaneous utility methods * Move macros into CPP * yarn format * Add TODO to rename MakeNapiJsiRuntime2 * Fix typo * Consume MakeNapiJsiRuntime2 * Conditionally build NapiJsiRuntime.cpp * Migrate test * Move declarations into NapiJsiRuntime.cpp * Delete NapiJsiRuntime_detail.h * Re-enable NAPI_EXPERIMENTAL * Added :NapiPointerValue definitions * Use explicit captures * Add export symbol for x86 * Ensure CreateExternalObject deletes scalars and arrays properly * Use constants for RefHolder names * Only run test if USE_V8 is defined * Rename NapiTests to JsiTests * Conditionally include Jsi Tests * Rename MakeNapiJsiRuntime2 to MakeNodeApiJsiRuntime Co-authored-by: dannyvv <dannyvv@microsoft.com> * Move Shared\NapiJsiRuntime.* to MSRN.Cxx\NodeApiJsiRuntime.* * Move JsiTest into MSRN.Cxx.UnitTests * clang format * Revert ABITests.vcxproj to main * Default Cxx.UnitTests to NOT use V8 * Compile JsiTest only when using V8 Co-authored-by: dannyvv <dannyvv@microsoft.com> * Remove backported change file * Change files Co-authored-by: dannyvv <dannyvv@microsoft.com>
- Loading branch information
1 parent
0314c1b
commit b4d6793
Showing
12 changed files
with
2,084 additions
and
6 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/react-native-windows-8061c4c0-22d1-4a30-9f8f-8f35cb50b230.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "Migrate NapiJsiRuntime from V8-JSI (#8617)", | ||
"packageName": "react-native-windows", | ||
"email": "julio.rocha@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
#include "pch.h" | ||
|
||
#include <gtest/gtest.h> | ||
|
||
// JSI | ||
#include <jsi/test/testlib.h> | ||
|
||
// NAPI | ||
#include <JSI/NodeApiJsiRuntime.h> | ||
|
||
using facebook::jsi::Runtime; | ||
using facebook::jsi::RuntimeFactory; | ||
|
||
namespace Microsoft::Test { | ||
|
||
std::vector<RuntimeFactory> runtimeGenerators() { | ||
return {[]() -> std::unique_ptr<Runtime> { | ||
napi_ext_env_settings settings{}; | ||
|
||
settings.this_size = sizeof(settings); | ||
settings.flags.enable_gc_api = true; | ||
napi_env env{}; | ||
napi_ext_create_env(&settings, &env); | ||
|
||
return Microsoft::JSI::MakeNodeApiJsiRuntime(env); | ||
}}; | ||
} | ||
|
||
} // namespace Microsoft::Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.