-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(core): Deprecate TestBed.get(...):any #29290
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
Conversation
Note: At head these tests were already failing - //packages/compiler-cli/test:extract_i18n |
// clang-format on | ||
import {ResourceLoader} from '@angular/compiler'; | ||
import {ApplicationInitStatus, COMPILER_OPTIONS, Compiler, CompilerOptions, Component, Directive, ErrorHandler, InjectFlags, InjectionToken, Injector, ModuleWithComponentFactories, NgModule, NgModuleFactory, NgZone, Pipe, PlatformRef, Provider, SchemaMetadata, StaticProvider, Type, resolveForwardRef, ɵInjectableDef as InjectableDef, ɵNG_COMPONENT_DEF as NG_COMPONENT_DEF, ɵNG_DIRECTIVE_DEF as NG_DIRECTIVE_DEF, ɵNG_INJECTOR_DEF as NG_INJECTOR_DEF, ɵNG_MODULE_DEF as NG_MODULE_DEF, ɵNG_PIPE_DEF as NG_PIPE_DEF, ɵNgModuleDef as NgModuleDef, ɵNgModuleFactory as R3NgModuleFactory, ɵNgModuleType as NgModuleType, ɵRender3ComponentFactory as ComponentFactory, ɵRender3NgModuleRef as NgModuleRef, ɵcompileComponent as compileComponent, ɵcompileDirective as compileDirective, ɵcompileNgModuleDefs as compileNgModuleDefs, ɵcompilePipe as compilePipe, ɵflushModuleScopingQueueAsMuchAsPossible as flushModuleScopingQueueAsMuchAsPossible, ɵgetInjectableDef as getInjectableDef, ɵpatchComponentDefWithScope as patchComponentDefWithScope, ɵresetCompiledComponents as resetCompiledComponents, ɵstringify as stringify, ɵtransitiveScopesFor as transitiveScopesFor} from '@angular/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you reformat this? Can you revert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changed because 2 types were added (InjectFlags, InjectionToken) and the format script updated this "changed lines", a recent patch added clang-off so I guess it's not changing anymore (?)
Anyways, done :)
Adds an overload to TestBed.get making parameters strongly typed and deprecated previous signature that accepted types `any`. The function still returns `any` to prevent build breakages, but eventually stronger type checks will be added so a future Angular version will break builds due to additional type checks. See previous breaking change - #13785 Issue #26491
Adds an overload to TestBed.get making parameters strongly typed and deprecated previous signature that accepted types `any`. The function still returns `any` to prevent build breakages, but eventually stronger type checks will be added so a future Angular version will break builds due to additional type checks. See previous breaking change - angular#13785 Issue angular#26491 PR Close angular#29290
Adds an overload to TestBed.get making parameters strongly typed and deprecated previous signature that accepted types `any`. The function still returns `any` to prevent build breakages, but eventually stronger type checks will be added so a future Angular version will break builds due to additional type checks. See previous breaking change - angular#13785 Issue angular#26491 PR Close angular#29290
PR angular#29290 introduced a new `TestBed.get` signature and deprecated the existing one. This raises a lot of TSLint deprecation warnings in projects using a strict TS config (see angular#29905 for context), so we are temporarily removing the `@deprecated` annotation in favor of a plain text warning until we properly fix it. Fixes angular#29905 Fixes FW-1336
PR angular#29290 introduced a new `TestBed.get` signature and deprecated the existing one. This raises a lot of TSLint deprecation warnings in projects using a strict TS config (see angular#29905 for context), so we are temporarily removing the `@deprecated` annotation in favor of a plain text warning until we properly fix it. Fixes angular#29905 Fixes FW-1336
PR angular#29290 introduced a new `TestBed.get` signature and deprecated the existing one. This raises a lot of TSLint deprecation warnings in projects using a strict TS config (see angular#29905 for context), so we are temporarily removing the `@deprecated` annotation in favor of a plain text warning until we properly fix it. Fixes angular#29905 Fixes FW-1336
… overload PR angular#29290 introduced a new `TestBed.get` signature and deprecated the existing one. This raises a lot of TSLint deprecation warnings in projects using a strict TS config (see angular#29905 for context), so we are temporarily removing the `@deprecated` annotation in favor of a plain text warning until we properly fix it. Refs angular#29905 Fixes FW-1336
… overload (#30514) PR #29290 introduced a new `TestBed.get` signature and deprecated the existing one. This raises a lot of TSLint deprecation warnings in projects using a strict TS config (see #29905 for context), so we are temporarily removing the `@deprecated` annotation in favor of a plain text warning until we properly fix it. Refs #29905 Fixes FW-1336 PR Close #30514
… overload (#30514) PR #29290 introduced a new `TestBed.get` signature and deprecated the existing one. This raises a lot of TSLint deprecation warnings in projects using a strict TS config (see #29905 for context), so we are temporarily removing the `@deprecated` annotation in favor of a plain text warning until we properly fix it. Refs #29905 Fixes FW-1336 PR Close #30514
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds an overload to TestBed.get making parameters strongly typed and
deprecated previous signature that accepted types
any
. The functionstill returns
any
to prevent build breakages, but eventually strongertype checks will be added so a future Angular version will break builds
due to additional type checks.
See previous breaking change - #13785
Issue #26491
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #26491
What is the new behavior?
"Same" signature as
Injector.get
:(Instead of returning
T
, it still returnsany
) to prevent breaking changes for 8.0, but this will hopefully break on 9.0Does this PR introduce a breaking change?
Note that the return type is still
any
, this will change to be an actual breaking change similar to #13785 in a future major versionOther information