Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

GIT-5689 get rid of tippy.js (#76247)

Egor Grushinab33899be54d
diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx
index 6c0c247baa5..dbd3ea2a1c9 100644
--- a/.storybook/preview.tsx
+++ b/.storybook/preview.tsx
@@ -11,7 +11,6 @@ import { PortalContainer, ThemeProvider } from "metabase/ui";
window.METABASE_REMOVE_DELAYS = true;
require("metabase/css/core/index.css");
-require("metabase/css/vendor.css");
require("metabase/css/index.module.css");
require("metabase/utils/dayjs");
diff --git a/bun.lock b/bun.lock
index 2ea9521bb5f..b45b08f3029 100644
--- a/bun.lock
+++ b/bun.lock
@@ -164,7 +164,6 @@
"stream-browserify": "^3.0.0",
"tether": "^1.2.0",
"tinykeys": "^3.0.0",
- "tippy.js": "^6.3.7",
"ts-pattern": "^5.9.0",
"ttag": "1.7.21",
"typescript": "^6.0.3",
@@ -5149,8 +5148,6 @@
"tinyspy": ["[email protected]", "", {}, "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q=="],
- "tippy.js": ["[email protected]", "", { "dependencies": { "@popperjs/core": "^2.9.0" } }, "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ=="],
-
"tldts": ["[email protected]", "", { "dependencies": { "tldts-core": "^6.1.85" }, "bin": { "tldts": "bin/cli.js" } }, "sha512-gBdZ1RjCSevRPFix/hpaUWeak2/RNUZB4/8frF1r5uYMHjFptkiT0JXIebWvgI/0ZHXvxaUDDJshiA0j6GdL3w=="],
"tldts-core": ["[email protected]", "", {}, "sha512-DTjUVvxckL1fIoPSb3KE7ISNtkWSawZdpfxGxwiIrZoO6EbHVDXXUIlIuWympPaeS+BLGyggozX/HTMsRAdsoA=="],
@@ -6995,8 +6992,6 @@
"test-exclude/minimatch": ["[email protected]", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw=="],
- "tippy.js/@popperjs/core": ["@popperjs/[email protected]", "", {}, "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ=="],
-
"to-buffer/safe-buffer": ["[email protected]", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
"transliteration/yargs": ["[email protected]", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w=="],
diff --git a/frontend/build/shared/rspack/css-config.js b/frontend/build/shared/rspack/css-config.js
index 0e4ebdcad61..e6982e4e765 100644
--- a/frontend/build/shared/rspack/css-config.js
+++ b/frontend/build/shared/rspack/css-config.js
@@ -3,7 +3,7 @@ const { IS_DEV_MODE } = require("../constants");
module.exports.CSS_CONFIG = {
modules: {
auto: (filename) =>
- ["node_modules", "vendor.css", "vendor.module.css"].every(
+ ["node_modules"].every(
(excludedPattern) => !filename.includes(excludedPattern),
),
localIdentName: IS_DEV_MODE
diff --git a/frontend/src/metabase-types/guards/index.ts b/frontend/src/metabase-types/guards/index.ts
index e84d0ba1d10..6a9af3fac0a 100644
--- a/frontend/src/metabase-types/guards/index.ts
+++ b/frontend/src/metabase-types/guards/index.ts
@@ -3,7 +3,6 @@ export * from "./click-behavior";
export * from "./common";
export * from "./dom";
export * from "./parameters";
-export * from "./react";
export * from "./revision";
export * from "./settings";
export * from "./visualization";
diff --git a/frontend/src/metabase-types/guards/react.ts b/frontend/src/metabase-types/guards/react.ts
deleted file mode 100644
index a721b754359..00000000000
--- a/frontend/src/metabase-types/guards/react.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import * as ReactIs from "react-is";
-
-// checking to see if the `element` is in JSX.IntrinisicElements since they support refs
-// tippy's `children` prop seems to complain about anything more specific that React.ReactElement, unfortunately
-export function isReactDOMTypeElement(
- element: any,
-): element is React.ReactElement {
- return ReactIs.isElement(element) && typeof element.type === "string";
-}
diff --git a/frontend/src/metabase/css/components/tippy.module.css b/frontend/src/metabase/css/components/tippy.module.css
deleted file mode 100644
index fca05aa171a..00000000000
--- a/frontend/src/metabase/css/components/tippy.module.css
+++ /dev/null
@@ -1,7 +0,0 @@
-:global(.tippy-content) {
- white-space: pre-wrap;
-}
-
-:global(.tippy-box) {
- color: inherit;
-}
diff --git a/frontend/src/metabase/css/index.module.css b/frontend/src/metabase/css/index.module.css
index 564ab315e06..095733094a5 100644
--- a/frontend/src/metabase/css/index.module.css
+++ b/frontend/src/metabase/css/index.module.css
@@ -1,6 +1,5 @@
@import "./components/form.module.css";
@import "./components/list.module.css";
-@import "./components/tippy.module.css";
@import "./components/grabber.module.css";
@import "./admin.module.css";
@import "./dashboard.module.css";
diff --git a/frontend/src/metabase/css/vendor.css b/frontend/src/metabase/css/vendor.css
deleted file mode 100644
index 85f04a766b3..00000000000
--- a/frontend/src/metabase/css/vendor.css
+++ /dev/null
@@ -1 +0,0 @@
-@import "tippy.js/dist/tippy.css";
diff --git a/frontend/src/metabase/embedding-sdk/vendors-side-effects.ts b/frontend/src/metabase/embedding-sdk/vendors-side-effects.ts
index 75dd8d1d78e..6177ab195ef 100644
--- a/frontend/src/metabase/embedding-sdk/vendors-side-effects.ts
+++ b/frontend/src/metabase/embedding-sdk/vendors-side-effects.ts
@@ -1,7 +1,6 @@
import "@mantine/core/styles.css";
import "@mantine/dates/styles.css";
-import "metabase/css/vendor.css";
import "metabase/css/index.module.css";
import "metabase/utils/dayjs";
diff --git a/frontend/src/metabase/visualizations/components/ClickActions/ClickActionsPopover.tsx b/frontend/src/metabase/visualizations/components/ClickActions/ClickActionsPopover.tsx
index 4a226791694..c8a26454bd7 100644
--- a/frontend/src/metabase/visualizations/components/ClickActions/ClickActionsPopover.tsx
+++ b/frontend/src/metabase/visualizations/components/ClickActions/ClickActionsPopover.tsx
@@ -1,6 +1,5 @@
import type { LocationDescriptorObject } from "history";
import { Component } from "react";
-import type * as tippy from "tippy.js";
import { connect } from "metabase/redux";
import type { Dispatch } from "metabase/redux/store";
@@ -46,8 +45,6 @@ export class ClickActionsPopover extends Component<
popoverAction: null,
};
- instance: tippy.Instance | null = null;
-
componentDidUpdate(prevProps: Readonly<ChartClickActionsProps>): void {
const { clicked } = this.props;
const { popoverAction } = this.state;
@@ -123,9 +120,6 @@ export class ClickActionsPopover extends Component<
popover = (
<PopoverContent
onClick={this.handleClickAction}
- onResize={() => {
- this.instance?.popperInstance?.update();
- }}
onChangeCardAndRun={(options) =>
onChangeCardAndRun({ drillName: popoverAction.name, ...options })
}
diff --git a/frontend/src/metabase/visualizations/types/click-actions.ts b/frontend/src/metabase/visualizations/types/click-actions.ts
index be103bd640b..b399db3606b 100644
--- a/frontend/src/metabase/visualizations/types/click-actions.ts
+++ b/frontend/src/metabase/visualizations/types/click-actions.ts
@@ -173,7 +173,6 @@ export type ClickActionPopoverProps = {
onClick: (action: RegularClickAction) => void;
onChangeCardAndRun: OnChangeCardAndRun;
onUpdateVisualizationSettings: (settings: VisualizationSettings) => void;
- onResize: (...args: unknown[]) => void;
onClose: () => void;
};
diff --git a/frontend/test/metabase-bootstrap.js b/frontend/test/metabase-bootstrap.js
index e995a53826e..8af5a1db044 100644
--- a/frontend/test/metabase-bootstrap.js
+++ b/frontend/test/metabase-bootstrap.js
@@ -1,4 +1,3 @@
-import "metabase/css/vendor.css";
import "metabase/css/index.module.css";
window.MetabaseBootstrap = {
diff --git a/package.json b/package.json
index e7c7164300a..2fa79d7a666 100644
--- a/package.json
+++ b/package.json
@@ -173,7 +173,6 @@
"stream-browserify": "^3.0.0",
"tether": "^1.2.0",
"tinykeys": "^3.0.0",
- "tippy.js": "^6.3.7",
"ts-pattern": "^5.9.0",
"ttag": "1.7.21",
"typescript": "^6.0.3",
diff --git a/rspack.main.config.js b/rspack.main.config.js
index b52f0eabd37..f9c958c7eab 100644
--- a/rspack.main.config.js
+++ b/rspack.main.config.js
@@ -116,7 +116,6 @@ const config = {
"app-embed": "./app-embed.ts",
"app-embed-sdk": "./app-embed-sdk.tsx",
"app-embed-mcp": "./app-embed-mcp.tsx",
- "vendor-styles": "./css/vendor.css",
styles: "./css/index.module.css",
},
@@ -279,31 +278,31 @@ const config = {
new HtmlWebpackPlugin({
filename: "../../index.html",
chunksSortMode: "manual",
- chunks: ["vendor", "vendor-styles", "styles", "app-main"],
+ chunks: ["vendor", "styles", "app-main"],
template: __dirname + "/resources/frontend_client/index_template.html",
}),
new HtmlWebpackPlugin({
filename: "../../public.html",
chunksSortMode: "manual",
- chunks: ["vendor", "vendor-styles", "styles", "app-public"],
+ chunks: ["vendor", "styles", "app-public"],
template: __dirname + "/resources/frontend_client/index_template.html",
}),
new HtmlWebpackPlugin({
filename: "../../embed.html",
chunksSortMode: "manual",
- chunks: ["vendor", "vendor-styles", "styles", "app-embed"],
+ chunks: ["vendor", "styles", "app-embed"],
template: __dirname + "/resources/frontend_client/index_template.html",
}),
new HtmlWebpackPlugin({
filename: "../../embed-sdk.html",
chunksSortMode: "manual",
- chunks: ["vendor", "vendor-styles", "styles", "app-embed-sdk"],
+ chunks: ["vendor", "styles", "app-embed-sdk"],
template: __dirname + "/resources/frontend_client/index_template.html",
}),
new HtmlWebpackPlugin({
filename: "../../embed-mcp.html",
chunksSortMode: "manual",
- chunks: ["vendor", "vendor-styles", "styles", "app-embed-mcp"],
+ chunks: ["vendor", "styles", "app-embed-mcp"],
template: __dirname + "/resources/frontend_client/mcp_apps_template.html",
// MCP apps are rendered inside a sandboxed srcdoc iframe (about:srcdoc),