-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 3.8 > 3.12 #6406
Conversation
In the upgrade from ember 3.8 > 3.12 the public interfaces for ComputedProperties have changed slightly. `meta` is no longer a public property of ComputedProperty but of a ComputedDecoratorImpl mixin instead. https://github.com/emberjs/ember.js/blob/7e4ba1096e3c2e3e0dde186d5ca52ff19cb8720a/packages/%40ember/-internals/metal/lib/computed.ts#L725 There seems to be no way, by just using publically available methods, to replicate this behaviour so that we can create our own 'ComputedProperty` factory via injecting the ComputedProperty class as we did previously. https://github.com/hashicorp/consul/blob/3f333bada181aaf6340523ca2268a28d1a7db214/ui-v2/app/utils/computed/factory.js#L1-L18 Instead we dynamically hang our `Catchable` `catch` method off the instantiated ComputedProperty. In doing it like this `ComputedProperty` has already has its `meta` method mixed in so we don't have to manually mix it in ourselves (which doesn't seem possible) This functionality is only used during our work in trying to ensure our EventSource/BlockingQuery work was as 'ember-like' as possible (i.e. using the traditional Route.model hooks and ember-like Controller properties). Our ongoing/upcoming work on a componentized approach to data a.k.a `<DataSource />` means we will be able to remove the majority of the code involved here now that it seems to be under an amount of flux in ember.
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.
Nice and easy! I noticed a huge amount of noise in the logs from this deprecation warning:
Model.data was private and it's use has been deprecated. For public access, use the RecordData API or iterate attributes [deprecation id: ember-data:Model.data]
I don’t know what your approach is to deprecations but if it’s something you’re planning to leave in for now, you could check out ember-cli-deprecation-workflow
to silence the message until you’re ready to deal with it. I’m not 100% sure but it seems like that message might be causing Circle to be unable to render the entire log!
Hey @backspace! Thanks again for looking over this!
😂 yeah there are loads of them. For me deprecations straight after an upgrade are 'fine' (more or less), with the understanding that deprecations are 'we are going to be changing this soon so between now and another upgrade in the future, you should probably change this before you do another big upgrade'. In saying that, I don't like all this noise at all myself and will be looking at these way before we actually need to. But I don't want them to block a merge as deprecations are still 'ok' (kinda). If I can get this run of work in before fixing the deprecations I will (but while I'm waiting I'll be looking into them at least, so expect more PRs for your 👀 ! ) I'll have a look at that addon you linked to, it definitely could be useful here. Generally I like things bugging me until they are sorted out, it means I don't forget about them, so I don't really want things hiding completely, but it would be nice to just see them in the CLI instead of in console also - will take a look 🙇 Lastly if it was just that failing test that was blocking approval, that should be ok now 🤞 |
Closing in favour of #6448 |
This PR uses
ember-cli-update
to upgrade from ember 3.8 to ember 3.12.We also hit one or two interesting problems after doing the upgrade.
Everything here apart from the changes to
catchable.js
are automated changes.In the upgrade from ember 3.8 > 3.12 the public interfaces for
ComputedProperties have changed slightly.
meta
is no longer a publicproperty of ComputedProperty but of a ComputedDecoratorImpl mixin
instead.
https://github.com/emberjs/ember.js/blob/7e4ba1096e3c2e3e0dde186d5ca52ff19cb8720a/packages/%40ember/-internals/metal/lib/computed.ts#L725
There seems to be no way, by just using publically available
methods, to replicate this behaviour so that we can create our own
'ComputedProperty` factory via injecting the ComputedProperty class as
we did previously.
consul/ui-v2/app/utils/computed/factory.js
Lines 1 to 18 in 3f333ba
Instead we dynamically hang our
Catchable
catch
method off theinstantiated ComputedProperty. In doing it like this
ComputedProperty
has already has its
meta
method mixed in so we don't have to manuallymix it in ourselves (which doesn't seem possible).
The
utils/computed/factory
util is now useless so we've removed it.This functionality is only used during our work in trying to ensure
our EventSource/BlockingQuery work was as 'ember-like' as possible (i.e.
using the traditional Route.model hooks and ember-like Controller
properties). Our ongoing/upcoming work on a componentized approach to
data a.k.a
<DataSource />
means we will be able to remove the majorityof the code involved here now that it seems to be under an amount of
flux in ember.