Skip to content

feat(config): expose html.parser.vue#9366

Open
dyc3 wants to merge 3 commits intonextfrom
dyc3/html-parser-vue-config
Open

feat(config): expose html.parser.vue#9366
dyc3 wants to merge 3 commits intonextfrom
dyc3/html-parser-vue-config

Conversation

@dyc3
Copy link
Copy Markdown
Contributor

@dyc3 dyc3 commented Mar 6, 2026

Summary

This option was supposed to be exposed, and is referenced in error messages, but it was not exposed.

Test Plan

added cli tests

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 6, 2026

🦋 Changeset detected

Latest commit: 4b6f882

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@biomejs/biome Minor
@biomejs/cli-win32-x64 Minor
@biomejs/cli-win32-arm64 Minor
@biomejs/cli-darwin-x64 Minor
@biomejs/cli-darwin-arm64 Minor
@biomejs/cli-linux-x64 Minor
@biomejs/cli-linux-arm64 Minor
@biomejs/cli-linux-x64-musl Minor
@biomejs/cli-linux-arm64-musl Minor
@biomejs/wasm-web Minor
@biomejs/wasm-bundler Minor
@biomejs/wasm-nodejs Minor
@biomejs/backend-jsonrpc Patch
@biomejs/js-api Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added A-Project Area: project A-Parser Area: parser L-HTML Language: HTML and super languages labels Mar 6, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 6, 2026

Merging this PR will degrade performance by 73.51%

❌ 4 regressed benchmarks
✅ 64 untouched benchmarks
⏩ 188 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
html_analyzer[real/wikipedia-fr-Guerre_de_Canudos.html] 450.6 ms 1,488 ms -69.72%
html_analyzer[real/wikipedia-Unix.html] 166.2 ms 592.3 ms -71.94%
html_analyzer[index_1033418810622582172.html] 469.2 µs 1,349.7 µs -65.23%
html_analyzer[real/wikipedia-JavaScript.html] 189.3 ms 714.5 ms -73.51%

Comparing dyc3/html-parser-vue-config (4b6f882) with next (aaf4af0)

Open in CodSpeed

Footnotes

  1. 188 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@dyc3 dyc3 force-pushed the dyc3/html-parser-vue-config branch from 76ac82f to e4b6fea Compare March 6, 2026 12:04
@github-actions github-actions Bot added the A-CLI Area: CLI label Mar 6, 2026
@dyc3 dyc3 force-pushed the dyc3/html-parser-vue-config branch from e4b6fea to 0bbda9e Compare March 6, 2026 12:07
@dyc3 dyc3 marked this pull request as ready for review March 6, 2026 12:19
Copy link
Copy Markdown
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to have a discussion about the applicability of this option.

I think it's safer to target only .html files, not .astro and .svelte.

However, if we've set on this, we need to document how users can opt out.

Also, there must be a docs PR

Comment thread .changeset/expose-html-parser-vue-option.md Outdated
Comment thread crates/biome_configuration/src/html.rs Outdated
@dyc3 dyc3 added this to the Biome v2.5 milestone Mar 7, 2026
@dyc3 dyc3 force-pushed the dyc3/html-parser-vue-config branch from 26d2dd3 to 41db234 Compare March 22, 2026 17:25
@github-actions github-actions Bot added A-Linter Area: linter A-Tooling Area: internal tools A-LSP Area: language server protocol L-JavaScript Language: JavaScript and super languages L-CSS Language: CSS and super languages L-JSON Language: JSON and super languages A-Diagnostic Area: diagnostocis L-Grit Language: GritQL A-Resolver Area: resolver labels Mar 22, 2026
@dyc3 dyc3 changed the base branch from main to next March 22, 2026 17:27
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ce5135c2-2e56-4550-bece-95e366445d2e

📥 Commits

Reviewing files that changed from the base of the PR and between fc44d5f and 4b6f882.

⛔ Files ignored due to path filters (2)
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (5)
  • .changeset/expose-html-parser-vue-option.md
  • crates/biome_configuration/src/html.rs
  • crates/biome_service/src/lib.rs
  • crates/biome_service/src/settings.rs
  • crates/biome_service/src/settings.tests.rs
✅ Files skipped from review due to trivial changes (1)
  • .changeset/expose-html-parser-vue-option.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/biome_service/src/settings.rs
  • crates/biome_configuration/src/html.rs
  • crates/biome_service/src/settings.tests.rs

Walkthrough

This PR exposes the html.parser.vue configuration option, adds a boolean HtmlParseVue type and an optional vue field on HtmlParserConfiguration, threads the setting into HtmlParserSettings and HtmlParserOptions (including a set_vue mutator), and updates service settings so Vue parsing is only enabled for HTML inputs. Tests were added to verify Vue directive parsing is enabled for .html and remains disabled for .astro/.svelte. The test_utils module compilation gating was broadened for test builds.

Possibly related PRs

Suggested reviewers

  • ematipico
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main objective: exposing the previously hidden html.parser.vue configuration option.
Description check ✅ Passed The description accurately explains the motivation (exposing a referenced but unexposed option) and notes that CLI tests were added for validation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dyc3/html-parser-vue-config

