Skip to content

Commit cc7e796

Browse files
authored
Merge pull request #2174 from ember-learn/super-rentals-tutorial
Tutorial Updates
2 parents 90576a9 + d5c2d64 commit cc7e796

5 files changed

Lines changed: 23 additions & 16 deletions

File tree

guides/release/tutorial/part-1/orientation.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ To verify that your installation was successful, run:
2424

2525
```shell
2626
$ ember --version
27-
ember-cli: 6.8.0
28-
node: 18.20.8
27+
ember-cli: 6.9.1
28+
node: 20.19.6
2929
os: linux x64
3030
```
3131

@@ -61,6 +61,7 @@ Creating a new Ember app in /home/runner/work/super-rentals-tutorial/super-renta
6161
create app/models/.gitkeep
6262
create app/router.js
6363
create app/routes/.gitkeep
64+
create app/services/.gitkeep
6465
create app/styles/app.css
6566
create /home/runner/work/super-rentals-tutorial/super-rentals-tutorial/dist/code/super-rentals/app/templates/application.gjs
6667
create config/ember-cli-update.json
@@ -122,6 +123,8 @@ super-rentals
122123
│ │ └── .gitkeep
123124
│ ├── routes
124125
│ │ └── .gitkeep
126+
│ ├── services
127+
│ │ └── .gitkeep
125128
│ ├── styles
126129
│ │ └── app.css
127130
│ ├── templates
@@ -165,7 +168,7 @@ super-rentals
165168
├── testem.cjs
166169
└── vite.config.mjs
167170
168-
27 directories, 56 files
171+
28 directories, 58 files
169172
```
170173

171174
We'll learn about the purposes of these files and folders as we go. For now, just know that we'll spend most of our time working within the `app` folder.
@@ -189,13 +192,14 @@ building...
189192

190193
Build successful (9761ms)
191194

195+
192196
Slowest Nodes (totalTime >= 5%) | Total (avg)
193197
-+-
194-
Babel: @embroider/macros (1) | 436ms
198+
Babel: @embroider/macros (1) | 389ms
195199

196200

197201

198-
VITE v6.3.6 ready in 4143 ms
202+
VITE v7.3.0 ready in 3754 ms
199203

200204
➜ Local: http://localhost:4200/
201205
```

guides/release/tutorial/part-1/reusable-components.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ building...
9999

100100
Build successful (13286ms)
101101

102+
102103
Slowest Nodes (totalTime >= 5%) | Total (avg)
103104
-+-
104-
Babel: @embroider/macros (1) | 423ms
105+
Babel: @embroider/macros (1) | 389ms
105106

106107

107108

108-
VITE v6.3.6 ready in 4119 ms
109+
VITE v7.3.0 ready in 3756 ms
109110

110111
➜ Local: http://localhost:4200/
111112
```

guides/release/tutorial/part-1/working-with-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Awesome! Now we're in business.
418418

419419
## Loops and Local Variables in Templates with `{{#each}}`
420420

421-
The last change we'll need to make is to our `index.hbs` route template, where we invoke our `<Rental>` components. Previously, we were passing in `@rental` as `@model` to our components. However, `@model` is no longer a single object, but rather, an array! So, we'll need to change this template to account for that.
421+
The last change we'll need to make is to our `index.gjs` route template, where we invoke our `<Rental>` components. Previously, we were passing in `@rental` as `@model` to our components. However, `@model` is no longer a single object, but rather, an array! So, we'll need to change this template to account for that.
422422

423423
Let's see how.
424424

guides/release/tutorial/part-2/ember-data.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,18 +334,14 @@ Let's start customizing the things that didn't work for us by default. Specifica
334334
335335
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.
336336
337-
```js { data-filename="app/app.js" data-diff="+7,+8,+9,+10,+11" }
337+
```js { data-filename="app/app.js" data-diff="+21,+22,+23,+24,+25" }
338338
import Application from '@ember/application';
339339
import compatModules from '@embroider/virtual/compat-modules';
340340
import Resolver from 'ember-resolver';
341341
import loadInitializers from 'ember-load-initializers';
342342
import config from 'super-rentals/config/environment';
343343
import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros';
344-
import { setBuildURLConfig } from '@ember-data/request-utils';
345-
346-
setBuildURLConfig({
347-
namespace: 'api',
348-
});
344+
import setupInspector from '@embroider/legacy-inspector-support/ember-source-4.12';
349345

350346
if (macroCondition(isDevelopingApp())) {
351347
importSync('./deprecation-workflow');
@@ -355,9 +351,15 @@ export default class App extends Application {
355351
modulePrefix = config.modulePrefix;
356352
podModulePrefix = config.podModulePrefix;
357353
Resolver = Resolver.withModules(compatModules);
354+
inspector = setupInspector(this);
358355
}
359356

360357
loadInitializers(App, config.modulePrefix, compatModules);
358+
import { setBuildURLConfig } from '@ember-data/request-utils';
359+
360+
setBuildURLConfig({
361+
namespace: 'api',
362+
});
361363
```
362364
363365
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.

guides/release/tutorial/part-2/provider-components.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- Heads up! This is a generated file, do not edit directly. You can find the source at https://github.com/ember-learn/super-rentals-tutorial/blob/master/src/markdown/tutorial/part-2/12-provider-components.md -->
22

3-
In this chapter, we'll work on adding a new search feature, and refactor our `index.hbs` template into a new component along the way. We'll learn about a new pattern for passing data around between components, too! Once we're done, our page will look like this:
3+
In this chapter, we'll work on adding a new search feature, and refactor our `index.gjs` template into a new component along the way. We'll learn about a new pattern for passing data around between components, too! Once we're done, our page will look like this:
44

55
<!-- TODO: make this a gif instead -->
66

@@ -58,7 +58,7 @@ Awesome, one step done. Now, this input looks great, but it doesn't actually _do
5858

5959
In order to make our search box actually work, we are going to need to retain and store the text that the user types in when they use the search box. This text is the search query, and it is a piece of _[state](../../../components/component-state-and-actions/)_ that is going to change whenever the user types something into the search box.
6060

61-
But where are we going to put this newly-introduced piece of state? In order to wire up the search box, we need a place to store the search query. At the moment, our search box lives on the `index.hbs` route template, which doesn't have a good place to store this search query state. Darn, this would be so much easier to do if we had a component, because we could just store the state directly on the component!
61+
But where are we going to put this newly-introduced piece of state? In order to wire up the search box, we need a place to store the search query. At the moment, our search box lives on the `index.gjs` route template, which doesn't have a good place to store this search query state. Darn, this would be so much easier to do if we had a component, because we could just store the state directly on the component!
6262

6363
Wait...why don't we just refactor the search box into a component? Once we do that, this will all be a bit easier—hooray!
6464

0 commit comments

Comments
 (0)