-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This type has been effectively "intimate" for many years, and fits in the same bucket as e.g. `Transition`: it is not user-constructible, but will be constructed by the framework and users need to be able to name it. For example, `ember-intl` needs to be able to see that a string has been marked as trusted to do the right thing to emit it. Internally, clean up a few long-standing TS issues (`any` etc.), make `SafeString` explicitly implement the contract from Glimmer so that if that contract changes, we will know at the definition site, and make the implementation details of how `SafeString` handles the string it wraps `private`. (This does not use a `#`-private field because private class fields have some non-trivial overhead in transpiled contexts, and `SafeString` can appear in fairly hot rendering paths.)
- Loading branch information
1 parent
7b11de3
commit d9a4cb9
Showing
2 changed files
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export { htmlSafe, isHTMLSafe } from '@ember/-internals/glimmer'; | ||
// NOTE: this intentionally *only* exports the *type* `SafeString`, not its | ||
// value, since it should not be constructed by users. | ||
export { htmlSafe, isHTMLSafe, type SafeString } from '@ember/-internals/glimmer'; |