Skip to content

Commit 095fa3e

Browse files
authored
Merge pull request #22 from void-mAlex/remove-sendAction-and-string-action-passing
ember >= 4.x compatibility
2 parents 4088793 + 0cf8647 commit 095fa3e

File tree

6 files changed

+25
-34
lines changed

6 files changed

+25
-34
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343

4444
strategy:
4545
matrix:
46-
ember-version: [ember-beta, ember-lts-3.28]
46+
ember-version: [ember-beta, ember-lts-4.8]
4747

4848
steps:
4949
- name: Checkout

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Provides the legacy implementation of the `Checkbox`, `LinkComponent`,
99
Compatibility
1010
------------------------------------------------------------------------------
1111

12-
* Ember.js v3.20 or above
13-
* Ember CLI v3.20 or above
14-
* Node.js v12 or above
12+
* Ember.js v4.0 or above
13+
* Ember CLI v4.0 or above
14+
* Node.js v16 or above
1515

1616

1717
Installation

addon/mixins/text-support.js

+1-20
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import { get, set } from '@ember/object';
33
import Mixin from '@ember/object/mixin';
44
import TargetActionSupport from './_target_action_support';
5-
import { deprecate } from '@ember/debug';
6-
import { SEND_ACTION } from '@ember/deprecated-features';
75
import { MUTABLE_CELL } from '@ember/-internals/views';
86

97
const KEY_EVENTS = {
@@ -319,24 +317,7 @@ function sendAction(eventName, view, event) {
319317

320318
let value = view.value;
321319

322-
if (SEND_ACTION && typeof action === 'string') {
323-
let message = `Passing actions to components as strings (like \`<Input @${eventName}="${action}" />\`) is deprecated. Please use closure actions instead (\`<Input @${eventName}={{action "${action}"}} />\`).`;
324-
325-
deprecate(message, false, {
326-
id: 'ember-component.send-action',
327-
until: '4.0.0',
328-
url: 'https://emberjs.com/deprecations/v3.x#toc_ember-component-send-action',
329-
for: 'ember-source',
330-
since: {
331-
enabled: '3.4.0',
332-
},
333-
});
334-
335-
view.triggerAction({
336-
action: action,
337-
actionContext: [value, event],
338-
});
339-
} else if (typeof action === 'function') {
320+
if (typeof action === 'function') {
340321
action(value, event);
341322
}
342323

config/ember-try.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ module.exports = async function () {
88
useYarn: true,
99
scenarios: [
1010
{
11-
name: 'ember-lts-3.28',
11+
name: 'ember-lts-4.8',
1212
npm: {
1313
devDependencies: {
14-
'ember-source': '~3.28.0',
14+
'ember-source': '~4.8.6',
1515
},
1616
},
1717
},
@@ -39,6 +39,8 @@ module.exports = async function () {
3939
},
4040
},
4141
},
42+
embroiderSafe(),
43+
embroiderOptimized(),
4244
],
4345
};
4446
};

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@
4141
},
4242
"devDependencies": {
4343
"@ember/optional-features": "^2.0.0",
44+
"@ember/string": "^3.1.1",
4445
"@ember/test-helpers": "^2.4.1",
4546
"@embroider/test-setup": "^1.0.0",
4647
"@glimmer/component": "^1.0.4",
4748
"@glimmer/tracking": "^1.0.4",
49+
"@glint/template": "^1.2.1",
4850
"@types/ember-qunit": "^5.0.0",
4951
"@types/ember-resolver": "^5.0.11",
5052
"@types/ember__application": "^4.0.0",
@@ -77,7 +79,6 @@
7779
"ember-cli-terser": "^4.0.2",
7880
"ember-cli-typescript-blueprints": "^3.0.0",
7981
"ember-disable-prototype-extensions": "^1.1.3",
80-
"ember-export-application-global": "^2.0.1",
8182
"ember-load-initializers": "^2.1.2",
8283
"ember-page-title": "^6.2.2",
8384
"ember-qunit": "^5.1.4",
@@ -101,10 +102,10 @@
101102
"webpack": "^5.52.1"
102103
},
103104
"peerDependencies": {
104-
"ember-source": "*"
105+
"ember-source": ">= 4.8"
105106
},
106107
"engines": {
107-
"node": "12.* || 14.* || >= 16"
108+
"node": ">= 16"
108109
},
109110
"ember": {
110111
"edition": "octane"

yarn.lock

+12-5
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,13 @@
10271027
mkdirp "^1.0.4"
10281028
silent-error "^1.1.1"
10291029

1030+
"@ember/string@^3.1.1":
1031+
version "3.1.1"
1032+
resolved "https://registry.yarnpkg.com/@ember/string/-/string-3.1.1.tgz#0a5ac0d1e4925259e41d5c8d55ef616117d47ff0"
1033+
integrity sha512-UbXJ+k3QOrYN4SRPHgXCqYIJ+yWWUg1+vr0H4DhdQPTy8LJfyqwZ2tc5uqpSSnEXE+/1KopHBE5J8GDagAg5cg==
1034+
dependencies:
1035+
ember-cli-babel "^7.26.6"
1036+
10301037
"@ember/test-helpers@^2.4.1":
10311038
version "2.6.0"
10321039
resolved "https://registry.yarnpkg.com/@ember/test-helpers/-/test-helpers-2.6.0.tgz#d687515c6ab49ba72717fc62046970ef4a72ea9c"
@@ -1206,6 +1213,11 @@
12061213
dependencies:
12071214
babel-plugin-debug-macros "^0.3.4"
12081215

1216+
"@glint/template@^1.2.1":
1217+
version "1.2.1"
1218+
resolved "https://registry.yarnpkg.com/@glint/template/-/template-1.2.1.tgz#b17b2e490ad1826d45e7bec3b87149ca926600e3"
1219+
integrity sha512-rlYy/93fAhYjXmTchWcwCpPFMfrqBYEskzbDYawS2oz4DVwtf4fOITLKB0QddQMI7WUCjgXAiIGZqcNa/R4YeQ==
1220+
12091221
"@handlebars/parser@^1.1.0":
12101222
version "1.1.0"
12111223
resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-1.1.0.tgz#d6dbc7574774b238114582410e8fee0dc3532bdf"
@@ -4713,11 +4725,6 @@ ember-disable-prototype-extensions@^1.1.3:
47134725
resolved "https://registry.yarnpkg.com/ember-disable-prototype-extensions/-/ember-disable-prototype-extensions-1.1.3.tgz#1969135217654b5e278f9fe2d9d4e49b5720329e"
47144726
integrity sha1-GWkTUhdlS14nj5/i2dTkm1cgMp4=
47154727

4716-
ember-export-application-global@^2.0.1:
4717-
version "2.0.1"
4718-
resolved "https://registry.yarnpkg.com/ember-export-application-global/-/ember-export-application-global-2.0.1.tgz#b120a70e322ab208defc9e2daebe8d0dfc2dcd46"
4719-
integrity sha512-B7wiurPgsxsSGzJuPFkpBWnaeuCu2PGpG2BjyrfA1VcL7//o+5RSnZqiCEY326y7qmxb2GoCgo0ft03KBU0rRw==
4720-
47214728
ember-load-initializers@^2.1.2:
47224729
version "2.1.2"
47234730
resolved "https://registry.yarnpkg.com/ember-load-initializers/-/ember-load-initializers-2.1.2.tgz#8a47a656c1f64f9b10cecdb4e22a9d52ad9c7efa"

0 commit comments

Comments
 (0)