Closed simonsarris closed 1 year ago
Sorry for the slow response. I overlooked this issue in the last days.
Accessor support was added in https://github.com/angular/tsickle/commit/d65bd3ee85ce3f7a705c755f7b7011a1ff6e4ab8.
We haven't had a tsickle release since then, mostly because we consider tsickle unsupported. Tsickle is only useful with Closure Compiler and unless you have specific use cases you're probably better off with one of the newer minifiers out there.
I see. I am using the Closure Compiler - in fact I've been using the Closure Compiler since about 2011, maybe 2012, to compile a library (GoJS). When we moved to TypeScript I originally looked at tsickle but rejected it, and instead wrote my own convoluted script to massage the TS output to work in the CC. This has been fine for years.
However, Closure Compiler recently deprecated the @expose
flag, which I was making heavy use of, so I figured I should make real externs, hence renewed interest in how tsickle is doing it.
Thank you for replying. I suppose I should close this.
Yeah, I'm sorry about that. I would recommend you try one of the newer minifiers (terser, esbuild, swc) and see if you can get similar results from them. We found these optimize most open source libraries really well and are much faster than Closure Compiler.
The closure Compiler is a beautiful piece of software, and the size gains are really good (though people don't care as much about bundle size a decade later), so I hope to keep using it. But I may need to roll my own externs-maker. Thanks for you explanations.
Sorry I know that this is not a bug report per se, but looking for a clarification of tsickle's limitations.
I am hoping to use tsickle with a
.d.ts
input to create closure externs. With a simple example like:The ouput contains "TODO: GetAccessor" for the properties:
Is this an intentional limitation of tsickle? Or is there an expected syntax for accessors? Or something else I'm doing quite wrong?