Skip to content

W-20884161: Add Node.js API for DataWeave native library#115

Open
svacas wants to merge 6 commits intomasterfrom
node-api
Open

W-20884161: Add Node.js API for DataWeave native library#115
svacas wants to merge 6 commits intomasterfrom
node-api

Conversation

@svacas
Copy link
Copy Markdown
Contributor

@svacas svacas commented May 7, 2026

Add @dataweave/native Node.js package mirroring the Python API, with N-API native addon using libuv for cross-platform Windows/Linux/macOS support. Includes run(), runStreaming(), and runTransform() APIs with full test suite, Gradle integration, and CI workflow updates.

Add @dataweave/native Node.js package mirroring the Python API, with N-API native addon using libuv for cross-platform Windows/Linux/macOS support. Includes run(), runStreaming(), and runTransform() APIs with full test suite, Gradle integration, and CI workflow updates.
@svacas svacas requested a review from a team as a code owner May 7, 2026 21:13
svacas and others added 5 commits May 7, 2026 18:51
MSVC rejects mixing /std:c++17 (injected by node-addon-api) with
/std:c11 for our pure C addon. Removed node-addon-api since we use
the raw node_api.h C header directly. Added CompileAs=1 (/TC) for
Windows to ensure C compilation mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MSVC compiles .c files as C and .cc files as C++ by extension, so no
explicit CompileAs or /std:c11 flags are needed. The previous attempts
conflicted with win_delay_load_hook.cc (a C++ file node-gyp includes
automatically on Windows). Also updates node-api-plan.md to reflect
libuv-based cross-platform architecture.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
libuv's uv/unix.h references pthread_rwlock_t which requires GNU/POSIX
extensions. Strict -std=c11 hides these types and also hides strdup.
Using -std=gnu11 on Linux enables the required extensions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sync iterables (generators, arrays) are now consumed one chunk at a
time during the native read callback, avoiding pre-buffering the entire
input. This reduces memory from ~658 MB to ~150 MB for 50M elements.
Async iterables still require pre-buffering due to the synchronous
nature of the native callback.

Adds example_streaming.mjs benchmark and documents the sync vs async
input behavior in README.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ase workflows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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