-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deprecate is not available from @ember/debug
pre 4.0.0
#441
Comments
In trying to fix this, I wound up at: ember-cli/ember-rfc176-data#431 |
So, starting analysis over, as changes to ember-rfc176-data did not fix my issue. The output of ;define("my-app-test-deprecate/app", ["exports", "ember-resolver", "ember-load-initializers", "my-app-test-deprecate/config/environment"], function (_exports, _emberResolver, _emberLoadInitializers, _environment) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
console.log(deprecate);
class App extends Ember.Application {
constructor() {
super(...arguments);
_defineProperty(this, "modulePrefix", _environment.default.modulePrefix);
_defineProperty(this, "podModulePrefix", _environment.default.podModulePrefix);
_defineProperty(this, "Resolver", _emberResolver.default);
}
}
_exports.default = App;
(0, _emberLoadInitializers.default)(App, _environment.default.modulePrefix);
}); which aligns with the current error I'm getting in the stand-alone app / reproduction:
reproduction: https://github.com/NullVoxPopuli/repo-repro-ember-cli-babel-441 |
Changing the "reproduction code" to: import { assert, deprecate } from '@ember/debug';
console.log(deprecate, assert); gives this output: ;define("my-app-test-deprecate/app", ["exports", "ember-resolver", "ember-load-initializers", "my-app-test-deprecate/config/environment"], function (_exports, _emberResolver, _emberLoadInitializers, _environment) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.default = void 0;
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
console.log(deprecate, assert);
class App extends Ember.Application {
constructor() {
super(...arguments);
_defineProperty(this, "modulePrefix", _environment.default.modulePrefix);
_defineProperty(this, "podModulePrefix", _environment.default.podModulePrefix);
_defineProperty(this, "Resolver", _emberResolver.default);
}
}
_exports.default = App;
(0, _emberLoadInitializers.default)(App, _environment.default.modulePrefix);
}); which is weird, cause now assert isn't defined either.... So it seems everything from |
So, this leads me to believe that ember-cli-babel is setting things up correctly, and we need to go deeper. next up: babel plugins! |
goofy thing (maybe correct thing?) with debugging this is that all the dependencies of my linked ember-cli-babel package are relative to that linked package. so I made the mistake of putting breakpoints in my app's babel plugins, but those babel plugins are not in use! |
looks like babel-plugin-debug-macros's goal is to remove imports. 🤔 so the |
this could make sense, if the debug-macros plugin was handling the |
Confirm! if I comment out lines 219, 220, and 221, then Progress! |
but this code was added in 2020.... why am I running in to this now? I need to investigate how |
ah, back in ember-cli-babel: // we have to use the global form when not compiling modules, because it is often used
// in the context of an `app.import` where there is no wrapped in an AMD module
if (!useModulesVersion) {
const ignore = _getEmberModulesAPIIgnore(parent, project);
return [
[require.resolve("babel-plugin-ember-modules-api-polyfill"), { ignore }],
];
} but this was also added in 2020 |
This is the PR that introduced these changes (or changed them): #371 |
but, why am I running in to this now? |
removing
still points at babel-plugin-ember-modules-api-polyfill 🤔 |
bah, I need a break from this 😅 babel stuff is dizzying |
For whomever finds this useful thread, this has been fixed in this dependency: https://github.com/ember-cli/ember-rfc176-data/blob/master/CHANGELOG.md#bug-bug-fix Dependencies that depend on |
I was originally going to report this on the embroider repo, as I had thought it was a v2-addon issue.
But it is not!
reproduction is super easy:
Repro repo: https://github.com/NullVoxPopuli/repo-repro-ember-cli-babel-441
just run
ember test
This was discovered while trying to add
deprecate
usage to a v2-addonover in this PR
In the scenarios test suite, it seems that any interaction from a v2
addon with deprecate from
@ember/debug
causes the test suite to hang.In a real app / addon ( < ember-source @ v4), a different behavior occurs (and what I was
trying to re-create in this change):
According to the docs for
@ember/debug
,deprecate
exists, so the above code should work (I don't yet know why -- first step is a failingtest reproduction, but ran in to the test suite hanging issue.)
For [email protected]+, the above issue is not present -- and judging by
how (I happen to know that) pre 3.27, all ember apis were on the
Ember
global and that embroider has no compat-adapter for
@ember/debug
,my hunch is that this is actually ember-cli-bable related -- but I
wanted to open a test here, since embroider has a much better
"e2e"-style test suite than ember-cli-babel does.
Also, the stack trace shows
babel-plugin-ember-modules-api-polyfill
,which is managed by ember-cli-babel.
however in writing this commit message / PR description_, I've found
that this behavior exists on a vanilla 3.25 app (new as of now).
So since the reproduction is not at all embroider or v2 addon related,
I'm going to post on ember-cli-babel
The text was updated successfully, but these errors were encountered: