duncanmak
duncanmak9mo ago

Support for auto-accessors

I'm playing around with Decorators, it seems like with "experimentalDecorators": false, there's a problem with the generated JS if I include the new accessor keyword. It doesn't get down-leveled in the generated code, which is what I want to see (since I'm targetting the browser).
3 Replies
Deno AI Helper
Deno AI Helper9mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the information you've provided, it seems like you might be encountering an issue with TypeScript configuration or behavior. If you're using the accessor keyword, which is a part of the more recent TypeScript features, and you have "experimentalDecorators": false, it's possible that TypeScript isn't processing decorators at all, since you've explicitly set the flag to false. This could be why you're not seeing the expected down-leveled JavaScript. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice. Make sure that your TypeScript configuration is set up correctly to handle decorators and that you're using a TypeScript version that supports the accessor keyword if it's a newer feature. Additionally, ensure that your target configuration in tsconfig.json is set to a version of ECMAScript that is compatible with the browsers you're targeting.
bartlomieju
bartlomieju9mo ago
Could you open an issue about it please? We might need to bump our transpiler (or open an issue with them)
duncanmak
duncanmak9mo ago
GitHub
Support auto-accessors · Issue #22173 · denoland/deno
Version: Deno 1.40.2 I'm trying to use Deno as my complete toolchain for writing a component using Lit. I'm trying out the new Stage 3 decorators. When I compile using "experimentalDec...