graphql / graphql/graphiql

new `monaco-graphql` test counts number of modules before tree shaking is complete

Open
#3,338 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

With #3022, a contributor is adding a single file to one of the libraries used by the example, but the test of stdout fails, even though her added method is not in the resulting bundle

![image](https://github.com/graphql/graphiql/assets/1368727/87a1419b-edde-4ce8-890c-4f24880a4c59)

when running an unminified build of `example-monaco-graphql-react-vite`, the number of modules transformed is pre-tree shaking:

> ✓ 1093 modules transformed.

the expected method from `@graphiql/toolkit` is present:
![image](https://github.com/graphql/graphiql/assets/1368727/3a1df794-9d1d-44ed-a422-39252f7c9a80)

whereas her added method is not found in the bundle
![image](https://github.com/graphql/graphiql/assets/1368727/4d90e623-02b5-42ec-8ca7-180a4ed06890)

this means that testing for the number of modules transformed is counting modules before the final tree shaking, and not indicating what we think it indicates

FWIW: (this is with `build: { minify: false }` and `vite build`

I suspect that the number of modules transformed figure comes from esbuild, and rollup then performs the final pass of tree shaking

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.