-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Get rid of createLegacyClass #21360
Comments
Summarizing and verifying -
|
I'm pretty sure If we want to park it in the platform queue for lack of an obvious alternative, we can. |
Scope of work - |
Only remaining usages are in the legacy state_management ( |
cc @flash1293 Do you know if those |
legacy state_management is only used in timelion which will be migrated away from it soon. This can simply be removed along with the legacy platform. |
Pretty sure this has been removed for awhile now -- @flash1293 is this issue safe to close? |
|
We have a way to inherit classes in an old fashioned style in
legacy_class
. Trying to convert some old Mocha tests to Jest (which we compile differently in Babel, because they run in node.js and not the browser) I found some issues with that class.createLegacyClass
currently only works, because we are compiling specific features (in this caseclass
) down to ES5. Since we are not compiling down to ES5, but use babel targetnode: 'current'
for Jest tests, this class does not work in Jest tests. In case we would ever stop compilingclass
to ES5 (e.g. we decide to no longer support IE11 or such), this class would also not work in the Kibana distributable anymore.The cause is, that
class Foo {}
will lead toFoo.prototype
beingwritable: false
from its descriptor (Object.getOwnPropertyDescriptor
), while the babel compiled code would containfunction Foo {}
which makesFoo.prototype
writable.createLegacyClass
tries to overwriteprototype
and thus fails if we are not compiling to ES5.This needs to be fixed before we ever possibly could get rid of compiling
class
no longer down for Kibana during runtime.cc @elastic/kibana-platform
The text was updated successfully, but these errors were encountered: