Skip to content

Commit b7c6aa0

Browse files
committed
Deprecate Ember.STRINGS
- Remove `getString` from string_registry, it was unused internally and not exposed publicly. (cherry picked from commit e6a9f62)
1 parent deb4c72 commit b7c6aa0

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed
+14-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1+
import { deprecate } from '@ember/debug';
2+
13
// STATE within a module is frowned upon, this exists
24
// to support Ember.STRINGS but shield ember internals from this legacy global
35
// API.
46
let STRINGS: { [key: string]: string } = {};
57

68
export function setStrings(strings: { [key: string]: string }) {
9+
deprecateEmberStrings();
710
STRINGS = strings;
811
}
912

1013
export function getStrings(): { [key: string]: string } {
14+
deprecateEmberStrings();
1115
return STRINGS;
1216
}
1317

14-
export function getString(name: string): string | undefined {
15-
return STRINGS[name];
18+
function deprecateEmberStrings() {
19+
deprecate('Ember.STRINGS is deprecated. It is no longer used by Ember.', false, {
20+
id: 'ember-strings',
21+
for: 'ember-source',
22+
since: {
23+
available: '4.10',
24+
enabled: '4.10.',
25+
},
26+
until: '5.0.0',
27+
});
1628
}

packages/ember/tests/reexports_test.js

+10
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ moduleFor(
6767
});
6868
}
6969

70+
['@test Ember.STRINGS is deprecated'](assert) {
71+
expectDeprecation(() => {
72+
assert.ok(Ember.STRINGS);
73+
}, 'Ember.STRINGS is deprecated. It is no longer used by Ember.');
74+
75+
expectDeprecation(() => {
76+
Ember.STRINGS = {};
77+
}, 'Ember.STRINGS is deprecated. It is no longer used by Ember.');
78+
}
79+
7080
'@test Ember.FEATURES is exported'(assert) {
7181
for (let feature in FEATURES) {
7282
assert.equal(

0 commit comments

Comments
 (0)