rockandrollwithemberjs / rarwe-issues

Errata and updates for the Rock and Roll with Ember.js book
https://rockandrollwithemberjs.com
43 stars 4 forks source link

Code shows absolute import while text claims relative - Chapter 4 Routing #484

Closed GradedJestRisk closed 4 years ago

GradedJestRisk commented 4 years ago

First, we import the configuration from the config/environment module via a relative import. A relative import is one that begins with a . or a .. and follows the rules of relative paths in UNIX operating systems. The absolute module names would be rarwe/router and rarwe/config/environment, respectively, so ./config/environment is a functioning module import from rarwe/router.

But the actual code is import config from 'rarwe/config/environment'; I suggest import config from './config/environment';

balinterdi commented 4 years ago

@GradedJestRisk Thank you, good spot.

GradedJestRisk commented 4 years ago

By the way, it's quite useful when the reader want to replace its own (non-working) file version with the book's one, and his repository name doesn't match rarwe. Are you okay with readers sharing their own code ? It's never mentioned in the book.

balinterdi commented 4 years ago

As access to the (private) repo is a paid add-on, I'd feel somewhat uneasy about my readers sharing their code. You make a good point about possibly different repo names, though we do start all with "ember new rarwe", unless I'm mistaken, so unless someone deviates from the beaten path, rarwe should be the top-level module name.

GradedJestRisk commented 4 years ago

I've turned the repository as private. Why not telling about it when allowing access to source code ?

balinterdi commented 4 years ago

@GradedJestRisk Thanks. You're totally right, I will.

GradedJestRisk commented 4 years ago

There's another import in Chapter 7 songs controller import { Song } from 'rarwe/routes/bands'; Can be replaced by import { Song } from '../../../routes/bands';