Skip to content

fix(html): support nested svelte each destructuring#9692

Merged
dyc3 merged 1 commit intobiomejs:mainfrom
mkosei:fix/svelte-each-destructuring
Mar 29, 2026
Merged

fix(html): support nested svelte each destructuring#9692
dyc3 merged 1 commit intobiomejs:mainfrom
mkosei:fix/svelte-each-destructuring

Conversation

@mkosei
Copy link
Copy Markdown
Contributor

@mkosei mkosei commented Mar 29, 2026

This PR was created with AI assistance (Codex).

Summary

Fixed nested destructuring in Svelte #each bindings such as [key, { a, b }].

This updates the Svelte binding pattern grammar so nested destructured names are accepted in #each blocks, and adds parser and formatter coverage for the case.

Test Plan

  • just gen-grammar html
  • cargo test -p biome_html_parser each_with_destructuring
  • cargo test -p biome_html_formatter each_with_destructuring
  • just f

just l currently fails in this environment during repo-wide linting in crates unrelated to this change.

Docs

Not applicable.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 29, 2026

🦋 Changeset detected

Latest commit: 1f52a5e

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

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

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-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools L-HTML Language: HTML and super languages labels Mar 29, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 29, 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: fa25d678-b3e1-420e-aa41-1e44c88f1a42

📥 Commits

Reviewing files that changed from the base of the PR and between c17e08e and 1f52a5e.

⛔ Files ignored due to path filters (3)
  • crates/biome_html_formatter/tests/specs/html/svelte/each_with_destructuring.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/ok/svelte/each_with_destructuring.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_syntax/src/generated/nodes.rs is excluded by !**/generated/**, !**/generated/** and included by **
📒 Files selected for processing (6)
  • .changeset/fix-svelte-each-nested-destructuring.md
  • crates/biome_html_formatter/src/svelte/any/binding_assignment_binding.rs
  • crates/biome_html_formatter/tests/specs/html/svelte/each_with_destructuring.svelte
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/each_with_destructuring.svelte
  • xtask/codegen/html.ungram

Walkthrough

This change extends Svelte #each block parsing and formatting to support nested destructuring patterns such as [key, { a, b }]. The updates modify the HTML parser to recognise and handle square and curly destructuring within binding assignment lists with proper lexer context switching, the grammar to permit AnySvelteDestructuredName in binding assignments, the formatter to process destructured names, and tests in both parser and formatter to validate the new functionality.

Possibly related PRs

Suggested labels

A-Parser, A-Formatter, A-Tooling

Suggested reviewers

  • dyc3
  • ematipico
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding support for nested Svelte each destructuring patterns like [key, { a, b }].
Description check ✅ Passed The description directly relates to the changeset, explaining the nested destructuring fix, grammar updates, and test coverage with specific commands.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 29, 2026

Merging this PR will not alter performance

✅ 67 untouched benchmarks
⏩ 161 skipped benchmarks1


Comparing mkosei:fix/svelte-each-destructuring (1f52a5e) with main (63fcbb3)2

Open in CodSpeed

Footnotes

  1. 161 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.

  2. No successful run was found on main (e4687fe) during the generation of this report, so 63fcbb3 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@dyc3 dyc3 merged commit 61b7ec5 into biomejs:main Mar 29, 2026
18 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter A-Parser Area: parser A-Tooling Area: internal tools L-HTML Language: HTML and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants