From a0853c916743a86885ff3405018013355a97d5a5 Mon Sep 17 00:00:00 2001 From: Sung-Hyun Kang Date: Tue, 14 Jan 2025 14:45:19 -0600 Subject: [PATCH] testing --- package.json | 1 + src/Common/IteratorUtilities.ts | 12 ++++------- src/Common/dataAccess/queryDocumentsPage.ts | 6 +++--- .../Tabs/QueryTab/QueryTabComponent.tsx | 20 +++++++++---------- webpack.config.js | 10 +++++++++- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 16e80c5e5..7ddbe9e28 100644 --- a/package.json +++ b/package.json @@ -228,6 +228,7 @@ "compile:fullStrict": "tsc -p ./tsconfig.json --strictNullChecks", "generateARMClients": "npx ts-node utils/armClientGenerator/generator.ts" }, + "sideEffects": false, "repository": { "type": "git", "url": "git+https://github.com/Azure/cosmos-explorer" diff --git a/src/Common/IteratorUtilities.ts b/src/Common/IteratorUtilities.ts index 6283488b8..87ce976c5 100644 --- a/src/Common/IteratorUtilities.ts +++ b/src/Common/IteratorUtilities.ts @@ -1,4 +1,4 @@ -import { QueryOperationOptions } from "@azure/cosmos"; +// import { QueryOperationOptions } from "@azure/cosmos"; import { QueryResults } from "../Contracts/ViewModels"; interface QueryResponse { @@ -11,17 +11,13 @@ interface QueryResponse { } export interface MinimalQueryIterator { - fetchNext: (queryOperationOptions?: QueryOperationOptions) => Promise; + fetchNext: () => Promise; } // Pick, "fetchNext">; -export function nextPage( - documentsIterator: MinimalQueryIterator, - firstItemIndex: number, - queryOperationOptions?: QueryOperationOptions, -): Promise { - return documentsIterator.fetchNext(queryOperationOptions).then((response) => { +export function nextPage(documentsIterator: MinimalQueryIterator, firstItemIndex: number): Promise { + return documentsIterator.fetchNext().then((response) => { const documents = response.resources; // eslint-disable-next-line @typescript-eslint/no-explicit-any const headers = (response as any).headers || {}; // TODO this is a private key. Remove any diff --git a/src/Common/dataAccess/queryDocumentsPage.ts b/src/Common/dataAccess/queryDocumentsPage.ts index 17e84ba28..1c9388898 100644 --- a/src/Common/dataAccess/queryDocumentsPage.ts +++ b/src/Common/dataAccess/queryDocumentsPage.ts @@ -1,4 +1,4 @@ -import { QueryOperationOptions } from "@azure/cosmos"; +// import { QueryOperationOptions } from "@azure/cosmos"; import { QueryResults } from "../../Contracts/ViewModels"; import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils"; import { getEntityName } from "../DocumentUtility"; @@ -9,13 +9,13 @@ export const queryDocumentsPage = async ( resourceName: string, documentsIterator: MinimalQueryIterator, firstItemIndex: number, - queryOperationOptions?: QueryOperationOptions, + // queryOperationOptions?: QueryOperationOptions, ): Promise => { const entityName = getEntityName(); const clearMessage = logConsoleProgress(`Querying ${entityName} for container ${resourceName}`); try { - const result: QueryResults = await nextPage(documentsIterator, firstItemIndex, queryOperationOptions); + const result: QueryResults = await nextPage(documentsIterator, firstItemIndex); const itemCount = (result.documents && result.documents.length) || 0; logConsoleInfo(`Successfully fetched ${itemCount} ${entityName} for container ${resourceName}`); return result; diff --git a/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx b/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx index 2347e0822..055a3c5a7 100644 --- a/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx +++ b/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable no-console */ -import { FeedOptions, QueryOperationOptions } from "@azure/cosmos"; +import { FeedOptions } from "@azure/cosmos"; import QueryError, { createMonacoErrorLocationResolver, createMonacoMarkersForQueryErrors } from "Common/QueryError"; import { SplitterDirection } from "Common/Splitter"; import { Platform, configContext } from "ConfigContext"; @@ -18,7 +18,7 @@ import { CosmosFluentProvider } from "Explorer/Theme/ThemeUtil"; import { useSelectedNode } from "Explorer/useSelectedNode"; import { KeyboardAction } from "KeyboardShortcuts"; import { QueryConstants } from "Shared/Constants"; -import { LocalStorageUtility, StorageKey, getRUThreshold, ruThresholdEnabled } from "Shared/StorageUtility"; +import { LocalStorageUtility, StorageKey } from "Shared/StorageUtility"; import { Action } from "Shared/Telemetry/TelemetryConstants"; import { Allotment } from "allotment"; import { QueryCopilotState, useQueryCopilot } from "hooks/useQueryCopilot"; @@ -368,19 +368,19 @@ class QueryTabComponentImpl extends React.Component await queryDocumentsPage( this.props.collection && this.props.collection.id(), this._iterator, firstItemIndex, - queryOperationOptions, + // queryOperationOptions, ); this.props.tabsBaseInstance.isExecuting(true); this.setState({ diff --git a/webpack.config.js b/webpack.config.js index c21baf3ef..98a817542 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -193,7 +193,12 @@ module.exports = function (_env = {}, argv = {}) { ]; if (argv.analyze) { - plugins.push(new BundleAnalyzerPlugin()); + plugins.push( + new BundleAnalyzerPlugin({ + analyzerMode: "static", + reportFilename: "bundle-report.html", + }), + ); } return { @@ -256,6 +261,9 @@ module.exports = function (_env = {}, argv = {}) { }, }), ], + splitChunks: { + chunks: "all", + }, }, watch: false, // Hack since it is hard to disable watch entirely with webpack dev server https://github.com/webpack/webpack-dev-server/issues/1251#issuecomment-654240734