Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
cc2417f
bump minimum supported V8 is 9.0+ (vcpkg version)
MangelSpec Feb 12, 2026
db7572d
fix script-reachable ToLocalChecked crashes
MangelSpec Feb 12, 2026
941c92d
add try_from_v8<T> exception-free conversion returning std::optional
MangelSpec Feb 12, 2026
7169dcc
fix V8PP_PRETTIFY_TYPENAMES config propagation
MangelSpec Feb 12, 2026
5521849
Add crash safety tests: from_v8 with invalid inputs, json
MangelSpec Feb 12, 2026
7d120d2
Add crash safety design fixes: unwrap_object depth limit, magic numbe…
MangelSpec Feb 12, 2026
1c7af9d
deduplicate object.hpp subobject traversal, replace SFINAE with C++20…
MangelSpec Feb 12, 2026
3a04d9d
add V8 performance hints: SideEffectType, internalized strings, NewFr…
MangelSpec Feb 12, 2026
e8ebabc
add convert extensions: BigInt, span, ArrayBuffer, set, pair, path, c…
MangelSpec Feb 12, 2026
929275b
add binding features: default parameters, function overloading, V8 Fa…
MangelSpec Feb 12, 2026
2211a97
add symbol protocol support, iterator protocol, and promise wrapper
MangelSpec Feb 12, 2026
61a92d4
add context_store for cross-context value persistence
MangelSpec Feb 12, 2026
664514d
add test suite expansion and fix constructor-without-new crash
MangelSpec Feb 12, 2026
a62e3d4
modernize CI workflow and improve reliability
MangelSpec Feb 12, 2026
7a8fd52
update README to reflect fork state and new features
MangelSpec Feb 12, 2026
b9a4845
improve CMake modernization and cleanup
MangelSpec Feb 12, 2026
4dd9ce0
add CLAUDE.md project guide
MangelSpec Feb 12, 2026
a67f55d
fix V8 12.9+ API compatibility for FastApiCallbackOptions and SetNati…
MangelSpec Feb 12, 2026
6c7993b
convert int64/uint64 to Number instead of BigInt for JS arithmetic co…
MangelSpec Feb 12, 2026
3bbf528
fix CI build failures across Ubuntu, Windows, and macOS
MangelSpec Feb 12, 2026
d83dcfe
fix CI failures: chrono precision, test cleanup, and compiler warnings
MangelSpec Feb 12, 2026
edc6336
add debug logging to test main and revert context-wrapping regression
MangelSpec Feb 12, 2026
39a34e2
fix alive_contexts thread safety and add Windows DLL diagnostics
MangelSpec Feb 12, 2026
a739cfa
fix NuGet cache missing V8 redist DLLs on Windows
MangelSpec Feb 12, 2026
cbcee36
add BUILD_BENCHMARKS option
MangelSpec Feb 12, 2026
e53d451
clean up debug printings from before
MangelSpec Feb 12, 2026
4afae20
add CUSTOM_V8_LIB_PATH support for custom V8 builds
MangelSpec Feb 12, 2026
fbee282
remove reference to none existing change analysis in README
MangelSpec Feb 12, 2026
4fb9b92
bump version to 3.0.0
MangelSpec Feb 12, 2026
e0596e0
fix: use proper UTF-8 conversion for filesystem::path in v8pp on Windows
MangelSpec Feb 12, 2026
548f85f
fix: define _AMD64_ before including stringapiset.h to fix Windows CI…
MangelSpec Feb 12, 2026
363bbed
fix: add _AMD64_ and NOMINMAX defines for stringapiset.h on Windows
MangelSpec Feb 12, 2026
4fe7a97
Merge branch 'master' into dev
MangelSpec Feb 12, 2026
f0d8ccd
include windows.h to setup all posibilities...
MangelSpec Feb 12, 2026
7fd12e3
add ctor extensions and fast property support
MangelSpec Feb 13, 2026
7af9c80
Add change detection job with dorny/paths-filter
MangelSpec Feb 13, 2026
690fda3
treat explicit undefined as "use the default" to match JS native beha…
MangelSpec Feb 13, 2026
38a0269
apply clang-format to all source files
MangelSpec Feb 13, 2026
85cb075
use clang-format-19
MangelSpec Feb 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 55 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,46 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
code:
- 'v8pp/**'
- 'test/**'
- 'plugins/**'
- 'examples/**'
- 'CMakeLists.txt'
- 'cmake/**'
- '.github/workflows/**'

