The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
revert the in app and in host app warning 66 (#85339)
Nicolò Pretto10890427cac8
diff --git a/e2e/test-component/scenarios/embedding-sdk/react-18-deprecation-warning.cy.spec.tsx b/e2e/test-component/scenarios/embedding-sdk/react-18-deprecation-warning.cy.spec.tsxdeleted file mode 100644index 2a1d7ad2fe1..00000000000--- a/e2e/test-component/scenarios/embedding-sdk/react-18-deprecation-warning.cy.spec.tsx+++ /dev/null@@ -1,66 +0,0 @@-import { StaticQuestion } from "@metabase/embedding-sdk-react";-import { version as reactVersion } from "react";--import { ORDERS_QUESTION_ID } from "e2e/support/cypress_sample_instance_data";-import { getSdkRoot } from "e2e/support/helpers/e2e-embedding-sdk-helpers";-import { mountSdkContent } from "e2e/support/helpers/embedding-sdk-component-testing";-import { signInAsAdminAndEnableEmbeddingSdk } from "e2e/support/helpers/embedding-sdk-testing";-import { mockAuthProviderAndJwtSignIn } from "e2e/support/helpers/embedding-sdk-testing/embedding-sdk-helpers";--// In .github/workflows/embedding-sdk-component-tests.yml, we run tests-// across multiple React versions, including React 19.-const hostReactMajorVersion = parseInt(reactVersion, 10);--const REACT_18_WARNING =- "This application uses React 18. The Metabase modular embedding SDK will require React 19 in a future release, and this embed will stop working once your Metabase instance is upgraded to it. Please upgrade your application to React 19.";--describe("scenarios > embedding-sdk > react-18-deprecation-warning", () => {- beforeEach(() => {- signInAsAdminAndEnableEmbeddingSdk();-- cy.signOut();-- mockAuthProviderAndJwtSignIn();-- cy.window().then((win) => {- cy.spy(win.console, "warn").as("consoleWarn");- });- });-- (hostReactMajorVersion === 18 ? it : it.skip)(- "warns about React 18 on localhost when the host app runs React 18",- () => {- mountSdkContent(<StaticQuestion questionId={ORDERS_QUESTION_ID} />);-- getSdkRoot().findByText("Product ID").should("exist");-- cy.findByTestId("sdk-usage-problem-indicator").click();-- cy.findByTestId("sdk-usage-problem-card").should(- "contain.text",- REACT_18_WARNING,- );-- cy.get("@consoleWarn").should(- "have.been.calledWithMatch",- REACT_18_WARNING,- );- },- );-- (hostReactMajorVersion > 18 ? it : it.skip)(- "does not warn about React 18 when the host app runs a newer React",- () => {- mountSdkContent(<StaticQuestion questionId={ORDERS_QUESTION_ID} />);-- getSdkRoot().findByText("Product ID").should("exist");-- cy.findByTestId("sdk-usage-problem-indicator").should("not.exist");-- cy.get("@consoleWarn").should(- "not.have.been.calledWithMatch",- REACT_18_WARNING,- );- },- );-});diff --git a/enterprise/frontend/src/embedding-sdk-ee/tests/auth-flow/jwt.unit.spec.tsx b/enterprise/frontend/src/embedding-sdk-ee/tests/auth-flow/jwt.unit.spec.tsxindex d65462716eb..15e363eda5a 100644--- a/enterprise/frontend/src/embedding-sdk-ee/tests/auth-flow/jwt.unit.spec.tsx+++ b/enterprise/frontend/src/embedding-sdk-ee/tests/auth-flow/jwt.unit.spec.tsx@@ -24,13 +24,6 @@ import { setupEmbeddingSdkEnterprisePlugins } from "../support";import { setup as baseSetup } from "./setup";-// Jest runs React 18 on localhost, which shows the React 18 warning banner.-// Mock React 19 so the spec only sees the usage problems it tests.-jest.mock("embedding-sdk-bundle/lib/host-react-version", () => ({- ...jest.requireActual("embedding-sdk-bundle/lib/host-react-version"),- getHostReactMajorVersion: () => 19,-}));-const setup = ({authConfig,locale,diff --git a/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay-simple-embedding.unit.spec.tsx b/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay-simple-embedding.unit.spec.tsxindex af9018698f9..90e68534f0a 100644--- a/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay-simple-embedding.unit.spec.tsx+++ b/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay-simple-embedding.unit.spec.tsx@@ -8,7 +8,6 @@ import { mockSettings } from "__support__/settings";import { createMockState } from "__support__/state";import { screen, within } from "__support__/ui";import * as IsLocalhostModule from "embedding-sdk-bundle/lib/get-is-localhost";-import { getHostReactMajorVersion } from "embedding-sdk-bundle/lib/host-react-version";import { renderWithSDKProviders } from "embedding-sdk-bundle/test/__support__/ui";import { createMockSdkConfig } from "embedding-sdk-bundle/test/mocks/config";import {@@ -27,16 +26,6 @@ jest.mock("metabase/visualizations/register", () => ({registerVisualizations: jest.fn(),}));-// Jest runs React 18 on localhost, which shows the React 18 warning banner.-// Each test sets the host React major version instead.-// Without the real module behind it, isHostReactVersionSupported is undefined-// here, and anything that loads the SDK hooks throws: each of them calls that-// check when its module loads.-jest.mock("embedding-sdk-bundle/lib/host-react-version", () => ({- ...jest.requireActual("embedding-sdk-bundle/lib/host-react-version"),- getHostReactMajorVersion: jest.fn(),-}));-jest.mock("metabase/embedding-sdk/config", () => ({...jest.requireActual("metabase/embedding-sdk/config"),// The actual helper reads the actual config, not the mocked one below.@@ -56,12 +45,9 @@ jest.mock("metabase/embedding-sdk/config", () => ({interface Options {hasSimpleEmbeddingFeature?: boolean;isSimpleEmbeddingEnabled?: boolean;- hostReactMajorVersion?: number;}-const setup = ({ hostReactMajorVersion = 19, ...options }: Options) => {- jest.mocked(getHostReactMajorVersion).mockReturnValue(hostReactMajorVersion);-+const setup = (options: Options) => {const tokenFeatures = createMockTokenFeatures({embedding_simple: options.hasSimpleEmbeddingFeature ?? true,});@@ -172,14 +158,4 @@ describe("SdkUsageProblemDisplay (simple embedding)", () => {mock.mockRestore();});-- it("does not show the React 18 warning, since the iframe embed runs the React shipped by Metabase", async () => {- expect(window.location.origin).toBe("http://localhost");-- await setup({ hostReactMajorVersion: 18 });-- expect(- screen.queryByTestId(PROBLEM_INDICATOR_TEST_ID),- ).not.toBeInTheDocument();- });});diff --git a/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay.unit.spec.tsx b/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay.unit.spec.tsxindex 779459c9def..77da6896c67 100644--- a/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay.unit.spec.tsx+++ b/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay.unit.spec.tsx@@ -10,7 +10,6 @@ import { createMockState } from "__support__/state";import { act, screen, waitFor, within } from "__support__/ui";import { SdkUsageProblemDisplay } from "embedding-sdk-bundle/components/private/SdkUsageProblem";import * as IsLocalhostModule from "embedding-sdk-bundle/lib/get-is-localhost";-import { getHostReactMajorVersion } from "embedding-sdk-bundle/lib/host-react-version";import { initAuth } from "embedding-sdk-bundle/store/auth";import { renderWithSDKProviders } from "embedding-sdk-bundle/test/__support__/ui";import {@@ -24,7 +23,6 @@ import {} from "embedding-sdk-bundle/test/mocks/state";import type { MetabaseAuthConfig } from "embedding-sdk-bundle/types";import type { LoginStatus } from "embedding-sdk-bundle/types/user";-import * as IsHostAppInDevModeModule from "embedding-sdk-shared/lib/is-host-app-in-dev-mode";import {createMockSettings,createMockTokenFeatures,@@ -37,36 +35,22 @@ jest.mock("metabase/visualizations/register", () => ({registerVisualizations: jest.fn(),}));-// Jest runs React 18 on localhost, which shows the React 18 warning banner.-// Each test sets the host React major version instead.-// Without the real module behind it, isHostReactVersionSupported is undefined-// here, and anything that loads the SDK hooks throws: each of them calls that-// check when its module loads.-jest.mock("embedding-sdk-bundle/lib/host-react-version", () => ({- ...jest.requireActual("embedding-sdk-bundle/lib/host-react-version"),- getHostReactMajorVersion: jest.fn(),-}));-interface Options {authConfig: MetabaseAuthConfig;hasEmbeddingFeature?: boolean;isEmbeddingSdkEnabled?: boolean;isDevelopmentMode?: boolean;hasExpirationClaim?: boolean;- hostReactMajorVersion?: number;initStatus?: LoginStatus["status"];children?: ReactElement;}const setup = ({hasExpirationClaim = true,- hostReactMajorVersion = 19,initStatus = "success",children = <div>hello!</div>,...options}: Options) => {- jest.mocked(getHostReactMajorVersion).mockReturnValue(hostReactMajorVersion);-const tokenFeatures = createMockTokenFeatures({embedding_sdk: options.hasEmbeddingFeature ?? true,development_mode: options.isDevelopmentMode ?? false,@@ -342,45 +326,15 @@ describe("SdkUsageProblemDisplay", () => {);});- it("shows a warning when the host app runs React 18 on localhost", async () => {- expect(window.location.origin).toBe("http://localhost");-- setup({ authConfig: createMockSdkConfig(), hostReactMajorVersion: 18 });-- await userEvent.click(screen.getByTestId(PROBLEM_INDICATOR_TEST_ID));-- const card = screen.getByTestId(PROBLEM_CARD_TEST_ID);-- expect(- within(card).getByText("This embed is powered by the Metabase SDK."),- ).toBeInTheDocument();-- expect(- within(card).getByText(- "This application uses React 18. The Metabase modular embedding SDK will require React 19 in a future release, and this embed will stop working once your Metabase instance is upgraded to it. Please upgrade your application to React 19.",- ),- ).toBeInTheDocument();-- const docsLink = within(card).getByRole("link", {- name: "Documentation",- });-- expect(docsLink).toHaveAttribute(- "href",- "https://www.metabase.com/docs/latest/embedding/sdk/introduction#modular-embedding-sdk-prerequisites",- );- });-it("logs a usage problem to the console once the SDK has initialized", async () => {const consoleWarnSpy = jest.spyOn(console, "warn").mockImplementation(() => {});- const authConfig = createMockSdkConfig();+ const authConfig = createMockApiKeyConfig();// The SDK test renderer turns console logging off for its own display.const { store } = setup({authConfig,- hostReactMajorVersion: 18,initStatus: "loading",children: (<SdkUsageProblemDisplay authConfig={authConfig} allowConsoleLog />@@ -400,159 +354,12 @@ describe("SdkUsageProblemDisplay", () => {expect(consoleWarnSpy).toHaveBeenCalledTimes(1);});expect(String(consoleWarnSpy.mock.calls[0][0])).toContain(- "This application uses React 18. The Metabase modular embedding SDK will require React 19 in a future release, and this embed will stop working once your Metabase instance is upgraded to it. Please upgrade your application to React 19.",+ "This embed is using API keys. This is intended for evaluation purposes and works only on localhost. To use on other sites, implement SSO.",);consoleWarnSpy.mockRestore();});- it("does not show the React 18 warning outside localhost", () => {- const mock = jest- .spyOn(IsLocalhostModule, "getIsLocalhost")- .mockImplementation(() => false);-- setup({ authConfig: createMockSdkConfig(), hostReactMajorVersion: 18 });-- expect(- screen.queryByTestId(PROBLEM_INDICATOR_TEST_ID),- ).not.toBeInTheDocument();-- mock.mockRestore();- });-- it("does not show the React 18 warning when the host app runs React 19", () => {- setup({ authConfig: createMockSdkConfig(), hostReactMajorVersion: 19 });-- expect(- screen.queryByTestId(PROBLEM_INDICATOR_TEST_ID),- ).not.toBeInTheDocument();- });-- it("shows the React 18 warning over the API key warning on localhost", async () => {- setup({ authConfig: createMockApiKeyConfig(), hostReactMajorVersion: 18 });-- await userEvent.click(screen.getByTestId(PROBLEM_INDICATOR_TEST_ID));-- const card = screen.getByTestId(PROBLEM_CARD_TEST_ID);-- expect(- within(card).getByText(- "This application uses React 18. The Metabase modular embedding SDK will require React 19 in a future release, and this embed will stop working once your Metabase instance is upgraded to it. Please upgrade your application to React 19.",- ),- ).toBeInTheDocument();-- expect(- within(card).queryByText(- /This is intended for evaluation purposes and works only on localhost. To use on other sites, implement SSO./,- ),- ).not.toBeInTheDocument();- });-- it("shows the React 18 warning on a non-localhost host app in development mode", async () => {- const isLocalhostMock = jest- .spyOn(IsLocalhostModule, "getIsLocalhost")- .mockImplementation(() => false);- const isHostAppInDevModeMock = jest- .spyOn(IsHostAppInDevModeModule, "isHostAppInDevMode")- .mockImplementation(() => true);-- setup({ authConfig: createMockSdkConfig(), hostReactMajorVersion: 18 });-- await userEvent.click(screen.getByTestId(PROBLEM_INDICATOR_TEST_ID));-- expect(- within(screen.getByTestId(PROBLEM_CARD_TEST_ID)).getByText(- "This application uses React 18. The Metabase modular embedding SDK will require React 19 in a future release, and this embed will stop working once your Metabase instance is upgraded to it. Please upgrade your application to React 19.",- ),- ).toBeInTheDocument();-- isLocalhostMock.mockRestore();- isHostAppInDevModeMock.mockRestore();- });-- it("shows the license error over the React 18 warning when JWT is used without a license", async () => {- setup({- authConfig: createMockSdkConfig(),- hasEmbeddingFeature: false,- hostReactMajorVersion: 18,- });-- await userEvent.click(screen.getByTestId(PROBLEM_INDICATOR_TEST_ID));-- const card = screen.getByTestId(PROBLEM_CARD_TEST_ID);-- expect(- within(card).getByText(- "Usage without a valid license for this feature is only allowed for evaluation purposes, using API keys and only on localhost. Attempting to use this in other ways is in breach of our usage policy.",- ),- ).toBeInTheDocument();-- expect(- within(card).queryByText(/This application uses React 18/),- ).not.toBeInTheDocument();- });-- it("shows the SDK disabled error over the React 18 warning on a host app in development mode", async () => {- const isLocalhostMock = jest- .spyOn(IsLocalhostModule, "getIsLocalhost")- .mockImplementation(() => false);- const isHostAppInDevModeMock = jest- .spyOn(IsHostAppInDevModeModule, "isHostAppInDevMode")- .mockImplementation(() => true);-- setup({- authConfig: createMockSdkConfig(),- isEmbeddingSdkEnabled: false,- hostReactMajorVersion: 18,- });-- await userEvent.click(screen.getByTestId(PROBLEM_INDICATOR_TEST_ID));-- const card = screen.getByTestId(PROBLEM_CARD_TEST_ID);-- expect(- within(card).getByText(- "Embedding is not enabled for this instance. Please enable it in settings.",- ),- ).toBeInTheDocument();-- expect(- within(card).queryByText(/This application uses React 18/),- ).not.toBeInTheDocument();-- isLocalhostMock.mockRestore();- isHostAppInDevModeMock.mockRestore();- });-- it("shows the API key error over the React 18 warning on a non-localhost host app in development mode", async () => {- const isLocalhostMock = jest- .spyOn(IsLocalhostModule, "getIsLocalhost")- .mockImplementation(() => false);- const isHostAppInDevModeMock = jest- .spyOn(IsHostAppInDevModeModule, "isHostAppInDevMode")- .mockImplementation(() => true);-- setup({ authConfig: createMockApiKeyConfig(), hostReactMajorVersion: 18 });-- await userEvent.click(screen.getByTestId(PROBLEM_INDICATOR_TEST_ID));-- const card = screen.getByTestId(PROBLEM_CARD_TEST_ID);-- expect(within(card).getByText("Error")).toBeInTheDocument();- expect(- within(card).getByText(- "This embed is using API keys. This is intended for evaluation purposes and works only on localhost. To use on other sites, implement SSO.",- ),- ).toBeInTheDocument();-- expect(- within(card).queryByText(/This application uses React 18/),- ).not.toBeInTheDocument();-- isLocalhostMock.mockRestore();- isHostAppInDevModeMock.mockRestore();- });-it("hides the problem when 'hide' is clicked", async () => {setup({authConfig: createMockSdkConfig(),diff --git a/frontend/src/embedding-sdk-bundle/hooks/private/use-log-version-info/use-log-version-info.ts b/frontend/src/embedding-sdk-bundle/hooks/private/use-log-version-info/use-log-version-info.tsindex 3b5d3f2a0df..dfefba02a86 100644--- a/frontend/src/embedding-sdk-bundle/hooks/private/use-log-version-info/use-log-version-info.ts+++ b/frontend/src/embedding-sdk-bundle/hooks/private/use-log-version-info/use-log-version-info.ts@@ -1,16 +1,11 @@import { useEffect } from "react";-import { getIsLocalhost } from "embedding-sdk-bundle/lib/get-is-localhost";import {- getHostReactMajorVersion,isHostReactVersionSupported,useLogUnsupportedReactVersion,} from "embedding-sdk-bundle/lib/host-react-version";-import { printUsageProblemToConsole } from "embedding-sdk-bundle/lib/print-usage-problem";import { useMetabaseProviderPropsStore } from "embedding-sdk-bundle/lib/provider-props-store";-import { toWarning } from "embedding-sdk-bundle/lib/usage-problem";import { getBuildInfo } from "embedding-sdk-shared/lib/get-build-info";-import { isHostAppInDevMode } from "embedding-sdk-shared/lib/is-host-app-in-dev-mode";import {isInvalidMetabaseVersion,isSdkPackageCompatibleWithSdkBundle,@@ -60,15 +55,6 @@ const useLogVersionInfoOnSupportedReact = () => {);}}, [allowConsoleLog, sdkPackageVersion, sdkBundleVersion]);-- useEffect(() => {- // Development hosts already get this warning from the usage problem banner.- const isProductionHost = !getIsLocalhost() && !isHostAppInDevMode();-- if (getHostReactMajorVersion() === 18 && isProductionHost) {- printUsageProblemToConsole(toWarning("REACT_18_DEPRECATED"));- }- }, []);};export const useLogVersionInfo = isHostReactVersionSupported()diff --git a/frontend/src/embedding-sdk-bundle/hooks/private/use-log-version-info/use-log-version-info.unit.spec.tsx b/frontend/src/embedding-sdk-bundle/hooks/private/use-log-version-info/use-log-version-info.unit.spec.tsxindex 13c3daa5cf2..002e9db41b4 100644--- a/frontend/src/embedding-sdk-bundle/hooks/private/use-log-version-info/use-log-version-info.unit.spec.tsx+++ b/frontend/src/embedding-sdk-bundle/hooks/private/use-log-version-info/use-log-version-info.unit.spec.tsx@@ -3,29 +3,12 @@ import { renderHook } from "@testing-library/react";import "embedding-sdk-bundle";import { EMBEDDING_SDK_BUNDLE_UNKNOWN_VERSION } from "build-configs/embedding-sdk/constants/versions";import { useLogVersionInfo } from "embedding-sdk-bundle/hooks/private/use-log-version-info";-import { getIsLocalhost } from "embedding-sdk-bundle/lib/get-is-localhost";-import { getHostReactMajorVersion } from "embedding-sdk-bundle/lib/host-react-version";-import { USAGE_PROBLEM_MESSAGES } from "embedding-sdk-bundle/lib/usage-problem";import { getBuildInfo } from "embedding-sdk-shared/lib/get-build-info";-import { isHostAppInDevMode } from "embedding-sdk-shared/lib/is-host-app-in-dev-mode";jest.mock("embedding-sdk-shared/lib/get-build-info", () => ({getBuildInfo: jest.fn(),}));-jest.mock("embedding-sdk-bundle/lib/get-is-localhost", () => ({- getIsLocalhost: jest.fn(),-}));--jest.mock("embedding-sdk-bundle/lib/host-react-version", () => ({- ...jest.requireActual("embedding-sdk-bundle/lib/host-react-version"),- getHostReactMajorVersion: jest.fn(),-}));--jest.mock("embedding-sdk-shared/lib/is-host-app-in-dev-mode", () => ({- isHostAppInDevMode: jest.fn(),-}));-const setup = async ({sdkPackageVersion,sdkBundleVersion,@@ -101,63 +84,4 @@ describe("useLogVersionInfo", () => {).toHaveLength(0);});});-- describe("React 18 deprecation", () => {- const setupReactVersion = ({- hostReactMajorVersion,- isLocalhost = false,- isHostAppInDevelopmentMode = false,- }: {- hostReactMajorVersion: number;- isLocalhost?: boolean;- isHostAppInDevelopmentMode?: boolean;- }) => {- jest- .mocked(getHostReactMajorVersion)- .mockReturnValue(hostReactMajorVersion);- jest.mocked(getIsLocalhost).mockReturnValue(isLocalhost);- jest- .mocked(isHostAppInDevMode)- .mockReturnValue(isHostAppInDevelopmentMode);-- renderHook(() => useLogVersionInfo());- };-- const getReact18Warnings = () =>- getWarnMessages().filter((message) =>- message.includes(USAGE_PROBLEM_MESSAGES.REACT_18_DEPRECATED),- );-- it("warns on a production host when the host app runs React 18", () => {- setupReactVersion({ hostReactMajorVersion: 18 });-- const warnings = getReact18Warnings();-- expect(warnings).toHaveLength(1);- expect(warnings[0]).toContain(- "https://www.metabase.com/docs/latest/embedding/sdk/introduction#modular-embedding-sdk-prerequisites",- );- });-- it("leaves the warning to the usage problem on localhost", () => {- setupReactVersion({ hostReactMajorVersion: 18, isLocalhost: true });-- expect(getReact18Warnings()).toHaveLength(0);- });-- it("leaves the warning to the usage problem when the host app is in development mode", () => {- setupReactVersion({- hostReactMajorVersion: 18,- isHostAppInDevelopmentMode: true,- });-- expect(getReact18Warnings()).toHaveLength(0);- });-- it("does not warn when the host app runs React 19", () => {- setupReactVersion({ hostReactMajorVersion: 19 });-- expect(getReact18Warnings()).toHaveLength(0);- });- });});diff --git a/frontend/src/embedding-sdk-bundle/lib/usage-problem.ts b/frontend/src/embedding-sdk-bundle/lib/usage-problem.tsindex 82dd8d126c2..1ea6181a1da 100644--- a/frontend/src/embedding-sdk-bundle/lib/usage-problem.ts+++ b/frontend/src/embedding-sdk-bundle/lib/usage-problem.ts@@ -5,7 +5,6 @@ import type {SdkUsageProblem,SdkUsageProblemKey,} from "embedding-sdk-bundle/types/usage-problem";-import { isHostAppInDevMode } from "embedding-sdk-shared/lib/is-host-app-in-dev-mode";import {EMBEDDING_SDK_CONFIG,isEmbeddingEajs,@@ -13,7 +12,6 @@ import {import type { MetabaseEmbeddingSessionToken } from "metabase/embedding-sdk/types/refresh-token";import { getIsLocalhost } from "./get-is-localhost";-import { getHostReactMajorVersion } from "./host-react-version";interface SdkProblemOptions {authConfig: MetabaseAuthConfig;@@ -43,8 +41,6 @@ export const USAGE_PROBLEM_MESSAGES = {// eslint-disable-next-line metabase/no-literal-metabase-strings -- only shown in development.DEVELOPMENT_MODE_CLOUD_INSTANCE: `This Metabase is in development mode intended exclusively for testing. Using this Metabase for everyday BI work or when embedding in production is considered unfair usage.`,JWT_EXP_NULL: `The JWT token is missing the "exp" (expiration) claim. We will disallow tokens without "exp" in a future release. Please add "exp" to the token payload.`,- // eslint-disable-next-line metabase/no-literal-metabase-strings -- only shown to developers of the host app.- REACT_18_DEPRECATED: `This application uses React 18. The Metabase modular embedding SDK will require React 19 in a future release, and this embed will stop working once your Metabase instance is upgraded to it. Please upgrade your application to React 19.`,} as const;export const SDK_AUTH_DOCS_URL =@@ -57,10 +53,6 @@ export const SDK_INTRODUCTION_DOCS_URL =// eslint-disable-next-line metabase/no-unconditional-metabase-links-render -- these links are used in the SDK banner which is only shown to developers"https://www.metabase.com/docs/latest/embedding/sdk/introduction#enable-the-sdk-in-metabase";-const SDK_PREREQUISITES_DOCS_URL =- // eslint-disable-next-line metabase/no-unconditional-metabase-links-render -- these links are used in the SDK banner which is only shown to developers- "https://www.metabase.com/docs/latest/embedding/sdk/introduction#modular-embedding-sdk-prerequisites";-/** Documentation for each kind of SDK usage problems */export const USAGE_PROBLEM_DOC_URLS: Record<SdkUsageProblemKey, string> = {API_KEYS_WITHOUT_LICENSE: METABASE_UPGRADE_URL,@@ -69,7 +61,6 @@ export const USAGE_PROBLEM_DOC_URLS: Record<SdkUsageProblemKey, string> = {EMBEDDING_SDK_NOT_ENABLED: SDK_INTRODUCTION_DOCS_URL,DEVELOPMENT_MODE_CLOUD_INSTANCE: METABASE_UPGRADE_URL,JWT_EXP_NULL: SDK_AUTH_DOCS_URL,- REACT_18_DEPRECATED: SDK_PREREQUISITES_DOCS_URL,} as const;/**@@ -100,8 +91,6 @@ export function getSdkUsageProblem(// in case of a local app running a distant MB instanceconst isLocalhost = isLocalHost ?? getIsLocalhost();- const isDevelopmentHost = isLocalhost || isHostAppInDevMode();-if (isDevelopmentMode) {return toWarning("DEVELOPMENT_MODE_CLOUD_INSTANCE");}@@ -127,9 +116,6 @@ export function getSdkUsageProblem(isEnabled,session,isMcpApp,- isDevelopmentHost,- hostReactMajorVersion: getHostReactMajorVersion(),- isEajs: isEmbeddingEajs(),})// MCP Apps uses temporary sessions created by MCP backend..with({ isMcpApp: true }, () => null)@@ -148,12 +134,6 @@ export function getSdkUsageProblem(.with({ isApiKey: true, hasTokenFeature: true, isLocalhost: false }, () =>toError("API_KEYS_WITH_LICENSE"),)- // The iframe embed renders with the React shipped by Metabase, so the- // host app's React version is not the customer's to upgrade there.- .with(- { hostReactMajorVersion: 18, isDevelopmentHost: true, isEajs: false },- () => toWarning("REACT_18_DEPRECATED"),- )// For API keys, we allow evaluation usage without a license in localhost.// This allows them to test-drive the SDK in development.// API keys are always enabled regardless of the "enable-embedding" setting,@@ -177,7 +157,7 @@ const toError = (type: SdkUsageProblemKey): SdkUsageProblem => ({documentationUrl: USAGE_PROBLEM_DOC_URLS[type],});-export const toWarning = (type: SdkUsageProblemKey): SdkUsageProblem => ({+const toWarning = (type: SdkUsageProblemKey): SdkUsageProblem => ({type,severity: "warning",title: getTitle(),diff --git a/frontend/src/metabase-types/api/embedding-sdk.ts b/frontend/src/metabase-types/api/embedding-sdk.tsdeleted file mode 100644index 7068db7bde0..00000000000--- a/frontend/src/metabase-types/api/embedding-sdk.ts+++ /dev/null@@ -1,7 +0,0 @@-export interface SdkReact18Host {- id: number;- /** `null` when the host app page URL has no hostname. */- host: string | null;- created_at: string;- last_seen_at: string;-}diff --git a/frontend/src/metabase-types/api/index.ts b/frontend/src/metabase-types/api/index.tsindex 0103fa7c6a3..85795bcef95 100644--- a/frontend/src/metabase-types/api/index.ts+++ b/frontend/src/metabase-types/api/index.ts@@ -24,7 +24,6 @@ export * from "./dependencies";export * from "./document";export * from "./email";export * from "./embed";-export * from "./embedding-sdk";export * from "./embedding-theme";export * from "./entity-id";export * from "./erd";diff --git a/frontend/src/metabase/admin/app/components/AdminApp/AdminApp.tsx b/frontend/src/metabase/admin/app/components/AdminApp/AdminApp.tsxindex 7997217a4fe..cc07aa90462 100644--- a/frontend/src/metabase/admin/app/components/AdminApp/AdminApp.tsx+++ b/frontend/src/metabase/admin/app/components/AdminApp/AdminApp.tsx@@ -4,7 +4,6 @@ import { Outlet } from "metabase/router";import { Box, Flex } from "metabase/ui";import DeprecationNotice from "../../containers/DeprecationNotice";-import { SdkReact18Notice } from "../SdkReact18Notice";export const AdminApp = (): JSX.Element => {return (@@ -13,7 +12,6 @@ export const AdminApp = (): JSX.Element => {<Box flex="1" mih={0}><Outlet /></Box>- <SdkReact18Notice /></Flex>);};diff --git a/frontend/src/metabase/admin/app/components/SdkReact18Notice/SdkReact18Notice.module.css b/frontend/src/metabase/admin/app/components/SdkReact18Notice/SdkReact18Notice.module.cssdeleted file mode 100644index fa6e6057506..00000000000--- a/frontend/src/metabase/admin/app/components/SdkReact18Notice/SdkReact18Notice.module.css+++ /dev/null@@ -1,4 +0,0 @@-/* Same edge as popovers and toasts: the shadow does not show on a dark page */-[data-mantine-color-scheme="dark"] .notice {- border: 0.5px solid var(--mb-color-border-neutral-strong);-}diff --git a/frontend/src/metabase/admin/app/components/SdkReact18Notice/SdkReact18Notice.tsx b/frontend/src/metabase/admin/app/components/SdkReact18Notice/SdkReact18Notice.tsxdeleted file mode 100644index 31ca0ed3859..00000000000--- a/frontend/src/metabase/admin/app/components/SdkReact18Notice/SdkReact18Notice.tsx+++ /dev/null@@ -1,62 +0,0 @@-import { skipToken } from "@reduxjs/toolkit/query";-import cx from "classnames";-import { t } from "ttag";--import { useListSdkReact18HostsQuery } from "metabase/api/embedding-sdk";-import { ExternalLink } from "metabase/common/components/ExternalLink";-import CS from "metabase/css/core/index.css";-import { getUserIsAdmin, useUserAcknowledgement } from "metabase/current-user";-import {- SdkReact18WarningBody,- useSdkReact18DocsUrl,-} from "metabase/embedding/settings/SdkReact18Warning";-import { useSelector } from "metabase/redux";-import { Button, Group, Paper, Stack, Text } from "metabase/ui";--import S from "./SdkReact18Notice.module.css";--const ACKNOWLEDGEMENT_KEY = "sdk-react-18-notice";--export function SdkReact18Notice() {- const isAdmin = useSelector(getUserIsAdmin);- const [isDismissed, { ack: dismiss, isLoading: isLoadingDismissed }] =- useUserAcknowledgement(ACKNOWLEDGEMENT_KEY);- const canShow = isAdmin && !isLoadingDismissed && !isDismissed;- const { data: hosts = [] } = useListSdkReact18HostsQuery(- canShow ? undefined : skipToken,- );- const { url: docsUrl, showMetabaseLinks } = useSdkReact18DocsUrl();-- if (!canShow || hosts.length === 0) {- return null;- }-- return (- <Paper- className={cx(S.notice, CS.z2)}- pos="fixed"- left="1.5rem"- bottom="1.5rem"- w="22.5rem"- p="xl"- radius="xxs"- shadow="sm"- role="status"- >- <Stack gap="md">- <Text fw="bold" fz="lg">- {t`Update host apps to React 19`}- </Text>- <SdkReact18WarningBody hosts={hosts} />- <Group justify="flex-end" gap="md" pt="xxs">- {showMetabaseLinks && (- <Button variant="subtle" component={ExternalLink} href={docsUrl}>- {t`Learn more`}- </Button>- )}- <Button onClick={dismiss}>{t`Dismiss warning`}</Button>- </Group>- </Stack>- </Paper>- );-}diff --git a/frontend/src/metabase/admin/app/components/SdkReact18Notice/SdkReact18Notice.unit.spec.tsx b/frontend/src/metabase/admin/app/components/SdkReact18Notice/SdkReact18Notice.unit.spec.tsxdeleted file mode 100644index 97c06631041..00000000000--- a/frontend/src/metabase/admin/app/components/SdkReact18Notice/SdkReact18Notice.unit.spec.tsx+++ /dev/null@@ -1,124 +0,0 @@-import { act } from "@testing-library/react";-import userEvent from "@testing-library/user-event";-import fetchMock from "fetch-mock";--import {- setupSdkReact18HostsEndpoint,- setupUserKeyValueEndpoints,-} from "__support__/server-mocks";-import { createMockState } from "__support__/state";-import { renderWithProviders, screen } from "__support__/ui";-import type { SdkReact18Host } from "metabase-types/api";-import { createMockUser } from "metabase-types/api/mocks";--import { SdkReact18Notice } from "./SdkReact18Notice";--const HOSTS_PATH = "path:/api/embedding-sdk/react-18-hosts";-const ACKNOWLEDGEMENT_PATH =- "path:/api/user-key-value/namespace/user_acknowledgement/key/sdk-react-18-notice";--interface SetupOpts {- hosts: SdkReact18Host[];- isAdmin?: boolean;- isDismissed?: boolean;-}--function createHost(host: Partial<SdkReact18Host>): SdkReact18Host {- return {- id: 1,- host: "app.example.com",- created_at: "2026-10-01T10:00:00Z",- last_seen_at: "2026-10-13T10:00:00Z",- ...host,- };-}--function setup({ hosts, isAdmin = true, isDismissed = false }: SetupOpts) {- setupSdkReact18HostsEndpoint(hosts);- setupUserKeyValueEndpoints({- namespace: "user_acknowledgement",- key: "sdk-react-18-notice",- value: isDismissed,- });-- renderWithProviders(<SdkReact18Notice />, {- storeInitialState: createMockState({- currentUser: createMockUser({ is_superuser: isAdmin }),- }),- });-}--async function waitForRequests() {- await act(async () => {- await fetchMock.callHistory.flush(true);- // RTK Query batches subscriber updates on a timer.- await jest.runOnlyPendingTimersAsync();- });-}--describe("SdkReact18Notice", () => {- beforeEach(() => {- jest.useFakeTimers();- });-- afterEach(() => {- jest.useRealTimers();- });-- it("lists the host apps that use React 18", async () => {- setup({- hosts: [- createHost({ id: 2, host: "app.example.com" }),- createHost({ id: 1, host: null }),- ],- });-- const notice = await screen.findByRole("status");- expect(notice).toHaveTextContent("Update host apps to React 19");- expect(notice).toHaveTextContent("app.example.com");- expect(notice).toHaveTextContent("Unknown host app");- expect(- screen.getByRole("link", { name: "Learn more" }),- ).toBeInTheDocument();- });-- it("hides the notice for good when the admin dismisses it", async () => {- setup({ hosts: [createHost({})] });-- const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime });- await user.click(- await screen.findByRole("button", { name: "Dismiss warning" }),- );- await waitForRequests();-- expect(screen.queryByRole("status")).not.toBeInTheDocument();- const [request] = fetchMock.callHistory.calls(ACKNOWLEDGEMENT_PATH, {- method: "PUT",- });- expect(request?.options?.body).toBe(JSON.stringify({ value: true }));- });-- it("renders nothing when the admin already dismissed it", async () => {- setup({ hosts: [createHost({})], isDismissed: true });-- await waitForRequests();- expect(screen.queryByRole("status")).not.toBeInTheDocument();- expect(fetchMock.callHistory.called(HOSTS_PATH)).toBe(false);- });-- it("renders nothing for non-admins", async () => {- setup({ hosts: [createHost({})], isAdmin: false });-- await waitForRequests();- expect(screen.queryByRole("status")).not.toBeInTheDocument();- expect(fetchMock.callHistory.called(HOSTS_PATH)).toBe(false);- });-- it("renders nothing when no host app uses React 18", async () => {- setup({ hosts: [] });-- await waitForRequests();- expect(fetchMock.callHistory.called(HOSTS_PATH)).toBe(true);- expect(screen.queryByRole("status")).not.toBeInTheDocument();- });-});diff --git a/frontend/src/metabase/admin/app/components/SdkReact18Notice/index.ts b/frontend/src/metabase/admin/app/components/SdkReact18Notice/index.tsdeleted file mode 100644index 3713829ed25..00000000000--- a/frontend/src/metabase/admin/app/components/SdkReact18Notice/index.ts+++ /dev/null@@ -1 +0,0 @@-export { SdkReact18Notice } from "./SdkReact18Notice";diff --git a/frontend/src/metabase/api/embedding-sdk.ts b/frontend/src/metabase/api/embedding-sdk.tsdeleted file mode 100644index ba788c62a68..00000000000--- a/frontend/src/metabase/api/embedding-sdk.ts+++ /dev/null@@ -1,13 +0,0 @@-import type { SdkReact18Host } from "metabase-types/api";--import { Api } from "./api";--export const embeddingSdkApi = Api.injectEndpoints({- endpoints: (builder) => ({- listSdkReact18Hosts: builder.query<SdkReact18Host[], void>({- query: () => `/api/embedding-sdk/react-18-hosts`,- }),- }),-});--export const { useListSdkReact18HostsQuery } = embeddingSdkApi;diff --git a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubContent.tsx b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubContent.tsxindex 33a98a0b590..c690acae2b5 100644--- a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubContent.tsx+++ b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubContent.tsx@@ -7,8 +7,6 @@ import {} from "metabase/nav/components/AreaLayout";import { Box } from "metabase/ui";-import { SdkReact18Alert } from "./SdkReact18Alert";-const CONTENT_MAX_WIDTH = "50rem";type EmbeddingHubContentProps = {@@ -41,10 +39,7 @@ export function EmbeddingHubContent({</Box><AreaContent fullWidth={fullWidth}>{fullWidth ? (- <>- <SdkReact18Alert />- {children}- </>+ children) : (<Boxmaw={CONTENT_MAX_WIDTH}@@ -52,7 +47,6 @@ export function EmbeddingHubContent({w="100%"data-testid="embedding-hub-content-cap">- <SdkReact18Alert />{children}</Box>)}diff --git a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubLayout.unit.spec.tsx b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubLayout.unit.spec.tsxindex 61844397e14..ff7c3ace0a9 100644--- a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubLayout.unit.spec.tsx+++ b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubLayout.unit.spec.tsx@@ -1,6 +1,5 @@import {setupPropertiesEndpoints,- setupSdkReact18HostsEndpoint,setupSettingsEndpoints,setupUserKeyValueEndpoints,} from "__support__/server-mocks";@@ -46,7 +45,6 @@ function setup({const tokenFeatures = createMockTokenFeatures();setupSettingsEndpoints([]);- setupSdkReact18HostsEndpoint([]);setupPropertiesEndpoints(createMockSettings({ "token-features": tokenFeatures }),);diff --git a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/SdkReact18Alert.tsx b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/SdkReact18Alert.tsxdeleted file mode 100644index d9c9a04a514..00000000000--- a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/SdkReact18Alert.tsx+++ /dev/null@@ -1,34 +0,0 @@-import { t } from "ttag";--import { useListSdkReact18HostsQuery } from "metabase/api/embedding-sdk";-import { ExternalLink } from "metabase/common/components/ExternalLink";-import {- SdkReact18WarningBody,- useSdkReact18DocsUrl,-} from "metabase/embedding/settings/SdkReact18Warning";-import { Alert, Icon, Stack } from "metabase/ui";--export function SdkReact18Alert() {- const { data: hosts = [] } = useListSdkReact18HostsQuery();- const { url: docsUrl, showMetabaseLinks } = useSdkReact18DocsUrl();-- if (hosts.length === 0) {- return null;- }-- return (- <Alert- icon={<Icon name="warning" />}- color="warning"- title={t`Update host apps to React 19`}- mb="xl"- >- <Stack gap="md" align="flex-start">- <SdkReact18WarningBody hosts={hosts} />- {showMetabaseLinks && (- <ExternalLink href={docsUrl}>{t`Learn more`}</ExternalLink>- )}- </Stack>- </Alert>- );-}diff --git a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/SdkReact18Alert.unit.spec.tsx b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/SdkReact18Alert.unit.spec.tsxdeleted file mode 100644index 4ae94040cfa..00000000000--- a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/SdkReact18Alert.unit.spec.tsx+++ /dev/null@@ -1,71 +0,0 @@-import { act } from "@testing-library/react";-import fetchMock from "fetch-mock";--import { setupSdkReact18HostsEndpoint } from "__support__/server-mocks";-import { renderWithProviders, screen, within } from "__support__/ui";-import type { SdkReact18Host } from "metabase-types/api";--import { SdkReact18Alert } from "./SdkReact18Alert";--interface SetupOpts {- hosts: SdkReact18Host[];-}--function createHost(host: Partial<SdkReact18Host>): SdkReact18Host {- return {- id: 1,- host: "app.example.com",- created_at: "2026-10-01T10:00:00Z",- last_seen_at: "2026-10-13T10:00:00Z",- ...host,- };-}--function setup({ hosts }: SetupOpts) {- setupSdkReact18HostsEndpoint(hosts);- renderWithProviders(<SdkReact18Alert />);-}--async function waitForRequests() {- await act(async () => {- await fetchMock.callHistory.flush(true);- // RTK Query batches subscriber updates on a timer.- await jest.runOnlyPendingTimersAsync();- });-}--describe("SdkReact18Alert", () => {- beforeEach(() => {- jest.useFakeTimers();- });-- afterEach(() => {- jest.useRealTimers();- });-- it("warns about React 18 and lists the host apps", async () => {- setup({- hosts: [- createHost({ id: 3, host: "app.example.com" }),- createHost({ id: 2, host: "admin.example.com" }),- createHost({ id: 1, host: null }),- ],- });-- const alert = await screen.findByRole("alert");- expect(alert).toHaveTextContent("Update host apps to React 19");- expect(within(alert).getByText("app.example.com")).toBeInTheDocument();- expect(within(alert).getByText("admin.example.com")).toBeInTheDocument();- expect(within(alert).getByText("Unknown host app")).toBeInTheDocument();- expect(- within(alert).getByRole("link", { name: "Learn more" }),- ).toBeInTheDocument();- });-- it("renders nothing when no host application uses React 18", async () => {- setup({ hosts: [] });-- await waitForRequests();- expect(screen.queryByRole("alert")).not.toBeInTheDocument();- });-});diff --git a/frontend/src/metabase/embedding/settings/SdkReact18Warning/SdkReact18Warning.tsx b/frontend/src/metabase/embedding/settings/SdkReact18Warning/SdkReact18Warning.tsxdeleted file mode 100644index 43149c802b1..00000000000--- a/frontend/src/metabase/embedding/settings/SdkReact18Warning/SdkReact18Warning.tsx+++ /dev/null@@ -1,34 +0,0 @@-import { t } from "ttag";--import { useDocsUrl } from "metabase/common/hooks";-import { Group, Icon, ScrollArea, Stack, Text } from "metabase/ui";-import type { SdkReact18Host } from "metabase-types/api";--export const useSdkReact18DocsUrl = () =>- useDocsUrl("embedding/sdk/introduction", {- anchor: "modular-embedding-sdk-prerequisites",- });--interface SdkReact18WarningBodyProps {- hosts: SdkReact18Host[];-}--export function SdkReact18WarningBody({ hosts }: SdkReact18WarningBodyProps) {- return (- <>- <Text lh="1.5rem">- {t`Metabase 66 removes support for React 18. Before upgrading to Metabase 66, update these apps to React 19:`}- </Text>- <ScrollArea.Autosize mah="10rem">- <Stack gap="xs" component="ul" m={0} p={0}>- {hosts.map(({ id, host }) => (- <Group key={id} component="li" gap="sm" wrap="nowrap">- <Icon name="globe" c="text-secondary" aria-hidden />- <Text lh="1.5rem">{host ?? t`Unknown host app`}</Text>- </Group>- ))}- </Stack>- </ScrollArea.Autosize>- </>- );-}diff --git a/frontend/src/metabase/embedding/settings/SdkReact18Warning/index.ts b/frontend/src/metabase/embedding/settings/SdkReact18Warning/index.tsdeleted file mode 100644index 5d9c021e38b..00000000000--- a/frontend/src/metabase/embedding/settings/SdkReact18Warning/index.ts+++ /dev/null@@ -1,4 +0,0 @@-export {- SdkReact18WarningBody,- useSdkReact18DocsUrl,-} from "./SdkReact18Warning";diff --git a/frontend/test/__support__/server-mocks/embedding-sdk.ts b/frontend/test/__support__/server-mocks/embedding-sdk.tsdeleted file mode 100644index 85f79434d7c..00000000000--- a/frontend/test/__support__/server-mocks/embedding-sdk.ts+++ /dev/null@@ -1,7 +0,0 @@-import fetchMock from "fetch-mock";--import type { SdkReact18Host } from "metabase-types/api";--export function setupSdkReact18HostsEndpoint(hosts: SdkReact18Host[]) {- fetchMock.get("path:/api/embedding-sdk/react-18-hosts", hosts);-}diff --git a/frontend/test/__support__/server-mocks/index.ts b/frontend/test/__support__/server-mocks/index.tsindex d308eea4a91..3c4623304d5 100644--- a/frontend/test/__support__/server-mocks/index.ts+++ b/frontend/test/__support__/server-mocks/index.ts@@ -23,7 +23,6 @@ export * from "./dataset";export * from "./document";export * from "./email";export * from "./embed";-export * from "./embedding-sdk";export * from "./field";export * from "./gdrive";export * from "./geojson";