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

Support TypeScript 4.9 class auto-accessors ("accessor" keyword) #6051

Open
eddyw opened this issue Sep 25, 2023 · 1 comment
Open

Support TypeScript 4.9 class auto-accessors ("accessor" keyword) #6051

eddyw opened this issue Sep 25, 2023 · 1 comment
Labels
bundler Something to do with the bundler enhancement New feature or request transpiler parser || printer typescript Something for TypeScript

Comments

@eddyw
Copy link

eddyw commented Sep 25, 2023

What is the problem this feature would solve?

The decorators proposal is stage 3 and one of the things it introduces (besides .. decorators) is class auto-accessors.

class Foo {
	accessor username: string = "";
	accessor password: string = "";
}

Currently outputs:

$ bun stuff.ts

error: Expected ";" but found "username"

        accessor username: string = "";
          ^
[...]/stuff.ts:18:11 334

$ bun --revision
1.0.3+25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a
$ uname -mprs
Darwin 23.0.0 x86_64 i386

What is the feature you are proposing to solve the problem?

It's been implemented in TypeScript 4.9 as well as supported in EsBuild v0.18.5. It'd be great to have support for this in Bun.

  1. esbuild v0.18.5 - release notes
  2. TypeScript 4.9 - Auto-Accessors in Classes
  3. Proposal Decorators - Class Auto-Accessors

Opening this issue to track when it eventually land in Bun.

What alternatives have you considered?

No response

@eddyw eddyw added the enhancement New feature or request label Sep 25, 2023
@Electroid Electroid added the typescript Something for TypeScript label Sep 25, 2023
@Atulin
Copy link

Atulin commented Jul 31, 2024

I just ran into the same issue a year later

@paperdave paperdave added transpiler parser || printer bundler Something to do with the bundler labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bundler Something to do with the bundler enhancement New feature or request transpiler parser || printer typescript Something for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants