Commit ce7a88f
authored
Speed up monaco-graphql bundle assertion test (#4298)
## Summary
- Replaces the `examples/monaco-graphql-react-vite` build target with a
minimal fixture under
`packages/monaco-graphql/__fixtures__/bundle-test/` that imports only
`monaco-graphql`'s public API and wires graphql + json workers. No
React, no example-app baggage, no TypeScript language support.
- Replaces the previous `execa`-driven `yarn workspace ... build`
shell-out with Vite's programmatic `build()` API. Drops `write: false`,
`minify: false`, `target: 'esnext'`, `reportCompressedSize: false`, and
`treeshake: false` since the assertion only cares about the chunk file
list, not the bundle contents or size.
- Adds an explicit negative regex assertion against
`/typescript|tsMode|tsWorker|ts\.worker|cssMode|css\.worker|htmlMode|html\.worker/i`,
so the test's intent ("don't bundle unwanted Monaco language modules")
is readable from the assertion, not just the snapshot.
- Removes the now-unused `execa` devDependency.
- Local test runtime drops from ~8.5s to ~2.3s. CI runtime is ~32s,
dominated by Rollup traversing monaco-editor's module graph; the new
minimal-fixture surface and dropped transforms don't change that floor.
Vitest timeout set to 60s (~28s headroom).
## Test plan
- [x] Run `yarn workspace monaco-graphql test` and confirm both tests
pass in under 5s locally.
- [x] Confirm the snapshot lists only editor core, graphql, and json
chunks (no TypeScript, CSS, or HTML language service modules).
- [x] Sanity-check the negative assertion by manually adding a
TypeScript worker import to the fixture, rerunning the test, and
confirming it fails with the explicit message before reverting.1 parent 76a5169 commit ce7a88f
6 files changed
Lines changed: 86 additions & 34 deletions
File tree
- packages/monaco-graphql
- __fixtures__/bundle-test
- __tests__
- resources
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
21 | 53 | | |
22 | 54 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
39 | 67 | | |
40 | 68 | | |
41 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17112 | 17112 | | |
17113 | 17113 | | |
17114 | 17114 | | |
17115 | | - | |
17116 | 17115 | | |
17117 | 17116 | | |
17118 | 17117 | | |
| |||
0 commit comments