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

refactor(core): deprecate NgProbeToken #51396

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions aio/content/guide/deprecations.md
Expand Up @@ -130,6 +130,7 @@ v16 - v19
| Area | API or Feature | Deprecated in | May be removed in |
|:--- |:--- |:--- |:--- |
| `@angular/core` | `PACKAGE_ROOT_URL` | v17 | v19 |
| `@angular/core` | `NgProbeToken` | v17 | v19 |

### Deprecated features with no planned removal version

Expand Down Expand Up @@ -187,6 +188,7 @@ In the [API reference section](api) of this site, deprecated APIs are indicated
| [`providedIn: 'any'`](api/core/Injectable#providedIn) | none | v15 | This option has confusing semantics and nearly zero usage. |
| [`EnvironmentInjector.runInContext`](api/core/EnvironmentInjector#runInContext) | `runInInjectionContext` | v16 | `runInInjectionContext` is a more flexible operation which supports element injectors as well |
| [`@Component.moduleId`](api/core/Component#moduleId) | none | v16 |
| [`NgProbeToken`](api/core/NgProbeToken) | none | v16 | `ng.prob` was replaced by `ng.getComponent` since Ivy


<a id="testing"></a>
Expand Down
2 changes: 1 addition & 1 deletion goldens/public-api/core/index.md
Expand Up @@ -1036,7 +1036,7 @@ export abstract class NgModuleRef<T> {
abstract onDestroy(callback: () => void): void;
}

// @public
// @public @deprecated
export class NgProbeToken {
constructor(name: string, token: any);
// (undocumented)
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/application_ref.ts
Expand Up @@ -151,6 +151,7 @@ export function isBoundToModule<C>(cf: ComponentFactory<C>): boolean {
/**
* A token for third-party components that can register themselves with NgProbe.
*
* @deprecated
* @publicApi
*/
export class NgProbeToken {
Expand Down
7 changes: 1 addition & 6 deletions packages/router/src/router_module.ts
Expand Up @@ -7,7 +7,7 @@
*/

import {HashLocationStrategy, Location, LocationStrategy, PathLocationStrategy, ViewportScroller} from '@angular/common';
import {APP_BOOTSTRAP_LISTENER, ComponentRef, inject, Inject, InjectionToken, ModuleWithProviders, NgModule, NgProbeToken, NgZone, Optional, Provider, SkipSelf, ɵRuntimeError as RuntimeError} from '@angular/core';
import {APP_BOOTSTRAP_LISTENER, ComponentRef, inject, Inject, InjectionToken, ModuleWithProviders, NgModule, NgZone, Optional, Provider, SkipSelf, ɵRuntimeError as RuntimeError} from '@angular/core';

import {EmptyOutletComponent} from './components/empty_outlet';
import {RouterLink} from './directives/router_link';
Expand Down Expand Up @@ -55,10 +55,6 @@ export const ROUTER_PROVIDERS: Provider[] = [
[],
];

export function routerNgProbeToken() {
return new NgProbeToken('Router', Router);
}

/**
* @description
*
Expand Down Expand Up @@ -123,7 +119,6 @@ export class RouterModule {
config?.useHash ? provideHashLocationStrategy() : providePathLocationStrategy(),
provideRouterScroller(),
config?.preloadingStrategy ? withPreloading(config.preloadingStrategy).ɵproviders : [],
{provide: NgProbeToken, multi: true, useFactory: routerNgProbeToken},
config?.initialNavigation ? provideInitialNavigation(config) : [],
config?.bindToComponentInputs ? withComponentInputBinding().ɵproviders : [],
provideRouterInitializer(),
Expand Down