Skip to content

Commit 2cac1c0

Browse files
authored
Merge pull request #74 from kratiahuja/minor-initializer-updates
Fixing minor corrections
2 parents 7dbaa97 + ab345b1 commit 2cac1c0

2 files changed

Lines changed: 5 additions & 18 deletions

File tree

markdown/docs/addon-author-guide.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,22 +335,24 @@ under `fastboot` directory. An example of directory structure is as follows:
335335
--------+ bar.js
336336
```
337337

338-
An example of how `foo1.js` from the above example will look as:
338+
An example of how `bar.js` from the above example will look as:
339339

340340
```js
341341
function initialize(app) {
342342
// do stuff that will only run in Node
343343
}
344344

345345
export default {
346-
name: 'foo1',
346+
name: 'bar',
347347
initialize: initializer
348348
}
349349
```
350350

351351
In the Node only initializer, you don't need to wrap them with any FastBoot check since the above initializer is never
352352
sent to the browser.
353353

354+
**Note**: You could define initializers for browser and Node with the same filename and `name` property. For example, you have an initializer `foo.js` under `app/initializers/foo.js` and `fastboot/initializers/foo.js` with the initializer `name` set to `foo`. When running the app in browser, `app/initializers/foo.js` will run. When running the app in Node, `fastboot/initializers/foo.js` will run.
355+
354356
## Requiring Node Modules
355357

356358
Some addons may need functionality when running in FastBoot that is

yarn.lock

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,13 +2906,6 @@ ember-export-application-global@^2.0.0:
29062906
dependencies:
29072907
ember-cli-babel "^6.0.0-beta.7"
29082908

2909-
ember-factory-for-polyfill@^1.1.0:
2910-
version "1.1.2"
2911-
resolved "https://registry.yarnpkg.com/ember-factory-for-polyfill/-/ember-factory-for-polyfill-1.1.2.tgz#ea802002ec55154eea7be82abb586e77429be579"
2912-
dependencies:
2913-
ember-cli-babel "^5.1.7"
2914-
ember-cli-version-checker "^1.2.0"
2915-
29162909
29172910
version "0.0.0"
29182911
resolved "https://registry.yarnpkg.com/ember-fr-markdown-file/-/ember-fr-markdown-file-0.0.0.tgz#b875a5ed6a6ec6088881bf857b73aee531b750cb"
@@ -2923,21 +2916,13 @@ [email protected]:
29232916
ember-cli-babel "^5.1.5"
29242917
ember-cli-htmlbars "^1.0.1"
29252918

2926-
2919+
[email protected], ember-getowner-polyfill@^1.0.0:
29272920
version "1.1.1"
29282921
resolved "https://registry.yarnpkg.com/ember-getowner-polyfill/-/ember-getowner-polyfill-1.1.1.tgz#6bb6603827dd2f8f33be2434570a86cc9e5273ff"
29292922
dependencies:
29302923
ember-cli-babel "^5.1.6"
29312924
ember-cli-version-checker "^1.2.0"
29322925

2933-
ember-getowner-polyfill@^1.0.0:
2934-
version "1.2.3"
2935-
resolved "https://registry.yarnpkg.com/ember-getowner-polyfill/-/ember-getowner-polyfill-1.2.3.tgz#ea70f4a48b1c05b91056371d1878bbafe018222e"
2936-
dependencies:
2937-
ember-cli-babel "^5.1.6"
2938-
ember-cli-version-checker "^1.2.0"
2939-
ember-factory-for-polyfill "^1.1.0"
2940-
29412926
ember-hash-helper-polyfill@^0.1.2:
29422927
version "0.1.2"
29432928
resolved "https://registry.yarnpkg.com/ember-hash-helper-polyfill/-/ember-hash-helper-polyfill-0.1.2.tgz#bc8ee6fa59e9541fce07d2cf4f263cf785e9e1db"

0 commit comments

Comments
 (0)