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

remove deprecated implicit injection #905

Conversation

amiarSlimane
Copy link
Contributor

Already solved here :

// ember-cli-fastboot/addon/services/fastboot.js
// this getter/setter pair is to avoid deprecation from [RFC - 680](https://github.com/emberjs/rfcs/pull/680)
  _fastbootInfo: computed({
    get() {
      if (this.__fastbootInfo) {
        return this.__fastbootInfo;
      }

      return getOwner(this).lookup('info:-fastboot');
    },
    set(_key, value) {
      this.__fastbootInfo = value;
      return value;
    }
  }),

but didn't remove the implicit injection:

// ember-cli-fastboot/packages/fastboot/src/fastboot-info.js
  instance.inject('service:fastboot', '_fastbootInfo', 'info:-fastboot');

@habdelra
Copy link
Contributor

Fixes #869. thanks!!

@SergeAstapov
Copy link
Contributor

@habdelra @amiarSlimane was this accidentally closed?

@habdelra
Copy link
Contributor

whoops!

@habdelra habdelra reopened this Jan 19, 2023
@gilest
Copy link

gilest commented Jan 25, 2023

What is needed to land this?

@nlfurniss
Copy link
Collaborator

What is needed to land this?

Tests passing for one thing :-P

@nlfurniss
Copy link
Collaborator

This fixes 1/6 failures

diff --git a/packages/fastboot/test/fixtures/shoebox/fastboot/fastboot-test.js b/packages/fastboot/test/fixtures/shoebox/fastboot/fastboot-test.js
index d7a497e..2571123 100644
--- a/packages/fastboot/test/fixtures/shoebox/fastboot/fastboot-test.js
+++ b/packages/fastboot/test/fixtures/shoebox/fastboot/fastboot-test.js
@@ -397,6 +397,21 @@ define('fastboot-test/services/fastboot', ['exports', 'ember'], function (export
       return typeof FastBoot !== 'undefined';
     }),
 
+    // this getter/setter pair is to avoid deprecation from [RFC - 680](https://github.com/emberjs/rfcs/pull/680)
+    _fastbootInfo: computed({
+      get() {
+        if (this.__fastbootInfo) {
+          return this.__fastbootInfo;
+        }
+
+        return getOwner(this).lookup('info:-fastboot');
+      },
+      set(_key, value) {
+        this.__fastbootInfo = value;
+        return value;
+      }
+    }),
+
     deferRendering: function deferRendering(promise) {
       _ember['default'].assert('deferRendering requires a promise or thennable object', typeof promise.then === 'function');
       this._fastbootInfo.deferRendering(promise);

Though I don't get why the whole service is copied over 🤔

@mansona
Copy link
Member

mansona commented May 5, 2023

I'm merging this because it clearly helps the situation 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants