Skip to content

chore(bindings): remove axios native binding, compile real axios from source - #10679

Draft
proggeramlug wants to merge 2 commits into
fix/10662-namespace-export-equals-fallbackfrom
wip/axios-native-binding-removal
Draft

proggeramlug wants to merge 2 commits into
fix/10662-namespace-export-equals-fallbackfrom
wip/axios-native-binding-removal

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

Removes the axios native binding (perry-ext-axios, perry-stdlib/src/axios.rs, the
js_axios_* FFI surface, and every NATIVE_MODULES/manifest/HIR/codegen special-case
that existed only to route it) so import axios from "axios" resolves to the real npm
package instead of Perry's hand-written reimplementation. Removal only — no other
binding touched, no behavior changes to anything that stays.

Do not merge before #10673 (fix/10662-namespace-export-equals-fallback). This
branch is based on it, not on main — axios does not compile without #10673's
agent-base/https-proxy-agent namespace export = fallback fix. If this PR merges
first, real-source axios (and anything depending on it) breaks.

What was deleted

  • crates/perry-ext-axios (crate + Cargo.toml workspace membership)
  • crates/perry-stdlib/src/axios.rs and its mod/pub use in lib.rs, and the axios
    response-property arm in common/dispatch/property_dispatch.rs
  • The [bindings.axios] block in well_known_bindings.toml
  • The "axios" NATIVE_MODULES entry and its 11 manifest method rows (entries.rs,
    entries/part_4.rs)
  • Codegen dispatch for axios's static HTTP methods and response-property access
    (lower_call/options/fetch.rs), and the js_axios_* FFI declarations
    (runtime_decls/stdlib_ffi/third_party.rs) plus their runtime/no-op-stub
    implementations (perry-runtime/src/closure/v8_stubs.rs + closure/mod.rs's
    re-export, perry-ui-android/src/stdlib_stubs.rs)
  • The HIR "axios.get/post/… returns a Response" local-instance tagging that existed
    only to route .status/.data/.statusText through the now-deleted native dispatch
    (local_natives.rs, destructuring/var_decl/native_new.rs, lower/module_decl.rs,
    lower/stmt.rs)
  • emit.rs's "callable default export" special-case, which existed only for axios's
    axios(config) shape (its two axios-specific .d.ts tests went with it)
  • The axios-only HIR test (axios_response_property_lowering.rs) and the native-dispatch
    NaN-boxing regression test (test_issue_340_axios_response_props.ts + its
    known_failures.json entry) — both tested internals of the deleted shim
  • workspace-architecture.json's crate entry and baseline counts (workspace_members
    83→82, decision_counts.externalize 33→32)

Regenerated docs/api/perry.d.ts, docs/src/api/reference.md, and
docs/src/native-libraries/governance.md's table. Dropped axios's row/section from
docs/native-libraries.md and its line from the perry native list example in
docs/src/cli/commands.md. Swapped unimplemented_api_check.rs's
supported_module_with_unknown_member_is_rejected witness from axios to node-fetch
(still native) since the test needs a live NATIVE_MODULES member.

Left alone (still legitimate as npm-package-name examples, unrelated to the native
binding): axios entries in crates/perry/src/commands/install/scanner/typosquat.rs +
top_packages.txt (typosquat popularity data), crates/perry-hir/src/capability.rs
(per-package capability-policy test fixtures), and comments across
perry-stdlib/perry-runtime/perry-codegen describing real axios behavior that
motivated generic (non-axios-specific) fixes.

The acceptance test that matters

A plain import axios from "axios" with no perry.compilePackages entry for axios at
all
compiles and runs correctly. Verified two ways:

  1. tests/release/packages/axios-get — its package.json already had no
    compilePackages block (it didn't need one when axios was native) and needs none now
    either. bash fixture.sh passes: real GET/HEAD/OPTIONS round-trip against an
    in-process node:http server, diffed against expected.txt.
  2. A from-scratch repro with just {"dependencies": {"axios": "^1"}} + npm install,
    compiled and run against a live server — RESULT: PASS.

No package.json configuration beyond a plain "axios" dependency is required.
Perry's default "compile npm package source when nothing claims the specifier natively"
path picks up axios and its full transitive dependency graph (agent-base,
https-proxy-agent, follow-redirects, form-data, combined-stream, mime-types, debug, and
the rest) automatically — perry compile reports "130 module(s): 130 native, 0
JavaScript" for them. The earlier probe's perry.compilePackages list (used to force
native-source compilation before this removal) is not needed post-removal — that was
testing something different from what a user actually needs to do.

Validation

  • cargo check --workspace --tests (minus cross-host UI crates): clean except two
    pre-existing breaks on this base branch, confirmed via git stash A/B (neither
    touches anything this PR changed): perry-codegen's test target fails to compile
    (ImportedClass missing constructor_has_synthetic_arguments in two unrelated test
    files) and perry-runtime --tests carries one pre-existing dead-code warning in
    box.rs.
  • cargo test: perry-api-manifest 41/41, perry-hir all suites 0 failed,
    perry-stdlib 139/139 (RUST_TEST_THREADS=1), perry 1136 lib tests + the 5
    integration tests whose comments mention axios (incoming_message_pipe,
    issue_10662_namespace_export_equals_fallback, issue_5174_headers_http_pump_hang,
    response_stream_body_pull) — none depend on axios functionally, all green. Not
    run
    : the full crates/perry/tests/*.rs sweep (~100 files, ~3 min each on the shared
    build host) — unrelated to this diff, and CI's e2e-scoped only runs integration
    tests the diff actually names, which is none here.
  • run_lint_gates.sh SKIP_COMPILE_GATES=1: 76 of 77 script gates pass. The one red
    ("Public benchmark evidence freshness") is pre-existing on every PR in this repo.
    Compile tier not run (known-red on Linux per the campaign brief).
  • cargo fmt --all -- --check: clean.
  • Grepped for axios/js_axios_/perry-ext-axios across the whole repo before and
    after; the only post-removal matches are historical (CHANGELOG.md, dated audit
    snapshots, docs/po/*.po), illustrative comments/examples unrelated to the native
    binding (typosquat data, capability-policy test fixtures, generic bug-history prose),
    and the still-passing axios-get release fixture.

… source

Deletes the perry-ext-axios crate, perry-stdlib's axios.rs shim, the
js_axios_* FFI surface, and every NATIVE_MODULES/manifest/HIR/codegen
special-case that existed only to route the native binding. A plain
`import axios from "axios"` with no perry.compilePackages entry now
resolves and compiles the real npm package (and its transitive deps)
from source instead.

Must not merge before #10673 (agent-base namespace/export= fallback
fix) -- axios's https-proxy-agent dependency needs it to compile.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Renamed the axios-removal changeset fragment now that the PR number is
known, and pointed PENDINGCS-compile-smoke-known.md's dangling
placeholder reference at it.
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