Skip to content

Commit e311d26

Browse files
committed
Deprecate calling Location.create
This functionality has been deprecated since 2014, but there wasn't any deprecation message before. See commit #1d1d0db4 for details.
1 parent 9d954ab commit e311d26

File tree

1 file changed

+15
-1
lines changed
  • packages/@ember/-internals/routing/lib/location

1 file changed

+15
-1
lines changed

packages/@ember/-internals/routing/lib/location/api.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assert } from '@ember/debug';
1+
import { assert, deprecate } from '@ember/debug';
22

33
export interface EmberLocation {
44
implementation: string;
@@ -111,6 +111,20 @@ export default {
111111
Boolean(implementationClass)
112112
);
113113

114+
deprecate(
115+
"Calling `create` on Location class is deprecated. Instead, use `container.lookup('location:my-location')` to lookup the location you need.",
116+
false,
117+
{
118+
id: 'deprecate-auto-location',
119+
until: '4.0.0',
120+
url: 'https://emberjs.com/deprecations/v3.x#toc_deprecate-auto-location',
121+
for: 'ember-source',
122+
since: {
123+
enabled: '3.28.1',
124+
},
125+
}
126+
);
127+
114128
return implementationClass.create(...arguments);
115129
},
116130

0 commit comments

Comments
 (0)