`installV3ShadowPiercer` ignores `opts.debug` — debug logging always enabled
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- devtools
Research direction
Start in packages/core/lib/v3/dom/piercer.runtime.ts at installV3ShadowPiercer and inspect how opts.debug is currently handled. Verify that the default disables attachShadow logging, while explicitly enabling debug preserves it. Done means the option controls the logging behavior without changing other shadow-piercer options.
Written by the indexing model from the issue text.
Description
Bug:installV3ShadowPiercer 中的 opts.debug 被忽略
文件: packages/core/lib/v3/dom/piercer.runtime.ts
V3ShadowPatchOptions 接口中定义了一个 debug?: boolean 选项:
export interface V3ShadowPatchOptions {
debug?: boolean;
tagExisting?: boolean;
}
但是,installV3ShadowPiercer 并没有使用 opts.debug,而是将
DEBUG 硬编码为 true,并在注释中也承认了这一点:
export function installV3ShadowPiercer(opts: V3ShadowPatchOptions = {}): void {
// hardcoded debug (remove later if desired)
const DEBUG = true;
这意味着无论调用方传入什么参数,console.info("[v3-piercer] attachShadow", ...)
都会在每次调用 attachShadow 时触发,V3ShadowPatchOptions 中的 debug 字段实际上成为了一个无效(未被使用)的 API。
期望行为:
DEBUG 应该基于 opts.debug ?? false 来设置,从而允许调用方控制日志输出的详细程度。
建议修复:
const DEBUG = opts.debug ?? false;
- Dominant language
- TypeScript
- Stars
- 24.6k
- Forks
- 1.7k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 62
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from browserbase/stagehand
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
browserbase/stagehand#2918 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
browserbase/stagehand#2910 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
browserbase/stagehand#2844 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
browserbase/stagehand#2735 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
browserbase/stagehand#2734 ·
All issues in browserbase/stagehand
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·