@umbraco-cms/backoffice
    Preparing search index...

    Helper class for deprecation warnings.

    UmbDeprecation

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Logs a deprecation warning to the console, annotated with the likely caller origin (Umbraco core, an /App_Plugins package, or other custom code). Core-origin warnings are suppressed in production builds, where a consumer cannot act on them.

      Parameters

      • Optionaloptions: { logAlways?: boolean } = {}

        Options for the warning message.

        • OptionallogAlways?: boolean

          If true, the warning is always logged regardless of origin (defaults to false).

      Returns void

      UmbDeprecation

      const deprecation = new UmbDeprecation({
      deprecated: 'The "foo" function is deprecated.',
      removeInVersion: '2.0.0',
      solution: 'Use the "bar" function instead.'
      });
      deprecation.warn();