-
Notifications
You must be signed in to change notification settings - Fork 110
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
Guidelines for supporting ADVANCED compile #305
Comments
It would be great for us to document this, thanks for filing the bug! To start with, https://developers.google.com/closure/compiler/docs/api-tutorial3 is a good read. It is my ultimate goal with tsickle that it always just does the right thing and you don't need to worry about what the compiler will do. See this bug label: |
Thanks @evmar, sounds like tsickle won't be able to insulate the user (in this case a generic typescript author) from knowing about what patterns to avoid to use ADVANCED compile. I'm coming into a project that has a medium'ish sized existing typescript codebase, probably overly optimistic / naiive to expect that it will work with advanced compilation without some serious examination of the codebase. Is that your sense as well? |
In practice it boils down to a few things:
|
And yes, it's likely you'll compile your project and discover some problems. However, usually it's not super hard to debug, though you will have to squint at some optimized code. |
Does tsickle convert |
No. It's important to be able to write let obj = JSON.parse(someText);
console.log(obj["foo"]); // should use "foo" in the output, as that's what the JSON has
// note that Closure might actually compile that into obj.foo as that's fewer characters My current thinking is we should warn people away from it in the case where you're using a string to access a property: |
Given a typescript codebase with no prior knowledge of Closure, what steps need to be taken to make it safe for advanced closure compilation (through tsickle)?
The text was updated successfully, but these errors were encountered: