Skip to content

refactor: remove callback thisArg support - #7626

Merged
benlesh merged 2 commits into
ReactiveX:masterfrom
benlesh:agent/remove-callback-thisarg
Aug 5, 2026
Merged

refactor: remove callback thisArg support#7626
benlesh merged 2 commits into
ReactiveX:masterfrom
benlesh:agent/remove-callback-thisarg

Conversation

@benlesh

@benlesh benlesh commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

  • remove thisArg overloads from every, filter, find, findIndex, map, and partition
  • invoke callbacks directly and update tests to use closures or Function.prototype.bind
  • classify the RxJS 7 receiver cases as intentional divergences and update migration and architecture documentation

Why

RxJS Next is not retaining the RxJS 7 thisArg convenience. Closures and bound functions provide the same behavior without requiring .call on every notification.

Validation

  • 750 RxJS source tests
  • affected cold/polyfill suites: 76/76 each
  • exact complete audits: 2,299/39 cold and 2,316/22 polyfill, unchanged
  • package build, public types, imports, migration freshness, installation audit, and lint
  • packaged fallback/native Chrome kernel: 8/8
  • performance: approximately 63.0M map values/sec and 140,627 cancellations/sec

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes RxJS 7-style callback thisArg overloads from key RxJS Next Symbol APIs to simplify the public contract and eliminate per-notification .call overhead, while updating migrated/spec evidence and documentation to record the intentional divergence.

Changes:

  • Removed thisArg overloads and .call(thisArg, …) dispatch from every, filter, find, findIndex, map, and static partition.
  • Updated focused + ported tests and ported-manifest generation to use closures / Function.prototype.bind instead of receiver arguments.
  • Updated migration and parity/compatibility documentation and evidence ledgers to classify the RxJS 7 receiver behavior as an intentional divergence.

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/rxjs/test/types/usage.ts Adds type-level negative assertions rejecting thisArg arguments.
packages/rxjs/test/ported/tools/generate-port-manifest.mjs Rewrites specific migrated programs to bind callbacks instead of using receiver args.
packages/rxjs/test/ported/platform/operators/map.spec.ts Updates ported platform map tests to use bound/closure projectors.
packages/rxjs/test/ported/platform/operators/find.spec.ts Updates ported platform find test to use predicate.bind(...).
packages/rxjs/test/ported/platform/operators/find-index.spec.ts Updates ported platform findIndex test to use predicate.bind(...).
packages/rxjs/test/ported/platform/operators/filter.spec.ts Updates ported platform filter tests to remove receiver usage.
packages/rxjs/test/ported/platform/observables/partition.spec.ts Updates ported platform partition test to use bound predicate.
packages/rxjs/test/ported/migration-evidence-ledger.generated.json Updates mappings/notes + classifications for receiver removal.
packages/rxjs/test/ported/manifest.generated.json Reclassifies affected cases as intentional divergence and updates migrated programs.
packages/rxjs/test/ported/cold/operators/map.spec.ts Updates ported cold map tests to use bound/closure projectors.
packages/rxjs/test/ported/cold/operators/find.spec.ts Updates ported cold find test to use predicate.bind(...).
packages/rxjs/test/ported/cold/operators/find-index.spec.ts Updates ported cold findIndex test to use predicate.bind(...).
packages/rxjs/test/ported/cold/operators/filter.spec.ts Updates ported cold filter tests to remove receiver usage.
packages/rxjs/test/ported/cold/observables/partition.spec.ts Updates ported cold partition test to use bound predicate.
packages/rxjs/test/ported/capability-registry.json Updates capability mappings/notes to remove thisArg?.
packages/rxjs/test/kernel/contract.mjs Updates kernel contract to validate map index behavior without thisArg.
packages/rxjs/src/partition.ts Removes thisArg overloads and direct-invokes predicates.
packages/rxjs/src/partition.spec.ts Updates focused partition spec to use closures instead of receivers.
packages/rxjs/src/map.ts Removes thisArg overload and .call dispatch.
packages/rxjs/src/map.spec.ts Removes focused spec that asserted RxJS 7 thisArg behavior.
packages/rxjs/src/find.ts Removes thisArg overloads and .call dispatch.
packages/rxjs/src/find.spec.ts Updates focused find spec to stop asserting receiver behavior.
packages/rxjs/src/find-index.ts Removes thisArg overloads and .call dispatch.
packages/rxjs/src/find-index.spec.ts Updates focused findIndex spec to stop asserting receiver behavior.
packages/rxjs/src/filter.ts Removes thisArg overloads and .call dispatch.
packages/rxjs/src/filter.spec.ts Updates focused filter spec to stop asserting receiver behavior.
packages/rxjs/src/every.ts Removes thisArg overloads and .call dispatch.
packages/rxjs/src/every.spec.ts Updates focused every spec to stop asserting receiver behavior.
packages/rxjs/MIGRATION.md Documents removal of thisArg and recommends closures/bind (example needs a small fix).
packages/rxjs/docs/MIGRATION_EVIDENCE_LEDGER.md Updates ledger table to include intentional-divergence classifications.
docs/rxjs-next/RxJS-7-parity.md Updates parity mapping text to remove thisArg? from signatures.
docs/rxjs-next/PROJECT_PLAN.md Records P6.11 completion evidence and session log entry.
docs/rxjs-next/OPEN_QUESTIONS.md Updates overlap narrative to reflect thisArg removal decision.
docs/rxjs-next/DECISIONS.md Adds D-059 and marks earlier thisArg-mentioning decision as superseded.
docs/rxjs-next/COMPATIBILITY.md Updates overlap/compat narrative to remove thisArg and reference D-059.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/rxjs/MIGRATION.md Outdated
Ensures the code snippet will compile and work if someone copy-pastes it.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@benlesh
benlesh merged commit 54796b3 into ReactiveX:master Aug 5, 2026
17 checks passed
@benlesh
benlesh deleted the agent/remove-callback-thisarg branch August 5, 2026 20:15
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