Skip to content

feat: set a @part as @internal #3228

@ryuran

Description

@ryuran

Prerequisites

Describe the Feature Request

Be able to set a part without a documentation in the readme.

Describe the Use Case

We use Stencil to build a design system and we introduced some part for internal use and would to not expose it publicly in user documentation.
Usually we rely on @internal tag for this purpose when it's for a prop, event or method.
It seems not possible for part or a slot.

For a slot it seems possible to just not add a @slot tag but for part even without the tag it's added to the readme.

Describe Preferred Solution

/**
 * @part @internal inner - inner element
 */
@Component({
  tag: 'my-button',
  shadow: true,
})
export class Button {
  render() {
    return (
      <div>
        <button part="inner"></button>
      </div>
    );
  }
}

Describe Alternatives

Do not automatically add parts to readme if not documented

Related Code

https://github.com/ionic-team/stencil/blob/d1d34cc4caec3b326b7b05abd0695ec758ccc1bc/src/compiler/docs/generate-doc-data.ts#L268-L275

Additional Information

hacky workaround (don't judge)

- part="inner"
+ {...{ part: 'inner' }}

I think the spread make fail the parser to found it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: Want this? Upvote it!This PR or Issue may be a great consideration for a future idea.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions