Skip to content
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

docs: override prop in manifest #3307

Merged
merged 2 commits into from
Dec 18, 2024
Merged

Conversation

DavideMininni-Fincons
Copy link
Contributor

@DavideMininni-Fincons DavideMininni-Fincons commented Dec 17, 2024

As already experienced with generics (see 5702592), the manifest generation has some issue when working with superclasses and mixin.
This time, i noticed that if an element extends a base class, and the base class implements a mixin and overrides some of its property, the overriding is not considered during the manifest generation, because the inheritance chain is traversed from the outer to the inner element and not vice versa as expected.

Eg. all the buttons extend the SbbButtonBaseElement class, which implements the SbbFormAssociatedMixin.
The SbbButtonBaseElement defines via getter/setter the form property by overriding the default form getter from the mixin; however, the override is not reflected in the manifest, which mark the form member as readonly, as does with getters. Also the inheritedFrom prop refers to the mixin and not to the base class.

This behavior is problematic when the Angular classes are generated, so a manual override must be done; I noticed that the corresponding attribute field is not changed when the inheritance chain it traversed, so it can be used as a 'baseline'.
As a consequence, the form jsDoc is overridden in all the button components, taking the correct description from the SbbButtonBaseElement.

NOTE: even if this PR fixes the Angular classes generation, it is not possible to automatically fix the type mismatch between get/set, so this should be done manually in the Angular repo.

  // button-base-element.ts
  
  @property()
  public override set form(value: string) {
    ...
  }
  public override get form(): HTMLFormElement | null {
     ... 
   }

Copy link
Contributor

@kyubisation kyubisation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, apart from the issue with the formatting

src/elements/button/accent-button/readme.md Outdated Show resolved Hide resolved
@github-actions github-actions bot added the pr: lead review approved Pull request has been approved by a lead review label Dec 17, 2024
Copy link
Contributor

@jeripeierSBB jeripeierSBB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM

@jeripeierSBB jeripeierSBB changed the title fix: override prop in manifest docs: override prop in manifest Dec 18, 2024
@DavideMininni-Fincons DavideMininni-Fincons merged commit ee4494f into main Dec 18, 2024
25 of 26 checks passed
@DavideMininni-Fincons DavideMininni-Fincons deleted the fix/override-prop-manifest branch December 18, 2024 09:36
@github-actions github-actions bot removed the pr: peer review required A peer review is required for this pull request label Dec 18, 2024
kyubisation pushed a commit that referenced this pull request Dec 19, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.0.2](v2.0.1...v2.0.2)
(2024-12-19)


### Bug Fixes

* handle scroll events in custom scroll contexts
([#3310](#3310))
([3634e37](3634e37)),
closes
[#3276](#3276)
* improve null/undefined type handling for Angular wrapper
([#3302](#3302))
([2f94992](2f94992))
* remove any type for Angular wrapper
([#3297](#3297))
([dca7ba5](dca7ba5))
* remove leading inline padding from icon list
([#3311](#3311))
([b9ce6d1](b9ce6d1))
* **sbb-accent-button:** adapt to new design
([#3313](#3313))
([1af2691](1af2691))
* **sbb-message:** fix image alignment
([#3305](#3305))
([1d4a5de](1d4a5de))
* **sbb-select:** update displayed value on option label change
([#3300](#3300))
([3c2f3c5](3c2f3c5))
* **sbb-teaser-hero:** fix image size on custom width
([#3295](#3295))
([5fc0634](5fc0634))


### Documentation

* override member properties in manifest
([#3307](#3307))
([ba25320](ba25320))
* standardize usage of terms `CSS` and `Sass`
([#3290](#3290))
([b52ac99](b52ac99))


### Code Refactoring

* move event handlers to constructors
([#3314](#3314))
([18660a3](18660a3))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants