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

feat: support BigIntLiteral #35

Merged
merged 4 commits into from
Nov 26, 2018

Conversation

ikatyang
Copy link
Contributor

Ref: prettier/prettier#5545

  • require typescript@3.2.0-rc (bitInt was added in TS 3.2)
  • update to @babel/parser@7.1.6 (bigInt was added in 7.0.0-beta.48)

@JamesHenry
Copy link
Owner

This PR allowed me to catch the fact that a lot of ast-alignment tests are currently not being run: #36

@JamesHenry
Copy link
Owner

JamesHenry commented Nov 25, 2018

That PR has now been merged, it might be that is surfaces some issues with updating the babel parser version, sorry for the confusion.

I am hesitant to break away from our historically consistent approach of waiting until TypeScript versions become stable before supporting them.

Currently semantic-release, the library we use to handle releases here does not automatically support multiple release channels, but it looks like it will really soon! semantic-release/semantic-release#991

Hopefully, therefore, for TypeScript 3.3 we will be able to automate everything and support TypeScript versions all through their prerelease phases, but for TypeScript 3.2, what I'd like to do is create a feature branch, and then once we are happy I will manually publish a release from it under a next tag. Prettier can then consume that until it become stable and we PR the feature branch into master.

Sound good?

@JamesHenry
Copy link
Owner

I've created the branch: https://github.com/JamesHenry/typescript-estree/tree/ts-3.2

@armano2
Copy link
Contributor

armano2 commented Nov 25, 2018

@JamesHenry, why not going other way around? making default branch as stable, and following latests rc/beta changes on separate branch and releasing them as *.*.*-beta.X

@JamesHenry
Copy link
Owner

I think we are describing the same thing? I am suggesting the base of this PR be changed to the new branch I just created, which will be the source of a new, non-stable distribution on npm.

@ikatyang ikatyang changed the base branch from master to ts-3.2 November 26, 2018 00:03
type: AST_NODE_TYPES.BigIntLiteral,
raw,
value
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not sure what should this node look like. @babel/parser parsed them as:

interface BigIntLiteral {
  type: "BigIntLiteral";
  value: string;
  extra: {
    raw: string;
    rawValue: string;
  }
}

but the alignment test rejected the extra field and expected:

interface BigIntLiteral {
  type: "BigIntLiteral";
  value: string;
  raw: string;
}

which is the current implementation.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yeah seems there isn't quite a consensus yet: estree/estree#169

There hasn't been any update on that issue for a while...

I think the least likely of all is having that extra object involved in ESTree, so maybe we should just ignore the AST comparison for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra is already ignored, I just want to make sure if it's fine to output the node that's different from babel's. 😅

{
key: 'extra',
predicate: always
},

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think it's fine, I think we just have to accept that as experimental things get added they may be subject to change.

We can always publish new major versions in future if we need to amend it

@JamesHenry JamesHenry merged commit 07275de into JamesHenry:ts-3.2 Nov 26, 2018
@ikatyang ikatyang deleted the feat/support-big-int-literal branch November 26, 2018 01:05
JamesHenry pushed a commit that referenced this pull request Dec 1, 2018
JamesHenry added a commit that referenced this pull request Dec 1, 2018
BREAKING CHANGE: Supported TypeScript version is now 3.2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants