[DEPRECATION canary] Deprecate Ember.String and prototype extension#15739
[DEPRECATION canary] Deprecate Ember.String and prototype extension#15739Serabe wants to merge 1 commit intoemberjs:masterfrom
Conversation
04075a9 to
37a06d4
Compare
|
@locks any update on this? |
4abca4f to
e27061b
Compare
|
restarting job. Seemed a problem with yarn. |
|
Passing. |
rwjblue
left a comment
There was a problem hiding this comment.
Looking really good! Only a few small questions/adjustments that I commented on inline...
| { | ||
| id: 'ember-glimmer.ember-string-html-safe', | ||
| until: '3.5.0', | ||
| url: '' |
There was a problem hiding this comment.
Do we know the URL's for these deprecations? I vaguely recall that there was already an open website PR for them...
There was a problem hiding this comment.
Adding the URL from https://github.com/emberjs/website/pull/2995/files
| const StringPrototype = String.prototype; | ||
|
|
||
| function deprecateEmberStringExtension(fn, opts = {}) { | ||
| let { name } = fn; |
There was a problem hiding this comment.
I don't think we can rely on Function.name (AFAIK it isn't supported on all platforms, which would make this fail in production).
Checkout https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name for a decent compat table (it isn't supported on IE at all)...
| return CAPITALIZE_CACHE.get(str); | ||
| } | ||
|
|
||
| function deprecateEmberStringUtil(fn, opts = {}) { |
There was a problem hiding this comment.
This seems roughly like the same function in the other file, can we share between the two and only have one implementation?
| } | ||
|
|
||
| function deprecateEmberStringUtil(fn, opts = {}) { | ||
| let { name } = fn; |
There was a problem hiding this comment.
Same concern as above RE: Function.name
packages/ember/lib/index.js
Outdated
| @type Object | ||
| @private | ||
| */ | ||
| Ember.Template = { |
There was a problem hiding this comment.
Lets underscore this, I'd hate for folks to start using it ....
|
Addressed your suggestions. Thanks for the review! |
e6c86fc to
cf9e15b
Compare
c257d81 to
e0c7a5f
Compare
|
Rebased and squashed. |
e0c7a5f to
f7e9fca
Compare
fe778f1 to
a672acb
Compare
a672acb to
e9a150c
Compare
|
Having lots of timeouts while doing |
|
Yay! I got tests passing after restarting some jobs several times. |
e9a150c to
5b80853
Compare
|
@rwjblue should we merge this? |
|
@mmun negatory, sir. we need to publish the deprecation guides and release the addon before. |
5b80853 to
c034404
Compare
|
Rebased! |
|
Rebased! |
|
I will rebase this at some point, quite likely, next Friday. Would that be ok, @locks ? |
c034404 to
d874956
Compare
|
I redid the whole PR because this rebase was going to be harder than redoing everything. |
This PR deprecates the use of String prototype extension and Ember.String namespace. Methods coming from ember-runtime --- A new `StringUtils` object is added, to be used internally by Ember instead of using the same object being exposed as `Ember.String`. This simplifies testing and the changes required in the rest of the code. Also, dropping the deprecated code will be much simpler. Methods coming from ember-glimmer --- Deprecated versions are being added and reexported as the same global the non-deprecated versions were. Besides, the non-deprecated version is being exported under the new global `Ember.Template`. The `Ember.Template` is just a placeholder until the final global is chosen.
d874956 to
4fc3dd5
Compare
|
Green again. |
|
Closing this. Sorry, I cannot keep rebasing this. |
|
Sorry 😢I'll wait for #16530. |
This PR deprecates the use of String prototype extension and
Ember.String namespace.
Methods coming from ember-runtime
A new
StringUtilsobject is added, to be used internally by Emberinstead of using the same object being exposed as
Ember.String. Thissimplifies testing and the changes required in the rest of the code.
Also, dropping the deprecated code will be much simpler.
Methods coming from ember-glimmer
Deprecated versions are being added and reexported as the same global
the non-deprecated versions were. Besides, the non-deprecated version is
being exported under the new global
Ember.Template.The
Ember.Templateis just a placeholder until the final global is chosen.