Currently, deprecation warnings are emitted via console.warn and silently allow execution to continue. It would be useful to provide a way to make deprecations throw errors instead, so that users can catch deprecated usage paths in their test suites or CI pipelines before upgrading to the next major version.
This could take the form of a static configuration option, e.g.:
import Keycloak from 'keycloak-js';
Keycloak.throwOnDeprecations = true;
or an init option:
keycloak.init({ throwOnDeprecations: true });
When enabled, any call that would normally emit a deprecation warning would instead throw an error, making it easy to surface deprecated usage in automated testing.
Use case
Teams preparing to upgrade from 26.x to 27.0.0 can enable this in their CI environment to identify all deprecated code paths that will break in the next major, without having to manually grep console output for warnings.
Related
Currently, deprecation warnings are emitted via
console.warnand silently allow execution to continue. It would be useful to provide a way to make deprecations throw errors instead, so that users can catch deprecated usage paths in their test suites or CI pipelines before upgrading to the next major version.This could take the form of a static configuration option, e.g.:
or an init option:
When enabled, any call that would normally emit a deprecation warning would instead throw an error, making it easy to surface deprecated usage in automated testing.
Use case
Teams preparing to upgrade from 26.x to 27.0.0 can enable this in their CI environment to identify all deprecated code paths that will break in the next major, without having to manually grep console output for warnings.
Related