Add console.log() %c support for parity with browsers, Deno, and Bun
未关闭
还没有人认领这个 Issue。
console
stale
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 272
描述
would be fixed by https://github.com/nodejs/node/pull/49205
My attempt at a compat table of ANSI and %c:
| %c | ANSI | |
|---|---|---|
| Node.js | ❌ | ☑️ |
| Deno | ☑️ | ☑️ |
| Bun | ☑️ | ☑️ |
| Chrome | ☑️ | ☑️ |
| Firefox | ☑️ | ❌ |
| Safari | ☑️ | ? |
Why this would be a good idea:
- Feature parity with other desktop JavaScript runtimes like Deno and Bun
- Allow documentation authors to recommend using %c instead of ANSI for more compatibility without "%c works everywhere except Node.js" clauses
- %c is ignored in unsupported environments (like current Node.js) whereas ANSI causes jargon to be printed (particularly in Firefox). Thus, encouraging %c is more "progressive enhancement" or "graceful degradation" than ANSI ??
basically just "everyone else is doing it, so it's probably a good idea to conform to what users expect"
previous issue https://github.com/nodejs/node/issues/29605
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 pull request #49205 和之前的 issue #29605 开始,然后检查其中确定的任何 console.log 格式化入口或测试。当 Node.js 按照本 issue 中描述的行为一致地支持 console.log() 的 %c 格式化时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, node.js
- 领域
- cli
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100