refactor: remove callback thisArg support - #7626
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
thisArgoverloads and.call(thisArg, …)dispatch fromevery,filter,find,findIndex,map, and staticpartition. - Updated focused + ported tests and ported-manifest generation to use closures /
Function.prototype.bindinstead 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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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