deprecate is not available from `@ember/debug` pre 4.0.0
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- babel, javascript
- 领域
- build-system, tooling
调研方向
从链接的复现仓库开始,运行 ember test 以确认报告的行为。跟踪 @ember/debug 的导入,经过 babel-plugin-ember-modules-api-polyfill 以及 ember-cli-babel 的测试或场景套件;当 4.0 之前的应用能够导入 deprecate,且不会挂起或出现缺少导出的构建错误时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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:
// app/app.js
import { deprecate } from '@ember/debug';
console.log(deprecate);
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-addon
over 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):
ERROR in ../../ember-resources/dist/deprecated-in-v4/use.js
Module build failed (from ../../node_modules/.pnpm/[email protected]_9351ded4f79a023849d74b5df047d562/node_modules/babel-loader/lib/index.js):
SyntaxError: /✂️/ember-resources/ember-resources/dist/deprecated-in-v4/use.js: @ember/debug does not have a deprecate export
1 | import { getValue } from '@glimmer/tracking/primitives/cache';
> 2 | import { deprecate, assert } from '@ember/debug';
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 | import { invokeHelper } from '@ember/helper';
4 | import { normalizeThunk } from './utils.js';
5 |
at File.buildCodeFrameError (/✂️/ember-resources/node_modules/.pnpm/@[email protected][email protected]/node_modules/@babel/core/lib/transformation/file/file.js:249:12)
at NodePath.buildCodeFrameError (/✂️/ember-resources/node_modules/.pnpm/@[email protected][email protected]/node_modules/@babel/traverse/lib/path/index.js:143:21)
at /✂️/ember-resources/node_modules/.pnpm/[email protected]/node_modules/babel-plugin-ember-modules-api-polyfill/src/index.js:228:20
at Array.forEach (<anonymous>)
at processImportDeclaration (/✂️/ember-resources/node_modules/.pnpm/[email protected]/node_modules/babel-plugin-ember-modules-api-polyfill/src/index.js:188:16)
at PluginPass.ImportDeclaration (/✂️/ember-resources/node_modules/.pnpm/[email protected]/node_modules/babel-plugin-ember-modules-api-polyfill/src/index.js:321:9)
at newFn (/✂️/ember-resources/node_modules/.pnpm/@[email protected][email protected]/node_modules/@babel/traverse/lib/visitors.js:177:21)
at NodePath._call (/✂️/ember-resources/node_modules/.pnpm/@[email protected][email protected]/node_modules/@babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/✂️/ember-resources/node_modules/.pnpm/@[email protected][email protected]/node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/✂️/ember-resources/node_modules/.pnpm/@[email protected][email protected]/node_modules/@babel/traverse/lib/path/context.js:100:31)
@ ../../ember-resources/dist/index.js 1:263-306 1:263-306
@ ../../../../../../../tmp/broccoli-2446401zQEKH5Rl0yks/cache-323-webpack_bundler_ember_auto_import_webpack/tests.js 15:49-75}
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 failing
test 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
- 主要语言
- JavaScript
- 星标
- 151
- 派生
- 115
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
emberjs/ember-cli-babel 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
emberjs/ember-cli-babel#508 ·
-
Add support for Babel v8可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 38/100
emberjs/ember-cli-babel#535 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
emberjs/ember-cli-babel#533 ·
-
难度 4/5 3-5 天 新手友好度 35/100
emberjs/ember-cli-babel#519 · 6 条评论 · 8 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 35/100
emberjs/ember-cli-babel#517 ·
查看 emberjs/ember-cli-babel 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
Graphify-Labs/graphify#4860 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
CommandCodeAI/command-code#1088 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
CanadaHonk/porffor#426 ·
-
难度 2/5 1-3 小时 新手友好度 66/100
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
RIT-Software-Engineering/RIT-SE-Senior-Project#546 ·
维护者通常 1 天内回复