Aman Karmani
Aman Karmani
See https://github.com/erikkaashoek/Comskip/issues/32#issuecomment-149066215
for reasons that are not clear to me, in the vscode codebase the generated syntax is es2020 style even though the tsconfig says es2022 ``` ❯ cd vscode ❯ grep...
is the printer the right place for this? ```diff diff --git i/internal/printer/printer.go w/internal/printer/printer.go index 7b65f042a..1dee8bc9c 100644 --- i/internal/printer/printer.go +++ w/internal/printer/printer.go @@ -2843,6 +2843,7 @@ func (p *Printer) emitSpreadElement(node *ast.SpreadElement) {...
okay i see there is a transformation layer, so maybe this belongs in `ESModuleTransformer` or `RuntimeSyntaxTransformer`
I think I misdiagnosed my issue and I don't actually need es2020 compat classes. Something else is causing generated JS not to load.
> for reasons that are not clear to me `"useDefineForClassFields": false` cc https://github.com/microsoft/vscode/issues/186726
makes sense. the other issue i ran into was decorators being emitted.
https://github.com/microsoft/TypeScript/blob/0693cc72e6ddb6c7468a14e05888efa2f43ac7b0/src/compiler/transformer.ts#L145-L153 ``` if (languageVersion < ScriptTarget.ESNext) { transformers.push(transformESNext); } if (!compilerOptions.experimentalDecorators && (languageVersion < ScriptTarget.ESNext || !useDefineForClassFields)) { transformers.push(transformESDecorators); } transformers.push(transformClassFields); ``` not clear what the equivalent of this is...
#819 added an `esnext` transform into a new internal package, so now there's a more obvious place to add classFields and decorator support in `transformers.GetScriptTransformers` https://github.com/microsoft/typescript-go/blob/3978f5070cf2155f6786d769715cfe119f9d4d56/internal/transformers/transformer.go#L92-L93
the flamegraph is empty: im' not seeing much data in the dev menus: