-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
feat(runtime-dom): trusted types compatibility #10844
Commits on May 30, 2024
-
fix: ensure no trusted types violations on fresh mount
This isn't a complete fix because `innerHTML` assignment also occurs in `insertStaticContent`. But at least this makes the hello-world app work with trusted types enabled. I'm still figuring out how to add test cases for trusted types. Remaining todos: - [ ] Add test cases for trusted types. - [ ] Fix `insertStaticContent` to be compatible with trusted types, we may need a `vue` policy for that case. - [ ] Add a note in the docs about trusted types compatibility. - [ ] Allow trusted values to be passed to `v-html` and other props, this ultimately fixes vuejs/rfcs#614
Configuration menu - View commit details
-
Copy full SHA for 286be04 - Browse repository at this point
Copy the full SHA 286be04View commit details -
fix(runtime-dom): use a trusted policy for innerHTML assignment in ap…
…p mounting Because `replaceChildren` isn't supported in all browsers, we still need to use `innerHTML` to clear the container before mounting the app. I left the compat mode implementation in `runtime-core` as is because it doesn't feel right to use a DOM-only API in `runtime-core`.
Configuration menu - View commit details
-
Copy full SHA for 455861f - Browse repository at this point
Copy the full SHA 455861fView commit details -
fix: trusted types compat for
insertStaticContent
It seems that the only source of the `content` is the output of `stringifyStatic` in `compiler-dom`. I guess no additional check is needed here.
Configuration menu - View commit details
-
Copy full SHA for 3ef9b8c - Browse repository at this point
Copy the full SHA 3ef9b8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for f853479 - Browse repository at this point
Copy the full SHA f853479View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4b0b42 - Browse repository at this point
Copy the full SHA e4b0b42View commit details -
fix: use textContent instead of innerHTML for clearing container
Setting `textContent` to empty string is the equivalent of setting `innerHTML` to empty string, but it doesn't trigger trusted types policy violation. Though maybe not as clear and performant as `trustedTypes.emptyHTML`, the code is more succint considering that we don't need to check for the existence of `trustedTypes` before using it.
Configuration menu - View commit details
-
Copy full SHA for 0dc028e - Browse repository at this point
Copy the full SHA 0dc028eView commit details -
Configuration menu - View commit details
-
Copy full SHA for cc5cd3c - Browse repository at this point
Copy the full SHA cc5cd3cView commit details -
feat: add a feature flag to turn on trusted types policy creation, an…
…d default to false
Configuration menu - View commit details
-
Copy full SHA for e9f8419 - Browse repository at this point
Copy the full SHA e9f8419View commit details -
Configuration menu - View commit details
-
Copy full SHA for a608074 - Browse repository at this point
Copy the full SHA a608074View commit details -
Configuration menu - View commit details
-
Copy full SHA for 60e5471 - Browse repository at this point
Copy the full SHA 60e5471View commit details
Commits on May 31, 2024
-
Configuration menu - View commit details
-
Copy full SHA for bef7c83 - Browse repository at this point
Copy the full SHA bef7c83View commit details
Commits on Aug 2, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1c64a31 - Browse repository at this point
Copy the full SHA 1c64a31View commit details -
Configuration menu - View commit details
-
Copy full SHA for d97b541 - Browse repository at this point
Copy the full SHA d97b541View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6950fb5 - Browse repository at this point
Copy the full SHA 6950fb5View commit details -
Configuration menu - View commit details
-
Copy full SHA for da0c8eb - Browse repository at this point
Copy the full SHA da0c8ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1dbec32 - Browse repository at this point
Copy the full SHA 1dbec32View commit details