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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support TypeScript 3.8 #7263
Comments
@sosukesuzuki i will take a look at this next week at typescript-estree site |
A relevant Babel issue: babel/babel#10981 ( |
1:14 Parsing error: '=' expected.
> 1 | import type { IAPIJobForUser } from '@hokify/common'; right now prettier does not handle the new syntax, any progress on this? can I support somehow? |
1984: feat(ts): add TS v3.7/3.8 language features r=spencercorwin a=spencercorwin ### Description of the Change Upgrades Smart-Contract compiler to support new TS language features: Features from TS v3.7: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html - [x] Optional Chaining - [x] Nullish Coalescing - Added in previous TS PR - [x] Assertion Functions - Not supported? - [x] `never`-Returning Functions - No change needed? - [x] Recursive Type Aliases - [x] Uncalled Function Checks - Should be supported without change from us? Features from TS v3.8.1-rc: https://devblogs.microsoft.com/typescript/announcing-typescript-3-8-rc/ - [x] Type-Only Imports and Exports - [x] ECMAScript Private Fields - [x] `export * as ns` Syntax - Added in previous TS PR - [x] Top-Level `await` - Not supported? ### Test Plan - All Unit Tests - `rush test` - `rush e2e` - Optional Chaining - `rush test -t packages/neo-one-smart-contract-compiler/src/__tests__/compile/expression/CallExpressionCompiler.test.ts` - `rush test -t packages/neo-one-smart-contract-compiler/src/__tests__/compile/expression/ElementAccessExpressionCompiler.test.ts` - `rush test -t packages/neo-one-smart-contract-compiler/src/__tests__/compile/expression/PropertyAccessExpressionCompiler.test.ts` - Nullish Coalescing - `rush test -t packages/neo-one-smart-contract-compiler/src/__tests__/compile/expression/ToNullishBooleanHelper.test.ts` - Recursive Type Aliases - `rush test -t packages/neo-one-smart-contract-compiler/src/__tests__/compile/declaration/TypeAliasDeclarationCompiler.test.ts` - Type-Only Imports and Exports - `rush test -t packages/neo-one-typescript-concatenator/src/__tests__/concatenate.test.ts` - ECMAScript Private Fields - `rush test -t packages/neo-one-smart-contract-compiler/src/__tests__/compile/declaration/ClassDeclarationCompiler.test.ts` - `rush test -t packages/neo-one-smart-contract-compiler/src/__tests__/compile/expression/ObjectLiteralExpressionCompiler.test.ts` - `export * as ns` Syntax - `rush test -t packages/neo-one-typescript-concatenator/src/__tests__/concatenate.test.ts` - Top-Level `await` - `rush test -t packages/neo-one-smart-contract-compiler/src/__tests__/compiler/expression/AwaitExpressionCompiler.test.ts` ### Alternate Designs None. ### Benefits - We support the latest language features for writing Smart Contracts in TS. ### Possible Drawbacks - Prettier doesn't support some TS v3.8 syntax yet, so all Prettier checks will fail on the `neo-one-typescript-concatenator` package until they/we update Prettier. They have an issue open for this [here](prettier/prettier#7263). They are waiting for TS 3.8 support in `typescript-eslint` for the new AST [here](typescript-eslint/typescript-eslint#1465). This is easy to ignore for now. - Possibly unforeseen problems. ### Applicable Issues #1889 Co-authored-by: Spencer Corwin <spencercorwin@icloud.com>
Update on this: However, I did merge typescript-eslint/typescript-eslint#1697 on the weekend, which adds support for import/export type. Would it be a good idea for prettier to bump the ts-estree version to v2.23.0 to help users in the interim? |
For private fields, I added temporary hacks in #7631. They seem to be good enough for now. Most probably we'll merge it before releasing 2.0. |
Do you have a timeline for release of this? I've pinged back on the ESTree side of things, so hopefully soon we can the spec merged, and then merge our PR. If the timeline is a week, then I would say we can't get it merged before then, but if it's a few weeks out then there's probably a good chance that we can. |
Thanks. It's not a blocker. If we release earlier, we'll add |
Update: |
Hopefully you鈥檇 add something only in a minor, not a patch ;-) |
@ljharb I could as well write "we'll fix it in 2.0.1". Same thing, but suddenly a patch is okay now. Magic! |
@thorn0 That's great news, thanks! When do you think we'd be able see this in a release? |
TypeScript 3.8 beta has been released!馃帀馃帀
We should support some syntax will be add via TS 3.8.
There are some syntaxes that can support by just (waiting and) updating typescript-estree(e.g. Top Level await), but there seems to be some that need to be supported on the Prettier side.(e.g. Type only imports exports)
New syntax:
import type
,export type
export * as ns
The text was updated successfully, but these errors were encountered: