Skip to content

feat: Allow ”as” ES6 keyword for Stencil’s decorators #3137

Closed

Description

@splitinfinities

Prerequisites

Describe the Feature Request

The @Event and @Element decorators can be imported and can interfere with global types or be mistakenly used within the components.d.ts file. In those circumstances, it would be helpful for component authors to be able to alias the import like with the as keyword of es6 modules.

import { h, Event as StencilEvent, Element as StencilElement } from “@stencil/core”;

//etc

Describe the Use Case

This feature allows component authors to use an aliased decorator that would be referred to within the components.d.ts file so that collisions can be reduced when interoping with global browser types.

Describe Preferred Solution

Open to perspective here, I’m not an expert on this.

Describe Alternatives

Maybe we could rename all the decorators? Or have alternate names that could be imported?

Open to perspective here, I’m not an expert on this.

Related Code

No response

Additional Information

No response

Activity

  1. rwaskiewicz commented on Nov 9, 2021

    @rwaskiewicz
    Member

    Potentially a part of the same problem/implementation space, but not the same problem: #3037

  2. rwaskiewicz commented on Nov 9, 2021

    @rwaskiewicz
    Member

    Related: stenciljs/eslint-plugin#28, although not the same issue

  3. added
    Resolution: Refine
    on Nov 9, 2021
  4. rwaskiewicz commented on Nov 9, 2021

    @rwaskiewicz
    Member

    This issue has been labeled to be added to our internal backlog to be discussed as a team.

  5. added a commit that references this issue on Dec 11, 2023
    6282011
  6. added a commit that references this issue on Dec 13, 2023
    97dcb45
  7. rwaskiewicz commented on Dec 18, 2023

    @rwaskiewicz
    Member

    The fix for this issue has been released as a part of today's Stencil 4.9.0 release.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: Refine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions