From ba1e20a7c2dd452e7176ce672042309cf22a5ad3 Mon Sep 17 00:00:00 2001 From: David LJ Date: Thu, 17 Oct 2024 12:54:56 +0200 Subject: [PATCH] feat: deprecate manager provider APIs v1 (#956) --- projects/ngx-meta/api-extractor/ngx-meta.api.md | 4 ++-- .../docs/content/guides/manage-your-custom-metadata.md | 6 +++--- .../make-metadata-manager-provider-from-setter-factory.ts | 8 ++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/projects/ngx-meta/api-extractor/ngx-meta.api.md b/projects/ngx-meta/api-extractor/ngx-meta.api.md index 1cd73e12..256cc875 100644 --- a/projects/ngx-meta/api-extractor/ngx-meta.api.md +++ b/projects/ngx-meta/api-extractor/ngx-meta.api.md @@ -140,10 +140,10 @@ export interface MakeKeyValMetaDefinitionOptions { valAttr?: string; } -// @public +// @public @deprecated export const makeMetadataManagerProviderFromSetterFactory: (setterFactory: MetadataSetterFactory, opts: MakeMetadataManagerProviderFromSetterFactoryOptions) => FactoryProvider; -// @public +// @public @deprecated export interface MakeMetadataManagerProviderFromSetterFactoryOptions { d?: FactoryProvider['deps']; g?: MetadataResolverOptions['global']; diff --git a/projects/ngx-meta/docs/content/guides/manage-your-custom-metadata.md b/projects/ngx-meta/docs/content/guides/manage-your-custom-metadata.md index 3a7eed79..52419986 100644 --- a/projects/ngx-meta/docs/content/guides/manage-your-custom-metadata.md +++ b/projects/ngx-meta/docs/content/guides/manage-your-custom-metadata.md @@ -114,9 +114,9 @@ You can also check a full example at [example standalone app]'s [`provideCustomM If you need, you can still check [this guide when it was using it](https://github.com/davidlj95/ngx/blob/ngx-meta-v1.0.0-beta.20/projects/ngx-meta/docs/content/guides/manage-your-custom-metadata.md) Or the [example app file using it](https://github.com/davidlj95/ngx/blob/ngx-meta-v1.0.0-beta.20/projects/ngx-meta/example-apps/templates/standalone/src/app/meta-late-loaded/provide-custom-metadata-manager.ts) - Anyway, it's recommended you upgrade to the new one described in the guide as soon as you can. - Otherwise, built-in modules are using the new one. And if you use this, then two functions will end up in - your bundle size that do the same. So some extra unwanted bytes in there. + However, beware that those APIs are now deprecated and will be removed in the future. It's recommended to upgrade to the new one described in the guide as soon as you can. + + Also, built-in modules are using the new one. And if you use this, then two functions will end up in your bundle that do the same. So some extra unneeded bytes in there. ### Using a class diff --git a/projects/ngx-meta/src/core/src/managers/provider/v1/make-metadata-manager-provider-from-setter-factory.ts b/projects/ngx-meta/src/core/src/managers/provider/v1/make-metadata-manager-provider-from-setter-factory.ts index 1e786b59..f5c33001 100644 --- a/projects/ngx-meta/src/core/src/managers/provider/v1/make-metadata-manager-provider-from-setter-factory.ts +++ b/projects/ngx-meta/src/core/src/managers/provider/v1/make-metadata-manager-provider-from-setter-factory.ts @@ -1,3 +1,5 @@ +// noinspection JSDeprecatedSymbols + import { MetadataResolverOptions, NgxMetaMetadataManager, @@ -11,6 +13,9 @@ import { MetadataSetterFactory } from '../metadata-setter-factory' * * See {@link https://ngx-meta.dev/guides/manage-your-custom-metadata/ | manage custom metadata guide} for an example. * + * @deprecated Use {@link provideNgxMetaManager} APIs instead. + * See {@link https://ngx-meta.dev/guides/manage-your-custom-metadata/ | custom metadata guide} for more information. + * * @remarks * * Factory providers are used for built-in modules instead of Angular services. @@ -48,6 +53,9 @@ export const makeMetadataManagerProviderFromSetterFactory = ( /** * Options argument object for {@link makeMetadataManagerProviderFromSetterFactory}. * + * @deprecated Use {@link provideNgxMetaManager} APIs instead. + * See {@link https://ngx-meta.dev/guides/manage-your-custom-metadata/ | custom metadata guide} for more information. + * * @public */ export interface MakeMetadataManagerProviderFromSetterFactoryOptions {