-
Notifications
You must be signed in to change notification settings - Fork 4.5k
UI/ember upgrade to v4.12 #23070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI/ember upgrade to v4.12 #23070
Conversation
| "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", |
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
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.
| {{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"}} |
There was a problem hiding this comment.
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
actionhelpers - remove all
muthelpers
| > | ||
|
|
||
| {{#let (unique-id) as |id reset|}} | ||
| {{#let (dom-guid) as |id reset|}} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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}} |
There was a problem hiding this comment.
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}} |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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' }, |
There was a problem hiding this comment.
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
ui/packages/consul-ui/.eslintrc.js
Outdated
| 'ember/no-new-mixins': ['warn'], | ||
| 'ember/no-jquery': 'warn', | ||
| 'ember/no-global-jquery': 'warn', | ||
| 'ember/no-jquery': 'error', |
There was a problem hiding this comment.
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
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
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.