From 5fca593de95b07464a5ba3f9649e08d4657f99bf Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Wed, 24 Nov 2021 13:43:48 -0600 Subject: [PATCH 1/5] Place store on Ember.Route to maintain default store behaviour --- .eslintrc.js | 1 + packages/-ember-data/addon/setup-container.js | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 97b43305a6f..47cf65a2c36 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -79,6 +79,7 @@ module.exports = { WeakMap: true, Set: true, Promise: false, + Symbol: true, }, env: { browser: true, diff --git a/packages/-ember-data/addon/setup-container.js b/packages/-ember-data/addon/setup-container.js index 88c191d28ac..4fb83a5b076 100644 --- a/packages/-ember-data/addon/setup-container.js +++ b/packages/-ember-data/addon/setup-container.js @@ -1,6 +1,10 @@ +import { getOwner } from '@ember/application'; import { deprecate } from '@ember/debug'; +import Route from '@ember/routing/route'; import { DEBUG } from '@glimmer/env'; +const EMBER_DATA_STORE = Symbol('ember-data-store'); + import Store from '@ember-data/store'; function initializeStore(application) { @@ -46,6 +50,36 @@ function initializeStore(application) { } } +// Implicit injection was removed. This is a replacement for Ember Route implicit store for >= v4.0 +Route.reopen({ + get store() { + if (this[EMBER_DATA_STORE]) { + return this[EMBER_DATA_STORE]; + } + + const store = getOwner(this).lookup('service:store'); + this[EMBER_DATA_STORE] = store; + + deprecate( + 'In 4.0, ember and ember-data removed implicitly injecting the store on all Ember framework objects. However, Ember.Route still needs to support a default store and it looks like you do not have an explicit `@service store` on your Route. Please add this service injection to your Route.', + false, + { + id: 'ember-data:implicit-store-on-route', + until: '5.0', + since: { + available: '4.0', + enabled: '4.0', + }, + } + ); + + return store; + }, + set store(value) { + this[EMBER_DATA_STORE] = value; + }, +}); + export default function setupContainer(application) { initializeStore(application); } From fad750f1669bc382975f17e29938614f7a73659d Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Wed, 24 Nov 2021 13:55:47 -0600 Subject: [PATCH 2/5] lint --- packages/-ember-data/addon/setup-container.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/-ember-data/addon/setup-container.js b/packages/-ember-data/addon/setup-container.js index 4fb83a5b076..5f1b2e1feda 100644 --- a/packages/-ember-data/addon/setup-container.js +++ b/packages/-ember-data/addon/setup-container.js @@ -3,10 +3,10 @@ import { deprecate } from '@ember/debug'; import Route from '@ember/routing/route'; import { DEBUG } from '@glimmer/env'; -const EMBER_DATA_STORE = Symbol('ember-data-store'); - import Store from '@ember-data/store'; +const EMBER_DATA_STORE = Symbol('ember-data-store'); + function initializeStore(application) { // we can just use registerOptionsForType when we no longer // support (deprecated) versions of @ember/test-helpers From 2bfe77ea6e1f2b768502c9a2aad8c539e050fe6e Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Wed, 24 Nov 2021 14:20:49 -0600 Subject: [PATCH 3/5] run external on release --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bdf195c5d03..cc1f34d47fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -303,7 +303,7 @@ jobs: needs: [additional-scenarios, basic-tests, floating-dependencies, lint, lts, releases] if: | github.event_name == 'pull_request' && ( - github.base_ref == 'master' || github.base_ref == 'beta' + github.base_ref == 'master' || github.base_ref == 'beta' || github.base_ref == 'release' ) || github.event_name == 'push' && ( endsWith(github.ref, '/master') || endsWith(github.ref, '/beta') ) From 9623aa599ac5ef0a519217fc4a69ebfacb466de6 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Wed, 24 Nov 2021 14:44:50 -0600 Subject: [PATCH 4/5] try this --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cc1f34d47fb..450cc15dd8a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -305,7 +305,7 @@ jobs: github.event_name == 'pull_request' && ( github.base_ref == 'master' || github.base_ref == 'beta' || github.base_ref == 'release' ) || github.event_name == 'push' && ( - endsWith(github.ref, '/master') || endsWith(github.ref, '/beta') + endsWith(github.ref, '/master') || endsWith(github.ref, '/beta') || endsWith(github.ref, '/release') ) runs-on: ubuntu-latest strategy: From e40108910d4afad25937a430ef04e76ceb820ace Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Wed, 24 Nov 2021 18:33:23 -0600 Subject: [PATCH 5/5] try this --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 450cc15dd8a..f5ba7b74912 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -300,7 +300,7 @@ jobs: run: yarn test external-partners: - needs: [additional-scenarios, basic-tests, floating-dependencies, lint, lts, releases] + needs: [additional-scenarios, basic-tests, floating-dependencies, lint, lts] if: | github.event_name == 'pull_request' && ( github.base_ref == 'master' || github.base_ref == 'beta' || github.base_ref == 'release'