Expose fastbootConfigTree hook#515
Expose fastbootConfigTree hook#515kratiahuja merged 1 commit intoember-fastboot:masterfrom kratiahuja:config-tree
Conversation
|
Tests will pass once new version of |
README.md
Outdated
| fastbootConfigTree() { | ||
| return { | ||
| '<engine-name>/config/environment': { | ||
| 'foo': 'bar |
There was a problem hiding this comment.
Missing an end quote here (throws off the markdown parser)
| contents.push( | ||
| 'if (typeof FastBoot !== \'undefined\') {', | ||
| 'return FastBoot.config();', | ||
| 'return FastBoot.config(\'' + appConfigModule + '\');', |
There was a problem hiding this comment.
Technically, this doesn't have to change right (since we do not intend to require the argument)?
There was a problem hiding this comment.
No it doesn't have to change. Just wanted to make it consistent and less magic :)
package-lock.json
Outdated
| @@ -0,0 +1,11312 @@ | |||
| { | |||
There was a problem hiding this comment.
We should stick with either yarn.lock or package-lock.json in this repo.
There was a problem hiding this comment.
Yes I didn't mean to commit package-lock.json.
| // this advance hook. | ||
| this.project.addons.forEach((addon) => { | ||
| if (addon.fastbootConfigTree) { | ||
| let configFromAddon = addon.fastbootConfigTree(); |
There was a problem hiding this comment.
@kratiahuja should environment be passed to this hook as an argument? Similar to how environment is provided to ember-cli Addon config hook https://ember-cli.com/api/classes/Addon.html#method_config
There was a problem hiding this comment.
No I don't see that is something going to be used by addons unless you have a usecase in mind.
|
Ok so all tests on Node 6 and Nod 8 should pass now. Node 4 will pass once ember-data issue is merged. @rwjblue this should be ready for another review. |
rwjblue
left a comment
There was a problem hiding this comment.
Only one minor fix in the README, but otherwise looks good to me.
README.md
Outdated
| ```js | ||
| fastbootConfigTree() { | ||
| return { | ||
| '<engine-name>/config/environment': { |
There was a problem hiding this comment.
I think that the key here now should be <engine-name>.
|
Node 4 is breaking again on ember data. |
|
Restarted Node4 travis job. If it passes, I'll merge and release. |
|
Thank you @SergeAstapov for the help here! |
Fixes #513 . This unblocks engines support in FastBoot
Exposes
fastBootConfigtree hook that addons can use to write additional config to expose in Node. In addition also bumped the schema version since the config schema is changed a bit.TODO:
cc: @rwjblue