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

Consider updating tsc target #1712

Closed
firelizzard18 opened this issue Aug 21, 2021 · 4 comments
Closed

Consider updating tsc target #1712

firelizzard18 opened this issue Aug 21, 2021 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@firelizzard18
Copy link
Contributor

The current tsc target, ES6, results in generator-based awaiter code. Compared to native async/await code, this adds to the compiled output size and makes debugging more difficult.

VSCode supports much more recent ECMAScript targets. For example, VSCode 1.52 uses Electron 9.3, according to VSCode's package.json; Electron 9 uses Node 12.14, according to the release notes; Microsoft recommends ES2019 for Node 12.

Reasons I can think of not to upgrade the tsc target are: other IDEs such as Theia and browser-based systems like GitPod.

@gopherbot gopherbot added this to the Untriaged milestone Aug 21, 2021
@hyangah
Copy link
Contributor

hyangah commented Aug 30, 2021

I found python extension is using ES2018. Is there any other popular extensions that picked up more recent targets?

I contacted one of our internal TheiaIDE based product users for comment.

@hyangah hyangah modified the milestones: Untriaged, Backlog Aug 30, 2021
@hyangah hyangah added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 30, 2021
@firelizzard18
Copy link
Contributor Author

The relationship between ECMAScript versions and what features are supported natively is not clear to me. But the feature I'm most interested in is native async, because it removes the async generator shims. By testing different values in tsconfig.json and looking at the code generated by esbuild/tsc, it appears that ES2017 is sufficiently recent to avoid async generator shims.

If you search for 'es20' on caniuse.com (link), support for async functions is shown under ES2017/ES8. Async generator/iterators appear to be an ES2018/ES9 feature, though I don't think the extension is using those.

With respect to Theia and browser support, all major browsers (edge, chrome, firefox, safari, and opera) have natively supported async functions since 2016 or 2017 (link). The situation appears similar for other ES2017 features (link), so upgrading to ES2017 is unlikely to cause major issues. Some (major) browsers do not yet fully support ES2018 (link), and those that do have supported it since around 2020.

@hyangah hyangah modified the milestones: Backlog, v0.29.0 Sep 21, 2021
@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/356509 mentions this issue: tsconfig.json: bump target to ES2017

@hyangah hyangah modified the milestones: v0.29.0, v0.30.0 Oct 26, 2021
@findleyr
Copy link
Contributor

Looks like this is done.

gopherbot pushed a commit that referenced this issue Nov 6, 2021
Fixes #1712

Change-Id: I6f90cff70178e6193a96fd6212a26d67746b2f51
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/356509
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
@golang golang locked and limited conversation to collaborators Oct 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants