From c66f9ad407a8c7de6a1f52ba71b0bc2c8144e8a9 Mon Sep 17 00:00:00 2001 From: chh <1474479+chenhunghan@users.noreply.github.com> Date: Mon, 11 Apr 2022 16:45:12 +0300 Subject: [PATCH] Expose ReactDOM as global object, and ensure in-tree extension to use the same instance (#5229) Signed-off-by: Hung-Han (Henry) Chen --- extensions/kube-object-event-status/webpack.config.js | 1 + extensions/metrics-cluster-feature/webpack.config.js | 1 + extensions/node-menu/webpack.config.js | 1 + extensions/pod-menu/webpack.config.js | 1 + src/renderer/bootstrap.tsx | 2 ++ 5 files changed, 6 insertions(+) diff --git a/extensions/kube-object-event-status/webpack.config.js b/extensions/kube-object-event-status/webpack.config.js index 5f50f6cfa8ad..8fe82e48a7dc 100644 --- a/extensions/kube-object-event-status/webpack.config.js +++ b/extensions/kube-object-event-status/webpack.config.js @@ -26,6 +26,7 @@ module.exports = [ { "@k8slens/extensions": "var global.LensExtensions", "react": "var global.React", + "react-dom": "var global.ReactDOM", "mobx": "var global.Mobx", "mobx-react": "var global.MobxReact", }, diff --git a/extensions/metrics-cluster-feature/webpack.config.js b/extensions/metrics-cluster-feature/webpack.config.js index ea3cf42181f6..951cffdabc20 100644 --- a/extensions/metrics-cluster-feature/webpack.config.js +++ b/extensions/metrics-cluster-feature/webpack.config.js @@ -26,6 +26,7 @@ module.exports = [ { "@k8slens/extensions": "var global.LensExtensions", "react": "var global.React", + "react-dom": "var global.ReactDOM", "mobx": "var global.Mobx", "mobx-react": "var global.MobxReact", }, diff --git a/extensions/node-menu/webpack.config.js b/extensions/node-menu/webpack.config.js index 5f50f6cfa8ad..8fe82e48a7dc 100644 --- a/extensions/node-menu/webpack.config.js +++ b/extensions/node-menu/webpack.config.js @@ -26,6 +26,7 @@ module.exports = [ { "@k8slens/extensions": "var global.LensExtensions", "react": "var global.React", + "react-dom": "var global.ReactDOM", "mobx": "var global.Mobx", "mobx-react": "var global.MobxReact", }, diff --git a/extensions/pod-menu/webpack.config.js b/extensions/pod-menu/webpack.config.js index 5f50f6cfa8ad..8fe82e48a7dc 100644 --- a/extensions/pod-menu/webpack.config.js +++ b/extensions/pod-menu/webpack.config.js @@ -26,6 +26,7 @@ module.exports = [ { "@k8slens/extensions": "var global.LensExtensions", "react": "var global.React", + "react-dom": "var global.ReactDOM", "mobx": "var global.Mobx", "mobx-react": "var global.MobxReact", }, diff --git a/src/renderer/bootstrap.tsx b/src/renderer/bootstrap.tsx index 35a09eb0c7a2..207ae3fd8fda 100644 --- a/src/renderer/bootstrap.tsx +++ b/src/renderer/bootstrap.tsx @@ -6,6 +6,7 @@ import "./components/app.scss"; import React from "react"; +import ReactDOM from "react-dom"; import * as Mobx from "mobx"; import * as MobxReact from "mobx-react"; import * as ReactRouter from "react-router"; @@ -187,6 +188,7 @@ const LensExtensions = { export { React, + ReactDOM, ReactRouter, ReactRouterDom, Mobx,