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

Generate externs for google closure compiler #35

Open
mk0x9 opened this issue Mar 16, 2019 · 5 comments
Open

Generate externs for google closure compiler #35

mk0x9 opened this issue Mar 16, 2019 · 5 comments

Comments

@mk0x9
Copy link
Contributor

mk0x9 commented Mar 16, 2019

Google closure compiler mangles all the property names unless you either use bracket syntax to access property (foo['bar'] instead of foo.bar) or specify extern file with external declarations (works similar to ambient declarations in typescript).

Would be extremely nice to be able to generate extern definitions for closure compiler!

@mk0x9
Copy link
Contributor Author

mk0x9 commented Mar 16, 2019

I think I can do it. The only things I yet noted that JSDoc doesn't support intersection types (just enumerate all possible properties and their types) and literal values (just use possible types of that values).

https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System

@mk0x9
Copy link
Contributor Author

mk0x9 commented Mar 16, 2019

I did basic stuff (mk0x9@f720056), but merging type definitions with same properties would take some time later.

@gcanti
Copy link
Owner

gcanti commented Mar 18, 2019

@mk0x9 not sure what's the problem here (I'm not acquainted with GCC) but I think that you can disable renaming google/closure-compiler#2707 is this related?

@mk0x9
Copy link
Contributor Author

mk0x9 commented Mar 18, 2019

It kinda defeats purpose of ADVANCED optimizations. I'll attach examples later, probably at the evening, showing what it is and why I'm doing this.

@mk0x9
Copy link
Contributor Author

mk0x9 commented Mar 18, 2019

Here you can find brief description about GCC's advanced optimizations: https://developers.google.com/closure/compiler/docs/compilation_levels#advanced_optimizations

And here is useful introduction to GCC: https://github.com/roman01la/closure-compiler-handbook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants