Remove deprecated API usage #128872
Labels
blocked
impact:medium
Addressing this issue will have a medium level of impact on the quality/strength of our product.
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
technical debt
Improvement of the software architecture and operational architecture
There are a few deprecated APIs in use in VisEditors plugins which should be fixed.
onAppLeave
inlens
/visualizations
Instead of
onAppLeave
, theblock
method of the history object passed down to the mount function of the app should be used (kibana/x-pack/plugins/lens/public/plugin.ts
Line 316 in 0ea741d
It's a thin wrapper around the
block
method of thehistory
object used for routing: https://github.com/remix-run/history/blob/3e9dab413f4eda8d6bce565388c5ddb7aeff9f7e/docs/blocking-transitions.mdIt seems like the easiest way to implement this is to introduce a shimming layer which keeps the
onAppLeave
semantics and useshistory.block
under the hood:onAppLeave
is called, execute the passed in callback with anactions
objectdefault
got called, call the unregister callback fromhistory.block
if it got called beforeconfirm
got called, call history.block if it didn't get called yet and render the modal in the callback and on a confirmation unblock and retry the transaction like in the example in https://github.com/remix-run/history/blob/3e9dab413f4eda8d6bce565388c5ddb7aeff9f7e/docs/blocking-transitions.mdmigration(done)warning
inlens
Should use
warn
instead(done)injectedMetadata
invega
Should have an optional dependency on the
maps_ems
plugin and get it from there via contractThe text was updated successfully, but these errors were encountered: