Skip to content

Commit d4f539c

Browse files
fix: bundle things better so not to cause errors (#903)
* fix: worker yielding * Revert "feat: split codes even more (#889)" This reverts commit 74da322. * add * add
1 parent f6aac9b commit d4f539c

14 files changed

Lines changed: 401 additions & 176 deletions

File tree

src/frontend/package-lock.json

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

src/frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
"tailwind-merge": "^3.5.0",
9292
"tailwind-variants": "^3.2.2",
9393
"tailwindcss": "^4.2.4",
94+
"terser": "^5.46.2",
9495
"tw-animate-css": "^1.4.0",
9596
"typescript": "^6.0.3",
9697
"typescript-eslint": "^8.59.1",

src/frontend/src/lib/components/CodeViewer.svelte

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<script lang="ts">
2-
import { onDestroy } from 'svelte';
3-
4-
const { EditorView, lineNumbers, highlightActiveLine } = await import('@codemirror/view');
5-
const { EditorState, Compartment } = await import('@codemirror/state');
6-
const {
2+
import { EditorView, lineNumbers, highlightActiveLine } from '@codemirror/view';
3+
import { EditorState, Compartment } from '@codemirror/state';
4+
import {
75
LanguageDescription,
86
syntaxHighlighting,
97
HighlightStyle,
108
bracketMatching,
119
foldGutter
12-
} = await import('@codemirror/language');
13-
const { tags } = await import('@lezer/highlight');
14-
const { languages } = await import('@codemirror/language-data');
10+
} from '@codemirror/language';
11+
import { tags } from '@lezer/highlight';
12+
import { languages } from '@codemirror/language-data';
13+
import { onDestroy } from 'svelte';
1514
1615
let { text, filename } = $props<{
1716
text: string;
1817
filename: string;
1918
}>();
2019
2120
let container: HTMLDivElement;
22-
let view: any | undefined;
21+
let view: EditorView | undefined;
22+
const langCompartment = new Compartment();
2323
2424
// Material Ocean palette
2525
const bg = '#0F111A';
@@ -142,8 +142,6 @@
142142
{ tag: tags.invalid, color: red }
143143
]);
144144
145-
const langCompartment = new Compartment();
146-
147145
$effect(() => {
148146
if (!container) return;
149147
@@ -174,10 +172,6 @@
174172
});
175173
});
176174
}
177-
178-
return () => {
179-
view?.destroy();
180-
};
181175
});
182176
183177
onDestroy(() => {

0 commit comments

Comments
 (0)