-
Notifications
You must be signed in to change notification settings - Fork 28
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
Property naming idea(s) #16
Comments
The thing we could automate is that tsickle sees
it could automatically convert to |
@alexeagle I read that also, and it seemed like a solution for the problem how to talk about data from the outside world. When setting up interfaces that describe data coming from an external source - JSON API or whatever - a developer would use that extra word of syntax, then Tsickle generates output such that Closure knows to preserve field names. But... I'd prefer, if possible to not treat Angular templates as external code that needs such treatment. Rather, compile templates + app code in such a way that Closure can do its whole-program-optimization magic, shortening field names, etc. With this further elaboration - does it seem feasible? Or is the best we can aim for, to treat Angular templates as "outside", and automatically flag data headed there to not rename fields? |
@kylecordes My experience so far is that template references already work that way. I have only had to quote properties when referring to properties in http responses. Example here: https://github.com/thelgevold/closure-compiler-angular-bundling-old/tree/migrate-demo/src/components/tree-view In the Treeview I define properties that are referenced from html and the component class. It generally seems to work as intended. Are you seeing cases where this breaks? |
@chuckjaz had some discussion with TypeScript team about this a couple weeks ago. I think we should plan sometime maybe in Q1 to have a serious design discussion about safer type-checking for property renaming. In the meantime let's move discussion to microsoft/TypeScript#14267 |
This is an issue to kick around ideas for property naming (Closure renaming...) of properties in objects exposed by Components to templates.
I'm not a fan of a mechanism to further automate forcing quoted property identifiers that don't get renamed - because:
Rather, I'd like Angular + tsickle + CC to meet the following contract:
IF, as a developer, I:
THEN,
Is this feasible? Desirable?
cc @alexeagle @thelgevold
The text was updated successfully, but these errors were encountered: