Repository navigation
Conversation
KazariEX
approved these changes
Jul 24, 2026
KazariEX
reviewed
Jul 24, 2026
Co-authored-by: Amulet Kerria <85992002+KazariEX@users.noreply.github.com>
Merged
2 of 9 tasks
pull Bot
pushed a commit
to Ballalhossaintalukder/storybook
that referenced
this pull request
Jul 31, 2026
vue-component-meta stringifies a TS enum member to its qualified name
("Severity.Info"), which says nothing about what gets passed to the
component. storybookjs#35565 therefore had to keep enums out of Controls entirely:
an enum sbType would have made a select inject the literal string
"Severity.Info" instead of 'info'.
vuejs/language-tools#6131, released in vue-component-meta 3.3.9, adds a
"literal" schema node carrying the runtime value next to the member name.
Consume it: TS enums now resolve to an enum sbType of their runtime values,
with control.labels mapping each value back to the member name it is
written as. Picking "Severity.Info" in the dropdown passes 'info'; numeric
enums pass 0 and 1. table.type.summary keeps the enum name either way.
The dotted-string guard stays, narrowed to what it actually catches now:
unresolved qualified type names like "typeof Config.alpha", which
stringify with a dot but stand for no value.
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.
TS enum members currently resolve to their qualified name only (
"MyEnum.Small"), becauseresolveSchemafalls through totypeToString. The runtime value is lost, even though the type checker has it at that exact spot (subtype.valueon the literal type).Consumers cannot recover the values without running their own type checker over the user's project. For docs tooling this matters: Storybook, for example, generates a select control from enum schemas, and with only the member names available it either injects the literal string
"MyEnum.Small"into the component (wrong value) or has to drop the control entirely (storybookjs/storybook#35565).This PR adds a
literalschema node for enum member types:valueis printed like literal-union members already are: strings quoted, numbers bare.TypeFlags.EnumLiteralliteral types only: Plain literal unions ('a' | 'b') keep their existing string form, so existing consumers are unaffected there.PropertyMetaSchemagains one variant:{ kind: 'literal'; type: string; value: string }.reference-type-propsfixture with a new assertion; the numeric enum snapshot and the tsc dts snapshot are updated accordingly.