Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
285 stars 76 forks source link

[Refactor] Turn `@readonly` JS Doc into getters #10263

Open maxpatiiuk opened 2 weeks ago

maxpatiiuk commented 2 weeks ago

Description

Blocked by https://github.com/Esri/calcite-design-system/issues/10310

Calcite components have ~22 readonly properties.

Those are currently denoted using the @readonly JS Doc tag: https://github.com/Esri/calcite-design-system/blob/34a80acae3594bed93f5fa4425d5b06470f972ca/packages/calcite-components/src/components/table/table.tsx#L131

This shows the property as readonly in the docs and the typings, but not at runtime.

In Lumina (formerly ArcGIS Lit) readonly can be enforced at runtime

Lumina readonly properties

See also this comment from Matt: https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/1463#issuecomment-4996968

Thus, after running the codemod, you should manually refactor the readonly property to getters OR add readOnly:true parameter to @property() decorator.

Proposed Advantages

The read only properties will be enforced for non-TypeScript users and HTML-only users

Which Component

22 properties across several components

Relevant Info

No response

Calcite package

jcfranco commented 3 days ago

Blocked by #10310.