--experimentalDecorators and --emitDecoratorMetadata
This PR ports emit for --experimentalDecorators and --emitDecoratorMetadata, since many users of the former also enable the later (which isn't even supported with standardized decorators in strada, apparently).
This looks pretty solid from the baselines at this point, I've only noticed two things I still want to follow up on, or at least get someone else's opinion on:
- The single sourcemap test'd diffs are still all outta line - there's just way more mappings. Something is probably missing a
EFNoSourceMapsthat should have it. Or it could just be class fields not being transformed yet. I'm unsure. (See sourceMapValidationDecorators.sourcemap.txt) Somewhere there's a nicer tool for viewing sourcemap diffs than our textual baselines, I just need to find it again... - There's a
target: es5test of a constructor reference to a decorated class within a static of that class - binding behavior here intentionally changes after es6, and the test is effectively targetinges6now (thanks to the new minimum target), so it's probably fine, but I'm not wholly convinced.
Additionally, I haven't included the conditional lookup of the BigInt global in emit for targets < es2020 at present. I could add it back, I'm just not completely sure why it was needed in the first place, and with Symbol definitely no longer being maybe-conditional with min target es6, it was the only use of the conditional global type reference emit logic.
Most of the remaining diffs in the touched baselines that weren't outright deleted are just other unported emit features remaining in the diffs - class fields, mostly, and a little await.
Fixes #914
The only other thing is to remove !!! emitDecoratorMetadata from program.go where we would have emitted an error on this option.
Thank you for tackling this 🙏
- Somewhere there's a nicer tool for viewing sourcemap diffs than our textual baselines, I just need to find it again...
Perhaps you're thinking of https://evanw.github.io/source-map-visualization
The only other thing is to remove !!! emitDecoratorMetadata from program.go where we would have emitted an error on this option.
AFAIK that's already gone, replaced with the error requiring emitDecoratorMetadata be specified alongside experimentalDecorators.
Great news 🎉
I am so happy to see this PR. I now know what to experiment this night. Thank you @weswigham and everyone involved for the work done.