Skip to content

Conversation

@GordonSmith
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the WebAssembly bindings from Emscripten's WebIDL to Embind across multiple packages (zstd, graphviz, expat, and base91). This modernizes the WASM interface generation approach and removes dependency on the deprecated WebIDL binder.

Key Changes:

  • Replaced WebIDL .idl files with inline Embind bindings using EMSCRIPTEN_BINDINGS macros
  • Updated TypeScript code to use Embind API patterns (e.g., .delete() instead of destroy(), direct class references instead of .prototype)
  • Modified C++ signatures to use std::string and uintptr_t instead of raw pointers for better Embind compatibility
  • Removed WebIDL glue code generation from CMakeLists.txt files

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/zstd/src/zstd.ts Updated to use _module.zstd directly instead of _module.zstd.prototype for static class functions
packages/zstd/src-cpp/main.idl Removed WebIDL interface definition (replaced by Embind bindings)
packages/zstd/src-cpp/main.cpp Replaced WebIDL glue with EMSCRIPTEN_BINDINGS macro, updated function signatures to use std::string and uintptr_t, changed getFrameContentSize return type to double for JavaScript compatibility
packages/zstd/src-cpp/CMakeLists.txt Removed WebIDL glue generation, added -lembind flag, fixed target name from graphvizlib to zstdlib
packages/graphviz/src/graphviz.ts Updated API calls to use _module.Graphviz directly, replaced this._module.destroy() with .delete(), updated static method calls
packages/graphviz/src-cpp/main.idl Removed WebIDL interface definition
packages/graphviz/src-cpp/main.hpp Changed return types and parameters from C-style strings to std::string, replaced StringBuffer with std::string
packages/graphviz/src-cpp/main.cpp Implemented EMSCRIPTEN_BINDINGS with both static class functions and instance methods, moved error handler to anonymous namespace, added null pointer checks when converting to strings
packages/graphviz/src-cpp/CMakeLists.txt Removed WebIDL glue generation, added -lembind flag
packages/expat/src/expat.ts Updated import path (removed expatlib subdirectory), changed to use _module.CExpat directly, replaced callback mechanism with setCallback() method, updated to use .delete()
packages/expat/src-cpp/stack_parser.h Removed commented-out dead code blocks
packages/expat/src-cpp/main.cpp New file with complete CExpat class implementation using Embind, added callback support via emscripten::val
packages/expat/src-cpp/expatlib/main.idl Removed WebIDL interface definition
packages/expat/src-cpp/expatlib/main.cpp Removed (functionality moved to parent directory)
packages/expat/src-cpp/expatlib/CMakeLists.txt Removed (consolidated into parent CMakeLists.txt)
packages/expat/src-cpp/CMakeLists.txt Consolidated build configuration from expatlib subdirectory, added -lembind flag, uses tabs for indentation (inconsistent with other files)
packages/base91/src-cpp/main.idl Removed WebIDL interface definition
packages/base91/src-cpp/main.cpp Replaced WebIDL glue with EMSCRIPTEN_BINDINGS, changed malloc/free from static to instance methods, updated to use std::string and uintptr_t
packages/base91/src-cpp/CMakeLists.txt Removed WebIDL glue generation, added -lembind flag

@GordonSmith GordonSmith merged commit 08829d2 into hpcc-systems:trunk Dec 18, 2025
8 checks passed
@GordonSmith GordonSmith deleted the OTHER_BINDINGS branch December 18, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant