Skip to content
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

types.cloneNode does not preverse type annotations #8996

Closed
gregberge opened this issue Nov 8, 2018 · 1 comment
Closed

types.cloneNode does not preverse type annotations #8996

gregberge opened this issue Nov 8, 2018 · 1 comment
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@gregberge
Copy link
Contributor

Bug Report

Current Behavior
Calling types.cloneNode on a node containing a typeAnnotation does not preserve it.

Expected behavior/code
It should preserve typeAnnotation.

Environment

  • Babel version(s): [v7.1.2]

Possible Solution
Clone typeAnnotation here: https://github.com/babel/babel/blob/master/packages/babel-types/src/clone/cloneNode.js#L64

Additional context/Screenshots
Actually it is a problem because @babel/template is using types.cloneNode, the result is that it is not possible to have a type annotation using Babel template.

The original use-case is to be able to create TypeScript template for SVGR (see gregberge/svgr#226).

@babel-bot
Copy link
Collaborator

Hey @neoziro! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

gregberge added a commit to gregberge/babel that referenced this issue Nov 8, 2018
gregberge added a commit to gregberge/babel that referenced this issue Nov 9, 2018
gregberge added a commit to gregberge/babel that referenced this issue Nov 9, 2018
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Feb 12, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

2 participants