-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Allow ”as” ES6 keyword for Stencil’s decorators #3137
Labels
Resolution: Refine
This PR is marked for Jira refinement. We're not working on it - we're talking it through.
Comments
Potentially a part of the same problem/implementation space, but not the same problem: #3037 |
Related: stencil-community/stencil-eslint#28, although not the same issue |
rwaskiewicz
added
the
Resolution: Refine
This PR is marked for Jira refinement. We're not working on it - we're talking it through.
label
Nov 9, 2021
This issue has been labeled to be added to our internal backlog to be discussed as a team. |
3 tasks
tanner-reits
added a commit
that referenced
this issue
Dec 11, 2023
The commit passes the aliased import name from the `ImportAliasMap` to each respective decorator transformer Fixes: #3137 STENCIL-263
2 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Dec 13, 2023
* create map of original imports to their aliased import this commit creates a map of original import names to aliased import names. This will be used to get the aliased name of a decorator when parsing Stencil decorators to static component metadata * change `importAliasMap` to class This commit creates an `ImportAliasMap` class that extends the `Map` class. This makes it easy to instantiate, reference the underlying type, and clearly override the default getter * pass aliased name to decorator parsers The commit passes the aliased import name from the `ImportAliasMap` to each respective decorator transformer Fixes: #3137 STENCIL-263 * add e2e tests for some aliased imports * check namedBindings exist * add rest of decorators to test
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
Labels
Resolution: Refine
This PR is marked for Jira refinement. We're not working on it - we're talking it through.
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 theas
keyword of es6 modules.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
The text was updated successfully, but these errors were encountered: