From 26692b8c8184d748e2b3e70a13397ffb04a19a36 Mon Sep 17 00:00:00 2001 From: mikebender Date: Fri, 18 Aug 2023 18:14:02 -0400 Subject: [PATCH 01/13] Externalize iris-grid and chart - Needed for chart plugins to work --- package-lock.json | 4 ++++ packages/app-utils/package.json | 2 ++ packages/app-utils/src/plugins/remote-component.config.ts | 4 ++++ packages/app-utils/tsconfig.json | 2 ++ 4 files changed, 12 insertions(+) diff --git a/package-lock.json b/package-lock.json index 5ffb5eae69..1556dcc3e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27923,7 +27923,9 @@ "license": "Apache-2.0", "dependencies": { "@deephaven/auth-plugins": "file:../auth-plugins", + "@deephaven/chart": "file:../chart", "@deephaven/components": "file:../components", + "@deephaven/iris-grid": "file:../iris-grid", "@deephaven/jsapi-bootstrap": "file:../jsapi-bootstrap", "@deephaven/jsapi-components": "file:../jsapi-components", "@deephaven/jsapi-types": "file:../jsapi-types", @@ -30030,7 +30032,9 @@ "version": "file:packages/app-utils", "requires": { "@deephaven/auth-plugins": "file:../auth-plugins", + "@deephaven/chart": "file:../chart", "@deephaven/components": "file:../components", + "@deephaven/iris-grid": "file:../iris-grid", "@deephaven/jsapi-bootstrap": "file:../jsapi-bootstrap", "@deephaven/jsapi-components": "file:../jsapi-components", "@deephaven/jsapi-types": "file:../jsapi-types", diff --git a/packages/app-utils/package.json b/packages/app-utils/package.json index 90234bcd2d..c82a992fe4 100644 --- a/packages/app-utils/package.json +++ b/packages/app-utils/package.json @@ -29,7 +29,9 @@ }, "dependencies": { "@deephaven/auth-plugins": "file:../auth-plugins", + "@deephaven/chart": "file:../chart", "@deephaven/components": "file:../components", + "@deephaven/iris-grid": "file:../iris-grid", "@deephaven/jsapi-bootstrap": "file:../jsapi-bootstrap", "@deephaven/jsapi-components": "file:../jsapi-components", "@deephaven/jsapi-types": "file:../jsapi-types", diff --git a/packages/app-utils/src/plugins/remote-component.config.ts b/packages/app-utils/src/plugins/remote-component.config.ts index 26b79e289c..02063b1cec 100644 --- a/packages/app-utils/src/plugins/remote-component.config.ts +++ b/packages/app-utils/src/plugins/remote-component.config.ts @@ -9,7 +9,9 @@ import * as redux from 'redux'; import * as reactRedux from 'react-redux'; import ReactDOM from 'react-dom'; import * as DeephavenAuthPlugins from '@deephaven/auth-plugins'; +import * as DeephavenChart from '@deephaven/chart'; import * as DeephavenComponents from '@deephaven/components'; +import * as DeephavenIrisGrid from '@deephaven/iris-grid'; import * as DeephavenJsapiBootstrap from '@deephaven/jsapi-bootstrap'; import * as DeephavenJsapiComponents from '@deephaven/jsapi-components'; import * as DeephavenJsapiUtils from '@deephaven/jsapi-utils'; @@ -23,7 +25,9 @@ export const resolve = { redux, 'react-redux': reactRedux, '@deephaven/auth-plugins': DeephavenAuthPlugins, + '@deephaven/chart': DeephavenChart, '@deephaven/components': DeephavenComponents, + '@deephaven/iris-grid': DeephavenIrisGrid, '@deephaven/jsapi-bootstrap': DeephavenJsapiBootstrap, '@deephaven/jsapi-components': DeephavenJsapiComponents, '@deephaven/jsapi-utils': DeephavenJsapiUtils, diff --git a/packages/app-utils/tsconfig.json b/packages/app-utils/tsconfig.json index f18e274171..f5e6f5ea9b 100644 --- a/packages/app-utils/tsconfig.json +++ b/packages/app-utils/tsconfig.json @@ -8,7 +8,9 @@ "exclude": ["node_modules", "src/**/*.test.*", "src/**/__mocks__/*"], "references": [ { "path": "../auth-plugins" }, + { "path": "../chart" }, { "path": "../components" }, + { "path": "../iris-grid" }, { "path": "../jsapi-bootstrap" }, { "path": "../jsapi-components" }, { "path": "../jsapi-types" }, From 28aae260b38320d3b0e76eb81c7e57660a365e4a Mon Sep 17 00:00:00 2001 From: mikebender Date: Tue, 22 Aug 2023 15:00:18 -0400 Subject: [PATCH 02/13] Add ChartType stuff --- packages/chart/src/Chart.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/chart/src/Chart.tsx b/packages/chart/src/Chart.tsx index c05a48ccaf..727b5f9ce8 100644 --- a/packages/chart/src/Chart.tsx +++ b/packages/chart/src/Chart.tsx @@ -176,6 +176,8 @@ export class Chart extends Component { const { isActive, settings } = this.props; this.updateFormatterSettings(settings as FormatterSettings); + // TODO: Need to handle the model itself updating... + if (isActive !== prevProps.isActive) { if (isActive) { this.subscribe(); From f0b231c3b53af1ff092d4ca655038033dca6ddc3 Mon Sep 17 00:00:00 2001 From: mikebender Date: Tue, 29 Aug 2023 13:08:30 -0400 Subject: [PATCH 03/13] Add Chart handling of model update --- packages/chart/src/Chart.tsx | 26 ++++++++++++++------------ packages/jsapi-types/src/dh.types.ts | 12 ++++++++++++ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/packages/chart/src/Chart.tsx b/packages/chart/src/Chart.tsx index 727b5f9ce8..67220688d0 100644 --- a/packages/chart/src/Chart.tsx +++ b/packages/chart/src/Chart.tsx @@ -166,29 +166,33 @@ export class Chart extends Component { this.initData(); this.initFormatter(); - const { isActive } = this.props; + const { isActive, model } = this.props; if (isActive) { - this.subscribe(); + this.subscribe(model); } } componentDidUpdate(prevProps: ChartProps): void { - const { isActive, settings } = this.props; + const { isActive, model, settings } = this.props; this.updateFormatterSettings(settings as FormatterSettings); - // TODO: Need to handle the model itself updating... + if (model !== prevProps.model) { + this.unsubscribe(prevProps.model); + this.subscribe(model); + } if (isActive !== prevProps.isActive) { if (isActive) { - this.subscribe(); + this.subscribe(model); } else { - this.unsubscribe(); + this.unsubscribe(model); } } } componentWillUnmount(): void { - this.unsubscribe(); + const { model } = this.props; + this.unsubscribe(model); } currentSeries: number; @@ -317,12 +321,11 @@ export class Chart extends Component { }); } - subscribe(): void { + subscribe(model: ChartModel): void { if (this.isSubscribed) { return; } - const { model } = this.props; if (!this.rect || this.rect.width === 0 || this.rect.height === 0) { log.debug2('Delaying subscription until model dimensions are set'); return; @@ -331,12 +334,11 @@ export class Chart extends Component { this.isSubscribed = true; } - unsubscribe(): void { + unsubscribe(model: ChartModel): void { if (!this.isSubscribed) { return; } - const { model } = this.props; model.unsubscribe(this.handleModelEvent); this.isSubscribed = false; } @@ -512,7 +514,7 @@ export class Chart extends Component { model.setDimensions(rect); // We may need to resubscribe if dimensions were too small before if (isActive) { - this.subscribe(); + this.subscribe(model); } } } diff --git a/packages/jsapi-types/src/dh.types.ts b/packages/jsapi-types/src/dh.types.ts index 365af150b7..b943172234 100644 --- a/packages/jsapi-types/src/dh.types.ts +++ b/packages/jsapi-types/src/dh.types.ts @@ -35,6 +35,7 @@ export interface dh { FileContents: FileContentsStatic; }; ValueType: typeof ValueType; + Widget: Widget; } const VariableType = { @@ -335,6 +336,17 @@ export interface Figure extends Evented { close(): void; } +export interface Widget { + readonly EVENT_MESSAGE: string; + + addEventListener: ( + type: string, + listener: (event: unknown) => void + ) => () => void; + getDataAsBase64(): string; + sendMessage: (message: string, args: unknown[]) => void; +} + export interface FigureDataUpdatedEvent { /** * The series instances which were affected by this event and need to be updated. From 313e9494e0266856589ff1c56c8c99306aa0d7a9 Mon Sep 17 00:00:00 2001 From: mikebender Date: Tue, 19 Sep 2023 21:25:39 -0400 Subject: [PATCH 04/13] Add some more externalized packages --- package-lock.json | 4 ++++ packages/app-utils/package.json | 2 ++ packages/app-utils/src/plugins/remote-component.config.ts | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/package-lock.json b/package-lock.json index 1556dcc3e2..87c11c8315 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27922,9 +27922,11 @@ "version": "0.50.0", "license": "Apache-2.0", "dependencies": { + "@adobe/react-spectrum": "^3.29.0", "@deephaven/auth-plugins": "file:../auth-plugins", "@deephaven/chart": "file:../chart", "@deephaven/components": "file:../components", + "@deephaven/icons": "file:../icons", "@deephaven/iris-grid": "file:../iris-grid", "@deephaven/jsapi-bootstrap": "file:../jsapi-bootstrap", "@deephaven/jsapi-components": "file:../jsapi-components", @@ -30031,9 +30033,11 @@ "@deephaven/app-utils": { "version": "file:packages/app-utils", "requires": { + "@adobe/react-spectrum": "^3.29.0", "@deephaven/auth-plugins": "file:../auth-plugins", "@deephaven/chart": "file:../chart", "@deephaven/components": "file:../components", + "@deephaven/icons": "file:../icons", "@deephaven/iris-grid": "file:../iris-grid", "@deephaven/jsapi-bootstrap": "file:../jsapi-bootstrap", "@deephaven/jsapi-components": "file:../jsapi-components", diff --git a/packages/app-utils/package.json b/packages/app-utils/package.json index c82a992fe4..9968aabfda 100644 --- a/packages/app-utils/package.json +++ b/packages/app-utils/package.json @@ -28,9 +28,11 @@ "redux": "^4.x" }, "dependencies": { + "@adobe/react-spectrum": "^3.29.0", "@deephaven/auth-plugins": "file:../auth-plugins", "@deephaven/chart": "file:../chart", "@deephaven/components": "file:../components", + "@deephaven/icons": "file:../icons", "@deephaven/iris-grid": "file:../iris-grid", "@deephaven/jsapi-bootstrap": "file:../jsapi-bootstrap", "@deephaven/jsapi-components": "file:../jsapi-components", diff --git a/packages/app-utils/src/plugins/remote-component.config.ts b/packages/app-utils/src/plugins/remote-component.config.ts index 02063b1cec..dbf2d23fcc 100644 --- a/packages/app-utils/src/plugins/remote-component.config.ts +++ b/packages/app-utils/src/plugins/remote-component.config.ts @@ -8,9 +8,11 @@ import react from 'react'; import * as redux from 'redux'; import * as reactRedux from 'react-redux'; import ReactDOM from 'react-dom'; +import * as AdobeReactSpectrum from '@adobe/react-spectrum'; import * as DeephavenAuthPlugins from '@deephaven/auth-plugins'; import * as DeephavenChart from '@deephaven/chart'; import * as DeephavenComponents from '@deephaven/components'; +import * as DeephavenIcons from '@deephaven/icons'; import * as DeephavenIrisGrid from '@deephaven/iris-grid'; import * as DeephavenJsapiBootstrap from '@deephaven/jsapi-bootstrap'; import * as DeephavenJsapiComponents from '@deephaven/jsapi-components'; @@ -24,9 +26,11 @@ export const resolve = { 'react-dom': ReactDOM, redux, 'react-redux': reactRedux, + '@adobe/react-spectrum': AdobeReactSpectrum, '@deephaven/auth-plugins': DeephavenAuthPlugins, '@deephaven/chart': DeephavenChart, '@deephaven/components': DeephavenComponents, + '@deephaven/icons': DeephavenIcons, '@deephaven/iris-grid': DeephavenIrisGrid, '@deephaven/jsapi-bootstrap': DeephavenJsapiBootstrap, '@deephaven/jsapi-components': DeephavenJsapiComponents, From cdf74fce6b98633f6f36d0b0d63a744dd251757d Mon Sep 17 00:00:00 2001 From: mikebender Date: Wed, 20 Sep 2023 16:18:40 -0400 Subject: [PATCH 05/13] Add SpectrumProvider - Now styles Spectrum components more or less correctly --- package-lock.json | 2 ++ packages/code-studio/package.json | 1 + packages/code-studio/src/AppRoot.tsx | 11 ++++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 87c11c8315..9392a357d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28079,6 +28079,7 @@ "version": "0.50.0", "license": "Apache-2.0", "dependencies": { + "@adobe/react-spectrum": "^3.29.0", "@deephaven/app-utils": "file:../app-utils", "@deephaven/auth-plugins": "file:../auth-plugins", "@deephaven/chart": "file:../chart", @@ -30111,6 +30112,7 @@ "@deephaven/code-studio": { "version": "file:packages/code-studio", "requires": { + "@adobe/react-spectrum": "^3.29.0", "@deephaven/app-utils": "file:../app-utils", "@deephaven/auth-plugins": "file:../auth-plugins", "@deephaven/chart": "file:../chart", diff --git a/packages/code-studio/package.json b/packages/code-studio/package.json index 013408a7a7..d7d555812f 100644 --- a/packages/code-studio/package.json +++ b/packages/code-studio/package.json @@ -11,6 +11,7 @@ "directory": "packages/code-studio" }, "dependencies": { + "@adobe/react-spectrum": "^3.29.0", "@deephaven/app-utils": "file:../app-utils", "@deephaven/auth-plugins": "file:../auth-plugins", "@deephaven/chart": "file:../chart", diff --git a/packages/code-studio/src/AppRoot.tsx b/packages/code-studio/src/AppRoot.tsx index acc1fe505c..acc959cdc6 100644 --- a/packages/code-studio/src/AppRoot.tsx +++ b/packages/code-studio/src/AppRoot.tsx @@ -1,5 +1,7 @@ import React from 'react'; import { Provider } from 'react-redux'; +import { Provider as SpectrumProvider } from '@adobe/react-spectrum'; +import { themeDHDefault } from '@deephaven/components'; import { MonacoUtils } from '@deephaven/console'; import { store } from '@deephaven/redux'; import { DownloadServiceWorkerUtils } from '@deephaven/iris-grid'; @@ -22,7 +24,14 @@ export function AppRoot(): JSX.Element { return ( - + {/* TODO: Remove this SpectrumProvider. Brian will be implementing it with his changes. */} + + + ); } From 7c7ed470c00bca93b4e0a4d803d9d72ac57e6e71 Mon Sep 17 00:00:00 2001 From: mikebender Date: Mon, 25 Sep 2023 14:13:46 -0400 Subject: [PATCH 06/13] Hopefully this will get me past alpha build failing - Instead of building apps in parallel build at the same time - Currently getting an OoM error when building in GitHub publish alpha action --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e41456ff5..87d3fc9e39 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "clean": "run-s clean:*", "types": "tsc --build", "watch:types": "tsc --build --watch --preserveWatchOutput", - "build": "run-s build:necessary types build:packages build:apps", + "build": "run-s build:necessary types build:packages build:app build:embed-grid build:embed-chart", "build:apps": "lerna run --scope=@deephaven/{code-studio,embed-chart,embed-grid} build", "build:app": "lerna run --scope=@deephaven/code-studio build", "build:embed-chart": "lerna run --scope=@deephaven/embed-chart build", From 6410ffe9d194c7dba5b2dbe4cc74f46e6aa896e9 Mon Sep 17 00:00:00 2001 From: mikebender Date: Mon, 25 Sep 2023 15:05:55 -0400 Subject: [PATCH 07/13] Add max-old-space-size flag to embed-chart - It was only in code-studio and embed-grid for some reason --- package.json | 2 +- packages/embed-chart/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 87d3fc9e39..4e41456ff5 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "clean": "run-s clean:*", "types": "tsc --build", "watch:types": "tsc --build --watch --preserveWatchOutput", - "build": "run-s build:necessary types build:packages build:app build:embed-grid build:embed-chart", + "build": "run-s build:necessary types build:packages build:apps", "build:apps": "lerna run --scope=@deephaven/{code-studio,embed-chart,embed-grid} build", "build:app": "lerna run --scope=@deephaven/code-studio build", "build:embed-chart": "lerna run --scope=@deephaven/embed-chart build", diff --git a/packages/embed-chart/package.json b/packages/embed-chart/package.json index 74c20cc991..d63eeb80ae 100644 --- a/packages/embed-chart/package.json +++ b/packages/embed-chart/package.json @@ -30,7 +30,7 @@ "scripts": { "analyze": "source-map-explorer build/assets/*.js --no-border-checks", "start": "vite", - "build": "vite build", + "build": "NODE_OPTIONS='--max-old-space-size=4096' vite build", "preview": "vite preview" }, "devDependencies": { From e11ae37307357dff8876c43a209341151d7d8da9 Mon Sep 17 00:00:00 2001 From: mikebender Date: Tue, 3 Oct 2023 14:49:51 -0400 Subject: [PATCH 08/13] Externalize Log --- packages/app-utils/src/plugins/remote-component.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app-utils/src/plugins/remote-component.config.ts b/packages/app-utils/src/plugins/remote-component.config.ts index dbf2d23fcc..21dfe9f21f 100644 --- a/packages/app-utils/src/plugins/remote-component.config.ts +++ b/packages/app-utils/src/plugins/remote-component.config.ts @@ -17,7 +17,7 @@ import * as DeephavenIrisGrid from '@deephaven/iris-grid'; import * as DeephavenJsapiBootstrap from '@deephaven/jsapi-bootstrap'; import * as DeephavenJsapiComponents from '@deephaven/jsapi-components'; import * as DeephavenJsapiUtils from '@deephaven/jsapi-utils'; -import * as DeephavenLog from '@deephaven/log'; +import DeephavenLog from '@deephaven/log'; import * as DeephavenReactHooks from '@deephaven/react-hooks'; // eslint-disable-next-line import/prefer-default-export From e038f84d0438b44753bbe26a62f327724481fd94 Mon Sep 17 00:00:00 2001 From: mikebender Date: Tue, 3 Oct 2023 14:50:06 -0400 Subject: [PATCH 09/13] Fix up the dark theme --- packages/golden-layout/scss/goldenlayout-dark-theme.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/golden-layout/scss/goldenlayout-dark-theme.scss b/packages/golden-layout/scss/goldenlayout-dark-theme.scss index 8bf2c972a7..021f9ad592 100644 --- a/packages/golden-layout/scss/goldenlayout-dark-theme.scss +++ b/packages/golden-layout/scss/goldenlayout-dark-theme.scss @@ -70,7 +70,6 @@ body:not(.lm_dragging) .lm_header .lm_tab .lm_close_tab:hover { // Single Pane content (area in which final dragged content is contained) .lm_content { background: $content-bg; - overflow: visible; } // Single Pane content during Drag (style of moving window following mouse) From b45f0f8abe992f151f24e4206e150a1d3d0c14ec Mon Sep 17 00:00:00 2001 From: mikebender Date: Tue, 10 Oct 2023 16:41:50 -0400 Subject: [PATCH 10/13] Remove the SpectrumProvider - Brian will be implementing this with his changes --- packages/code-studio/src/AppRoot.tsx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/code-studio/src/AppRoot.tsx b/packages/code-studio/src/AppRoot.tsx index acc959cdc6..acc1fe505c 100644 --- a/packages/code-studio/src/AppRoot.tsx +++ b/packages/code-studio/src/AppRoot.tsx @@ -1,7 +1,5 @@ import React from 'react'; import { Provider } from 'react-redux'; -import { Provider as SpectrumProvider } from '@adobe/react-spectrum'; -import { themeDHDefault } from '@deephaven/components'; import { MonacoUtils } from '@deephaven/console'; import { store } from '@deephaven/redux'; import { DownloadServiceWorkerUtils } from '@deephaven/iris-grid'; @@ -24,14 +22,7 @@ export function AppRoot(): JSX.Element { return ( - {/* TODO: Remove this SpectrumProvider. Brian will be implementing it with his changes. */} - - - + ); } From f3b882c6326bd5bb5c78b2256188bb885f4f6033 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Mon, 16 Oct 2023 09:40:46 -0400 Subject: [PATCH 11/13] Update packages/jsapi-types/src/dh.types.ts Co-authored-by: Matthew Runyon --- packages/jsapi-types/src/dh.types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jsapi-types/src/dh.types.ts b/packages/jsapi-types/src/dh.types.ts index b943172234..9b889f865f 100644 --- a/packages/jsapi-types/src/dh.types.ts +++ b/packages/jsapi-types/src/dh.types.ts @@ -344,7 +344,7 @@ export interface Widget { listener: (event: unknown) => void ) => () => void; getDataAsBase64(): string; - sendMessage: (message: string, args: unknown[]) => void; + sendMessage: (message: string, references?: never[]) => void; } export interface FigureDataUpdatedEvent { From e7573e3fb021d16c4e1acf83af72d17eae7f5162 Mon Sep 17 00:00:00 2001 From: mikebender Date: Mon, 16 Oct 2023 10:58:02 -0400 Subject: [PATCH 12/13] Revert golden layout theme changes --- packages/golden-layout/scss/goldenlayout-dark-theme.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/golden-layout/scss/goldenlayout-dark-theme.scss b/packages/golden-layout/scss/goldenlayout-dark-theme.scss index 021f9ad592..8bf2c972a7 100644 --- a/packages/golden-layout/scss/goldenlayout-dark-theme.scss +++ b/packages/golden-layout/scss/goldenlayout-dark-theme.scss @@ -70,6 +70,7 @@ body:not(.lm_dragging) .lm_header .lm_tab .lm_close_tab:hover { // Single Pane content (area in which final dragged content is contained) .lm_content { background: $content-bg; + overflow: visible; } // Single Pane content during Drag (style of moving window following mouse) From 092a83164599e29da9494927b6842248172da721 Mon Sep 17 00:00:00 2001 From: mikebender Date: Mon, 16 Oct 2023 11:21:37 -0400 Subject: [PATCH 13/13] Clean up some types specified in dh.types.ts - Will also have a follow up ticket to use the automatically generated types --- packages/jsapi-types/src/dh.types.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/jsapi-types/src/dh.types.ts b/packages/jsapi-types/src/dh.types.ts index 9b889f865f..d8cd8bf65a 100644 --- a/packages/jsapi-types/src/dh.types.ts +++ b/packages/jsapi-types/src/dh.types.ts @@ -336,6 +336,12 @@ export interface Figure extends Evented { close(): void; } +export type WidgetExportedObject = { + type: string; + fetch: () => Promise; + close: () => void; +}; + export interface Widget { readonly EVENT_MESSAGE: string; @@ -344,7 +350,10 @@ export interface Widget { listener: (event: unknown) => void ) => () => void; getDataAsBase64(): string; + getDataAsString(): string; + getDataAsU8(): Uint8Array; sendMessage: (message: string, references?: never[]) => void; + exportedObjects: WidgetExportedObject[]; } export interface FigureDataUpdatedEvent {