The incorrect deprecation warning message seems to be caused by a limitation of the message template wherein the suggested importKey is derived from the dotKey. That is, run.backburner becomes backburner though it should be _backburner.
See https://github.com/jacobq/backburner-debug-test/blob/main/app/app.js#L23-L36
The method specified in the guides produces a deprecation warning in 3.28 and breaks in 4.x.
π Actual Behavior
Following the direction of the guides or the deprecation warning lead to incorrect code.
import { run } from '@ember/runloop';
run.backburner.DEBUG = true;
Neither of these works in Ember 4.x.
π€ Expected Behavior
The guides, deprecation warning, and RFC176 data should all be in agreement and their suggestion should work (not break or produce deprecation warnings).
Deprecation message should say:
Using `run.backburner` has been deprecated. Instead, import the value directly from @ember/runloop:\n\n import { _backburner } from '@ember/runloop'`
but it is missing the _.
Guides should say to do this:
import { _backburner } from '@ember/runloop';
_backburner.DEBUG = true;
It would also be good if the guides could state whether or not this is public API, as it does not appear to be listed publicly in the API docs
β Additional Context
This may, in fact, be a special case of a larger general problem where the old/global property key is not the same as the import key. For example, Ember.run.hasScheduledTimers -> import { _hasScheduledTimers } from '@ember/runloop'; though I didn't test that.
π Describe the Issue
There is conflicting (and just plain wrong) information in the guide pages and deprecation warnings regarding how to enable Backburner debugging.
π¬ Minimal Reproduction
I explored this issue in depth here: https://github.com/jacobq/backburner-debug-test#backburner-debug-test
The incorrect deprecation warning message seems to be caused by a limitation of the message template wherein the suggested
importKey
is derived from thedotKey
. That is,run.backburner
becomesbackburner
though it should be_backburner
. See https://github.com/jacobq/backburner-debug-test/blob/main/app/app.js#L23-L36The method specified in the guides produces a deprecation warning in 3.28 and breaks in 4.x.
π Actual Behavior
Following the direction of the guides or the deprecation warning lead to incorrect code.
import { backburner } from '@ember/runloop'
Guides say to do this:
Neither of these works in Ember 4.x.
π€ Expected Behavior
The guides, deprecation warning, and RFC176 data should all be in agreement and their suggestion should work (not break or produce deprecation warnings).
Deprecation message should say:
but it is missing the
_
.Guides should say to do this:
It would also be good if the guides could state whether or not this is public API, as it does not appear to be listed publicly in the API docs
β Additional Context
This may, in fact, be a special case of a larger general problem where the old/global property key is not the same as the import key. For example,
Ember.run.hasScheduledTimers
->import { _hasScheduledTimers } from '@ember/runloop';
though I didn't test that.