-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Deprecate @ember/string when used from ember-source; point users to add the @ember/string
addon
#20344
Deprecate @ember/string when used from ember-source; point users to add the @ember/string
addon
#20344
Conversation
kategengler
commented
Jan 4, 2023
- Duplicate a portion of @ember/string in @ember/-internals/string for internal use by ember-source without triggering deprecations
the `@ember/string` addon - Duplicate a portion of @ember/string in @ember/-internals/string for internal use by ember-source without triggering deprecations
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.
Looks good. For completeness we possibly should add @ember/-internals/string to the list in publish.mjs, though we probably don't actually need it since its is never re-exported.
- Remove `getString` from string_registry, it was unused internally and not exposed publicly.
}, | ||
}); | ||
Object.defineProperty(Ember.String, 'isHTMLSafe', { | ||
function deprecateStringUseOnEmberModule() { |
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.
The prior deprecation here would show Importing htmlSafe from '@ember/string' is deprecated. Please import htmlSafe from '@ember/template
, but would only show when someone was doing
import Ember from 'ember';
Ember.String.htmlSafe('foo');
Now, they will see 'Using Ember.String
is deprecated. Please import methods directly from @ember/string
' If they do that with htmlSafe
or isHTMLSafe
they will then get a deprecation about importing from @ember/template
. It's a little annoying but I think it is the cleanest way forward and most projects will have updated the imports already.
enumerable: true, | ||
configurable: true, | ||
get() { | ||
deprecateImportFromString('isHTMLSafe'); | ||
return isHTMLSafe; | ||
deprecateStringUseOnEmberModule(); |
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.
This deprecation must be here, and not in the definitions of the methods on @ember/string
because it only applies when methods are referenced off the Ember module.