Skip to content

Conversation

@rishabh-gupta-hashicorp
Copy link
Contributor

Description

This PR upgrades Ember from v3.28 to v4.12
Along with Ember upgrade, the PR upgrades multiple other packages and fixes some more deprecations.
Multiple Code Refactoring and Linting changes to follow best practices for v4.12 as well as paves the way for version upgrade to v5.

Testing & Reproduction steps

Links

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.

  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.

  • If applicable, I've documented the impact of any changes to security controls.

    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

@github-actions github-actions bot added the theme/ui Anything related to the UI label Nov 20, 2025
@rishabh-gupta-hashicorp rishabh-gupta-hashicorp added the backport/all Apply backports for all active releases per .release/versions.hcl label Nov 20, 2025
@rishabh-gupta-hashicorp rishabh-gupta-hashicorp changed the title Rishabh gupta/UI/ember upgrade to v4.12 UI/ember upgrade to v4.12 Nov 24, 2025
"ember-data": "~3.28.6",
"ember-data-model-fragments": "5.0.0-beta.8",
"ember-data": "~4.0.0",
"ember-data-model-fragments": "6.0.10",
Copy link

@deanmarano deanmarano Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend matching ember-data-model-fragments 6.0.10 with ember-data 4.6.7 - that is the intended pairing.

@color='critical'
data-test-delete
{{on 'click' (fn confirm )}}
{{on 'click' confirm }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be this.confirm to reference the component. Also the same for the cancel below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirm is trickling down as return value from the wrapping BlockSlot. It's not part of this object.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was confusing to me at first but I have looked at the file and it seems this are block arguments, which seems fine but does ask for some refactor in the future

@color='critical'
@text='Delete'
{{on "click" (fn confirm )}}
{{on "click" confirm }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be tied to the component action using this.

Suggested change
{{on "click" confirm }}
{{on "click" this.confirm }}

@search={{search}}
@onsearch={{action (mut search) value="target.value"}}
@search={{this.search}}
@onsearch={{action (mut this.search) value="target.value"}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[note]: ideally we would address two items in the follow up as well, since it would help with the next steps:

  • remove all action helpers
  • remove all mut helpers

>

{{#let (unique-id) as |id reset|}}
{{#let (dom-guid) as |id reset|}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a custom helper?

Copy link
Contributor Author

@rishabh-gupta-hashicorp rishabh-gupta-hashicorp Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, unique-id was a custom helper we were using. Ember 4 provides its own helper by the same name. Changed our helpers name to dom-guid to avoid conflicts.

}}

<div
...attributes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it a good idea to keep splatributes on component level, maybe move it a level if this wrapping div is just a leftover from ember component migration

<Route @name={{routeName}} as |route|>
{{did-insert this.transitionToImported}}
<Route @name={{this.routeName}} as |route|>
{{did-insert-helper this.transitionToImported}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I know did-insert-helper set of helpers are deprecated in favour of did-insert etc., maybe be out of scope of this PR to refactor but it as well just keep did-insert

/>
{{else}}
{{did-insert this.connect}}
{{did-insert-helper this.connect}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as mantioned above, I now wonder what prompted this refactor

export default class InstancesController extends Controller {
@tracked proxies = [];

@action setProxies(data) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@action setProxies(data) {
@action
setProxies(data) {

import { inject as service } from '@ember/service';

export default class UniqueIdHelper extends Helper {
export default class DomGuidHelper extends Helper {
Copy link
Collaborator

@aklkv aklkv Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if now we can just use builtin helper https://rfcs.emberjs.com/id/0659-unique-id-helper/

maybe not because of that custom dom service

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our custom helper has some additional things going on.

{ handler: 'silence', matchId: 'ember-component.send-action' },
{ handler: 'silence', matchId: 'ember-cli-page-object.multiple' },
{ handler: 'silence', matchId: 'computed-property.override' },
{ handler: 'log', matchId: 'ember-cli-page-object.string-properties-on-definition' },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we tend to set to throw for some time till we upgrade past deprecation in order to catch deprecations more effectively

'ember/no-new-mixins': ['warn'],
'ember/no-jquery': 'warn',
'ember/no-global-jquery': 'warn',
'ember/no-jquery': 'error',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be default now, so it might be safe to remove as as the one below

aklkv
aklkv previously approved these changes Dec 1, 2025
aklkv
aklkv previously approved these changes Dec 3, 2025
@rishabh-gupta-hashicorp rishabh-gupta-hashicorp merged commit 335b379 into main Dec 8, 2025
74 checks passed
@hc-github-team-consul-core hc-github-team-consul-core added backport/1.22 Changes are backported to 1.22 backport/ent/1.18 Changes are backported to 1.18 ent backport/ent/1.20 backport to ent 1.20 backport/ent/1.21 changes are backported to 1.21 ent labels Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/all Apply backports for all active releases per .release/versions.hcl backport/ent/1.18 Changes are backported to 1.18 ent backport/ent/1.20 backport to ent 1.20 backport/ent/1.21 changes are backported to 1.21 ent backport/1.22 Changes are backported to 1.22 theme/ui Anything related to the UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants