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: Upgrade to Ember 4.12 #22122
UI: Upgrade to Ember 4.12 #22122
Changes from 21 commits
09ce409
b6812d3
da76d64
09ea562
082e603
bf50b35
f894d2c
b45d545
bdfb09b
92461ca
199460a
2826315
0fcb370
fa692ba
4231802
29f0d51
af00582
e452be2
b19cdce
f83d7d2
2ad3b1e
bee6570
66bb750
dbf25fb
ddde559
461c71b
07e5bfa
a7fef9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,11 @@ module.exports = { | |
printWidth: 125, | ||
}, | ||
}, | ||
{ | ||
files: '*.{js,ts}', | ||
options: { | ||
singleQuote: true, | ||
}, | ||
}, | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# unconventional files | ||
/blueprints/*/files/ | ||
|
||
# compiled output | ||
/dist/ | ||
|
||
# addons | ||
/.node_modules.ember-try/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'], | ||
}; |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Database role tests were exiting early, so this was an attempt to stabilize those |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,12 +73,11 @@ export default Component.extend({ | |
).drop(), | ||
|
||
willDestroy() { | ||
this._super(...arguments); | ||
const model = this.model; | ||
if (!model) return; | ||
if ((model.get('isDirty') && !model.isDestroyed) || !model.isDestroying) { | ||
if (model && model.get('isDirty') && !model.isDestroyed && !model.isDestroying) { | ||
model.rollbackAttributes(); | ||
} | ||
this._super(...arguments); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Always call |
||
}, | ||
|
||
actions: { | ||
|
hashishaw marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,10 @@ export function initialize() { | |
registerDeprecationHandler((message, options, next) => { | ||
// filter deprecations that are scheduled to be removed in a specific version | ||
// when upgrading or addressing deprecation warnings be sure to update this or remove if not needed | ||
if (options?.until !== '5.0.0') { | ||
next(message, options); | ||
if (options?.until.includes('5.0')) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. deprecations are returning |
||
return; | ||
} | ||
return; | ||
next(message, options); | ||
}); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,23 @@ import { computed } from '@ember/object'; | |
import ObjectProxy from '@ember/object/proxy'; | ||
import PromiseProxyMixin from '@ember/object/promise-proxy-mixin'; | ||
import { resolve } from 'rsvp'; | ||
/** | ||
* after upgrading to Ember 4.12 a secrets test was erroring with "Cannot create a new tag for `<model::capabilities:undefined>` after it has been destroyed" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this is an error I've also seen while developing - I wonder if the test was finally catching it now after the upgrade? Or do you think this behavior is just isolated to tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could be, but I thought in the app we saw an id instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yeah, that error is familiar too. Sounds good! |
||
* see this GH issue for information on the fix https://github.com/emberjs/ember.js/issues/16541#issuecomment-382403523 | ||
*/ | ||
ObjectProxy.reopen({ | ||
unknownProperty(key) { | ||
if (this.isDestroying || this.isDestroyed) { | ||
return; | ||
} | ||
|
||
if (this.content && (this.content.isDestroying || this.content.isDestroyed)) { | ||
return; | ||
} | ||
|
||
return this._super(key); | ||
}, | ||
}); | ||
|
||
export function maybeQueryRecord(modelName, options = {}, ...keys) { | ||
return computed(...keys, 'store', { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ export default Mixin.create({ | |
return; | ||
} | ||
removeRecord(this.store, model); | ||
model.destroy(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
// it's important to unset the model on the controller since controllers are singletons | ||
this.controller.set(modelPath, null); | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
*/ | ||
|
||
import Mixin from '@ember/object/mixin'; | ||
import Ember from 'ember'; | ||
|
||
// this mixin relies on `unload-model-route` also being used | ||
export default Mixin.create({ | ||
|
@@ -15,6 +16,7 @@ export default Mixin.create({ | |
} | ||
if (model.hasDirtyAttributes) { | ||
if ( | ||
Ember.testing || | ||
window.confirm( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. window.confirm blows up in testing |
||
'You have unsaved changes. Navigating away will discard these changes. Are you sure you want to discard your changes?' | ||
) | ||
|
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 because of the upgrade? I thought since we sent the namespace as the header, the
/sys/internal/ui/mounts
requests only fires for that namespacThere 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.
Right, but we have to unload the store here or else that call will just append to the store we already have. This note is just to clarify what the below is doing, so that we can remove it later (
unloadAll
was causing issues throughout tests)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.
Ahh I see - I thought the store cleared with the new request. Thanks for clarifying!