From 7497979f699ba014853d5fede0d8c70e93e274b6 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:37:48 -0400 Subject: [PATCH] Support only 4.12 (LTS) or higher, delete a bunch of code, remove macros, etc --- .github/workflows/ci-build.yml | 2 -- addon/addon/index.js | 21 ++----------------- addon/addon/template-cache.js | 8 ------- addon/package.json | 1 - package-lock.json | 4 +--- test-app/config/ember-try.js | 16 -------------- .../unit/resolvers/classic/-setup-resolver.js | 13 +----------- 7 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 addon/addon/template-cache.js diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index bf870b4d..6ba5af07 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -66,8 +66,6 @@ jobs: fail-fast: false matrix: ember-try-scenario: - - ember-lts-4.4 - - ember-lts-4.8 - ember-lts-4.12 - ember-lts-5.4 - ember-lts-5.8 diff --git a/addon/addon/index.js b/addon/addon/index.js index 86ed92a8..01c52793 100644 --- a/addon/addon/index.js +++ b/addon/addon/index.js @@ -5,21 +5,8 @@ import EmberObject from '@ember/object'; import { dasherize, classify, underscore } from './string'; import { DEBUG } from '@glimmer/env'; import classFactory from './utils/class-factory'; -import { - macroCondition, - dependencySatisfies, - importSync, -} from '@embroider/macros'; - -let getOwner; - -if (macroCondition(dependencySatisfies('ember-source', '>= 4.11'))) { - getOwner = importSync('@ember/owner').getOwner; -} else { - getOwner = importSync('@ember/application').getOwner; -} -import { TEMPLATES } from './template-cache'; +import { getOwner } from '@ember/owner'; if (typeof requirejs.entries === 'undefined') { requirejs.entries = requirejs._eak_seen; @@ -307,11 +294,7 @@ class Resolver extends EmberObject { } resolveTemplate(parsedName) { - let resolved = this.resolveOther(parsedName); - if (resolved == null) { - resolved = TEMPLATES[parsedName.fullNameWithoutType]; - } - return resolved; + return this.resolveOther(parsedName); } mainModuleName(parsedName) { diff --git a/addon/addon/template-cache.js b/addon/addon/template-cache.js deleted file mode 100644 index 26bcf384..00000000 --- a/addon/addon/template-cache.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Originally: https://github.com/emberjs/ember.js/blob/28444d536fa20debef2a67e2f18c5eb11113a4b5/packages/%40ember/-internals/glimmer/lib/template_registry.ts#L9 - * - * import { TEMPLATES } from 'ember'; - * - * Removed for RFC 1003 - */ -export let TEMPLATES = {}; diff --git a/addon/package.json b/addon/package.json index e9756841..6e18c354 100644 --- a/addon/package.json +++ b/addon/package.json @@ -23,7 +23,6 @@ }, "scripts": {}, "dependencies": { - "@embroider/macros": "^1.16.2", "ember-cli-babel": "^7.26.11" }, "peerDependencies": { diff --git a/package-lock.json b/package-lock.json index 2fd7ee08..724e2ce5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,6 @@ "version": "11.0.1", "license": "MIT", "dependencies": { - "@embroider/macros": "^1.16.2", "ember-cli-babel": "^7.26.11" }, "engines": { @@ -31594,7 +31593,6 @@ "ember-resolver": { "version": "file:addon", "requires": { - "@embroider/macros": "^1.16.2", "ember-cli-babel": "^7.26.11" } }, @@ -40411,7 +40409,7 @@ "@babel/plugin-proposal-decorators": "^7.21.0", "@ember/optional-features": "^2.0.0", "@ember/test-helpers": "^2.8.1", - "@embroider/macros": "*", + "@embroider/macros": "^1.16.2", "@embroider/test-setup": "^2.1.1", "broccoli-asset-rev": "^3.0.0", "ember-auto-import": "^2.6.3", diff --git a/test-app/config/ember-try.js b/test-app/config/ember-try.js index 73e6525c..b657a453 100644 --- a/test-app/config/ember-try.js +++ b/test-app/config/ember-try.js @@ -42,22 +42,6 @@ module.exports = async function () { }, scenarios: [ - { - name: 'ember-lts-4.4', - npm: { - devDependencies: { - 'ember-source': '~4.4.0', - }, - }, - }, - { - name: 'ember-lts-4.8', - npm: { - devDependencies: { - 'ember-source': '~4.8.0', - }, - }, - }, { name: 'ember-lts-4.12', npm: { diff --git a/test-app/tests/unit/resolvers/classic/-setup-resolver.js b/test-app/tests/unit/resolvers/classic/-setup-resolver.js index 67b9f768..f1b8808f 100644 --- a/test-app/tests/unit/resolvers/classic/-setup-resolver.js +++ b/test-app/tests/unit/resolvers/classic/-setup-resolver.js @@ -1,17 +1,6 @@ import Resolver, { ModuleRegistry } from 'ember-resolver'; -import { - macroCondition, - dependencySatisfies, - importSync, -} from '@embroider/macros'; -let setOwner; - -if (macroCondition(dependencySatisfies('ember-source', '>= 4.11'))) { - setOwner = importSync('@ember/owner').setOwner; -} else { - setOwner = importSync('@ember/application').setOwner; -} +import { setOwner } from '@ember/owner'; export let resolver; export let loader;