mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Resolve and unsilence ember.built-in-components
deprecation (#20716)
- Install `@ember/legacy-built-in-components` and update our import statements to use it - Remove our custom attributeBinding extensions of `TextField` and `TextArea`. Modern ember 'angle bracket syntax' allows us to apply html attributes to a component's element without needing attributeBindings
This commit is contained in:
parent
5e5024d3e7
commit
1161c980f2
@ -1,4 +1,4 @@
|
|||||||
import TextArea from "@ember/component/text-area";
|
import { TextArea } from "@ember/legacy-built-in-components";
|
||||||
|
|
||||||
export default TextArea.extend({
|
export default TextArea.extend({
|
||||||
attributeBindings: ["aria-label"],
|
attributeBindings: ["aria-label"],
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { observes, on } from "discourse-common/utils/decorators";
|
import { observes, on } from "discourse-common/utils/decorators";
|
||||||
import TextArea from "@ember/component/text-area";
|
import { TextArea } from "@ember/legacy-built-in-components";
|
||||||
import autosize from "discourse/lib/autosize";
|
import autosize from "discourse/lib/autosize";
|
||||||
import { schedule } from "@ember/runloop";
|
import { schedule } from "@ember/runloop";
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { cancel, next } from "@ember/runloop";
|
import { cancel, next } from "@ember/runloop";
|
||||||
import { isLTR, isRTL, siteDir } from "discourse/lib/text-direction";
|
import { isLTR, isRTL, siteDir } from "discourse/lib/text-direction";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import TextField from "@ember/component/text-field";
|
import { TextField } from "@ember/legacy-built-in-components";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import discourseDebounce from "discourse-common/lib/debounce";
|
import discourseDebounce from "discourse-common/lib/debounce";
|
||||||
|
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
import TextField from "@ember/component/text-field";
|
|
||||||
import TextArea from "@ember/component/text-area";
|
|
||||||
let initializedOnce = false;
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "ember-input-component-extensions",
|
|
||||||
|
|
||||||
initialize() {
|
|
||||||
if (initializedOnce) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TextField.reopen({
|
|
||||||
attributeBindings: ["aria-describedby", "aria-invalid"],
|
|
||||||
});
|
|
||||||
TextArea.reopen({
|
|
||||||
attributeBindings: ["aria-describedby", "aria-invalid"],
|
|
||||||
});
|
|
||||||
|
|
||||||
initializedOnce = true;
|
|
||||||
},
|
|
||||||
};
|
|
@ -94,8 +94,8 @@
|
|||||||
@value={{this.accountName}}
|
@value={{this.accountName}}
|
||||||
@id="new-account-name"
|
@id="new-account-name"
|
||||||
@class={{value-entered this.accountName}}
|
@class={{value-entered this.accountName}}
|
||||||
@aria-describedby="fullname-validation"
|
aria-describedby="fullname-validation"
|
||||||
@aria-invalid={{this.nameValidation.failed}}
|
aria-invalid={{this.nameValidation.failed}}
|
||||||
/>
|
/>
|
||||||
<label class="alt-placeholder" for="new-account-name">
|
<label class="alt-placeholder" for="new-account-name">
|
||||||
{{i18n "user.name.title"}}
|
{{i18n "user.name.title"}}
|
||||||
@ -134,8 +134,8 @@
|
|||||||
id="new-account-password"
|
id="new-account-password"
|
||||||
@autocomplete="current-password"
|
@autocomplete="current-password"
|
||||||
@capsLockOn={{this.capsLockOn}}
|
@capsLockOn={{this.capsLockOn}}
|
||||||
@aria-describedby="password-validation"
|
aria-describedby="password-validation"
|
||||||
@aria-invalid={{this.passwordValidation.failed}}
|
aria-invalid={{this.passwordValidation.failed}}
|
||||||
/>
|
/>
|
||||||
<label class="alt-placeholder" for="new-account-password">
|
<label class="alt-placeholder" for="new-account-password">
|
||||||
{{i18n "user.password.title"}}
|
{{i18n "user.password.title"}}
|
||||||
|
@ -3,8 +3,6 @@ globalThis.deprecationWorkflow.config = {
|
|||||||
// We're using RAISE_ON_DEPRECATION in environment.js instead of
|
// We're using RAISE_ON_DEPRECATION in environment.js instead of
|
||||||
// `throwOnUnhandled` here since it is easier to toggle.
|
// `throwOnUnhandled` here since it is easier to toggle.
|
||||||
workflow: [
|
workflow: [
|
||||||
{ handler: "silence", matchId: "ember.built-in-components.reopen" },
|
|
||||||
{ handler: "silence", matchId: "ember.built-in-components.import" },
|
|
||||||
{ handler: "silence", matchId: "implicit-injections" },
|
{ handler: "silence", matchId: "implicit-injections" },
|
||||||
{ handler: "silence", matchId: "route-render-template" },
|
{ handler: "silence", matchId: "route-render-template" },
|
||||||
{ handler: "silence", matchId: "routing.transition-methods" },
|
{ handler: "silence", matchId: "routing.transition-methods" },
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
"@discourse/virtual-dom": "^2.1.2-0",
|
"@discourse/virtual-dom": "^2.1.2-0",
|
||||||
"@ember-compat/tracked-built-ins": "^0.9.1",
|
"@ember-compat/tracked-built-ins": "^0.9.1",
|
||||||
"@ember/jquery": "^2.0.0",
|
"@ember/jquery": "^2.0.0",
|
||||||
|
"@ember/legacy-built-in-components": "^0.4.2",
|
||||||
"@ember/optional-features": "^2.0.0",
|
"@ember/optional-features": "^2.0.0",
|
||||||
"@ember/render-modifiers": "^2.0.5",
|
"@ember/render-modifiers": "^2.0.5",
|
||||||
"@ember/test-helpers": "^2.9.3",
|
"@ember/test-helpers": "^2.9.3",
|
||||||
|
@ -1088,6 +1088,16 @@
|
|||||||
jquery "^3.5.0"
|
jquery "^3.5.0"
|
||||||
resolve "^1.15.1"
|
resolve "^1.15.1"
|
||||||
|
|
||||||
|
"@ember/legacy-built-in-components@^0.4.2":
|
||||||
|
version "0.4.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@ember/legacy-built-in-components/-/legacy-built-in-components-0.4.2.tgz#79a97d66153ff17909759b368b2a117bc9e168e5"
|
||||||
|
integrity sha512-rJulbyVQIVe1zEDQDqAQHechHy44DsS2qxO24+NmU/AYxwPFSzWC/OZNCDFSfLU+Y5BVd/00qjxF0pu7Nk+TNA==
|
||||||
|
dependencies:
|
||||||
|
"@embroider/macros" "^1.0.0"
|
||||||
|
ember-cli-babel "^7.26.6"
|
||||||
|
ember-cli-htmlbars "^5.7.1"
|
||||||
|
ember-cli-typescript "^4.1.0"
|
||||||
|
|
||||||
"@ember/optional-features@^2.0.0":
|
"@ember/optional-features@^2.0.0":
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/@ember/optional-features/-/optional-features-2.0.0.tgz#c809abd5a27d5b0ef3c6de3941334ab6153313f0"
|
resolved "https://registry.yarnpkg.com/@ember/optional-features/-/optional-features-2.0.0.tgz#c809abd5a27d5b0ef3c6de3941334ab6153313f0"
|
||||||
@ -3999,6 +4009,22 @@ ember-cli-typescript@^2.0.2:
|
|||||||
stagehand "^1.0.0"
|
stagehand "^1.0.0"
|
||||||
walk-sync "^1.0.0"
|
walk-sync "^1.0.0"
|
||||||
|
|
||||||
|
ember-cli-typescript@^4.1.0:
|
||||||
|
version "4.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/ember-cli-typescript/-/ember-cli-typescript-4.2.1.tgz#54d08fc90318cc986f3ea562f93ce58a6cc4c24d"
|
||||||
|
integrity sha512-0iKTZ+/wH6UB/VTWKvGuXlmwiE8HSIGcxHamwNhEC5x1mN3z8RfvsFZdQWYUzIWFN2Tek0gmepGRPTwWdBYl/A==
|
||||||
|
dependencies:
|
||||||
|
ansi-to-html "^0.6.15"
|
||||||
|
broccoli-stew "^3.0.0"
|
||||||
|
debug "^4.0.0"
|
||||||
|
execa "^4.0.0"
|
||||||
|
fs-extra "^9.0.1"
|
||||||
|
resolve "^1.5.0"
|
||||||
|
rsvp "^4.8.1"
|
||||||
|
semver "^7.3.2"
|
||||||
|
stagehand "^1.0.0"
|
||||||
|
walk-sync "^2.2.0"
|
||||||
|
|
||||||
ember-cli-typescript@^5.0.0:
|
ember-cli-typescript@^5.0.0:
|
||||||
version "5.1.0"
|
version "5.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/ember-cli-typescript/-/ember-cli-typescript-5.1.0.tgz#460eb848564e29d64f2b36b2a75bbe98172b72a4"
|
resolved "https://registry.yarnpkg.com/ember-cli-typescript/-/ember-cli-typescript-5.1.0.tgz#460eb848564e29d64f2b36b2a75bbe98172b72a4"
|
||||||
|
Loading…
Reference in New Issue
Block a user