Skip to content

Commit 6b7946c

Browse files
authored
Merge pull request #265 from kategengler/kg-suppress-ember-data-deprecation
2 parents 4725acd + be2b18c commit 6b7946c

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

src/markdown/tutorial/part-2/11-ember-data.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,29 @@ It is worth pointing out that EmberData provides a `store` *[service](../../../s
157157
export { default } from 'ember-data/store';
158158
```
159159
160+
```run:file:patch hidden=true lang=js cwd=super-rentals filename=app/app.js
161+
@@ -6,2 +6,15 @@
162+
163+
+/* This is to account for a deprecation that shipped in ember-cli 6.4
164+
+ with ember-data v5.6 which needs a blueprint update to avoid the
165+
+ deprecation that is otherwise irrelevant for tutorial purposes.
166+
+*/
167+
+import { registerDeprecationHandler } from '@ember/debug';
168+
+registerDeprecationHandler((message, options, next) => {
169+
+ if (message.includes('Using WarpDrive with EmberJS requires')) {
170+
+ return;
171+
+ } else {
172+
+ next(message, options);
173+
+ }
174+
+});
175+
+
176+
if (macroCondition(isDevelopingApp())) {
177+
```
178+
179+
```run:command hidden=true cwd=super-rentals
180+
git add app/app.js
181+
```
182+
160183
Running the tests in the browser confirms that everything is working as intended:
161184
162185
```run:command hidden=true cwd=super-rentals
@@ -272,18 +295,14 @@ Let's start customizing the things that didn't work for us by default. Specifica
272295
The first thing we want to do is have our builder respect a configurable default host and/or namespace. Adding a namespace prefix happens to be pretty common across Ember apps, so EmberData provides a global config mechanism for host and namespace. Typically you will want to do this either in your store file or app file.
273296
274297
```run:file:patch lang=js cwd=super-rentals filename=app/app.js
275-
@@ -3,6 +3,11 @@ import Resolver from 'ember-resolver';
276-
import loadInitializers from 'ember-load-initializers';
277-
import config from 'super-rentals/config/environment';
298+
@@ -5,2 +5,7 @@
278299
import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros';
279300
+import { setBuildURLConfig } from '@ember-data/request-utils';
280301
+
281302
+setBuildURLConfig({
282303
+ namespace: 'api',
283304
+});
284305

285-
if (macroCondition(isDevelopingApp())) {
286-
importSync('./deprecation-workflow');
287306
```
288307
289308
Adding the `.json` extension is a bit less common, and doesn't have a declarative configuration API of its own. We could just modify request options directly in place of use, but that would be a bit messy. Instead, let's create a handler to do this for us.

0 commit comments

Comments
 (0)