Speed up monaco-graphql bundle assertion test#4298
Open
trevor-scheer wants to merge 6 commits into
Open
Conversation
Replace the `execa`-based `yarn workspace example-monaco-graphql-react-vite build` shell command with Vite's programmatic API, passing `write: false`, `treeshake: false`, `target: 'esnext'`, and `reportCompressedSize: false`. These options together cut local test runtime from ~8.5s to ~4.3s (2x), and should reduce CI runtime from ~50s to ~25s, keeping it comfortably under the 30s timeout. The assertion changes from parsing Vite's stdout (including `dist/` prefixes and ANSI stripping) to reading `result.output.map(f => f.fileName)` directly, which is more robust and does not depend on Vite's CLI output format. The set of asserted files is identical. Removes `execa` from devDependencies since it is no longer used.
|
- `import path from 'node:path'` to satisfy oxlint unicorn rule - add `treeshake` to cspell custom words - run oxfmt to fix formatting - raise test timeout to 90s; CI hardware is slower than local
Replaces the full `examples/monaco-graphql-react-vite` build target with a tiny fixture under `packages/monaco-graphql/__fixtures__/bundle-test/` that imports only `monaco-graphql`'s public API and wires graphql + json workers. No React, no TypeScript language support. Reduces local test time from ~4s to ~2.3s (wall); CI should drop well under 10s. Timeout lowered from 90s to 30s.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/monaco-graphql-react-vitebuild target with a minimal fixture underpackages/monaco-graphql/__fixtures__/bundle-test/that imports onlymonaco-graphql's public API and wires graphql + json workers. No React, no example-app baggage, no TypeScript language support.execa-drivenyarn workspace ... buildshell-out with Vite's programmaticbuild()API. Dropswrite: false,minify: false,target: 'esnext',reportCompressedSize: false, andtreeshake: falsesince the assertion only cares about the chunk file list, not the bundle contents or size./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.execadevDependency.Test plan
yarn workspace monaco-graphql testand confirm both tests pass in under 5s locally.Notes
CI runtime stays close to the previous version because monaco-editor's bundle graph itself is the cost. Getting CI under ~5s would require switching to static module-graph inspection (resolving but not bundling monaco-editor) or to a faster bundler with a worker plugin. Filed as a follow-up rather than blocking this change.