emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.47k stars 4.21k forks source link

[Documentation] run.backburner.DEBUG deprecation warning and guides are wrong #20001

Open jacobq opened 2 years ago

jacobq commented 2 years ago

πŸ“™ 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 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.

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).

βž• 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.

BryanCrotaz commented 11 months ago

This is still a problem - I just followed the documentation for 4.12 and got stuck.