-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add trustedHTML via alias/re-export of htmlSafe #20939
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
Add trustedHTML via alias/re-export of htmlSafe #20939
Conversation
Estimated Asset SizesDiff --- main/out.txt 2025-06-23 17:58:14.000000000 +0000
+++ pr/./pr-15831737610/out.txt 2025-06-23 18:08:28.000000000 +0000
@@ -1,34 +1,34 @@
╔═══════╤═══════════╤═══════════╗
║ │ Min │ Gzip ║
╟───────┼───────────┼───────────╢
-║ Total │ 408.76 KB │ 228.78 KB ║
+║ Total │ 408.84 KB │ 228.88 KB ║
╚═══════╧═══════════╧═══════════╝
╔══════════════════════╤═══════════╤══════════╗
║ @ember/* │ Min │ Gzip ║
╟──────────────────────┼───────────┼──────────╢
-║ Total │ 239.15 KB │ 147.1 KB ║
+║ Total │ 239.23 KB │ 147.2 KB ║
╟──────────────────────┼───────────┼──────────╢
-║ -internals │ 35.39 KB │ 25.43 KB ║
-║ application │ 12.83 KB │ 7.66 KB ║
+║ -internals │ 35.44 KB │ 25.49 KB ║
+║ application │ 12.83 KB │ 7.62 KB ║
║ array │ 12.66 KB │ 7.32 KB ║
║ canary-features │ 304 B │ 419 B ║
-║ component │ 1.07 KB │ 976 B ║
+║ component │ 1.07 KB │ 1004 B ║
║ controller │ 1.8 KB │ 1.36 KB ║
║ debug │ 11.4 KB │ 7.92 KB ║
║ deprecated-features │ 31 B │ 77 B ║
║ destroyable │ 561 B │ 383 B ║
║ enumerable │ 259 B │ 387 B ║
-║ helper │ 823 B │ 583 B ║
+║ helper │ 823 B │ 570 B ║
║ instrumentation │ 2.43 KB │ 1.78 KB ║
-║ modifier │ 669 B │ 601 B ║
+║ modifier │ 669 B │ 614 B ║
║ object │ 33.78 KB │ 20.79 KB ║
║ owner │ 159 B │ 178 B ║
-║ renderer │ 385 B │ 331 B ║
-║ routing │ 58.05 KB │ 33.42 KB ║
+║ renderer │ 385 B │ 327 B ║
+║ routing │ 58.05 KB │ 33.43 KB ║
║ runloop │ 2.2 KB │ 1.33 KB ║
║ service │ 859 B │ 741 B ║
-║ template │ 396 B │ 343 B ║
+║ template │ 430 B │ 390 B ║
║ template-compilation │ 429 B │ 366 B ║
║ template-compiler │ 57.81 KB │ 30.44 KB ║
║ template-factory │ 94 B │ 160 B ║ Details
|
@@ -456,7 +456,7 @@ export { | |||
type FunctionBasedHelper, | |||
type FunctionBasedHelperInstance, | |||
} from './lib/helper'; | |||
export { SafeString, htmlSafe, isHTMLSafe } from './lib/utils/string'; | |||
export { SafeString, trustedHTML, isTrustedHTML, htmlSafe, isHTMLSafe } from './lib/utils/string'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not to bike shed on this, since I'm happy to see this land, even as-is, but what about trustHTML
so the method is a verb?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I'd really love to see SafeString
become TrustedHTML
as well, but I know that's more of a lift.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
am fan, verb fits more with what we're doing, and I'll reject all noun-proposals going forward for this haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I'd really love to see SafeString become TrustedHTML as well, but I know that's more of a lift.
ya, I could alias this, too
I'm 👍 but types are failing |
htmlsafe is a misleading phrase, so here we are aliasing to what we really mean: that we trust the HTML
we should do an RFC to deprecate htmlSafe