You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observe that the externs file now contains no mention of a property other, so Closure Compiler will most likely happily rename it if it encounters the property in your program. Ouch.
Depending on host configuration, we do print a warning when encountering this, but warnings are typically hard to find for users in large builds. Emitting a comment in the source text also doesn't help much, as few people will read their generated externs sources.
Given the high stakes in externs, we could consider erroring out instead of emitting a warning in this case. However this might break using many .d.ts files with tsickle, so we need to balance the impact here.
Example comes from issue #1067:
Because it cannot represent intersection types to Closure Compiler, tsickle will emit something like:
Observe that the externs file now contains no mention of a property
other
, so Closure Compiler will most likely happily rename it if it encounters the property in your program. Ouch.Depending on host configuration, we do print a warning when encountering this, but warnings are typically hard to find for users in large builds. Emitting a comment in the source text also doesn't help much, as few people will read their generated externs sources.
Given the high stakes in externs, we could consider erroring out instead of emitting a warning in this case. However this might break using many
.d.ts
files with tsickle, so we need to balance the impact here./CC @engelsdamien
The text was updated successfully, but these errors were encountered: