Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pipe): signature for arbitrary array of T->T operations #7394

Closed
wants to merge 4 commits into from
Closed

feat(pipe): signature for arbitrary array of T->T operations #7394

wants to merge 4 commits into from

Conversation

jeengbe
Copy link

@jeengbe jeengbe commented Dec 1, 2023

Description:

Sometimes, you have an array of MonoTypeOperatorFunction<T> (e.g. a list of independent filters), and currently the only way of doing this is as follows:

// @ts-expect-error -- RxJS provides no signature for 'pipe<T>(...operations: readonly MonoTypeOperatorFunction<T>[]): Observable<T>;'
.pipe(...filters)

This PR adds an additional signature for this use-case.

Related issue:

Maybe #3989

@jeengbe
Copy link
Author

jeengbe commented Dec 4, 2023

Hi @ whoever approved the pipeline

the issue is not mine but something with the pipeline

Error: node_modules/typescript/lib/lib.es2015.collection.d.ts(62,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.iterable.d.ts(162,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts(140,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/@types/lodash/index.d.ts(372,15): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.collection.d.ts(62,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.iterable.d.ts(162,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts(140,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/@types/lodash/index.d.ts(372,15): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.collection.d.ts(62,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.iterable.d.ts(162,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts(140,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/@types/lodash/index.d.ts(372,15): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.collection.d.ts(62,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.iterable.d.ts(162,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts(140,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/@types/lodash/index.d.ts(372,15): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.collection.d.ts(62,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.iterable.d.ts(162,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts(140,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/@types/lodash/index.d.ts(372,15): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.collection.d.ts(62,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.iterable.d.ts(162,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts(140,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/@types/lodash/index.d.ts(372,15): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.collection.d.ts(62,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.iterable.d.ts(162,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts(140,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: node_modules/@types/lodash/index.d.ts(372,15): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
Error: Process completed with exit code 1.

@benlesh
Copy link
Member

benlesh commented Dec 4, 2023

I think the updated CI rules for our master branch are conflicting with this branch. We'll take a look soon.

@JamesHenry
Copy link
Contributor

All current issues on the 7.x branch relate to the same problem - the code has stayed the same, but it is trying to be run with tooling which has since evolved. This PR fixes the existing issues:

#7398

If @benlesh agrees with the rationale/approach it can be merged before this one and this one rebased on top

@benlesh
Copy link
Member

benlesh commented Dec 12, 2023

Yeah if you rebase, everything will run now. Thank you, @JamesHenry .

@jeengbe
Copy link
Author

jeengbe commented Dec 17, 2023

Let's try the pipeline again 🙂

@jeengbe
Copy link
Author

jeengbe commented Dec 20, 2023

This time 🚀

@jeengbe
Copy link
Author

jeengbe commented Dec 26, 2023

Let's run it once more 🙂 @benlesh

@jeengbe
Copy link
Author

jeengbe commented Dec 26, 2023

Time to run it locally and wait for npm... I had aborted the clone at 100MB and hoped the code would work out of the box. Sorry for the inconvenience.

@jeengbe
Copy link
Author

jeengbe commented Dec 26, 2023

Hmm It's an issue with TS 4

image

That's the supposedly failing test

ERROR: /home/jeengbe/rxjs/spec-dtslint/Observable-spec.ts:86:5 - Expected type to be: Observable<"foo">; got: Observable<string>

@jeengbe
Copy link
Author

jeengbe commented Dec 26, 2023

Now; success guaranteed 🙂

@benlesh
Copy link
Member

benlesh commented Jan 4, 2024

We'll need to have the same PR merged to master first, or it's technically a regression. (if 7.x supports this but 8.x does not)

@jeengbe
Copy link
Author

jeengbe commented Jan 4, 2024

Are these types still an issue with 8.x?

@jeengbe jeengbe closed this by deleting the head repository Feb 13, 2024
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.

None yet

3 participants