[Toolkit] Read prop and block docs from Twig documentation comments - #3796
Open
Kocal wants to merge 1 commit into
Open
[Toolkit] Read prop and block docs from Twig documentation comments#3796Kocal wants to merge 1 commit into
Kocal wants to merge 1 commit into
Conversation
Kocal
force-pushed
the
toolkit-documentation-comments
branch
2 times, most recently
from
August 19, 2026 20:13
b78bf20 to
6ad67fb
Compare
This comment was marked as low quality.
This comment was marked as low quality.
Kocal
force-pushed
the
toolkit-documentation-comments
branch
2 times, most recently
from
August 24, 2026 11:36
33cea21 to
b16bf31
Compare
Kocal
marked this pull request as ready for review
August 24, 2026 11:37
Kocal
force-pushed
the
toolkit-documentation-comments
branch
from
August 24, 2026 11:37
b16bf31 to
e6a3c78
Compare
Member
Author
|
Waiting for Twig 3.29, and VincentLanglet/Twig-CS-Fixer#461 for making Fabbot happy |
Kocal
force-pushed
the
toolkit-documentation-comments
branch
from
August 24, 2026 11:59
e6a3c78 to
9902262
Compare
The Toolkit used to parse `{# @prop #}` and `{# @block #}`
docblocks with regular expressions. It now reads the same
information straight from Twig's own documentation comments.
Prop type and description come from the new
`PropsNode::getPropDocumentation()` method exposed by
TwigComponent. Block descriptions are read by tokenizing the
template and pulling the documentation attached to each
`{% block %}`, `block(outerBlocks.x)` or `block('x')` token.
This bumps `twig/twig` to `^3.29` and `symfony/ux-twig-component`
to `^3.5`, and updates the linter (`ComponentDocChecker`), the
parser, the `create-kit` scaffold, the kit authoring skill, and
the tests accordingly.
Kocal
force-pushed
the
toolkit-documentation-comments
branch
from
August 30, 2026 21:01
9902262 to
acf606d
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Depends on #3795, twig/twig >= 3.29
The Toolkit now documents kit props and blocks with Twig 3.29's documentation comments instead of the old
{# @prop #}/{# @block #}docblocks, and reads them natively instead of parsing them with regular expressions.Prop type and description come from
PropsNode::getPropDocumentation(). Block descriptions are read by tokenizing the template and pulling the documentation attached to each{% block %},block(outerBlocks.x)orblock('x')token. The linter (ComponentDocChecker), the parser, thecreate-kitscaffold and the kit authoring skill have all been updated to match.All 254 kit component templates are migrated to the new syntax as part of this PR.
The migration is byte-neutral: no snapshot changes, and all kits still lint clean. Block comments sit on their own line above the block and mirror its whitespace-trim (
{##- ... -#}when the block opens with{%-/{{-,{## ... -#}when it opens with{%/{{), so they never change the rendered whitespace.This depends on #3795 and needs Twig 3.29, so it should be merged after that one.