Skip to content

feat: Don't enforce a renderer for subclasses of HTMLElement - #1126

Open
codeworrior wants to merge 1 commit into
mainfrom
ignore-missing-renderer-for-HTMLElement
Open

feat: Don't enforce a renderer for subclasses of HTMLElement#1126
codeworrior wants to merge 1 commit into
mainfrom
ignore-missing-renderer-for-HTMLElement

Conversation

@codeworrior

Copy link
Copy Markdown
Member

UI5 runtime introduces a new base class for native HTML controls and webcomponents. This base class implements renderer inheritance. A missing renderer property in a subclass therefore should not be reported as an error.

UI5 runtime introduces a new base class for native HTML controls and
webcomponents. This base class implements renderer inheritance.
A missing renderer property in a subclass therefore should not be
reported as an error.
@codeworrior
codeworrior force-pushed the ignore-missing-renderer-for-HTMLElement branch from 1273cb3 to f6f5a0c Compare August 26, 2026 07:29
@RandomByte

Copy link
Copy Markdown
Member

Locally for me, the tests seem to pass with and without the change in SourceFileLinter.ts

@codeworrior

codeworrior commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

Locally for me, the tests seem to pass with and without the change in SourceFileLinter.ts

I had a discussion about this with @matz3 via private chat. The reasons IMO is that sap/ui/core/html/HTMLElement doesn't exist yet, esp. not in the @sapui5/types 1.136. Therefore, TypeScript / the linter can't know that HTMLElement is a control and should be checked for a proper renderer declaration.

And as the test is a negative test, the lack of a finding does not cause a failure.

I've tested the current linter (w/o the PR) against @Thodd's change (openui5 6222857). I see no errors, neither for the new library sap.html nor for sap.ui.core. But I guess that's because only the combination of the two projects makes the renderer issues visible (sap.ui.core contains the base class and the renderer, sap.html contains the subclasses that are lacking a renderer definition).

When I copy everything together in one project so that TypeScript sees base class and subclass at the same time, then I get the expected errors for al the subclasses:

/xxxxx/openui5/src/sap.ui.core/src/sap/html/Strong.js
  9:20 error Control 'Strong' is missing a renderer declaration  no-deprecated-control-renderer-declaration

@codeworrior

Copy link
Copy Markdown
Member Author

Update: with the PR, I don't see the errors.

@RandomByte RandomByte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants