Skip to content
This repository was archived by the owner on Jan 14, 2019. It is now read-only.

BREAKING: correct nodes TSConstructorType and TSConstructorType #74

Merged
merged 1 commit into from
Jan 4, 2019

Conversation

armano2
Copy link
Contributor

@armano2 armano2 commented Dec 29, 2018

This PR contains breaking changes and its alternative way of solving issue #30

Changes from this PR align structure of AST with what babel produces.
There is alternative version of aligning those nodes #60


babel parses CallSignature and ConstructSignature as TSCallSignatureDeclaration and TSConstructSignatureDeclaration and has fields:

interface foo {
  <P>(x: X): A
}
  • typeParameters typeParameters
  • parameters array of all parameters
  • typeAnnotation expected return type of function

right now we are parsing it as typeParameters, (params or parameters) and typeAnnotation

fixes: #30, #60

@armano2 armano2 changed the title feat: align call and construct signature declarations BREAKING: align call and construct signature declarations Dec 31, 2018
@armano2 armano2 changed the title BREAKING: align call and construct signature declarations BREAKING: correct nodes TSConstructorType and TSConstructorType (variant 2) Dec 31, 2018
@armano2 armano2 changed the title BREAKING: correct nodes TSConstructorType and TSConstructorType (variant 2) BREAKING: correct nodes TSConstructorType and TSConstructorType Jan 1, 2019
@armano2
Copy link
Contributor Author

armano2 commented Jan 4, 2019

i'm unsure how we should proceed with this, do we want to have same structure as babel for this? or we want to align it to how names are provided in estree...

@JamesHenry
Copy link
Owner

JamesHenry commented Jan 4, 2019

Yeah it's a tricky one for sure. The inconsistency on the babel side makes me think that maybe we should forgo compatibility on this one for now and just make a clear note that we need to fix it up on the babel side later.

There have been plenty of cases over the last year or so that I flagged up or fixed odd things on the babel side after discovering them through the ast-alignment testing, so it is not entirely unexpected.

What do you think?

@armano2
Copy link
Contributor Author

armano2 commented Jan 4, 2019

I'm OK with changing names of properties but I feel like we should keep type of node same as babel has

@JamesHenry
Copy link
Owner

Sounds good 👍

@armano2
Copy link
Contributor Author

armano2 commented Jan 4, 2019

ok i'm closing than #60 and i will rebase change here

@JamesHenry JamesHenry merged commit 3ec7fce into JamesHenry:master Jan 4, 2019
@JamesHenry
Copy link
Owner

🎉 This PR is included in version 11.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TSCallSignature and TSConstructSignature have different properties for parameters
2 participants