Skip to content

Commit 7a3b525

Browse files
committed
Removed polyfills (DH-19067)
1 parent 0bb3301 commit 7a3b525

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

packages/jsapi-nodejs/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ import path from 'node:path';
1717

1818
import { loadDhModules } from '@deephaven/jsapi-nodejs';
1919

20+
// Polyfills needed if consuming DH as `ESM` module
21+
globalThis.self = globalThis;
22+
globalThis.window = globalThis;
23+
2024
const tmpDir = path.join(__dirname, 'tmp');
2125

2226
// Download jsapi from a Deephaven server

packages/jsapi-nodejs/src/loaderUtils.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,6 @@ export async function loadDhModules({
100100
LoadModuleOptions,
101101
'serverUrl' | 'storageDir' | 'targetModuleType'
102102
>): Promise<typeof DhType> {
103-
if (targetModuleType === 'esm') {
104-
// These will not be needed if we ever update the JSAPI to not rely on
105-
// `window` and `self`.
106-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
107-
// @ts-ignore
108-
globalThis.self = globalThis;
109-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
110-
// @ts-ignore
111-
globalThis.window = globalThis;
112-
}
113-
114103
const coreModule = await loadModules<
115104
typeof DhType & { default?: typeof DhType }
116105
>({

0 commit comments

Comments
 (0)