Skip to content

A platform for community discussion. Free, open, simple.

DEV: Resolve and unsilence `ember.built-in-components` deprecation (#20716)

David Taylor1161c980f2ff
diff --git a/app/assets/javascripts/discourse/app/components/d-textarea.js b/app/assets/javascripts/discourse/app/components/d-textarea.js
index 2c231631cf9..a4f296e2dfb 100644
--- a/app/assets/javascripts/discourse/app/components/d-textarea.js
+++ b/app/assets/javascripts/discourse/app/components/d-textarea.js
@@ -1,4 +1,4 @@
-import TextArea from "@ember/component/text-area";
+import { TextArea } from "@ember/legacy-built-in-components";
export default TextArea.extend({
attributeBindings: ["aria-label"],
diff --git a/app/assets/javascripts/discourse/app/components/expanding-text-area.js b/app/assets/javascripts/discourse/app/components/expanding-text-area.js
index 86a15b910b8..58b3dff7961 100644
--- a/app/assets/javascripts/discourse/app/components/expanding-text-area.js
+++ b/app/assets/javascripts/discourse/app/components/expanding-text-area.js
@@ -1,5 +1,5 @@
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 { schedule } from "@ember/runloop";
diff --git a/app/assets/javascripts/discourse/app/components/text-field.js b/app/assets/javascripts/discourse/app/components/text-field.js
index 9044d9c1ced..8f82fffff4a 100644
--- a/app/assets/javascripts/discourse/app/components/text-field.js
+++ b/app/assets/javascripts/discourse/app/components/text-field.js
@@ -1,7 +1,7 @@
import { cancel, next } from "@ember/runloop";
import { isLTR, isRTL, siteDir } from "discourse/lib/text-direction";
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 discourseDebounce from "discourse-common/lib/debounce";
diff --git a/app/assets/javascripts/discourse/app/initializers/ember-input-component-extension.js b/app/assets/javascripts/discourse/app/initializers/ember-input-component-extension.js
deleted file mode 100644
index 841ff0e9929..00000000000
--- a/app/assets/javascripts/discourse/app/initializers/ember-input-component-extension.js
+++ /dev/null
@@ -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;
- },
-};
diff --git a/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs b/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs
index 2be3ffb3b69..8a560fe8777 100644
--- a/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs
+++ b/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs
@@ -94,8 +94,8 @@
@value={{this.accountName}}
@id="new-account-name"
@class={{value-entered this.accountName}}
- @aria-describedby="fullname-validation"
- @aria-invalid={{this.nameValidation.failed}}
+ aria-describedby="fullname-validation"
+ aria-invalid={{this.nameValidation.failed}}
/>
<label class="alt-placeholder" for="new-account-name">
{{i18n "user.name.title"}}
@@ -134,8 +134,8 @@
id="new-account-password"
@autocomplete="current-password"
@capsLockOn={{this.capsLockOn}}
- @aria-describedby="password-validation"
- @aria-invalid={{this.passwordValidation.failed}}
+ aria-describedby="password-validation"
+ aria-invalid={{this.passwordValidation.failed}}
/>
<label class="alt-placeholder" for="new-account-password">
{{i18n "user.password.title"}}
diff --git a/app/assets/javascripts/discourse/config/deprecation-workflow.js b/app/assets/javascripts/discourse/config/deprecation-workflow.js
index e4d622f1bb7..5fceec5fb65 100644
--- a/app/assets/javascripts/discourse/config/deprecation-workflow.js
+++ b/app/assets/javascripts/discourse/config/deprecation-workflow.js
@@ -3,8 +3,6 @@ globalThis.deprecationWorkflow.config = {
// We're using RAISE_ON_DEPRECATION in environment.js instead of
// `throwOnUnhandled` here since it is easier to toggle.
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: "route-render-template" },
{ handler: "silence", matchId: "routing.transition-methods" },
diff --git a/app/assets/javascripts/discourse/package.json b/app/assets/javascripts/discourse/package.json
index 88d9075eb03..7604808ae7b 100644
--- a/app/assets/javascripts/discourse/package.json
+++ b/app/assets/javascripts/discourse/package.json
@@ -23,6 +23,7 @@
"@discourse/virtual-dom": "^2.1.2-0",
"@ember-compat/tracked-built-ins": "^0.9.1",
"@ember/jquery": "^2.0.0",
+ "@ember/legacy-built-in-components": "^0.4.2",
"@ember/optional-features": "^2.0.0",
"@ember/render-modifiers": "^2.0.5",
"@ember/test-helpers": "^2.9.3",
diff --git a/app/assets/javascripts/yarn.lock b/app/assets/javascripts/yarn.lock
index cf679cd3191..5c57b3407a3 100644
--- a/app/assets/javascripts/yarn.lock
+++ b/app/assets/javascripts/yarn.lock
@@ -1088,6 +1088,16 @@
jquery "^3.5.0"
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":
version "2.0.0"
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"
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:
version "5.1.0"
resolved "https://registry.yarnpkg.com/ember-cli-typescript/-/ember-cli-typescript-5.1.0.tgz#460eb848564e29d64f2b36b2a75bbe98172b72a4"