Skip to content

Commit 060a44c

Browse files
chancancodeChris Garrett
authored andcommitted
[BUGFIX release] 3.27 deprecation metadata
* Unify deprecation ids * Add missing `url` and `since` * Correctly reference `@ember/legacy-built-in-components` addon * Error instead for `<LinkTo @href=...>`
1 parent 414cbee commit 060a44c

File tree

17 files changed

+163
-43
lines changed

17 files changed

+163
-43
lines changed

packages/@ember/-internals/glimmer/lib/components/-link-to.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,8 +1035,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
10351035
{
10361036
id: 'ember.built-in-components.reopen',
10371037
for: 'ember-source',
1038-
since: {},
1038+
since: {
1039+
enabled: '3.27.0',
1040+
},
10391041
until: '4.0.0',
1042+
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen',
10401043
}
10411044
);
10421045

@@ -1060,8 +1063,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
10601063
{
10611064
id: 'ember.built-in-components.reopen',
10621065
for: 'ember-source',
1063-
since: {},
1066+
since: {
1067+
enabled: '3.27.0',
1068+
},
10641069
until: '4.0.0',
1070+
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen',
10651071
}
10661072
);
10671073

packages/@ember/-internals/glimmer/lib/components/-textarea.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
6262
{
6363
id: 'ember.built-in-components.reopen',
6464
for: 'ember-source',
65-
since: {},
65+
since: {
66+
enabled: '3.27.0',
67+
},
6668
until: '4.0.0',
69+
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen',
6770
}
6871
);
6972

@@ -87,8 +90,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
8790
{
8891
id: 'ember.built-in-components.reopen',
8992
for: 'ember-source',
90-
since: {},
93+
since: {
94+
enabled: '3.27.0',
95+
},
9196
until: '4.0.0',
97+
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen',
9298
}
9399
);
94100

packages/@ember/-internals/glimmer/lib/components/checkbox.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
181181
{
182182
id: 'ember.built-in-components.reopen',
183183
for: 'ember-source',
184-
since: {},
184+
since: {
185+
enabled: '3.27.0',
186+
},
185187
until: '4.0.0',
188+
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen',
186189
}
187190
);
188191

@@ -206,8 +209,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
206209
{
207210
id: 'ember.built-in-components.reopen',
208211
for: 'ember-source',
209-
since: {},
212+
since: {
213+
enabled: '3.27.0',
214+
},
210215
until: '4.0.0',
216+
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen',
211217
}
212218
);
213219

packages/@ember/-internals/glimmer/lib/components/internal.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,12 @@ export function handleDeprecatedArguments(target: DeprecatingInternalComponentCo
274274
deprecate(`Passing the \`@${name}\` argument to <${angle}> is deprecated.`, false, {
275275
id: 'ember.built-in-components.legacy-arguments',
276276
for: 'ember-source',
277-
since: {},
277+
since: {
278+
enabled: '3.27.0',
279+
},
278280
until: '4.0.0',
281+
url:
282+
'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments',
279283
});
280284

281285
this.modernized = false;
@@ -356,8 +360,12 @@ export function handleDeprecatedAttributeArguments(
356360
{
357361
id: 'ember.built-in-components.legacy-attribute-arguments',
358362
for: 'ember-source',
359-
since: {},
363+
since: {
364+
enabled: '3.27.0',
365+
},
360366
until: '4.0.0',
367+
url:
368+
'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-attribute-arguments',
361369
}
362370
);
363371

@@ -517,8 +525,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
517525
{
518526
id: 'ember.built-in-components.legacy-attribute-arguments',
519527
for: 'ember-source',
520-
since: {},
528+
since: {
529+
enabled: '3.27.0',
530+
},
521531
until: '4.0.0',
532+
url:
533+
'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-attribute-arguments',
522534
}
523535
);
524536

@@ -530,8 +542,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
530542
{
531543
id: 'ember.built-in-components.legacy-attribute-arguments',
532544
for: 'ember-source',
533-
since: {},
545+
since: {
546+
enabled: '3.27.0',
547+
},
534548
until: '4.0.0',
549+
url:
550+
'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-attribute-arguments',
535551
}
536552
);
537553

packages/@ember/-internals/glimmer/lib/components/link-to.ts

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
393393
['role', 'ariaRole'],
394394

395395
// LinkTo
396-
'href',
397396
'title',
398397
'rel',
399398
'tabindex',
@@ -402,6 +401,23 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
402401

403402
handleDeprecatedEventArguments(LinkTo);
404403

404+
// @href
405+
{
406+
let superOnUnsupportedArgument = prototype['onUnsupportedArgument'];
407+
408+
Object.defineProperty(prototype, 'onUnsupportedArgument', {
409+
configurable: true,
410+
enumerable: false,
411+
value: function onUnsupportedArgument(this: LinkTo, name: string): void {
412+
if (name === 'href') {
413+
assert(`Passing the \`@href\` argument to <LinkTo> is not supported.`);
414+
} else {
415+
superOnUnsupportedArgument.call(this, name);
416+
}
417+
},
418+
});
419+
}
420+
405421
// @tagName
406422
{
407423
let superOnUnsupportedArgument = prototype['onUnsupportedArgument'];
@@ -454,8 +470,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
454470
{
455471
id: 'ember.built-in-components.legacy-arguments',
456472
for: 'ember-source',
457-
since: {},
473+
since: {
474+
enabled: '3.27.0',
475+
},
458476
until: '4.0.0',
477+
url:
478+
'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments',
459479
}
460480
);
461481

@@ -472,8 +492,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
472492
{
473493
id: 'ember.built-in-components.legacy-arguments',
474494
for: 'ember-source',
475-
since: {},
495+
since: {
496+
enabled: '3.27.0',
497+
},
476498
until: '4.0.0',
499+
url:
500+
'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments',
477501
}
478502
);
479503

@@ -505,8 +529,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
505529
{
506530
id: 'ember.built-in-components.legacy-arguments',
507531
for: 'ember-source',
508-
since: {},
532+
since: {
533+
enabled: '3.27.0',
534+
},
509535
until: '4.0.0',
536+
url:
537+
'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments',
510538
}
511539
);
512540
} else {
@@ -519,8 +547,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
519547
{
520548
id: 'ember.built-in-components.legacy-arguments',
521549
for: 'ember-source',
522-
since: {},
550+
since: {
551+
enabled: '3.27.0',
552+
},
523553
until: '4.0.0',
554+
url:
555+
'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments',
524556
}
525557
);
526558

@@ -540,8 +572,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
540572
{
541573
id: 'ember.built-in-components.legacy-arguments',
542574
for: 'ember-source',
543-
since: {},
575+
since: {
576+
enabled: '3.27.0',
577+
},
544578
until: '4.0.0',
579+
url:
580+
'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments',
545581
}
546582
);
547583

@@ -556,8 +592,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
556592
{
557593
id: 'ember.built-in-components.legacy-arguments',
558594
for: 'ember-source',
559-
since: {},
595+
since: {
596+
enabled: '3.27.0',
597+
},
560598
until: '4.0.0',
599+
url:
600+
'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments',
561601
}
562602
);
563603
}

packages/@ember/-internals/glimmer/lib/components/text-field.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
225225
{
226226
id: 'ember.built-in-components.reopen',
227227
for: 'ember-source',
228-
since: {},
228+
since: {
229+
enabled: '3.27.0',
230+
},
229231
until: '4.0.0',
232+
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen',
230233
}
231234
);
232235

@@ -250,8 +253,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
250253
{
251254
id: 'ember.built-in-components.reopen',
252255
for: 'ember-source',
253-
since: {},
256+
since: {
257+
enabled: '3.27.0',
258+
},
254259
until: '4.0.0',
260+
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen',
255261
}
256262
);
257263

packages/@ember/-internals/glimmer/lib/environment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ const VM_DEPRECATION_OVERRIDES: (DeprecationOptions & {
118118
},
119119
{
120120
id: 'argument-less-helper-paren-less-invocation',
121+
url: 'https://deprecations.emberjs.com/v3.x#toc_argument-less-helper-paren-less-invocation',
121122
until: '4.0.0',
122123
for: 'ember-source',
123124
since: {

packages/@ember/-internals/glimmer/tests/integration/components/link-to/rendering-angle-test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Router, Route } from '@ember/-internals/routing';
99
import Controller from '@ember/controller';
1010
import { set } from '@ember/-internals/metal';
1111
import { LinkComponent } from '@ember/-internals/glimmer';
12+
import { DEBUG } from '@glimmer/env';
1213

1314
moduleFor(
1415
'<LinkTo /> component (rendering tests)',
@@ -22,6 +23,19 @@ moduleFor(
2223
);
2324
}
2425

26+
async [`@test it throws a useful error if you pass the href argument`](assert) {
27+
this.addTemplate('application', `<LinkTo @href="nope" @route="index">Index</LinkTo>`);
28+
29+
if (DEBUG) {
30+
await assert.rejects(
31+
this.visit('/'),
32+
/Passing the `@href` argument to <LinkTo> is not supported\./
33+
);
34+
} else {
35+
assert.expect(0);
36+
}
37+
}
38+
2539
async ['@test it should be able to be inserted in DOM when the router is not present']() {
2640
this.addTemplate('application', `<LinkTo @route='index'>Go to Index</LinkTo>`);
2741

packages/@ember/-internals/glimmer/tests/integration/components/link-to/rendering-curly-test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { moduleFor, ApplicationTestCase, RenderingTestCase, runTask } from 'inte
33
import Controller from '@ember/controller';
44
import { set } from '@ember/-internals/metal';
55
import { LinkComponent } from '@ember/-internals/glimmer';
6+
import { DEBUG } from '@glimmer/env';
67

78
moduleFor(
89
'{{link-to}} component (rendering tests)',
@@ -15,6 +16,19 @@ moduleFor(
1516
}, /You must provide one or more parameters to the `{{link-to}}` component\. \('my-app\/templates\/application\.hbs' @ L1:C0\)/);
1617
}
1718

19+
async [`@test it throws a useful error if you pass the href argument`](assert) {
20+
this.addTemplate('application', `{{#link-to href="nope" route="index"}}Index{{/link-to}}`);
21+
22+
if (DEBUG) {
23+
await assert.rejects(
24+
this.visit('/'),
25+
/Passing the `@href` argument to <LinkTo> is not supported\./
26+
);
27+
} else {
28+
assert.expect(0);
29+
}
30+
}
31+
1832
async ['@test it should be able to be inserted in DOM when the router is not present']() {
1933
this.addTemplate('application', `{{#link-to route='index'}}Go to Index{{/link-to}}`);
2034

packages/@ember/-internals/runtime/lib/mixins/target_action_support.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
170170
deprecate('Reopening Ember.TargetActionSupport is deprecated.', false, {
171171
id: 'ember.built-in-components.reopen',
172172
for: 'ember-source',
173-
since: {},
173+
since: {
174+
enabled: '3.27.0',
175+
},
174176
until: '4.0.0',
177+
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen',
175178
});
176179

177180
TargetActionSupport._wasReopened = true;

0 commit comments

Comments
 (0)