ComponentSupport: Missing public documentation about hyphenating properties
See original GitHub issueSteps to reproduce the problem
-
Check this private API description: https://github.com/SAP/openui5/blob/005a9e2d8c35260eccfb062d65b34a90506bd58f/src/sap.ui.core/src/sap/ui/core/ComponentSupport.js#L86-L101
It says:
As HTML is case-insensitive, camel cased properties have to be written in dashed form.
Valid ✔️
<div data-sap-ui-component data-auto-prefix-id="true" ...>
Invalid ❌
<div data-sap-ui-component data-autoprefixid="true" ...>
Error: Property or event “autoprefixid” does not exist in sap.ui.core.ComponentContainer.
-
Go to the public API reference page. Or the topic Declarative API for Initial Components
What is the expected result?
The important message, that “camel cased properties have to be written in dashed form”, is clearly noticeable in the documentation as well as in the API reference page, maybe even as a MessageStrip with an additional link to the naming convention.
What happens instead?
Neither the API reference nor the documentation topic makes the reader aware of the naming convention.
The thing is; application developers are used to write bootstrap config attributes without hyphens in index.html
, such as:
resourceroots
✔️oninit
✔️waitfortheme
✔️
Naturally, within the same index.html
page, they tend to write ComponentContainer settings without hyphens as well:
autoprefixid
❌componentloaded
❌handlevalidation
❌
They then see the error in the console and wonder if defining such properties is possible at all, and if yes, what the proper syntax looks like.
<del>A better approach would be to allow the above syntax if possible. This would make developing ui5 applications a bit more intuitive.</del> --> Nevermind!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
PS: Additionally we will make changes to the Dev-Guide, once we rework the Component-Section.
just FYI #1980266553