Commit 3a6a346
committed
improvement(perf): eight verified cuts to workspace cold-load JavaScript
Second round of load-time work, adversarially verified for strict behaviour
preservation before implementation. Each item is an import-graph fix — none
changes what renders, when it renders, or any data path:
- knowledge/[id] imported one modal through the [documentId] components
barrel, which also exports the chunk editor and therefore js-tiktoken
(~2.5 MB gzip of BPE tables) on a route that never edits chunks. Deep
import.
- prepareBlockState moved out of stores/workflows/utils.ts into its own
module. It is the only function there needing the block registry and the
generated tool-outputs artifact (~476 KB gzip), and utils.ts is reached by
the persistent shell — so every workspace route paid for a canvas-only
helper, including a module-scope JSON.parse of a 5.4 MB string.
- ExecutionSnapshot (the frozen-canvas modal) is now React.lazy behind its
interaction gates, per the code-splitting procedure in sim-imports.md:
deep import, dead barrel re-export deleted, sibling imports in log-details
deepened to break the parent->child barrel cycle, local Suspense at both
render sites. Takes ~7.6 MB of source off logs hydration.
- The api contracts barrel no longer re-exports ./tools, ./selectors, ./v1,
or ./demo-requests (~58 KB gzip of Zod schema construction on every
route). Zero importers used the barrel path for any of them.
- createCsvParser (streaming csv-parse, a Node Transform) moved to a
server-only module so its stream polyfill leaves client bundles.
Deliberately not re-exported from the lib/table barrel.
- jszip is dynamically imported at both remaining static call sites (skill
zip extraction, pptx parsing) — both already-async, user-triggered paths,
mirroring the existing pattern in workflow import-export.
- The desktop local-filesystem tool executor is dynamically imported in
use-chat; a chunk-load failure now reports an error completion so the
server-side tool call settles instead of hanging.
Production build, JS downloaded before the load event, vs the previous
release:
/home 4.44 -> 3.87 MB /logs 4.44 -> 3.64 MB
/knowledge 4.22 -> 3.68 MB /tables 4.17 -> 3.61 MB
/files 4.68 -> 4.10 MB /w/[id] 4.80 -> 4.67 MB
/home total after idle prefetch: 8.15 -> 5.52 MB
The lazy snapshot was exercised end-to-end: its chunk loads when a log
detail opens (off the route's cold path, warm before the View Snapshot
click) and the modal renders without errors. Boundary baseline retightened.1 parent b654bc1 commit 3a6a346
19 files changed
Lines changed: 481 additions & 372 deletions
File tree
- apps/sim
- app/workspace/[workspaceId]
- home/hooks
- knowledge/[id]
- logs
- components
- log-details
- components/execution-snapshot
- skills/components
- w/[workflowId]
- lib
- api/contracts
- pptx-renderer/parser
- table
- orchestration
- stores/workflows
- scripts
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
| |||
2009 | 2008 | | |
2010 | 2009 | | |
2011 | 2010 | | |
2012 | | - | |
| 2011 | + | |
2013 | 2012 | | |
2014 | 2013 | | |
2015 | 2014 | | |
2016 | | - | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
2017 | 2041 | | |
2018 | 2042 | | |
2019 | 2043 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 38 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
4 | 14 | | |
5 | 15 | | |
6 | 16 | | |
| |||
48 | 58 | | |
49 | 59 | | |
50 | 60 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
| |||
73 | 85 | | |
74 | 86 | | |
75 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
76 | 99 | | |
77 | 100 | | |
78 | 101 | | |
| |||
679 | 702 | | |
680 | 703 | | |
681 | 704 | | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
689 | 714 | | |
690 | 715 | | |
691 | 716 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| |||
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
109 | 125 | | |
110 | 126 | | |
111 | 127 | | |
| |||
1259 | 1275 | | |
1260 | 1276 | | |
1261 | 1277 | | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
1269 | 1287 | | |
1270 | 1288 | | |
1271 | 1289 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
94 | 99 | | |
95 | 100 | | |
96 | 101 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | | - | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
1 | 9 | | |
2 | 10 | | |
3 | 11 | | |
| |||
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
10 | | - | |
11 | 18 | | |
12 | 19 | | |
13 | 20 | | |
| |||
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
26 | | - | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
31 | | - | |
32 | 37 | | |
33 | 38 | | |
34 | | - | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
0 commit comments