chore: resolve missing inherited members and fix CEM type overrides#11252
Closed
web-padawan wants to merge 5 commits intomainfrom
Closed
chore: resolve missing inherited members and fix CEM type overrides#11252web-padawan wants to merge 5 commits intomainfrom
web-padawan wants to merge 5 commits intomainfrom
Conversation
e77bab0 to
12328a4
Compare
5821ca6 to
9d9d7ad
Compare
The CEM analyzer only follows inheritedFrom one level deep, so members inherited through 2+ levels of mixins or superclasses are dropped from class declarations (e.g., TextField.label via FieldMixin → LabelMixin). Add a multi-pass resolution step that copies missing members and attributes from mixin and superclass declarations to class declarations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The CEM analyzer resolves inherited members from the deepest ancestor (e.g., I18nMixin), losing specific @type JSDoc overrides from closer mixins (e.g., AppLayoutMixin's @type {!AppLayoutI18n}). Add typeOverridePlugin (analyzePhase) to collect @type tags from getter overrides, and applyTypeOverrides (packageLinkPhase) to re-apply them after the analyzer's inheritance resolution using closest-wins BFS. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract repeated `(node.jsDoc || []).flatMap(doc => doc.tags || [])` pattern into a shared `getJsDocTags` helper used by three plugins. Switch readonlyPlugin from `extractMixinNodes` to `findClassNode` for consistency with typeOverridePlugin, removing the unused import. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a member already exists on a class but has no type (due to multi-level inheritance), copy the type from the parent declaration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…CEM config Extend copyMissingItems to also propagate descriptions from parent declarations when a member exists but has no description (e.g., value on Checkbox and RadioButton inherited via multi-level mixin chain). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9d9d7ad to
eac4449
Compare
|
Member
Author
|
This PR got quite big and contains unrelated changes, I will split it into smaller parts to make it easier to review. |
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.



Description
The CEM analyzer only follows inheritedFrom one level deep, so members inherited through 2+ levels of mixins or superclasses are dropped from class declarations (e.g., TextField.label via FieldMixin → LabelMixin).
Add a multi-pass resolution step that copies missing members and attributes from mixin and superclass declarations to class declarations.
Type of change
Note
Can be tested by running
yarn release:cem- in this PR there will belabelproperty in thecustom-elements.jsonforvaadin-text-fieldcomponent, and inmainbranch it's missing from there:UPD: added a second commit that fixes a problem with type for
i18nproperties incorrectly set toObject.