Skip to content

bug: Non-Reflective Properties Shown as Attributes in Stencil gernated Docs #6247

@hyyan

Description

@hyyan

Prerequisites

Stencil Version

4.30.0

Current Behavior

In Stencil 4.28.0 and later, the docs-readme and docs-json output targets include attributes that can only be assigned as properties and are marked as non-reflective.

Before:

  "props": [
        {
          "name": "list",
          "type": "string[]",
          "complexType": {
            "original": "string[]",
            "resolved": "string[]",
            "references": {}
          },
          "mutable": false,
          "reflectToAttr": false,
          "docs": "The list of values to display when spinning.",
          "docsTags": [],
          "default": "[]",
          "values": [
            {
              "type": "string[]"
            }
          ],
          "optional": false,
          "required": false,
          "getter": false,
          "setter": false
        }
]

After:

   "props": [
        {
          "name": "list",
          "type": "string[]",
          "complexType": {
            "original": "string[]",
            "resolved": "string[]",
            "references": {}
          },
          "mutable": false,
          "attr": "list",
          "reflectToAttr": false,
          "docs": "The list of values to display when spinning.",
          "docsTags": [],
          "default": "[]",
          "values": [
            {
              "type": "string[]"
            }
          ],
          "optional": false,
          "required": false,
          "getter": false,
          "setter": false
        }
]

Expected Behavior

The "attr" should be empty because there is no attribute for the given property.

System Info

System: node 18.20.5
    Platform: darwin (24.2.0)
   CPU Model: Apple M2 Pro (10 cpus)
    Compiler: /Users/Shared/Laptop/Github/dwc/node_modules/@stencil/core/compiler/stencil.js
       Build: 1745512551
     Stencil: 4.30.0 🌺
  TypeScript: 5.5.4
      Rollup: 4.34.9
      Parse5: 7.2.1
      jQuery: 4.0.0-pre
      Terser: 5.37.0

Steps to Reproduce

https://stenciljs.com/docs/getting-started#running-the-create-stencil-cli

Code Reproduction URL

NONE

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedThis PR or Issue is verified to be a bug within StencilHelp Wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions