Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid implicit injection _fastbootInfo deprecation #841

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/ember-cli-fastboot/addon/services/fastboot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* global FastBoot */
import { getOwner } from '@ember/application';
import { computed, get } from '@ember/object';
import { readOnly } from '@ember/object/computed';
import { assert } from '@ember/debug';
Expand Down Expand Up @@ -88,6 +89,11 @@ const FastBootService = Service.extend({
return RequestObject.create({ request: get(this, '_fastbootInfo.request') });
}),

_fastbootInfo: computed(function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the test changes in https://github.com/ember-fastboot/ember-cli-fastboot/pull/823/files? Specifically registering info:-fastboot in the container for later lookup.

Copy link
Contributor Author

@snewcomer snewcomer Aug 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like it based on the tests passing! Do you see other value here?

// this getter is to avoid deprecation from [RFC - 680](https://github.com/emberjs/rfcs/pull/680)
return getOwner(this).lookup('info:-fastboot');
}),

deferRendering(promise) {
assert('deferRendering requires a promise or thennable object', typeof promise.then === 'function');
this._fastbootInfo.deferRendering(promise);
Expand Down