Skip to content

add array support to rust/jsg#5868

Merged
anonrig merged 3 commits intomainfrom
yagiz/add-array-suport
Feb 5, 2026
Merged

add array support to rust/jsg#5868
anonrig merged 3 commits intomainfrom
yagiz/add-array-suport

Conversation

@anonrig
Copy link
Copy Markdown
Member

@anonrig anonrig commented Jan 12, 2026

Adds array support to the Rust/JSG layer.

  • We now support Vec as function parameters where T is a primitive (such as boolean etc.)
  • Vec for JavaScript typed arrays (such as uint8array) etc.
  • Support for nested arrays. (example Vec<Vec>)
  • Support for &[T]
  • Replaces javascript number representation from f64 to jsg::Number

Some other notable changes:

  • Support for getting a javascript object as a parameter as well as returning an object.

@anonrig anonrig requested review from a team as code owners January 12, 2026 21:35
@anonrig anonrig force-pushed the yagiz/add-array-suport branch from 35b2d20 to a117878 Compare January 12, 2026 21:51
@codspeed-hq

This comment was marked as off-topic.

@anonrig anonrig requested review from guybedford and mikea January 12, 2026 22:34
Copy link
Copy Markdown
Contributor

@guybedford guybedford left a comment

Choose a reason for hiding this comment

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

Can Arrays of GC references be handled? There don't seem to be any test cases covering this. What happens for Vec<Ref> with this implementation currently?

Fine to defer, just nice to know what the situation is.

@anonrig
Copy link
Copy Markdown
Member Author

anonrig commented Jan 26, 2026

Can Arrays of GC references be handled? There don't seem to be any test cases covering this. > What happens for Vec with this implementation currently?

This is intentional. This mostly depends on the GC spec I'm writing at the moment.

@anonrig anonrig force-pushed the yagiz/add-array-suport branch from a117878 to 5778609 Compare January 26, 2026 20:53
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 26, 2026

Codecov Report

❌ Patch coverage is 75.79844% with 341 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.22%. Comparing base (637f37f) to head (e9e9d92).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/rust/jsg/v8.rs 61.58% 131 Missing ⚠️
src/rust/jsg/ffi.c++ 0.00% 127 Missing ⚠️
src/rust/jsg/wrappable.rs 64.94% 34 Missing ⚠️
src/rust/jsg/lib.rs 31.57% 26 Missing ⚠️
src/rust/jsg-macros/lib.rs 0.00% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5868      +/-   ##
==========================================
+ Coverage   70.14%   70.22%   +0.07%     
==========================================
  Files         407      408       +1     
  Lines      107225   108610    +1385     
  Branches    17972    17974       +2     
==========================================
+ Hits        75214    76272    +1058     
- Misses      21228    21553     +325     
- Partials    10783    10785       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@anonrig anonrig force-pushed the yagiz/add-array-suport branch from bcab4a2 to e9e9d92 Compare January 28, 2026 20:15
@anonrig
Copy link
Copy Markdown
Member Author

anonrig commented Jan 28, 2026

Rebased and force pushed.

@anonrig anonrig requested a review from guybedford January 29, 2026 19:59
@anonrig anonrig merged commit 526fae3 into main Feb 5, 2026
34 of 36 checks passed
@anonrig anonrig deleted the yagiz/add-array-suport branch February 5, 2026 17:59
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.

3 participants