Repository navigation
Angular: Derive required inputs from Compodoc's own flag - #35758
Merged
Merged
Conversation
Compodoc reports whether an input is required, and we never read it. We
computed requiredness from the TypeScript-optional marker instead, so every
signal input rendered as required regardless of how it was declared.
Requiredness now comes from Compodoc's flag, with the optional marker still
consulted. Both are needed: Compodoc derives its flag from the presence of the
`required` key in an `@Input({...})` argument rather than its value, so
`@Input({ required: false })` reports itself as required and optional at once,
and only requiring the two to agree keeps that case right.
A `model()` signal's synthesized change output is now always optional. It used
to inherit the requiredness of the input it derives from, which disagreed with
how every real output reads.
Plain decorator inputs still read as required. Compodoc emits neither flag for
them, which is an upstream gap; when it is fixed they correct themselves.
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
WalkthroughChangesAngular requiredness metadata
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
Comment |
valentinpalkovic
force-pushed
the
valentin/sb11-angular-compodoc-package
branch
from
August 5, 2026 00:34
9095526 to
53f1137
Compare
huang-julien
approved these changes
Aug 5, 2026
Contributor
Package BenchmarksCommit: No significant changes detected, all good. 👏 |
4 of 9 tasks
2 tasks done
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.
Closes #28706 (partially)
What I did
Angular components describe whether each input is required, and Storybook was ignoring that. It worked out requiredness from whether the property could be undefined instead, which is a different question. The result was that every signal-based input showed up as required in the props table, even ones with a default value.
Storybook now uses the requiredness the component actually declares. It still checks the optional marker as well, because Compodoc reports an input written as explicitly-not-required as being both required and optional at the same time, and only taking both into account gets that case right.
One related fix: a two-way binding's change event used to be marked required or not depending on the property it belongs to. Events are never required, and every other event already said so.
This does not fix everything in the linked issue. Inputs declared with the older decorator syntax and no explicit requiredness still show as required, because Compodoc does not report anything about them at all. That part has to be fixed upstream in Compodoc and is being worked on separately; once it lands, those inputs correct themselves with no further change here.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
yarn task --task sandbox --start-from auto --template angular-vite/default-tsinput.required()ones still areDocumentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.