Skip to content

[#3598] Add FormData constructor and mutator parity#3642

Merged
proggeramlug merged 8 commits into
PerryTS:mainfrom
andrewtdiz:codex/3598-fetch-body-methods
Jun 1, 2026
Merged

[#3598] Add FormData constructor and mutator parity#3642
proggeramlug merged 8 commits into
PerryTS:mainfrom
andrewtdiz:codex/3598-fetch-body-methods

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Refs #3598

Summary

  • add new FormData() lowering plus native FormData registry allocation
  • wire string-valued FormData append, set, delete, has, get, getAll, entries, keys, values, and forEach through typed and any-typed fetch handle dispatch
  • expose deterministic FormData constructor/prototype name/length metadata and add FormData to the fetch/node-fetch API manifest declarations
  • add a focused parity fixture for constructor/prototype/mutator/iteration/forEach ordering

Verification

  • cargo fmt --check
  • node --experimental-strip-types test-parity/node-suite/fetch/form-data/constructor-mutators.ts
  • cargo check -p perry-stdlib -p perry-runtime -p perry-codegen -p perry-hir
  • cargo build -p perry -p perry-runtime -p perry-stdlib
  • PERRY_ALLOW_UNIMPLEMENTED=1 ./target/debug/perry test-parity/node-suite/fetch/form-data/constructor-mutators.ts -o /tmp/perry_formdata_constructor_mutators && /tmp/perry_formdata_constructor_mutators matched the Node baseline; the fetch sidecar auto-optimize build was bounded/stopped after dependency build contention and Perry fell back to prebuilt libs before linking/running the fixture.
  • Attempted ./run_parity_tests.sh --suite node-suite --module fetch, stopped while it was sitting in release-build contention without useful fixture output.

Remaining Fetch/FormData Work

  • File/Blob-valued FormData entries are not implemented in this registry; values are currently stored/coerced as strings.
  • Multipart FormData parsing/serialization and filename/content-type metadata remain follow-up work.
  • Broader Body method expansion beyond the locally supported fetch registry is intentionally left out of this PR.
  • This does not change globalThis.fetch value exposure; that remains separate from draft PR fix(fetch): expose globalThis fetch value #3632.

@andrewtdiz andrewtdiz force-pushed the codex/3598-fetch-body-methods branch 5 times, most recently from 365d69d to 5973903 Compare May 31, 2026 20:01
@andrewtdiz andrewtdiz force-pushed the codex/3598-fetch-body-methods branch from 86ccf3e to 0fc6cbd Compare May 31, 2026 20:26
@andrewtdiz andrewtdiz marked this pull request as ready for review May 31, 2026 20:49
Ralph Küpper added 3 commits June 1, 2026 07:52
…-methods

# Conflicts:
#	crates/perry-runtime/src/object/global_this.rs
#	docs/api/perry.d.ts
#	docs/src/api/reference.md
#	scripts/check_file_size.sh
Resolve conflicts in global_this.rs (FormData proto-method arms vs.
WebSocket/Crypto/CryptoKey arms from main; tables relocated to
global_this_tables.rs picked up main's Storage/WebSocket/WebAssembly
additions) and regenerate API docs (2496 entries).
Re-resolve global_this.rs after main absorbed the Navigator work: keep the
relocated tables (global_this_tables.rs) and fold in main's Navigator
constructor + spec_length(0); merge the prototype-constructor install so
both the web-fetch ctors (FormData/Headers/Request/Response/Blob/File) and
Navigator/TextEncoder|DecoderStream get their .constructor. Regenerate API
docs (2499 entries).
@proggeramlug proggeramlug merged commit ed9308d into PerryTS:main Jun 1, 2026
11 checks passed
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.

2 participants