You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preserve JSX Istanbul ignore comments when compiling component children, and annotate compiler-generated ref dispatch branches so they do not count toward coverage.
Add /* istanbul ignore next */ annotations to compiler-generated conditional ref dispatches.
Add regression coverage.
How did you test this change?
pnpm --filter @solidjs/babel-plugin exec vitest run
28 test files passed, 259 tests passed
Thanks for taking this on — half of it is exactly what we want, and the diff splits cleanly along that line.
Keep: preserving the user's own pragma. A {/* istanbul ignore next */} the author wrote in JSX should survive onto the get children() getter the compiler emits. That is comment fidelity for a deliberate annotation, and it's the right layer for it. Two asks on this half:
Match c8 ignore alongside istanbul ignore (/^\s*(istanbul|c8)\s+ignore\b/). v8-based coverage is what most Vitest users run now, and it's the same regex.
Oxc parity. The Babel plugin and packages/compiler share codegen expectations; the same carry-through needs to land in the native compiler with the shared fixture before this can merge.
Drop: injecting /* istanbul ignore next */ on the generated ref dispatch. This is the part that touches dom/element.ts, universal/element.ts, and rewrites fourteen fixture outputs, and we don't want it — not for size, on principle:
The compiler would be emitting a specific tool's pragma into every user's output. That's tool knowledge in the wrong layer, and it doesn't stop at one vendor.
Coverage of compiler-generated branches is the coverage tool's problem, and the tools have been solving it: v8 coverage with AST-aware remapping attributes back through the source map to the JSX, where there is no branch. Instrumenting post-compile output with Istanbul is the configuration that produces the phantom branches.
Every injected comment is dev-build bytes for everyone and one more thing both compilers must mirror forever.
If real demand shows up later, an explicit opt-in is the ceiling we'd consider, but we'd rather not add it speculatively.
Also: @solidjs/web#test-types is red on this branch. It's probably the base (next moved on Sep 7); a rebase should tell.
Once it's down to the preserve half + c8 + Oxc parity, happy to merge.
Removed all automatically injected coverage comments from generated ref dispatches.
Preserved only user-authored JSX pragmas, now supporting both istanbul ignore and c8 ignore.
Added Oxc parity for DOM, Universal, and SSR.
Added a shared fixture consumed by the Babel and native compiler regression tests.
Thanks for your review!
nickshiro
changed the title
fix(babel): preserve Istanbul ignore comments in generated output
fix(compiler): preserve coverage pragmas in JSX
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ref #2138
Preserve JSX Istanbul ignore comments when compiling component children, and annotate compiler-generated ref dispatch branches so they do not count toward coverage.
/* istanbul ignore next */annotations to compiler-generated conditionalrefdispatches.How did you test this change?
pnpm --filter @solidjs/babel-plugin exec vitest run
28 test files passed, 259 tests passed
pnpm --filter @solidjs/babel-plugin typecheck