Skip to content

Commit f2b15ea

Browse files
authored
fix(editor): Polyfill Array.prototype.toSorted (no-chanhelog) (#13463)
1 parent d277e0b commit f2b15ea

File tree

4 files changed

+46
-14
lines changed

4 files changed

+46
-14
lines changed

packages/editor-ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"@vue-flow/node-resizer": "^1.4.0",
4747
"@vueuse/components": "^10.11.0",
4848
"@vueuse/core": "catalog:frontend",
49+
"array.prototype.tosorted": "1.1.4",
4950
"axios": "catalog:",
5051
"bowser": "2.11.0",
5152
"change-case": "^5.4.4",

packages/editor-ui/src/App.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<script setup lang="ts">
2+
import '@/polyfills';
3+
24
import { ref, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue';
35
import { useRoute } from 'vue-router';
4-
import { v4 as uuid } from 'uuid';
56
import LoadingView from '@/views/LoadingView.vue';
67
import BannerStack from '@/components/banners/BannerStack.vue';
78
import AskAssistantChat from '@/components/AskAssistant/AskAssistantChat.vue';
@@ -18,11 +19,6 @@ import { useSettingsStore } from '@/stores/settings.store';
1819
import { useHistoryHelper } from '@/composables/useHistoryHelper';
1920
import { useStyles } from './composables/useStyles';
2021
21-
// Polyfill crypto.randomUUID
22-
if (!('randomUUID' in crypto)) {
23-
Object.defineProperty(crypto, 'randomUUID', { value: uuid });
24-
}
25-
2622
const route = useRoute();
2723
const rootStore = useRootStore();
2824
const assistantStore = useAssistantStore();

packages/editor-ui/src/polyfills.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import 'array.prototype.tosorted';
2+
import { v4 as uuid } from 'uuid';
3+
4+
// Polyfill crypto.randomUUID
5+
if (!('randomUUID' in crypto)) {
6+
Object.defineProperty(crypto, 'randomUUID', { value: uuid });
7+
}

pnpm-lock.yaml

Lines changed: 36 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)