Restore Trusted Types from BCD 6.0.24#2074
Conversation
|
Thanks for the PR! This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged. |
|
Every feedback from #1246 applies here too. |
|
Work item - Trusted* types should be ignored from the getter. And those types need to get the nominal type hack too. (Why in 2025 we still have no official solution for this? 😞) |
This needs TS5.1+ for microsoft/TypeScript#53417. Meaning anyone with pre-5.1 will not be able to assign trusted types without Edit: well, given we only have 5.5/5.6 backward-compat types, this effectively means pre-5.5 users would get problems. (I really don't want to add more unless it's super duper required) |
|
Oh boy, I wonder how much this conflicts with the existing trusted types that people are using... |
|
Should certainly take a look at https://www.npmjs.com/package/@types/trusted-types?activeTab=code to reduce friction. |
|
Although the library's |
Yeah, they are declared as classes, and that private brand means they are nominal. I think this is definitely something that needs to be rectified somehow... |
Closes #1246