format:
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format-19
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main" | sudo tee /etc/apt/sources.list.d/llvm-19.list
sudo apt-get update && sudo apt-get install -y clang-format-19
- name: Check formatting with clang-format
run: |
find v8pp test plugins \
-path '*/out/*' -prune -o \
\( -name '*.hpp' -o -name '*.cpp' -o -name '*.ipp' \) -print | \
xargs clang-format-19 --dry-run --Werror

build:
needs: changes
if: needs.changes.outputs.code == 'true'
timeout-minutes: 30
strategy:
fail-fast: false
Expand All @@ -36,7 +75,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install V8 apt
- name: Install V8 apt
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt update && sudo apt install libv8-dev -y

Expand Down Expand Up @@ -67,8 +106,22 @@ jobs:
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v5

- name: Set up ccache
if: ${{ !startsWith(matrix.os, 'windows') }}
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{matrix.os}}-${{matrix.shared_lib}}-${{matrix.header_only}}

- name: Configure CMake
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBUILD_TESTING=TRUE -DBUILD_SHARED_LIBS=${{matrix.shared_lib}} -DV8PP_HEADER_ONLY=${{matrix.header_only}} -DV8_COMPRESS_POINTERS=${{matrix.v8_compress_pointers}} -DV8_ENABLE_SANDBOX=${{matrix.v8_enable_sandbox}}
run: >
cmake -G Ninja -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DBUILD_TESTING=TRUE
-DBUILD_SHARED_LIBS=${{matrix.shared_lib}}
-DV8PP_HEADER_ONLY=${{matrix.header_only}}
-DV8_COMPRESS_POINTERS=${{matrix.v8_compress_pointers}}
-DV8_ENABLE_SANDBOX=${{matrix.v8_enable_sandbox}}
${{ !startsWith(matrix.os, 'windows') && '-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache' || '' }}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
Expand Down
13 changes: 4 additions & 9 deletions plugins/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ v8::Local<v8::Value> init(v8::Isolate* isolate)
.function("close", &file_base::close)
.function("good", &file_base::good)
.function("is_open", &file_base::is_open)
.function("eof", &file_base::eof)
;
.function("eof", &file_base::eof);

// .ctor<> template arguments declares types of file_writer constructor
// file_writer inherits from file_base_class
Expand All @@ -105,8 +104,7 @@ v8::Local<v8::Value> init(v8::Isolate* isolate)
.inherit<file_base>()
.function("open", &file_writer::open)
.function("print", &file_writer::print)
.function("println", &file_writer::println)
;
.function("println", &file_writer::println);

// .ctor<> template arguments declares types of file_reader constructor.
// file_base inherits from file_base_class
Expand All @@ -115,16 +113,13 @@ v8::Local<v8::Value> init(v8::Isolate* isolate)
.ctor<char const*>()
.inherit<file_base>()
.function("open", &file_reader::open)
.function("getln", &file_reader::getline)
;
.function("getln", &file_reader::getline);

// Create a module to add classes and functions to and return a
// new instance of the module to be embedded into the v8 context
v8pp::module m(isolate);
m.function("rename", +[](char const* src, char const* dest) -> bool
{
return std::rename(src, dest) == 0;
});
{ return std::rename(src, dest) == 0; });
m.class_("writer", file_writer_class);
m.class_("reader", file_reader_class);

Expand Down
66 changes: 32 additions & 34 deletions test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,29 @@ void run_tests()
void test_adversarial();
void test_thread_safety();

std::pair<char const*, void (*)()> tests[] =
{
std::pair<char const*, void (*)()> tests[] = {
{ "test_type_info", test_type_info },
{"test_utility", test_utility},
{"test_context", test_context},
{"test_context_store", test_context_store},
{"test_convert", test_convert},
{"test_throw_ex", test_throw_ex},
{"test_function", test_function},
{"test_ptr_traits", test_ptr_traits},
{"test_call_v8", test_call_v8},
{"test_call_from_v8", test_call_from_v8},
{"test_module", test_module},
{"test_class", test_class},
{"test_property", test_property},
{"test_object", test_object},
{"test_json", test_json},
{"test_overload", test_overload},
{"test_fast_api", test_fast_api},
{"test_symbol", test_symbol},
{"test_promise", test_promise},
{"test_gc_stress", test_gc_stress},
{"test_adversarial", test_adversarial},
{"test_thread_safety", test_thread_safety},
{ "test_utility", test_utility },
{ "test_context", test_context },
{ "test_context_store", test_context_store },
{ "test_convert", test_convert },
{ "test_throw_ex", test_throw_ex },
{ "test_function", test_function },
{ "test_ptr_traits", test_ptr_traits },
{ "test_call_v8", test_call_v8 },
{ "test_call_from_v8", test_call_from_v8 },
{ "test_module", test_module },
{ "test_class", test_class },
{ "test_property", test_property },
{ "test_object", test_object },
{ "test_json", test_json },
{ "test_overload", test_overload },
{ "test_fast_api", test_fast_api },
{ "test_symbol", test_symbol },
{ "test_promise", test_promise },
{ "test_gc_stress", test_gc_stress },
{ "test_adversarial", test_adversarial },
{ "test_thread_safety", test_thread_safety },
};

for (auto const& test : tests)
Expand Down Expand Up @@ -91,22 +90,21 @@ int main(int argc, char const* argv[])
if (arg == "-h" || arg == "--help")
{
std::cout << "Usage: " << argv[0] << " [arguments] [script]\n"
<< "Arguments:\n"
<< " --help,-h Print this message and exit\n"
<< " --version,-v Print V8 version\n"
<< " --lib-path <dir> Set <dir> for plugins library path\n"
<< " --run-tests Run library tests\n"
;
<< "Arguments:\n"
<< " --help,-h Print this message and exit\n"
<< " --version,-v Print V8 version\n"
<< " --lib-path <dir> Set <dir> for plugins library path\n"
<< " --run-tests Run library tests\n";
return EXIT_SUCCESS;
}
else if (arg == "-v" || arg == "--version")
{
std::cout << "V8 version " << v8::V8::GetVersion() << std::endl;
std::cout << "v8pp version " << v8pp::version()
<< " (major=" << v8pp::version_major()
<< " minor=" << v8pp::version_minor()
<< " patch=" << v8pp::version_patch()
<< ")\n";
<< " (major=" << v8pp::version_major()
<< " minor=" << v8pp::version_minor()
<< " patch=" << v8pp::version_patch()
<< ")\n";
std::cout << "v8pp build options " << v8pp::build_options() << std::endl;
}
else if (arg == "--lib-path")
Expand All @@ -128,7 +126,7 @@ int main(int argc, char const* argv[])
// for v8pp::class_ tests
v8::V8::SetFlagsFromString("--expose_gc");

//v8::V8::InitializeICU();
// v8::V8::InitializeICU();
v8::V8::InitializeExternalStartupData(argv[0]);
#if V8_MAJOR_VERSION >= 7
std::unique_ptr<v8::Platform> platform(v8::platform::NewDefaultPlatform());
Expand Down
8 changes: 4 additions & 4 deletions test/test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ std::ostream& operator<<(std::ostream& os, std::pair<First, Second> const& pair)
return os << pair.first << ": " << pair.second;
}

template<typename Enum> requires std::is_enum_v<Enum>
template<typename Enum>
requires std::is_enum_v<Enum>
std::ostream& operator<<(std::ostream& os, Enum value)
{
return os << static_cast<typename std::underlying_type_t<Enum>>(value);
Expand All @@ -167,12 +168,11 @@ template<typename... Ts>
std::ostream& operator<<(std::ostream& os, std::tuple<Ts...> const& tuple)
{
std::apply([&os](auto&&... elems) mutable
{
{
bool first = true;
os << '(';
((os << (first ? (first = false, "") : ", ") << elems), ...);
os << ')';
}, tuple);
os << ')'; }, tuple);
return os;
}

Expand Down
Loading