From 8a4fe8f697ada12fa5ef8cdd683f86d531573ac7 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Tue, 13 Oct 2026 00:18:07 -0400 Subject: [PATCH 1/3] Add deprecation warning with text from docs to top of classes that are deprecated --- app/assets/styles.css | 7 +++++++ app/models/class.js | 3 +++ app/serializers/application.js | 7 +++++++ app/templates/project-version/classes/class.gjs | 11 +++++++++++ 4 files changed, 28 insertions(+) diff --git a/app/assets/styles.css b/app/assets/styles.css index 568ad17c..2d802104 100644 --- a/app/assets/styles.css +++ b/app/assets/styles.css @@ -27,6 +27,13 @@ html { vertical-align: middle; } +.deprecated-warning { + padding: var(--spacing-2); + border-radius: var(--radius-lg); + border: 1px solid var(--color-gray-800); + line-break: anywhere; +} + main a.edit-icon { height: 1rem; width: 16px; diff --git a/app/models/class.js b/app/models/class.js index 39208d0a..ddffdccd 100644 --- a/app/models/class.js +++ b/app/models/class.js @@ -13,6 +13,9 @@ export default class Class extends Model { @attr() deprecated; + @attr() + deprecationMessage; + @attr() access; diff --git a/app/serializers/application.js b/app/serializers/application.js index 1d128732..ad36ae15 100644 --- a/app/serializers/application.js +++ b/app/serializers/application.js @@ -30,4 +30,11 @@ export default class Application extends JSONAPISerializer { return normalizedDocument; } + + keyForAttribute(key) { + if (key === 'deprecationMessage') { + return key; + } + return super.keyForAttribute(key); + } } diff --git a/app/templates/project-version/classes/class.gjs b/app/templates/project-version/classes/class.gjs index 41d65f0b..ffc43b56 100644 --- a/app/templates/project-version/classes/class.gjs +++ b/app/templates/project-version/classes/class.gjs @@ -136,6 +136,17 @@ import ApiIndex from 'ember-api-docs/components/api-index'; {{/if}} + {{#if @model.deprecated}} +
+
+

This class is deprecated!

+ {{log @model.deprecationMessage}} +

+
+ {{/if}} {{#if (and (not (eq @controller.static 1)) @controller.hasImportExample)}} {{/if}} From 1871503dd87ff56a30af484b353175206da7c8b0 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Tue, 13 Oct 2026 00:35:18 -0400 Subject: [PATCH 2/3] Add tag to expose deprecated modules - Add a message when there are no contents that the visibility of deprecated and private should be toggled --- app/models/module.js | 3 +++ .../project-version/modules/module.gjs | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/app/models/module.js b/app/models/module.js index 9fdbf22c..d8a14fdd 100644 --- a/app/models/module.js +++ b/app/models/module.js @@ -23,6 +23,9 @@ export default class Module extends ClassModel { @attr() allstaticfunctions; + @attr() + deprecated; + @belongsTo('project-version', { async: false, inverse: null }) projectVersion; } diff --git a/app/templates/project-version/modules/module.gjs b/app/templates/project-version/modules/module.gjs index 4a1870db..eb35547a 100644 --- a/app/templates/project-version/modules/module.gjs +++ b/app/templates/project-version/modules/module.gjs @@ -4,6 +4,7 @@ import { array } from '@ember/helper'; import MarkdownToHtml from 'ember-cli-showdown/components/markdown-to-html'; import not from 'ember-truth-helpers/helpers/not'; import and from 'ember-truth-helpers/helpers/and'; +import or from 'ember-truth-helpers/helpers/or'; import gt from 'ember-truth-helpers/helpers/gt'; import functionHeadingId from 'ember-api-docs/helpers/function-heading-id'; import betterGet from 'ember-api-docs/helpers/better-get'; @@ -19,6 +20,9 @@ import betterGet from 'ember-api-docs/helpers/better-get'; {{#if @controller.model.access}}{{@controller.model.access}}{{/if}} + {{#if @controller.model.deprecated}}deprecated{{/if}} {{/if}} @@ -122,6 +126,22 @@ import betterGet from 'ember-api-docs/helpers/better-get'; {{/each}} {{/if}} + {{#unless + (or + @controller.submodules + @controller.classesAndNamespaces + (and + @controller.functionHeadings + (gt @controller.functionHeadings.length 0) + ) + ) + }} +

+ No submodules, classes, namespaces, or functions are visible. Some may + be hidden because private and deprecated packages are not shown. Toggle + "Show Private / Deprecated packages" in the sidebar to reveal them. +

+ {{/unless}} {{outlet}} From 483e3329c14afe6a056239c96d4c6bcef8bf420f Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Tue, 13 Oct 2026 00:47:25 -0400 Subject: [PATCH 3/3] Add warning box to deprecated functions, methods, properties, fields --- app/assets/styles.css | 1 + app/components/class-field-description.gjs | 13 +++++ .../project-version/classes/class.gjs | 1 - .../project-version/modules/module.gjs | 36 +++++++------ tests/acceptance/module-test.js | 52 +++++++++++++++++++ 5 files changed, 87 insertions(+), 16 deletions(-) diff --git a/app/assets/styles.css b/app/assets/styles.css index 2d802104..53758712 100644 --- a/app/assets/styles.css +++ b/app/assets/styles.css @@ -31,6 +31,7 @@ html { padding: var(--spacing-2); border-radius: var(--radius-lg); border: 1px solid var(--color-gray-800); + margin-bottom: var(--spacing-2); line-break: anywhere; } diff --git a/app/components/class-field-description.gjs b/app/components/class-field-description.gjs index 436d298f..bc31b607 100644 --- a/app/components/class-field-description.gjs +++ b/app/components/class-field-description.gjs @@ -142,6 +142,19 @@ export default class ClassFieldDescription extends Component { {{/if}} + + {{#if @field.deprecated}} +
+

This {{@type}} is deprecated!

+ {{#if @field.deprecationMessage}} + + {{/if}} +
+ {{/if}} + diff --git a/app/templates/project-version/classes/class.gjs b/app/templates/project-version/classes/class.gjs index ffc43b56..172e525c 100644 --- a/app/templates/project-version/classes/class.gjs +++ b/app/templates/project-version/classes/class.gjs @@ -140,7 +140,6 @@ import ApiIndex from 'ember-api-docs/components/api-index';

This class is deprecated!

- {{log @model.deprecationMessage}}

- No submodules, classes, namespaces, or functions are visible. Some may - be hidden because private and deprecated packages are not shown. Toggle - "Show Private / Deprecated packages" in the sidebar to reveal them. -

- {{/unless}} + }} +

+ No submodules, classes, namespaces, or functions are visible. Some may + be hidden because private and deprecated packages are not shown. + Toggle "Show Private / Deprecated packages" in the sidebar to reveal + them. +

+ {{/if}} + {{/if}} {{outlet}} diff --git a/tests/acceptance/module-test.js b/tests/acceptance/module-test.js index b2471afc..c605eacf 100644 --- a/tests/acceptance/module-test.js +++ b/tests/acceptance/module-test.js @@ -46,6 +46,58 @@ module('Acceptance | Module', function (hooks) { assert.equal(findAll('.spec-method-list li').length, numberSubModules); }); + test('does not show the empty-module warning when the module has submodules', async function (assert) { + await visit('ember/1.0/modules/ember'); + + assert + .dom('[data-test-empty-module-warning]') + .doesNotExist('no warning when module has submodules'); + }); + + test('does not show the empty-module warning when the module has public classes or namespaces', async function (assert) { + await visit('ember/1.0/modules/ember-handlebars'); + + assert + .dom('[data-test-empty-module-warning]') + .doesNotExist('no warning when module has public classes'); + }); + + test('does not show the empty-module warning when the module has public functions', async function (assert) { + // ember/2.16/modules/jquery has only public static functions ($) and no classes, namespaces, or submodules + await visit('ember/2.16/modules/jquery'); + + assert + .dom('[data-test-empty-module-warning]') + .doesNotExist('no warning when module has public functions'); + }); + + test('does not show the empty-module warning on the ember-data-overview page', async function (assert) { + // ember-data-overview has no content at all, but is excluded from the warning by name + await visit('ember-data/4.7/modules/ember-data-overview'); + + assert + .dom('[data-test-empty-module-warning]') + .doesNotExist( + 'no warning on ember-data-overview regardless of empty content', + ); + }); + + test('shows a note when all content is hidden by the private/deprecated filter', async function (assert) { + // ember-htmlbars in 1.13 has only a private class (HandlebarsCompatibleHelper) + // and no public classes, namespaces, submodules, or functions + await visit('ember/1.13/modules/ember-htmlbars'); + + assert + .dom('[data-test-empty-module-warning]') + .exists('warning shown when no public content is visible'); + + await click('[data-test-private-deprecated-toggle]'); + + assert + .dom('[data-test-empty-module-warning]') + .doesNotExist('warning hidden after showing private/deprecated content'); + }); + test('display submodule parent', async function (assert) { await visit('ember/1.0/modules/ember-application');