Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat(dep): remove long and protobufjs (#16816)

p0ny5141d70c880e
diff --git a/frontend/package.json b/frontend/package.json
index efa9e58350..8e47ff1fd5 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -129,12 +129,10 @@
"events": "^3.3.0",
"jquery": "3.7.1",
"jsdom": "25.0.1",
- "long": "^5.3.2",
"micromark": "^4.0.2",
"micromark-util-sanitize-uri": "^2.0.1",
"postcss": "8.5.4",
"prettier": "3.5.3",
- "protobufjs": "^7.5.3",
"remark-gfm": "^4.0.1",
"remark-parse": "^11.0.0",
"rollup": "4.41.1",
diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml
index 17977cb1f3..340342dc8f 100644
--- a/frontend/pnpm-lock.yaml
+++ b/frontend/pnpm-lock.yaml
@@ -344,9 +344,6 @@ importers:
jsdom:
specifier: 25.0.1
version: 25.0.1
- long:
- specifier: ^5.3.2
- version: 5.3.2
micromark:
specifier: ^4.0.2
version: 4.0.2
@@ -359,9 +356,6 @@ importers:
prettier:
specifier: 3.5.3
version: 3.5.3
- protobufjs:
- specifier: ^7.5.3
- version: 7.5.3
remark-gfm:
specifier: ^4.0.1
version: 4.0.1
@@ -2109,36 +2103,6 @@ packages:
'@popperjs/[email protected]':
resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==}
- '@protobufjs/[email protected]':
- resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==}
-
- '@protobufjs/[email protected]':
- resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==}
-
- '@protobufjs/[email protected]':
- resolution: {integrity: sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==}
-
- '@protobufjs/[email protected]':
- resolution: {integrity: sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==}
-
- '@protobufjs/[email protected]':
- resolution: {integrity: sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==}
-
- '@protobufjs/[email protected]':
- resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==}
-
- '@protobufjs/[email protected]':
- resolution: {integrity: sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==}
-
- '@protobufjs/[email protected]':
- resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==}
-
- '@protobufjs/[email protected]':
- resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==}
-
- '@protobufjs/[email protected]':
- resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==}
-
'@rolldown/[email protected]':
resolution: {integrity: sha512-FeISF1RUTod5Kvt3yUXByrAPk5EfDWo/1BPv1ARBZ07weqx888SziPuWS6HUJU0YroGyQURjdIrkjWJP2zBFDQ==}
@@ -3954,9 +3918,6 @@ packages:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
- resolution: {integrity: sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==}
-
resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==}
@@ -4482,10 +4443,6 @@ packages:
resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==}
- resolution: {integrity: sha512-sildjKwVqOI2kmFDiXQ6aEB0fjYTafpEvIBs8tOR8qI4spuL9OPROLVu2qZqi/xgCfsHIwVqlaF8JBjWFHnKbw==}
- engines: {node: '>=12.0.0'}
-
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
@@ -8084,29 +8041,6 @@ snapshots:
'@popperjs/[email protected]': {}
- '@protobufjs/[email protected]': {}
-
- '@protobufjs/[email protected]': {}
-
- '@protobufjs/[email protected]': {}
-
- '@protobufjs/[email protected]': {}
-
- '@protobufjs/[email protected]':
- dependencies:
- '@protobufjs/aspromise': 1.1.2
- '@protobufjs/inquire': 1.1.0
-
- '@protobufjs/[email protected]': {}
-
- '@protobufjs/[email protected]': {}
-
- '@protobufjs/[email protected]': {}
-
- '@protobufjs/[email protected]': {}
-
- '@protobufjs/[email protected]': {}
-
'@rolldown/[email protected]': {}
@@ -10058,8 +9992,6 @@ snapshots:
-
@@ -10801,21 +10733,6 @@ snapshots:
- dependencies:
- '@protobufjs/aspromise': 1.1.2
- '@protobufjs/base64': 1.1.2
- '@protobufjs/codegen': 2.0.4
- '@protobufjs/eventemitter': 1.1.0
- '@protobufjs/fetch': 1.1.0
- '@protobufjs/float': 1.0.2
- '@protobufjs/inquire': 1.1.0
- '@protobufjs/path': 1.1.2
- '@protobufjs/pool': 1.1.0
- '@protobufjs/utf8': 1.1.0
- '@types/node': 22.15.29
- long: 5.3.2
-
diff --git a/frontend/src/components/Changelist/ChangelistDetail/RawSQLPanel/RawSQLPanel.vue b/frontend/src/components/Changelist/ChangelistDetail/RawSQLPanel/RawSQLPanel.vue
index db88eccd16..4497f7e06f 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/RawSQLPanel/RawSQLPanel.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/RawSQLPanel/RawSQLPanel.vue
@@ -62,7 +62,6 @@
<script setup lang="ts">
import { create as createProto } from "@bufbuild/protobuf";
import { computedAsync } from "@vueuse/core";
-import Long from "long";
import { NButton } from "naive-ui";
import { zindexable as vZindexable } from "vdirs";
import { computed, ref, watch } from "vue";
@@ -107,8 +106,8 @@ const show = computed(() => {
const isSheetOversize = computed(() => {
if (!sheet.value) return false;
- return getStatementSize(getSheetStatement(sheet.value)).lt(
- Long.fromBigInt(sheet.value.contentSize)
+ return (
+ getStatementSize(getSheetStatement(sheet.value)) < sheet.value.contentSize
);
});
diff --git a/frontend/src/components/Changelog/ChangelogDetail.vue b/frontend/src/components/Changelog/ChangelogDetail.vue
index d5d0690153..ced9cff73d 100644
--- a/frontend/src/components/Changelog/ChangelogDetail.vue
+++ b/frontend/src/components/Changelog/ChangelogDetail.vue
@@ -130,7 +130,6 @@
</template>
<script lang="ts" setup>
-import Long from "long";
import { NSwitch, NTag } from "naive-ui";
import { computed, reactive, watch, unref } from "vue";
import { BBSpin } from "@/bbkit";
@@ -204,9 +203,7 @@ const changelogStatement = computed(() => {
}
let statement = changelog.value.statement;
if (
- getStatementSize(changelog.value.statement).lt(
- Long.fromBigInt(changelog.value.statementSize)
- )
+ getStatementSize(changelog.value.statement) < changelog.value.statementSize
) {
statement = `${statement}${statement.endsWith("\n") ? "" : "\n"}...`;
}
diff --git a/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
index 6951f8078d..073e644b1f 100644
--- a/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
+++ b/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
@@ -177,7 +177,6 @@
import { create } from "@bufbuild/protobuf";
import { useElementSize } from "@vueuse/core";
import { cloneDeep, head, isEmpty } from "lodash-es";
-import Long from "long";
import { ExpandIcon } from "lucide-vue-next";
import { NButton, NTooltip, useDialog } from "naive-ui";
import { computed, reactive, ref, toRef, watch } from "vue";
@@ -322,8 +321,8 @@ const isSheetOversize = computed(() => {
if (state.isEditing) return false;
if (!sheetReady.value) return false;
if (!sheet.value) return false;
- return getStatementSize(getSheetStatement(sheet.value)).lt(
- Long.fromBigInt(sheet.value.contentSize)
+ return (
+ getStatementSize(getSheetStatement(sheet.value)) < sheet.value.contentSize
);
});
diff --git a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
index 9ecf259f29..11f00ac767 100644
--- a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
+++ b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
@@ -167,7 +167,6 @@
<script setup lang="ts">
import { create } from "@bufbuild/protobuf";
import { cloneDeep, includes, isEmpty } from "lodash-es";
-import Long from "long";
import { ExpandIcon } from "lucide-vue-next";
import { NButton, NTooltip, useDialog } from "naive-ui";
import { v1 as uuidv1 } from "uuid";
@@ -277,8 +276,8 @@ const isSheetOversize = computed(() => {
if (state.isEditing) return false;
if (!sheetReady.value) return false;
if (!sheet.value) return false;
- return getStatementSize(getSheetStatement(sheet.value)).lt(
- Long.fromBigInt(sheet.value.contentSize)
+ return (
+ getStatementSize(getSheetStatement(sheet.value)) < sheet.value.contentSize
);
});
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 3c154c53d2..07f07190ce 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -1,5 +1,3 @@
-import Long from "long";
-import protobufjs from "protobufjs";
import "regenerator-runtime/runtime";
import { createApp } from "vue";
import App from "./App.vue";
@@ -21,9 +19,6 @@ import {
} from "./store";
import { humanizeDate, humanizeTs, isDev, isRelease } from "./utils";
-protobufjs.util.Long = Long;
-protobufjs.configure();
-
console.debug("dev:", isDev());
console.debug("release:", isRelease());
diff --git a/frontend/src/store/modules/v1/worksheet.ts b/frontend/src/store/modules/v1/worksheet.ts
index daba93c31c..0da9937deb 100644
--- a/frontend/src/store/modules/v1/worksheet.ts
+++ b/frontend/src/store/modules/v1/worksheet.ts
@@ -1,7 +1,6 @@
import { create } from "@bufbuild/protobuf";
import { createContextValues } from "@connectrpc/connect";
import { uniqBy } from "lodash-es";
-import Long from "long";
import { defineStore } from "pinia";
import { computed } from "vue";
import { worksheetServiceClientConnect } from "@/grpcweb";
@@ -315,9 +314,7 @@ export const useWorkSheetAndTabStore = defineStore("worksheet_and_tab", () => {
// Incomplete sheets should be read-only. e.g. 100MB sheet from issue task.、
const statement = getSheetStatement(worksheet);
- if (
- getStatementSize(statement).ne(Long.fromBigInt(worksheet.contentSize))
- ) {
+ if (getStatementSize(statement) !== worksheet.contentSize) {
return true;
}
diff --git a/frontend/src/types/v1/schemaEditor/atomType.ts b/frontend/src/types/v1/schemaEditor/atomType.ts
index 75155c58b2..1104639bec 100644
--- a/frontend/src/types/v1/schemaEditor/atomType.ts
+++ b/frontend/src/types/v1/schemaEditor/atomType.ts
@@ -1,5 +1,3 @@
-import type Long from "long";
-
type Status = "normal" | "created" | "dropped";
export interface ColumnDefaultValue {
@@ -38,8 +36,8 @@ export interface Table {
name: string;
engine: string;
collation: string;
- rowCount: Long;
- dataSize: Long;
+ rowCount: bigint;
+ dataSize: bigint;
comment: string;
userComment: string;
columnList: Column[];
diff --git a/frontend/src/utils/sheet.ts b/frontend/src/utils/sheet.ts
index afde204dd6..7e220cab2b 100644
--- a/frontend/src/utils/sheet.ts
+++ b/frontend/src/utils/sheet.ts
@@ -1,10 +1,8 @@
-import Long from "long";
-
// Default maximum size of a statement in bytes (100MB).
export const MAX_UPLOAD_FILE_SIZE_MB = 100;
-export const getStatementSize = (statement: string): Long => {
- return Long.fromNumber(new TextEncoder().encode(statement).length);
+export const getStatementSize = (statement: string): bigint => {
+ return BigInt(new TextEncoder().encode(statement).length);
};
export const readFileAsArrayBuffer = (
diff --git a/frontend/src/utils/v1/sql.ts b/frontend/src/utils/v1/sql.ts
index e5c2164ba9..3d3f12b747 100644
--- a/frontend/src/utils/v1/sql.ts
+++ b/frontend/src/utils/v1/sql.ts
@@ -1,6 +1,5 @@
import { toJson } from "@bufbuild/protobuf";
import dayjs from "dayjs";
-import Long from "long";
import { getDateForPbTimestampProtoEs } from "@/types";
import { Engine } from "@/types/proto-es/v1/common_pb";
import type {
@@ -270,11 +269,11 @@ export const compareQueryRowValues = (
if (isNullOrUndefined(valueA)) return 1;
if (isNullOrUndefined(valueB)) return -1;
- // Check if the values are Longs and compare them.
+ // Check if the values are bigints and compare them.
const rawA = extractSQLRowValueRaw(a);
const rawB = extractSQLRowValueRaw(b);
- if (Long.isLong(rawA) && Long.isLong(rawB)) {
- return rawA.compare(rawB);
+ if (typeof rawA === "bigint" && typeof rawB === "bigint") {
+ return rawA < rawB ? -1 : rawA > rawB ? 1 : 0;
}
if (typeof valueA === "number" && typeof valueB === "number") {
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index cf2e9ae313..e71073364f 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -67,10 +67,6 @@ export default defineConfig({
if (id.includes("sql-formatter") || id.includes("antlr4")) {
return "sql-tools";
}
- // Protobuf - separate chunk
- if (id.includes("protobufjs")) {
- return "protobuf";
- }
// UI framework
if (id.includes("naive-ui")) {
return "ui-framework";