Skip to content

Improve Server Preset watcher time - #8405

Merged
eddeee888 merged 6 commits into
mainfrom
new-watcher-exp
Aug 27, 2026
Merged

Improve Server Preset watcher time#8405
eddeee888 merged 6 commits into
mainfrom
new-watcher-exp

Conversation

@eddeee888

Copy link
Copy Markdown
Collaborator

Description

Previously, Server Preset time doesn't change between initial run vs subsequent runs.
This is because a TypeScript compiler is created between runs, so the previous TypeScript buildinfo and cache goes away.
With the upcoming version of Server Preset, the reference of the TypeScript compiler is kept between runs so it doesn't have to start from scratch (observed ~3s for TypeScript to compile the first time)

Type Old New Changes
Initial run, with all generates block 7.33s 7.33s N/A
Subsequent runs, with all generates block 7.33s 5.06s -30.9%
Subsequent runs, with only Server Preset 4.53s 3.02s -33%

I think there are space to optimise for this a bit more. I'm hopeful we can get to ~3s with all generates block

For comparison:

  • a run (initial or subsequent) of just client-preset takes ~1.4s
  • a run (initial or subsequent) of everything but Server Preset takes ~2.2s

Comment thread codegen.mts
Comment on lines +8 to +10
overwrite: {
removeStaleFiles: false,
},

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally Server Preset's defineConfig should handle this without us having to set this globally like this.

However, the overwrite checks are not working for presets due to it using the actual filename and not the generates key. I'll fix this next

@theguild-bot

theguild-bot commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/apollo 0.48.6-alpha-20260827112103-1d543db59669ab7ef63c4ff5abe6ef403b75ab14 npm ↗︎ unpkg ↗︎
@graphql-hive/cli 0.62.1-alpha-20260827112103-1d543db59669ab7ef63c4ff5abe6ef403b75ab14 npm ↗︎ unpkg ↗︎
@graphql-hive/core 0.22.4-alpha-20260827112103-1d543db59669ab7ef63c4ff5abe6ef403b75ab14 npm ↗︎ unpkg ↗︎
@graphql-hive/envelop 0.40.11-alpha-20260827112103-1d543db59669ab7ef63c4ff5abe6ef403b75ab14 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-plugin-console-sdk 0.1.5-alpha-20260827112103-1d543db59669ab7ef63c4ff5abe6ef403b75ab14 npm ↗︎ unpkg ↗︎
@graphql-hive/yoga 0.49.5-alpha-20260827112103-1d543db59669ab7ef63c4ff5abe6ef403b75ab14 npm ↗︎ unpkg ↗︎
hive 11.12.1-alpha-20260827112103-1d543db59669ab7ef63c4ff5abe6ef403b75ab14 npm ↗︎ unpkg ↗︎

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tags: 11.12.1-alpha-1d543db, 1d543db, 1d543db59669ab7ef63c4ff5abe6ef403b75ab14

Comment thread package.json Outdated
"@changesets/changelog-github": "0.7.0",
"@changesets/cli": "2.31.1",
"@eddeee888/gcg-typescript-resolver-files": "0.18.0",
"@eddeee888/gcg-typescript-resolver-files": "0.0.0-pr474-run407-1-20260813135601",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be replaced with real version once this is merged

@eddeee888
eddeee888 requested review from jdolle and n1ru4l August 26, 2026 21:16
@eddeee888
eddeee888 marked this pull request as ready for review August 26, 2026 21:17
@eddeee888

Copy link
Copy Markdown
Collaborator Author

Hi @n1ru4l could you try this new version to see if watch feels faster for you? 🙂

@n1ru4l n1ru4l left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great 🥳

@eddeee888
eddeee888 merged commit 18e6877 into main Aug 27, 2026
29 checks passed
@eddeee888
eddeee888 deleted the new-watcher-exp branch August 27, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants