Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(core): remove TestBed.deprecatedOverrideProvider #30576

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

Closed
wants to merge 1 commit into from

Conversation

kara
Copy link
Contributor

@kara kara commented May 20, 2019

BREAKING CHANGE

In PR #19558, we fixed a bug in TestBed.overrideProvider where
eager providers were not being instantiated correctly. However,
it turned out that since this bug had been around for quite a bit,
many apps were relying on the broken behavior where the providers
would not be instantiated. To assist in the transition, the
TestBed.deprecatedOverrideProvider method was temporarily
introduced to mimic the old behavior so that apps would have a
longer time period to migrate their code.

2 years and 3 versions later, it is time to remove the temporary
method. This commit removes TestBed.deprecatedOverrideProvider
altogether. Any usages of TestBed.deprecatedOverrideProvider
should be replaced with TestBed.overrideProvider. This may mean
that providers that were not created before will now be instantiated,
which could mean that your tests need to provide more mocks or stubs
for the dependencies of the newly instantiated providers.

@kara kara force-pushed the deprecatedOverrideProvider branch 2 times, most recently from 6f18717 to 8d7ffe0 Compare May 20, 2019 23:34
@mary-poppins
Copy link

You can preview 6f18717 at https://pr30576-6f18717.ngbuilds.io/.

@kara
Copy link
Contributor Author

kara commented May 20, 2019

presubmit

@kara kara added action: presubmit The PR is in need of a google3 presubmit state: WIP and removed action: presubmit The PR is in need of a google3 presubmit labels May 20, 2019
@mary-poppins
Copy link

You can preview 8d7ffe0 at https://pr30576-8d7ffe0.ngbuilds.io/.

@kara kara removed the aio: preview label May 21, 2019
@kara kara force-pushed the deprecatedOverrideProvider branch from 8d7ffe0 to 70cd7ad Compare May 21, 2019 01:28
@kara kara changed the title WIP: refactor(core): remove TestBed.deprecatedOverrideProvider refactor(core): remove TestBed.deprecatedOverrideProvider May 21, 2019
@kara kara added area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release and removed state: WIP labels May 21, 2019
@ngbot ngbot bot added this to the needsTriage milestone May 21, 2019
@kara kara added the action: presubmit The PR is in need of a google3 presubmit label May 21, 2019
@kara
Copy link
Contributor Author

kara commented May 21, 2019

global presubmit

@kara kara added the action: review The PR is still awaiting reviews from at least one requested reviewer label May 21, 2019
@kara kara marked this pull request as ready for review May 21, 2019 02:04
@kara kara requested review from IgorMinar and a team as code owners May 21, 2019 02:04
@alfaproject
Copy link
Contributor

Refactoring means functionality and especially API surface doesn't change. What you are doing is a feature. Something is being added or removed in this case. (;

Copy link
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

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

lgtm.

confidence note: we've done research in google3 and found no references and while github has over a thousand references they all refer to vendored angular d.ts files. We don't think that anyone is really using these apis and they just take up space and confuse people.

@IgorMinar
Copy link
Contributor

I updated #30400 to reflect this change

@IgorMinar IgorMinar modified the milestones: needsTriage, version 8 May 21, 2019
@kara kara removed the action: presubmit The PR is in need of a google3 presubmit label May 21, 2019
@kara kara added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 21, 2019
@kara
Copy link
Contributor Author

kara commented May 21, 2019

merge-assistance: Igor has global approval and I'm an owner of core

@kara
Copy link
Contributor Author

kara commented May 21, 2019

@alfaproject Yeah, "refactor" doesn't seem quite right, but neither does "feature" (is it really a feature to remove something?). I think it's probably fine for the circumstances, but maybe "fix" would be better? 🤔

Edit: updated to "fix"

BREAKING CHANGE

In PR angular#19558, we fixed a bug in `TestBed.overrideProvider` where
eager providers were not being instantiated correctly. However,
it turned out that since this bug had been around for quite a bit,
many apps were relying on the broken behavior where the providers
would not be instantiated. To assist in the transition, the
`TestBed.deprecatedOverrideProvider` method was temporarily
introduced to mimic the old behavior so that apps would have a
longer time period to migrate their code.

2 years and 3 versions later, it is time to remove the temporary
method. This commit removes `TestBed.deprecatedOverrideProvider`
altogether. Any usages of `TestBed.deprecatedOverrideProvider`
should be replaced with `TestBed.overrideProvider`. This may mean
that providers that were not created before will now be instantiated,
which could mean that your tests need to provide more mocks or stubs
for the dependencies of the newly instantiated providers.
@kara kara force-pushed the deprecatedOverrideProvider branch from 70cd7ad to 28dd132 Compare May 21, 2019 16:58
@kara kara changed the title refactor(core): remove TestBed.deprecatedOverrideProvider fix(core): remove TestBed.deprecatedOverrideProvider May 21, 2019
@jasonaden jasonaden closed this in a96976e May 21, 2019
jasonaden pushed a commit that referenced this pull request May 21, 2019
…#30576)

BREAKING CHANGE

In PR #19558, we fixed a bug in `TestBed.overrideProvider` where
eager providers were not being instantiated correctly. However,
it turned out that since this bug had been around for quite a bit,
many apps were relying on the broken behavior where the providers
would not be instantiated. To assist in the transition, the
`TestBed.deprecatedOverrideProvider` method was temporarily
introduced to mimic the old behavior so that apps would have a
longer time period to migrate their code.

2 years and 3 versions later, it is time to remove the temporary
method. This commit removes `TestBed.deprecatedOverrideProvider`
altogether. Any usages of `TestBed.deprecatedOverrideProvider`
should be replaced with `TestBed.overrideProvider`. This may mean
that providers that were not created before will now be instantiated,
which could mean that your tests need to provide more mocks or stubs
for the dependencies of the newly instantiated providers.

PR Close #30576
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime cla: yes merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants