Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292977

Trigger deprecation notifications on JavaScript deprecations to notify developers that deprecated code is being used

$
0
0

Problem/Motivation

#2918868: [policy, no patch] Use a deprecation process for JavaScript similar to what we use for PHP code decided on a standard for documenting deprecated JavaScript code: https://www.drupal.org/core/deprecation#javascript.

The next step is to document a consistent way to trigger deprecation notifications on JavaScript deprecations to notify developers that deprecated code is being used. The error should be clearly visible to developers, and there most likely should be a way to silence the notifications on production environment.

Proposed resolution

Provide Drupal.deprecationWarning and Drupal.deprecateProperty functions for marking classes, methods and properties as deprecated. Provide new Drupal setting suppressDeprecationWarnings for suppressing JavaScript deprecation warnings.

Remaining tasks

  1. Agree how to trigger errors
  2. Document that on the Drupal core deprecation policy

API changes

Release notes snippet


Viewing all articles
Browse latest Browse all 292977

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>