Comment @coderabbitai help to get the list of available commands and usage tips.

@dyc3 dyc3 self-assigned this Apr 25, 2026
@dyc3 dyc3 force-pushed the dyc3/html-parser-vue-config branch from 41db234 to fc44d5f Compare April 26, 2026 13:22
@dyc3 dyc3 requested a review from ematipico April 26, 2026 13:22
@github-actions github-actions Bot removed the A-Linter Area: linter label Apr 26, 2026
@github-actions github-actions Bot removed A-Tooling Area: internal tools A-LSP Area: language server protocol L-CSS Language: CSS and super languages A-Diagnostic Area: diagnostocis L-Grit Language: GritQL A-Resolver Area: resolver labels Apr 26, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/biome_cli/tests/cases/html.rs`:
- Around line 444-528: The two tests should only differ by the parser.vue flag;
update the should_error_when_vue_is_disabled test so its biome.json parser block
explicitly sets "interpolation": true (and "vue": false) to match
should_not_error_when_vue_is_enabled except for vue, ensuring the regression is
isolated; locate the test function should_error_when_vue_is_disabled and adjust
the JSON under the Utf8Path::new("biome.json") insert so parser.interpolation is
true while parser.vue is false, keeping linter.enabled true and leaving
run_cli/Args/SnapshotPayload usage unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4c196fb7-4a0c-4ded-8a73-0fea02836c70

📥 Commits

Reviewing files that changed from the base of the PR and between 2093e3e and fc44d5f.

⛔ Files ignored due to path filters (4)
  • crates/biome_cli/tests/snapshots/main_cases_html/should_error_when_vue_is_disabled.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_html/should_not_error_when_vue_is_enabled.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (7)
  • .changeset/expose-html-parser-vue-option.md
  • crates/biome_cli/tests/cases/html.rs
  • crates/biome_configuration/src/html.rs
  • crates/biome_html_parser/src/parser.rs
  • crates/biome_service/src/file_handlers/html.rs
  • crates/biome_service/src/settings.rs
  • crates/biome_service/src/settings.tests.rs

Comment on lines +444 to +528
#[test]
fn should_error_when_vue_is_disabled() {
let fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

let html_file = Utf8Path::new("file.html");
fs.insert(
html_file.into(),
r#"<div v-if="show">{{ message }}</div>
"#
.as_bytes(),
);
fs.insert(
Utf8Path::new("biome.json").into(),
r#"{
"html": {
"linter": {
"enabled": true
}
}
}"#
.as_bytes(),
);

let (fs, result) = run_cli(
fs,
&mut console,
Args::from(["lint", html_file.as_str()].as_slice()),
);

assert!(result.is_err(), "run_cli returned {result:?}");

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"should_error_when_vue_is_disabled",
fs,
console,
result,
));
}

#[test]
fn should_not_error_when_vue_is_enabled() {
let fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

let html_file = Utf8Path::new("file.html");
fs.insert(
html_file.into(),
r#"<div v-if="show">{{ message }}</div>
"#
.as_bytes(),
);
fs.insert(
Utf8Path::new("biome.json").into(),
r#"{
"html": {
"parser": {
"vue": true,
"interpolation": true
},
"linter": {
"enabled": true
}
}
}"#
.as_bytes(),
);

let (fs, result) = run_cli(
fs,
&mut console,
Args::from(["lint", html_file.as_str()].as_slice()),
);

assert!(result.is_ok(), "run_cli returned {result:?}");

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"should_not_error_when_vue_is_enabled",
fs,
console,
result,
));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Vue toggle tests are coupled to interpolation and can mask regressions.

Right now the “disabled” case can fail purely because interpolation is off, even if Vue parsing wiring breaks. Please isolate the variable under test so only parser.vue differs.

Suggested test adjustment
@@
-        r#"<div v-if="show">{{ message }}</div>
+        r#"<div v-if="show"></div>
 "#
@@
     "html": {
+        "parser": {
+            "interpolation": true
+        },
         "linter": {
             "enabled": true
         }
@@
-        r#"<div v-if="show">{{ message }}</div>
+        r#"<div v-if="show"></div>
 "#
@@
         "parser": {
             "vue": true,
             "interpolation": true
         },

As per coding guidelines: “All code changes MUST include appropriate tests … and bug fixes require tests that reproduce and validate the fix.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_cli/tests/cases/html.rs` around lines 444 - 528, The two tests
should only differ by the parser.vue flag; update the
should_error_when_vue_is_disabled test so its biome.json parser block explicitly
sets "interpolation": true (and "vue": false) to match
should_not_error_when_vue_is_enabled except for vue, ensuring the regression is
isolated; locate the test function should_error_when_vue_is_disabled and adjust
the JSON under the Utf8Path::new("biome.json") insert so parser.interpolation is
true while parser.vue is false, keeping linter.enabled true and leaving
run_cli/Args/SnapshotPayload usage unchanged.

@dyc3 dyc3 force-pushed the dyc3/html-parser-vue-config branch from fc44d5f to 4b6f882 Compare April 26, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Parser Area: parser A-Project Area: project L-HTML Language: HTML and super languages L-JavaScript Language: JavaScript and super languages L-JSON Language: JSON and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants