Skip to content

Restore Trusted Types from BCD 6.0.24 #2074

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

saschanaz
Copy link
Contributor

@saschanaz saschanaz commented Jul 19, 2025

Closes #1246

Copy link
Contributor

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.

@saschanaz
Copy link
Contributor Author

Every feedback from #1246 applies here too.

@saschanaz
Copy link
Contributor Author

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? 😞)

@saschanaz
Copy link
Contributor Author

saschanaz commented Jul 19, 2025

Trusted* types should be ignored from the getter.

This needs TS5.1+ for microsoft/TypeScript#53417. Meaning anyone with pre-5.1 will not be able to assign trusted types without any hack.

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)

@jakebailey
Copy link
Member

Oh boy, I wonder how much this conflicts with the existing trusted types that people are using...

@saschanaz
Copy link
Contributor Author

Should certainly take a look at https://www.npmjs.com/package/@types/trusted-types?activeTab=code to reduce friction.

@saschanaz
Copy link
Contributor Author

Although the library's private brand: true effectively makes it exclusive to any other declaration AFAICT...

@jakebailey
Copy link
Member

Although the library's private brand: true effectively makes it exclusive to any other declaration AFAICT...

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...

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

Successfully merging this pull request may close these issues.

2 participants