Repository navigation
[Ember] Update htmlSafe and isHTMLSafe types to import from '@ember/template' #50545
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
Merged
weswigham
merged 2 commits into
DefinitelyTyped:master
from
eramod:update-htmlSafe-isHTMLSafe-types
Jan 14, 2021
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm not sure removing this re-export was actually the right thing. See discussions in: #38571
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.
Gah, I had a vague memory there was something like that but when I went poking around I couldn’t find it.
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.
I can’t actually find either any public documentation of the
@ember/stringexports or deprecations thereof, but I believe the issue that spawned this PR was due to@ember/string’s incorrectly publishing types, so presumably they are public? This seems to be a bit of a mess. 😬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.
It is a mess. The
@ember/stringpackage is written in TS and does indeed ship types (that don't includehtmlSafeandisHTMLSafebecause they are not implemented there), but that package is an addon of string utilities extracted from Ember.ember-sourcealso provides@ember/string, which does includehtmlSafeandisHTMLSafeas demonstrated in this twiddle (they are added to@ember/stringhere inember-source, wherehtmlSafeis defined here andisHTMLSafeis defined here). The@ember/stringpackage is not a dep ofember-source, but is is a dep ofember-dataas of 3.24: warp-drive-data/warp-drive#7356. Twiddle only goes up to 3.18, so I tried the same thing I did there locally with a fresh 3.24 app and it still works (is functional) but fails to typecheck. Just downgrading to@types/[email protected]does not work in this case because[email protected]has installed the@ember/stringpackage and TS is using it's types rather than@types/ember__string. If I removeember-data(and thus the@ember/stringpackage) with the downgraded@types/ember__string, it typechecks (and is functional). A solution that does work for both cases, however, is using module augmentation here instead of module declaration. I'll open a PR shortly for this.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.
#50653
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.
Oh, wait found more info!: emberjs/rfc-tracking#26
IMHO we should leave these in until removed (which I assume won't be until Ember 4.0).