Skip to content

Commit 7b59763

Browse files
authored
fix: Remove @deephaven/app-utils from @deephaven/dashboard-core-plugins dependency list (#1596)
Fixes #1593 I don't think these breaking changes should affect enterprise since it doesn't use `@deephaven/app-utils` BREAKING CHANGE: - `usePlugins` and `PluginsContext` were moved from `@deephaven/app-utils` to `@deephaven/plugin`. - `useLoadTablePlugin` was moved from `@deephaven/app-utils` to `@deephaven/dashboard-core-plugins`. - `useConnection` and `ConnectionContext` were moved from `@deephaven/app-utils` to `@deephaven/jsapi-components`. - `DeephavenPluginModuleMap` was removed from `@deephaven/redux`. Use `PluginModuleMap` from `@deephaven/plugin` instead.
1 parent 491e467 commit 7b59763

36 files changed

Lines changed: 91 additions & 60 deletions

package-lock.json

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/app-utils/src/components/AuthBootstrap.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import { LoadingOverlay } from '@deephaven/components';
99
import { useClient } from '@deephaven/jsapi-bootstrap';
1010
import { getErrorMessage } from '@deephaven/utils';
11-
import { PluginsContext } from './PluginsBootstrap';
11+
import { PluginsContext } from '@deephaven/plugin';
1212
import { getAuthPluginComponent } from '../plugins';
1313
import LoginNotifier from './LoginNotifier';
1414

packages/app-utils/src/components/ConnectionBootstrap.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import React, { createContext, useEffect, useState } from 'react';
1+
import React, { useEffect, useState } from 'react';
22
import { LoadingOverlay } from '@deephaven/components';
33
import { useApi, useClient } from '@deephaven/jsapi-bootstrap';
44
import type { IdeConnection } from '@deephaven/jsapi-types';
5+
import { ConnectionContext } from '@deephaven/jsapi-components';
56
import Log from '@deephaven/log';
67

7-
const log = Log.module('@deephaven/jsapi-components.ConnectionBootstrap');
8-
9-
export const ConnectionContext = createContext<IdeConnection | null>(null);
8+
const log = Log.module('@deephaven/app-utils.ConnectionBootstrap');
109

1110
export type ConnectionBootstrapProps = {
1211
/**

packages/app-utils/src/components/PluginsBootstrap.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import { type Plugin } from '@deephaven/plugin';
2-
import React, { createContext, useEffect, useState } from 'react';
3-
import { PluginModuleMap, loadModulePlugins } from '../plugins';
4-
5-
export const PluginsContext = createContext<PluginModuleMap | null>(null);
1+
import React, { useEffect, useState } from 'react';
2+
import {
3+
type Plugin,
4+
type PluginModuleMap,
5+
PluginsContext,
6+
} from '@deephaven/plugin';
7+
import { loadModulePlugins } from '../plugins';
68

79
export type PluginsBootstrapProps = {
810
/**

packages/app-utils/src/components/ThemeBootstrap.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { ThemeProvider } from '@deephaven/components';
21
import { useContext, useMemo } from 'react';
2+
import { ThemeProvider } from '@deephaven/components';
3+
import { PluginsContext } from '@deephaven/plugin';
34
import { getThemeDataFromPlugins } from '../plugins';
4-
import { PluginsContext } from './PluginsBootstrap';
55

66
export interface ThemeBootstrapProps {
77
children: React.ReactNode;

packages/app-utils/src/components/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@ export * from './FontBootstrap';
55
export * from './FontsLoaded';
66
export * from './PluginsBootstrap';
77
export * from './ThemeBootstrap';
8-
export * from './usePlugins';
9-
export * from './useConnection';
108
export * from './useServerConfig';
119
export * from './useUser';
12-
export * from './useLoadTablePlugin';

packages/app-utils/src/plugins/PluginUtils.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getThemeKey, ThemeData } from '@deephaven/components';
22
import Log from '@deephaven/log';
33
import {
4-
type PluginModule,
4+
type PluginModuleMap,
55
type AuthPlugin,
66
type AuthPluginComponent,
77
isAuthPlugin,
@@ -18,8 +18,6 @@ import loadRemoteModule from './loadRemoteModule';
1818

1919
const log = Log.module('@deephaven/app-utils.PluginUtils');
2020

21-
export type PluginModuleMap = Map<string, PluginModule>;
22-
2321
export type PluginManifestPluginInfo = {
2422
name: string;
2523
main: string;

packages/code-studio/src/main/AppInit.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
import { FileStorage } from '@deephaven/file-explorer';
1919
import { useApi, useClient } from '@deephaven/jsapi-bootstrap';
2020
import type { dh as DhType, IdeConnection } from '@deephaven/jsapi-types';
21+
import { useConnection } from '@deephaven/jsapi-components';
2122
import {
2223
DecimalColumnFormatter,
2324
getSessionDetails,
@@ -44,14 +45,9 @@ import {
4445
Workspace,
4546
WorkspaceStorage,
4647
ServerConfigValues,
47-
DeephavenPluginModuleMap,
4848
} from '@deephaven/redux';
49-
import {
50-
useConnection,
51-
usePlugins,
52-
useServerConfig,
53-
useUser,
54-
} from '@deephaven/app-utils';
49+
import { useServerConfig, useUser } from '@deephaven/app-utils';
50+
import { type PluginModuleMap, usePlugins } from '@deephaven/plugin';
5551
import { setLayoutStorage as setLayoutStorageAction } from '../redux/actions';
5652
import App from './App';
5753
import LocalWorkspaceStorage from '../storage/LocalWorkspaceStorage';
@@ -76,7 +72,7 @@ interface AppInitProps {
7672
setLayoutStorage: (layoutStorage: LayoutStorage) => void;
7773
setDashboardConnection: (id: string, connection: IdeConnection) => void;
7874
setDashboardSessionWrapper: (id: string, wrapper: SessionWrapper) => void;
79-
setPlugins: (map: DeephavenPluginModuleMap) => void;
75+
setPlugins: (map: PluginModuleMap) => void;
8076
setUser: (user: User) => void;
8177
setWorkspace: (workspace: Workspace) => void;
8278
setWorkspaceStorage: (workspaceStorage: WorkspaceStorage) => void;

packages/code-studio/src/main/AppMainContainer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ import {
7676
RootState,
7777
User,
7878
ServerConfigValues,
79-
DeephavenPluginModuleMap,
8079
} from '@deephaven/redux';
8180
import { bindAllMethods, PromiseUtils } from '@deephaven/utils';
8281
import GoldenLayout from '@deephaven/golden-layout';
@@ -86,6 +85,7 @@ import {
8685
isDashboardPlugin,
8786
type LegacyDashboardPlugin,
8887
isLegacyDashboardPlugin,
88+
type PluginModuleMap,
8989
} from '@deephaven/plugin';
9090
import JSZip from 'jszip';
9191
import SettingsMenu from '../settings/SettingsMenu';
@@ -131,7 +131,7 @@ interface AppMainContainerProps {
131131
updateWorkspaceData: (workspaceData: Partial<WorkspaceData>) => void;
132132
user: User;
133133
workspace: Workspace;
134-
plugins: DeephavenPluginModuleMap;
134+
plugins: PluginModuleMap;
135135
serverConfigValues: ServerConfigValues;
136136
}
137137

@@ -689,7 +689,7 @@ export class AppMainContainer extends Component<
689689
});
690690
}
691691

692-
getDashboardPlugins = memoize((plugins: DeephavenPluginModuleMap) => {
692+
getDashboardPlugins = memoize((plugins: PluginModuleMap) => {
693693
const dashboardPlugins = [...plugins.entries()].filter(
694694
([, plugin]) =>
695695
isDashboardPlugin(plugin) || isLegacyDashboardPlugin(plugin)

packages/dashboard-core-plugins/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
2323
},
2424
"dependencies": {
25-
"@deephaven/app-utils": "file:../app-utils",
2625
"@deephaven/chart": "file:../chart",
2726
"@deephaven/components": "file:../components",
2827
"@deephaven/console": "file:../console",
@@ -34,6 +33,7 @@
3433
"@deephaven/icons": "file:../icons",
3534
"@deephaven/iris-grid": "file:../iris-grid",
3635
"@deephaven/jsapi-bootstrap": "file:../jsapi-bootstrap",
36+
"@deephaven/jsapi-components": "file:../jsapi-components",
3737
"@deephaven/jsapi-types": "file:../jsapi-types",
3838
"@deephaven/jsapi-utils": "file:../jsapi-utils",
3939
"@deephaven/log": "file:../log",

0 commit comments

Comments
 (0)