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
- Agree how to trigger errors
- Document that on the Drupal core deprecation policy