Skip to content

Commit d1fb1e7

Browse files
authored
Merge pull request #19656 from mixonic/mixonic/remove-string-based-component-manager
Remove string-based setComponentManager
2 parents 561d569 + 6446a60 commit d1fb1e7

File tree

3 files changed

+2
-38
lines changed

3 files changed

+2
-38
lines changed

packages/@ember/-internals/glimmer/lib/utils/managers.ts

+2-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Owner } from '@ember/-internals/owner';
22
import { deprecate } from '@ember/debug';
3-
import { COMPONENT_MANAGER_STRING_LOOKUP } from '@ember/deprecated-features';
43
import { DEBUG } from '@glimmer/env';
54
import { ComponentManager } from '@glimmer/interfaces';
65
import {
@@ -10,33 +9,10 @@ import {
109
} from '@glimmer/manager';
1110

1211
export function setComponentManager(
13-
stringOrFunction: string | ((owner: Owner) => ComponentManager<unknown>),
12+
manager: (owner: Owner) => ComponentManager<unknown>,
1413
obj: object
1514
): object {
16-
let factory: (owner: Owner) => ComponentManager<unknown>;
17-
18-
if (COMPONENT_MANAGER_STRING_LOOKUP && typeof stringOrFunction === 'string') {
19-
deprecate(
20-
'Passing the name of the component manager to "setupComponentManager" is deprecated. Please pass a function that produces an instance of the manager.',
21-
false,
22-
{
23-
id: 'deprecate-string-based-component-manager',
24-
until: '4.0.0',
25-
url: 'https://deprecations.emberjs.com/v3.x/#toc_component-manager-string-lookup',
26-
for: 'ember-source',
27-
since: {
28-
enabled: '3.8.0',
29-
},
30-
}
31-
);
32-
factory = function (owner: Owner) {
33-
return owner.lookup<ComponentManager<unknown>>(`component-manager:${stringOrFunction}`)!;
34-
};
35-
} else {
36-
factory = stringOrFunction as (owner: Owner) => ComponentManager<unknown>;
37-
}
38-
39-
return glimmerSetComponentManager(factory, obj);
15+
return glimmerSetComponentManager(manager, obj);
4016
}
4117

4218
export let componentCapabilities = glimmerComponentCapabilities;

packages/@ember/-internals/glimmer/tests/integration/custom-component-manager-test.js

-11
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@ class ComponentManagerTest extends RenderingTestCase {
8080
moduleFor(
8181
'Component Manager - Curly Invocation',
8282
class extends ComponentManagerTest {
83-
['@test the string based version of setComponentManager is deprecated']() {
84-
expectDeprecation(() => {
85-
setComponentManager(
86-
'basic',
87-
EmberObject.extend({
88-
greeting: 'hello',
89-
})
90-
);
91-
}, 'Passing the name of the component manager to "setupComponentManager" is deprecated. Please pass a function that produces an instance of the manager.');
92-
}
93-
9483
['@test it can render a basic component with custom component manager']() {
9584
let ComponentClass = setComponentManager(
9685
createBasicManager,

packages/@ember/deprecated-features/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// not the version that the feature will be removed.
55

66
export const ROUTER_EVENTS = !!'4.0.0';
7-
export const COMPONENT_MANAGER_STRING_LOOKUP = !!'3.8.0';
87
export const JQUERY_INTEGRATION = !!'3.9.0';
98
export const APP_CTRL_ROUTER_PROPS = !!'3.10.0-beta.1';
109
export const MOUSE_ENTER_LEAVE_MOVE_EVENTS = !!'3.13.0-beta.1';

0 commit comments

Comments
 (0)