Repository navigation
Commit 3bae054
committed
feat(editor): replace Monaco with Pierre's editor in the file viewer and the Code tab
One CodeEditor on @pierre/diffs (already shipped for diffs) replaces Monaco in both
places: the editable file viewer and the read-only workflow Code tab.
- Lighter and faster: opening a .ts file loads ~460 KB instead of ~1.25 MB plus up to
9 MB of language workers; first paint is 4x faster, the heap a third to a half of
Monaco's up to 30k lines, and highlighting never blocks the main thread.
- Highlighting runs on Pierre's WebAssembly highlighter, so the CSP allows
'wasm-unsafe-eval' (WebAssembly compilation only); Shiki is the fallback.
- Read-only is a guard in front of a live editor, so search, selection and copy
keep working; Tab leaves the editor, every edit is refused.
- External updates (streaming, refresh, reload) keep the scroll position and never
join the undo history; a growing document follows its end.
- Chrome uses the app's tokens: a --surface-hover caret line, ::selection and find
colors, a quiet bracket match, and one syntax palette for Shiki and Zed themes.
- Removes the Monaco wrapper, its themes and workers, the Code tab's language
registration and minimal-edit helper, and the Monaco-only PostHog filter.1 parent 64a3953 commit 3bae054
21 files changed
Lines changed: 680 additions & 833 deletions
File tree
- apps/sim
- app
- _shell
- workspace/[workspaceId]
- files/components/file-viewer
- w/[workflowId]/components/panel/components/code
- components
- code-editor
- diff
- lib
- core/security
- posthog
- scripts
- types
- packages/emcn/src/components/code
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | | - | |
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
| |||
103 | 101 | | |
104 | 102 | | |
105 | 103 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | 104 | | |
112 | 105 | | |
113 | 106 | | |
| |||
This file was deleted.
0 commit comments