Skip to content
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

fix: Remove @deephaven/app-utils from @deephaven/dashboard-core-plugins dependency list #1596

Merged
merged 3 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/app-utils/src/components/AuthBootstrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { LoadingOverlay } from '@deephaven/components';
import { useClient } from '@deephaven/jsapi-bootstrap';
import { getErrorMessage } from '@deephaven/utils';
import { PluginsContext } from './PluginsBootstrap';
import { PluginsContext } from '@deephaven/plugin';
import { getAuthPluginComponent } from '../plugins';
import LoginNotifier from './LoginNotifier';

Expand Down
7 changes: 3 additions & 4 deletions packages/app-utils/src/components/ConnectionBootstrap.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React, { createContext, useEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';
import { LoadingOverlay } from '@deephaven/components';
import { useApi, useClient } from '@deephaven/jsapi-bootstrap';
import type { IdeConnection } from '@deephaven/jsapi-types';
import { ConnectionContext } from '@deephaven/jsapi-components';
import Log from '@deephaven/log';

const log = Log.module('@deephaven/jsapi-components.ConnectionBootstrap');

export const ConnectionContext = createContext<IdeConnection | null>(null);
const log = Log.module('@deephaven/app-utils.ConnectionBootstrap');

export type ConnectionBootstrapProps = {
/**
Expand Down
12 changes: 7 additions & 5 deletions packages/app-utils/src/components/PluginsBootstrap.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { type Plugin } from '@deephaven/plugin';
import React, { createContext, useEffect, useState } from 'react';
import { PluginModuleMap, loadModulePlugins } from '../plugins';

export const PluginsContext = createContext<PluginModuleMap | null>(null);
import React, { useEffect, useState } from 'react';
import {
type Plugin,
type PluginModuleMap,
PluginsContext,
} from '@deephaven/plugin';
import { loadModulePlugins } from '../plugins';

export type PluginsBootstrapProps = {
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/app-utils/src/components/ThemeBootstrap.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ThemeProvider } from '@deephaven/components';
import { useContext, useMemo } from 'react';
import { ThemeProvider } from '@deephaven/components';
import { PluginsContext } from '@deephaven/plugin';
import { getThemeDataFromPlugins } from '../plugins';
import { PluginsContext } from './PluginsBootstrap';

export interface ThemeBootstrapProps {
children: React.ReactNode;
Expand Down
3 changes: 0 additions & 3 deletions packages/app-utils/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ export * from './FontBootstrap';
export * from './FontsLoaded';
export * from './PluginsBootstrap';
export * from './ThemeBootstrap';
export * from './usePlugins';
export * from './useConnection';
export * from './useServerConfig';
export * from './useUser';
export * from './useLoadTablePlugin';
4 changes: 1 addition & 3 deletions packages/app-utils/src/plugins/PluginUtils.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getThemeKey, ThemeData } from '@deephaven/components';
import Log from '@deephaven/log';
import {
type PluginModule,
type PluginModuleMap,
type AuthPlugin,
type AuthPluginComponent,
isAuthPlugin,
Expand All @@ -18,8 +18,6 @@ import loadRemoteModule from './loadRemoteModule';

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

export type PluginModuleMap = Map<string, PluginModule>;

export type PluginManifestPluginInfo = {
name: string;
main: string;
Expand Down
12 changes: 4 additions & 8 deletions packages/code-studio/src/main/AppInit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import { FileStorage } from '@deephaven/file-explorer';
import { useApi, useClient } from '@deephaven/jsapi-bootstrap';
import type { dh as DhType, IdeConnection } from '@deephaven/jsapi-types';
import { useConnection } from '@deephaven/jsapi-components';
import {
DecimalColumnFormatter,
getSessionDetails,
Expand All @@ -44,14 +45,9 @@ import {
Workspace,
WorkspaceStorage,
ServerConfigValues,
DeephavenPluginModuleMap,
} from '@deephaven/redux';
import {
useConnection,
usePlugins,
useServerConfig,
useUser,
} from '@deephaven/app-utils';
import { useServerConfig, useUser } from '@deephaven/app-utils';
import { type PluginModuleMap, usePlugins } from '@deephaven/plugin';
import { setLayoutStorage as setLayoutStorageAction } from '../redux/actions';
import App from './App';
import LocalWorkspaceStorage from '../storage/LocalWorkspaceStorage';
Expand All @@ -76,7 +72,7 @@ interface AppInitProps {
setLayoutStorage: (layoutStorage: LayoutStorage) => void;
setDashboardConnection: (id: string, connection: IdeConnection) => void;
setDashboardSessionWrapper: (id: string, wrapper: SessionWrapper) => void;
setPlugins: (map: DeephavenPluginModuleMap) => void;
setPlugins: (map: PluginModuleMap) => void;
setUser: (user: User) => void;
setWorkspace: (workspace: Workspace) => void;
setWorkspaceStorage: (workspaceStorage: WorkspaceStorage) => void;
Expand Down
6 changes: 3 additions & 3 deletions packages/code-studio/src/main/AppMainContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ import {
RootState,
User,
ServerConfigValues,
DeephavenPluginModuleMap,
} from '@deephaven/redux';
import { bindAllMethods, PromiseUtils } from '@deephaven/utils';
import GoldenLayout from '@deephaven/golden-layout';
Expand All @@ -86,6 +85,7 @@ import {
isDashboardPlugin,
type LegacyDashboardPlugin,
isLegacyDashboardPlugin,
type PluginModuleMap,
} from '@deephaven/plugin';
import JSZip from 'jszip';
import SettingsMenu from '../settings/SettingsMenu';
Expand Down Expand Up @@ -131,7 +131,7 @@ interface AppMainContainerProps {
updateWorkspaceData: (workspaceData: Partial<WorkspaceData>) => void;
user: User;
workspace: Workspace;
plugins: DeephavenPluginModuleMap;
plugins: PluginModuleMap;
serverConfigValues: ServerConfigValues;
}

Expand Down Expand Up @@ -689,7 +689,7 @@ export class AppMainContainer extends Component<
});
}

getDashboardPlugins = memoize((plugins: DeephavenPluginModuleMap) => {
getDashboardPlugins = memoize((plugins: PluginModuleMap) => {
const dashboardPlugins = [...plugins.entries()].filter(
([, plugin]) =>
isDashboardPlugin(plugin) || isLegacyDashboardPlugin(plugin)
Expand Down
2 changes: 1 addition & 1 deletion packages/dashboard-core-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
},
"dependencies": {
"@deephaven/app-utils": "file:../app-utils",
"@deephaven/chart": "file:../chart",
"@deephaven/components": "file:../components",
"@deephaven/console": "file:../console",
Expand All @@ -34,6 +33,7 @@
"@deephaven/icons": "file:../icons",
"@deephaven/iris-grid": "file:../iris-grid",
"@deephaven/jsapi-bootstrap": "file:../jsapi-bootstrap",
"@deephaven/jsapi-components": "file:../jsapi-components",
"@deephaven/jsapi-types": "file:../jsapi-types",
"@deephaven/jsapi-utils": "file:../jsapi-utils",
"@deephaven/log": "file:../log",
Expand Down
2 changes: 1 addition & 1 deletion packages/dashboard-core-plugins/src/ChartPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useDashboardPanel,
} from '@deephaven/dashboard';
import { useApi } from '@deephaven/jsapi-bootstrap';
import { useConnection } from '@deephaven/app-utils';
import { useConnection } from '@deephaven/jsapi-components';
import { ChartModel, ChartModelFactory } from '@deephaven/chart';
import type { dh as DhType, IdeConnection } from '@deephaven/jsapi-types';
import { IrisGridUtils } from '@deephaven/iris-grid';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { render, screen, act } from '@testing-library/react';
import {
PluginType,
PluginsContext,
type WidgetPlugin,
type WidgetComponentProps,
} from '@deephaven/plugin';
Expand All @@ -11,7 +12,7 @@ import { createMockStore } from '@deephaven/redux';
import { dh } from '@deephaven/jsapi-shim';
import { ApiContext } from '@deephaven/jsapi-bootstrap';
import { type IdeConnection } from '@deephaven/jsapi-types';
import { ConnectionContext, PluginsContext } from '@deephaven/app-utils';
import { ConnectionContext } from '@deephaven/jsapi-components';
import {
type LayoutManager,
EventEmitter,
Expand Down
7 changes: 5 additions & 2 deletions packages/dashboard-core-plugins/src/WidgetLoaderPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ import {
PanelProps,
canHaveRef,
} from '@deephaven/dashboard';
import { usePlugins } from '@deephaven/app-utils';
import { isWidgetPlugin, type WidgetPlugin } from '@deephaven/plugin';
import {
isWidgetPlugin,
usePlugins,
type WidgetPlugin,
} from '@deephaven/plugin';
import Log from '@deephaven/log';
import { WidgetPanel } from './panels';

Expand Down
3 changes: 2 additions & 1 deletion packages/dashboard-core-plugins/src/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { createMockStore } from '@deephaven/redux';
import { dh } from '@deephaven/jsapi-shim';
import { ApiContext } from '@deephaven/jsapi-bootstrap';
import { type IdeConnection } from '@deephaven/jsapi-types';
import { ConnectionContext, PluginsContext } from '@deephaven/app-utils';
import { ConnectionContext } from '@deephaven/jsapi-components';
import { PluginsContext } from '@deephaven/plugin';
import {
ChartPlugin,
ConsolePlugin,
Expand Down
1 change: 1 addition & 0 deletions packages/dashboard-core-plugins/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export { default as ControlType } from './controls/ControlType';
export { default as LinkerUtils } from './linker/LinkerUtils';
export type { Link } from './linker/LinkerUtils';
export { default as ToolType } from './linker/ToolType';
export * from './useLoadTablePlugin';

export * from './events';
export * from './panels';
Expand Down
9 changes: 6 additions & 3 deletions packages/dashboard-core-plugins/src/panels/ConsolePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ import type { IdeSession, VariableDefinition } from '@deephaven/jsapi-types';
import { SessionWrapper } from '@deephaven/jsapi-utils';
import Log from '@deephaven/log';
import {
DeephavenPluginModuleMap,
getCommandHistoryStorage,
getPlugins,
getTimeZone,
RootState,
} from '@deephaven/redux';
import { assertNotNull } from '@deephaven/utils';
import { getIconForPlugin, pluginSupportsType } from '@deephaven/plugin';
import {
getIconForPlugin,
pluginSupportsType,
type PluginModuleMap,
} from '@deephaven/plugin';
import type { JSZipObject } from 'jszip';
import { ConsoleEvent } from '../events';
import Panel from './Panel';
Expand Down Expand Up @@ -59,7 +62,7 @@ interface ConsolePanelProps extends DashboardPanelProps {

timeZone: string;
unzip?: (file: File) => Promise<JSZipObject[]>;
plugins: DeephavenPluginModuleMap;
plugins: PluginModuleMap;
}

interface ConsolePanelState {
Expand Down
3 changes: 2 additions & 1 deletion packages/dashboard-core-plugins/src/useHydrateGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
PanelHydrateFunction,
} from '@deephaven/dashboard';
import { useApi } from '@deephaven/jsapi-bootstrap';
import { useConnection, useLoadTablePlugin } from '@deephaven/app-utils';
import { useConnection } from '@deephaven/jsapi-components';
import { Table } from '@deephaven/jsapi-types';
import { IrisGridModelFactory } from '@deephaven/iris-grid';
import {
Expand All @@ -13,6 +13,7 @@ import {
isIrisGridPanelMetadata,
isLegacyIrisGridPanelMetadata,
} from './panels';
import { useLoadTablePlugin } from './useLoadTablePlugin';

export function useHydrateGrid<
P extends DehydratedDashboardPanelProps = DehydratedDashboardPanelProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {
type TablePluginComponent,
isTablePlugin,
isLegacyTablePlugin,
usePlugins,
} from '@deephaven/plugin';
import Log from '@deephaven/log';
import usePlugins from './usePlugins';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/dashboard-core-plugins/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx"],
"exclude": ["node_modules", "src/**/*.test.*", "src/**/__mocks__/*"],
"references": [
{ "path": "../app-utils" },
{ "path": "../chart" },
{ "path": "../components" },
{ "path": "../console" },
Expand All @@ -18,6 +17,7 @@
{ "path": "../grid" },
{ "path": "../iris-grid" },
{ "path": "../jsapi-bootstrap" },
{ "path": "../jsapi-components" },
{ "path": "../jsapi-shim" },
{ "path": "../jsapi-types" },
{ "path": "../log" },
Expand Down
1 change: 1 addition & 0 deletions packages/embed-chart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@deephaven/chart": "file:../chart",
"@deephaven/components": "file:../components",
"@deephaven/jsapi-bootstrap": "file:../jsapi-bootstrap",
"@deephaven/jsapi-components": "file:../jsapi-components",
"@deephaven/jsapi-types": "file:../jsapi-types",
"@deephaven/jsapi-utils": "file:../jsapi-utils",
"@deephaven/log": "file:../log",
Expand Down
Loading