-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Support TypeScript 3.7 (and drop Node 6 support for direct inst… #6657
Conversation
Looks like your snapshots aren’t up-to-date? |
@lydell Yeah, it's still WIP. |
@suchipi fyi |
@lydell updated |
btw |
I think it should be possible to stub chokidar out. Maybe @fisker can help? |
Ah, thanks, I forgot about that. |
How long might that be? Surely node 6 counts as legacy now. Node 8 was released 2 years ago. I'm not sure node 6 is even in its LTS maintenance window any more. |
6 has been EOL since April. (12 will be LTS Monday next week) |
I think it is time to drop node |
Can we drop support for it then? |
/cc @prettier/core I think it is time to use babel on our source code to avoid breaking change also we drop node 6 for direct-from-GitHub installs, what do you think about it? |
Sounds good to me! |
@fisker could you help advice how to shim |
I already merged your code into #6680 About how to make it work, you can read my PR there is build script in another repo. |
@fisker great, i'll close my PR when yours has been merged. |
FYI, |
Now you can try in the playground for this PR! |
/cc @Cryrivers Thanks for great work /cc @fisker and @Cryrivers Can you work together (comments/reviews/etc) in one PR? Because we have two PRs #6657 and #6680, it is create unnecessary noise for contributors and developers who wait this |
actually Its your call, drop node 6, merge this. support node 6, merge #6680. they are the same |
It is just proposal, we need consider this /cc @prettier/core Which solution will we choose? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting some following cases incorrectly removes the parentheses and results in a syntax error when reformatting.
let f = () => ({}?.());
a = () => ({}?.() && a);
a = () => ({}?.()() && a);
(a) => ({}?.()?.b && 0);
(x) => ({}?.()());
(x) => ({}?.().b);
({}?.a().b());
({ a: 1 }?.entries());
We should add OptionalCallExpression
to this line to fix this.(And also need to add tests)
However, these occur even in Babel's OptionalChaining format and have not been pointed out so far, so I think we can ignore it in this PR.
@sosukesuzuki Optional chaining is going to become much more popular after TS 3.7 gets released, so better to catch all these parens issues in this PR and be ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @Cryrivers and @thorn0, LGTM!
Sorry for the late response. FWIW, I'm in favor of dropping legacy Node, but we've promised to our user that we won't make breaking changes in minor/patch release (according to semver) so we shouldn't introduce such change in minor release IMO, though I'm still not quite sure if this rule should be applied here. One possible backward-compatible workaround would be to introduce some |
@ikatyang Just in case you weren’t aware, we only drop Node 6 support for direct installation from GitHub. The version released on npm will still work – even in Node.js 4. See also: typescript-eslint/typescript-eslint#1108 (comment) Not sure if that changes your opinion, but just in case 🤷♂ |
Yeah, I'm aware. I meant that we've explicitly specified |
@ikatyang IMHO the contents of package.json on GitHub can't be a promise unless such a promise is documented somehow, otherwise we could call any piece of code a promise. |
@thorn0 Yes, but we did mention that we support installation from GitHub in https://prettier.io/versions.html, that's why I'm still not sure if it is considered a promise. Anyway, this is just a suggestion, not a requirement. |
@ikatyang It's called "next" there though, not 1.x.x. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job 👍
So we are waiting to release :) |
Awesome.. waiting for the release.. 💯 |
Guys, when it's planned to deliver this to npm? |
Is anyone getting |
@damiangreen What exactly are you doing to get it? |
@thorn0 It appears to happen on our Bamboo build server. |
@damiangreen What exactly is that build server doing when this happens? Do you have any stack traces or something? |
@thorn0 Our devops guys just pulled this down from AWS Console. I just switched back from Note I have the latest "source-map-support": "^0.5.15", in my
|
@damiangreen You still haven't written what this process is doing. How does it use Prettier? Is this stack trace full? BTW, let's stop spamming everyone who follows this PR. Feel free to open an issue with a proper error report. |
This PR addresses TypeScript 3.7 supports, which includes:
asserts
keyword (Fixes [TypeScript 3.7] add support forasserts
keyword #6574)declare
keyword on class fields (Fixes [TypeScript 3.7] declare modifier on class fields #6661)Fixes #6569
docs/
directory)CHANGELOG.unreleased.md
file following the template.✨Try the playground for this PR✨