Code editor: CodeMirror 6 replaces Monaco
Node source (Python) and the JSON dialog share one CodeMirror editor with find and replace, autocomplete, folding, indent guides, comment toggle and a JSON lint, themed from the CSS tokens so light and dark follow the .dark class without a second palette. Programmatic value changes no longer fire onChange, blur ignores focus moving into the find bar, readOnly keeps selection and copy. The editor chunk is 470 kB (157 kB gzipped) against 2.7 MB (704 kB) for Monaco, which also pulled in a 1.2 MB JSON mode, two workers and a font. At 4x CPU on slow 4G a node panel is ready in 5.7 s instead of 10.8 s, the JSON dialog in 1.5 s instead of 6.7 s. Typing without a key delay keeps every character. monaco-editor, @monaco-editor/react and the dompurify override are removed. Specs: typed code reaches the node source, a JSON setting saves only text that parses. Docs name Tab and Ctrl-M.
This commit is contained in:
@@ -88,7 +88,9 @@ Define `process(...)` in **Code**. If the file instead contains exactly one
|
||||
public function, Fluksio uses that function.
|
||||
|
||||
Code saves as you type. ⌘S / Ctrl-S in the code editor saves immediately;
|
||||
**Publish** applies ordinary node code to the running flow. Generated code
|
||||
**Publish** applies ordinary node code to the running flow. Tab indents in the
|
||||
editor; Ctrl-M (⇧⌥M on macOS) lets Tab move focus on to the next control
|
||||
instead. Generated code
|
||||
from `fluksio sync` is read-only: edit its source repository and sync again.
|
||||
|
||||
Only superusers can add or edit code-running nodes. Other users can read code
|
||||
@@ -148,6 +150,7 @@ Use ⌘ on macOS and Ctrl elsewhere.
|
||||
|---|---|
|
||||
| ⌘P / Ctrl-P | command palette |
|
||||
| ⌘S / Ctrl-S | publish the flow; inside the code editor, save code |
|
||||
| Ctrl-M / ⇧⌥M | inside the code editor, make Tab move focus instead of indenting |
|
||||
| ⌘Z / Ctrl-Z | undo a graph edit |
|
||||
| ⌘⇧Z / Ctrl-Shift-Z | redo a graph edit |
|
||||
| ⌘C / Ctrl-C | copy selected nodes |
|
||||
|
||||
Reference in New Issue
Block a user