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

Provide a V7 migration script (e.g. rxjs-6-to-7-migrate) #5843

Closed
2 tasks
yjaaidi opened this issue Oct 21, 2020 · 6 comments
Closed
2 tasks

Provide a V7 migration script (e.g. rxjs-6-to-7-migrate) #5843

yjaaidi opened this issue Oct 21, 2020 · 6 comments

Comments

@yjaaidi
Copy link

yjaaidi commented Oct 21, 2020

Feature Request

It would be nice to provide a migration script like rxjs-5-to-6-migrage to help migrating to V7.
For instance, it could transform source$.toPromise() to lastValueFrom(source$).

Why

The script should not cover breaking changes only; it should also cover recommendations and deprecations for the following reasons:

  1. migration scripts are not just a way of avoiding breaking changes; they are a way to discover, learn and quickly enjoy the latest features,
  2. what can be automated should be automated if not too expensive and fragile,
  3. most of us won't fix deprecations until they become breaking changes (e.g. on V8 for example) and that's when we get stuck with V7.

What

Which features should be covered by this migration script? Please help me fill this list 🙏

  • replace toPromise by lastValueFrom
  • TODO

How

Should the rules be implemented for both eslint & tslint to https://github.com/cartant/rxjs-tslint-rules and https://github.com/cartant/eslint-plugin-rxjs?
Or should we make a script like rx-5-to-6-migrate (Cf. https://github.com/ReactiveX/rxjs-tslint) based on eslint? 🤔

When

Should this be added to the V7 roadmap: #5795?

@BioPhoton
Copy link
Contributor

To figure out the deprecations u can run https://github.com/ts-chore/deprecation-manager. What is missing ATM is detection of breaking changes...

@benlesh
Copy link
Member

benlesh commented Nov 2, 2020

This would be fantastic. But we don't have the engineering hours to support an effort like this. Development here is 100% volunteer. The last time we had migration scripts and compat packages, it was largely provided by contractors and employees paid by Google (via the generosity of the Angular team).

@benlesh
Copy link
Member

benlesh commented Nov 2, 2020

Also, it is worth noting that most of the breaking changes here are related to the generics and types we're using. So most of any migration anyone would need to do would involve no longer using explicit generics (incorrectly)... Like: map<number>(fn), or const s = new Subject<number>(); s.next(); // bad. etc.

@benlesh benlesh closed this as completed Nov 2, 2020
@samal-rasmussen
Copy link
Contributor

samal-rasmussen commented Nov 6, 2020

Can we still do a 6-to-7 migration guide though?

EDIT: This seems to be tracked in #4776.

@yjaaidi
Copy link
Author

yjaaidi commented Nov 17, 2020

Thank you @BioPhoton for the tip.
Thank you @benlesh for the feedback.
Actually, I would like to help and contribute with the migration script. I was just wondering if the right way would be to extend https://github.com/cartant/eslint-plugin-rxjs or should that be a dedicated script.

@undsoft
Copy link

undsoft commented Sep 12, 2022

For anybody coming here looking on an easy way to migrate, you can use prefer-observer from eslint-plugin-rxjs with. automatic fixer.

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

No branches or pull requests

5 participants