Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3300,7 +3300,7 @@ jobs:
# a "no reactor running" panic. `test_issue_414_mysql_query_params`
# was the single compile-smoke failure this caused. Same set the
# doc-tests job already builds together.
run: cargo build --release -p perry -p perry-runtime -p perry-stdlib -p perry-runtime-static -p perry-stdlib-static -p perry-ext-ioredis -p perry-ext-mongodb -p perry-ext-nodemailer
run: cargo build --release -p perry -p perry-runtime -p perry-stdlib -p perry-runtime-static -p perry-stdlib-static -p perry-ext-mongodb -p perry-ext-nodemailer

- name: Issue #945 scalar method IR guard
run: |
Expand Down Expand Up @@ -4152,7 +4152,7 @@ jobs:
# Build them in this SAME Cargo graph as perry-stdlib: otherwise each
# no-auto fallback build bundles a distinct tokio TLS/runtime and the
# linker rejects the unsafe pair (#507, #7629).
run: cargo build --release -p perry -p perry-runtime -p perry-stdlib -p perry-runtime-static -p perry-stdlib-static -p ${{ matrix.ui_backend }} -p perry-doc-tests -p perry-ext-ioredis -p perry-ext-mongodb -p perry-ext-nodemailer -p perry-ext-net
run: cargo build --release -p perry -p perry-runtime -p perry-stdlib -p perry-runtime-static -p perry-stdlib-static -p ${{ matrix.ui_backend }} -p perry-doc-tests -p perry-ext-mongodb -p perry-ext-nodemailer -p perry-ext-net

- name: Verify macOS application bundle packaging
if: matrix.os == 'macos-14'
Expand Down
105 changes: 7 additions & 98 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ members = [
"crates/perry-ext-sharp",
"crates/perry-ext-ethers",
"crates/perry-ext-nodemailer",
"crates/perry-ext-ioredis",

"crates/perry-ext-undici",
"crates/perry-ext-mongodb",
Expand Down Expand Up @@ -216,8 +215,6 @@ codegen-units = 1
# and safe to drop duplicates from — an assumption this mismatch violated.
[profile.release.package.perry-ext-http]
codegen-units = 1
[profile.release.package.perry-ext-ioredis]
codegen-units = 1
[profile.release.package.perry-ext-net]
codegen-units = 1
[profile.release.package.perry-ext-undici]
Expand Down Expand Up @@ -313,8 +310,6 @@ codegen-units = 1
# the "shared tokio" (#507) cargo invocation is required.
[profile.dist.package.perry-ext-http]
codegen-units = 1
[profile.dist.package.perry-ext-ioredis]
codegen-units = 1
[profile.dist.package.perry-ext-net]
codegen-units = 1
[profile.dist.package.perry-ext-undici]
Expand Down Expand Up @@ -455,15 +450,14 @@ turnloop-websocket = { version = "0.1.0-alpha.8", default-features = false }
# (docs/turnloop/p6-report.md).
turnloop-smtp = { version = "0.1.0-alpha.8", default-features = false }
# turnloop P7 (docs/turnloop/p7-report.md): the sans-I/O database protocol
# cores that replace sqlx, the `redis` crate and the `mongodb` driver on the
# cores that replace sqlx and the `mongodb` driver on the
# paths Perry's bindings own. Default features only, for the same reason as the
# two above — with the `turnloop` feature off these crates depend on neither
# `turnloop-io` nor `turnloop-tls`, so they are pure protocol state machines and
# Perry drives them over P1's socket layer. alpha.4 rather than alpha.3 because
# it is the release that gave MySQL and MongoDB one deflate state per
# connection, each compressed message framed as its own zlib stream; alpha.3
# re-created the state per message and is a wire-level regression to adopt.
turnloop-redis = { version = "0.1.0-alpha.8", default-features = false }
turnloop-mongodb = { version = "0.1.0-alpha.8", default-features = false }
tempfile = "3"
itoa = "1.0"
Expand Down Expand Up @@ -578,7 +572,6 @@ perry-ext-cheerio = { path = "crates/perry-ext-cheerio" }
perry-ext-sharp = { path = "crates/perry-ext-sharp" }
perry-ext-ethers = { path = "crates/perry-ext-ethers" }
perry-ext-nodemailer = { path = "crates/perry-ext-nodemailer" }
perry-ext-ioredis = { path = "crates/perry-ext-ioredis" }

perry-ext-undici = { path = "crates/perry-ext-undici" }
perry-ext-mongodb = { path = "crates/perry-ext-mongodb" }
Expand Down
7 changes: 7 additions & 0 deletions changelog.d/11238-remove-ioredis-binding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Removes the native ioredis binding (`crates/perry-ext-ioredis`). It served three npm names, `ioredis`, `iovalkey` and `redis`, and all three now compile from their own npm source. This is part of the native-binding removal campaign.

- Deleted: the crate, its three `well_known_bindings.toml` rows, its 18 `module: "ioredis"` native-table rows and `js_ioredis_*` declarations, and the `new Redis()` constructor lowering in `lower_builtin_new`. Also deleted: the `Redis` class-name routing in HIR (`native_new`, `module_decl`, the `Redis` type-annotation tables in `fn_decl` / `expr_function` / `misc`, `duplicate()` chaining) and the `redis`/`iovalkey` → `ioredis` dispatch normalization. Also deleted: the CLI's ioredis feature detection, `PERRY_NATIVE_EXTENSION_PACKAGES` entry, `binding_needs_shared_tokio` / `async-runtime` / sandbox-profile arms, the API-manifest entries and the Android stub symbols.
- The HIR type tables were a live hazard once the source compiles. Any parameter or return value typed `Redis` was registered as a native `ioredis` instance, so its method calls lowered to `js_ioredis_*` FFI instead of the real class's methods.
- Before this change the binding was already worse than source. On main at `feb2b7606` (#11225 included), the default route for all three packages failed with auto-optimize on: `ioredis` (`require("ioredis/package.json")` → undefined), `redis` (`TypeError: value is not a function` after connect), `iovalkey` (wrapper/stdlib tokio mismatch, link refused). With `perry.compilePackages`, `ioredis` already worked from source. `redis` and `iovalkey` could not be taken off the binding at all, because the `Redis`/alias routing still linked the wrapper.
- Re-derived: `native_result_ledger` 309 → 292 rows and 274 → 258 providers (script output, not arithmetic). The tokio inventory drops the `perry-ext-ioredis → redis` and `→ tokio` edges (group J), and the `redis` crate leaves `Cargo.lock`, along with `turnloop-redis`, `arc-swap`, `arcstr`, `backon`, `sha1_smol` and the duplicate `num-bigint` 0.5. `workspace-architecture.json` goes from 71 to 70 members (externalize 13 → 12). The two GC root-holder entries and the unrooted-local-shape baseline row go too (383 → 382). The API reference and `perry.d.ts` are regenerated.
- New gap tests: `test_gap_ioredis_from_source`, `test_gap_iovalkey_from_source` and `test_gap_node_redis_from_source`. Each one runs connect, SET/GET, a pipeline, MULTI/EXEC, SUBSCRIBE/PUBLISH and QUIT against an in-process fake RESP server (`test-files/_helpers/fake_resp_server.ts`), so CI needs no redis-server. `ioredis@5.11.1`, `iovalkey@0.4.0` and `redis@6.1.0` are pinned exactly in the root devDependencies, and each fixture prints its resolved version.
9 changes: 2 additions & 7 deletions crates/perry-api-manifest/src/entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ use crate::{ApiEntry, ApiKind, ApiSource, ParamSpec, TypeSpec};
/// `perry-hir`. Order matches the original list to keep diffs minimal.
pub const NATIVE_MODULES: &[&str] = &[
// ── Third-party npm packages (native wrappers; see well_known_bindings.toml) ──
"bcrypt", // bcrypt password hashing (replaces the N-API addon)
"argon2", // Argon2 password hashing (replaces the N-API addon)
"ioredis", // Redis/Valkey client
// iovalkey: the Valkey fork of ioredis (valkey-io/iovalkey), served by the
// same perry-ext-ioredis surface — see well_known_bindings.toml.
"iovalkey",
"bcrypt", // bcrypt password hashing (replaces the N-API addon)
"argon2", // Argon2 password hashing (replaces the N-API addon)
"node-fetch", // WHATWG fetch client
"ws", // WebSocket client/server
"zlib", // (Node builtin) gzip/deflate/brotli/zstd compression
Expand Down Expand Up @@ -132,7 +128,6 @@ pub const NATIVE_MODULES: &[&str] = &[
"perry/audio", // audio surface
"perry/background", // background-task surface
// ── More third-party npm packages ──
"redis", // npm `redis` client (aliases ioredis)
// `undici` (#466) — served by perry's native fetch stack via the
// bundled perry-ext-undici wrapper (ProxyAgent / Agent /
// setGlobalDispatcher / getGlobalDispatcher / fetch subset).
Expand Down
29 changes: 0 additions & 29 deletions crates/perry-api-manifest/src/entries/part_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,6 @@ pub(crate) const API_MANIFEST_PART_1: &[ApiEntry] = &[
// (extracted from crates/perry-codegen/src/lower_call.rs;
// drift guarded by perry-codegen's manifest_consistency test)
// ===========================================================
method_sig(
"ioredis",
"createClient",
false,
None,
&[p_any("p0")],
TypeSpec::Any,
),
method("ioredis", "set", true, None),
method("ioredis", "setex", true, None),
method("ioredis", "get", true, None),
method("ioredis", "del", true, None),
method("ioredis", "exists", true, None),
method("ioredis", "incr", true, None),
method("ioredis", "decr", true, None),
method("ioredis", "expire", true, None),
method("ioredis", "ping", true, None),
method("ioredis", "hget", true, None),
method("ioredis", "hset", true, None),
method("ioredis", "hdel", true, None),
method("ioredis", "hlen", true, None),
method("ioredis", "hgetall", true, None),
method("ioredis", "quit", true, None),
// v0.5.707 closes-#605: NATIVE_MODULE_TABLE added connect/disconnect rows
// when normalizing the `redis` npm package alias to ioredis dispatch.
// Manifest must mirror or `every_dispatch_entry_has_manifest_counterpart`
// fails the workspace test build.
method("ioredis", "connect", true, None),
method("ioredis", "disconnect", true, None),
method_sig(
"mongodb",
"connect",
Expand Down
1 change: 0 additions & 1 deletion crates/perry-api-manifest/src/entries/part_3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,6 @@ pub(crate) const API_MANIFEST_PART_3: &[ApiEntry] = &[
class("net", "Server"),
class("net", "BlockList"),
class("net", "SocketAddress"),
class("ioredis", "Redis"),
class("url", "URL"),
class("url", "URLSearchParams"),
class("url", "URLPattern"),
Expand Down
13 changes: 0 additions & 13 deletions crates/perry-api-manifest/src/entries/part_4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,19 +691,6 @@ pub(crate) const API_MANIFEST_PART_4: &[ApiEntry] = &[
// export `Widget(config)` produces a WidgetDecl in HIR; see
// try_lower_widget_decl in perry-hir/src/lower.rs. ---
method("perry/widget", "Widget", false, None),
// --- redis — alias for ioredis (well-known table routes both to
// perry-ext-ioredis). The Redis class instance methods come
// from the ioredis class entries. ---
class("redis", "Redis"),
method("redis", "createClient", false, None),
// --- iovalkey — the Valkey fork of ioredis (valkey-io/iovalkey),
// served by the same perry-ext-ioredis surface. Dispatch
// normalizes `iovalkey` → `ioredis` (see native_module_dispatch.rs),
// so there are no iovalkey rows in NATIVE_MODULE_TABLE; these
// entries exist so the module clears the #513 strict-mode gate
// (module_has_any_entries) and mirror the `redis` alias above. ---
class("iovalkey", "Redis"),
method("iovalkey", "createClient", false, None),
// --- fetch — well-known alias for perry-ext-fetch. Same surface
// as node-fetch (the more common alias above). ---
method("fetch", "default", false, None),
Expand Down
2 changes: 1 addition & 1 deletion crates/perry-codegen/src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2714,7 +2714,7 @@ pub fn compile_module(hir: &HirModule, opts: CompileOptions) -> Result<Vec<u8>>
// Per-module local-name → import-source map. Walks `hir.imports`
// and records every named/default import binding's source spec.
// `lower_builtin_new` consults this to gate ambiguously-named
// built-in arms (Client / Pool / Database / Redis / MongoClient /
// built-in arms (Client / Pool / Database / MongoClient /
// Decimal) on the import source — `import Client from
// "better-sqlite3"` should not dispatch through pg's Client arm.
// See issue #602.
Expand Down
Loading
Loading