-
-
Notifications
You must be signed in to change notification settings - Fork 781
feat(parse/html/vue): parse v-slot shorthand syntax #8226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 6aceb12 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
WalkthroughAdds explicit support for Vue v-slot shorthand ( Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (9)
📒 Files selected for processing (12)
🚧 Files skipped from review as they are similar to previous changes (10)
🧰 Additional context used🧬 Code graph analysis (2)crates/biome_html_formatter/src/generated.rs (1)
crates/biome_html_parser/src/syntax/mod.rs (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🔇 Additional comments (4)
Comment |
da06f37 to
d803d0e
Compare
crates/biome_html_parser/tests/html_specs/ok/vue/v-slot-shorthand.vue.snap
Show resolved
Hide resolved
d803d0e to
cd399eb
Compare
| // is there any trivia after the hash and before argument? | ||
| if let Some(last_trivia) = p.source().trivia_list.last() | ||
| && pos < last_trivia.text_range().start() | ||
| { | ||
| // `# slot="5"` is not valid syntax | ||
| // but we want to recover gracefully | ||
| p.error(expected_vue_directive_argument(p, last_trivia.text_range())); | ||
| return Present(m.complete(p, VUE_BOGUS_DIRECTIVE)); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently don't handle this for the other shorthand syntaxes. I left it out of this PR for brevity. Will fix in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently don't handle this for the other shorthand syntaxes. I left it out of this PR for brevity. Will fix in another PR.
Optionally, we could evaluate syntax rules for these cases. I believe they would be easier to implement, because the current solutions feel more like a hack
cd399eb to
6aceb12
Compare
Summary
Lets the HTML parser handle v-slot shorthand syntax:
<template #foo>fixes #8222
Test Plan
added snapshot tests
Docs