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

Export all core APIs from rxjs module directly. #6242

Closed
benlesh opened this issue Apr 20, 2021 · 6 comments
Closed

Export all core APIs from rxjs module directly. #6242

benlesh opened this issue Apr 20, 2021 · 6 comments
Labels
7.x Issues and PRs for version 7.x

Comments

@benlesh
Copy link
Member

benlesh commented Apr 20, 2021

Given the issue #6067 seems to be fairly difficult to solve, and given that we have renamed everything such that there are no conflicts between things like concat the creation function, and concat the operator, etc. Maybe it's time we talk about exporting all primary APIs from rxjs proper.

  1. It's a non-breaking change.
  2. It's the direction we've all discussed going many times.
  3. It's easier to deal with, overall.

I'm talking about:

import { of, interval, take, concatWith, map } from 'rxjs';

interval(1000).pipe(
  take(3),
  concatWith(of('done')),
  map(x => `Tick: ${x}`)
)
@benlesh benlesh added the AGENDA ITEM Flagged for discussion at core team meetings label Apr 20, 2021
@benlesh
Copy link
Member Author

benlesh commented Apr 20, 2021

Oh, and to be clear, I'm not talking about rxjs/ajax, rxjs/fetch, rxjs/webSocket, or rxjs/testing. Overtime maybe those should be their own modules I'm not sure. For now, though, I wouldn't include them in this. I'm just talking about creation functions, subjects, operators, and schedulers.

@kolodny
Copy link
Member

kolodny commented Apr 20, 2021

Isn't concat in both 'rxjs' and 'rxjs/operators'? Granted the operator is deprecated but will that be confusing to folks who assume everything is smooshed together?

@benlesh
Copy link
Member Author

benlesh commented Apr 20, 2021

@kolodny we'd only move the newer name of the concat operator, which is concatWith.

@LayZeeDK
Copy link

Any notable effect on tree-shaking or overall TypeScript compilation speed?

@benlesh
Copy link
Member Author

benlesh commented Apr 21, 2021

Core Team Meeting: General core team approval

  • Doesn't need to be aligned with v7. Could be Minor release later.

@benlesh benlesh removed the AGENDA ITEM Flagged for discussion at core team meetings label Apr 21, 2021
@tmair
Copy link
Contributor

tmair commented May 1, 2021

Just as a side note. This change could also enable the use of API Extractor at least for the rxjs import location. The tool might help to automate detection of changes to the API surface of the library.

@cartant cartant added the 7.x Issues and PRs for version 7.x label May 7, 2021
benlesh added a commit to benlesh/rxjs that referenced this issue Jun 21, 2021
benlesh added a commit that referenced this issue Jul 5, 2021
* feat: operators are all exported at the top level, from "rxjs".

Related #6242

* chore: update golden files

* chore: fix symbol type on symbol observable
akunzai added a commit to akunzai/react-boilerplate that referenced this issue Jul 12, 2021
@benlesh benlesh closed this as completed Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.x Issues and PRs for version 7.x
Projects
None yet
Development

No branches or pull requests

5 participants