Build a second client without the embedded server - #391
Merged
Conversation
A slim build leaves out embedded-server.tar.gz and the native overlay: 72MB unpacked, 34MB off the Windows installer, so 126MB becomes 92MB. Measured, both variants packaged on this machine. GRYT_VARIANT=slim drives it, because the same answer has to reach three places that do not call each other. The beforeBuild hook skips packaging the runtime, which is also most of why a slim build is quicker — that step is what needs the server, worker and SFU checkouts. check-extra-resources stops demanding the two files, so the rest of that check stays in force rather than being switched off. And electron-builder.config.cjs reads electron-builder.yml, which is still where everything is written down, then applies the three edits YAML cannot express. Two of those three are about the release rather than the build. The artifacts need different names or the variants overwrite each other in one release, and the update feed needs its own channel or a slim install downloads the full installer next time and quietly puts the 34MB back. electron-builder writes slim.yml and bakes `channel: slim` into app-update.yml, which is what electron-updater reads. main.ts does not set autoUpdater.channel. app-update.yml is the build's own statement of which variant it is, and assigning the property would override that with a value inferred from a missing file. The inference is only used for the pre-check that reads the yml before the updater does, where being wrong means reporting no update rather than fetching the wrong installer. check-builder-config now validates both variants against electron-builder's schema, and asserts the three things that otherwise fail silently: the filter, the channel and the artifact name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
prepareEmbeddedServerRuntime returns early when the archive is absent, which is every slim build, and the line after it logged "Embedded server runtime ready" regardless. Found while smoke-testing the slim build: the log said ready, so I went looking for an extracted runtime that was never meant to be there. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Replaces #389, which GitHub closed when its base branch was deleted on the
#388 merge. Same work, rebased onto main.
GRYT_VARIANT=slimproduces a second build with the embedded server left out.Measured on Windows, both packaged from this branch:
yarn electron:buildyarn electron:build:slimElectron's own runtime is about 90 MB of that 92, so the slim build is roughly
Gryt plus Chromium and not much else.
How it hangs together
The variant reaches three places that do not call each other, so it travels in
the environment:
build is quicker — packaging is the step that needs the server, worker and SFU
checkouts.
everything else. That script exists because electron-builder skips a missing
extraResource silently, and this leans on exactly that behaviour.
electron-builder.ymland applies thethree things YAML cannot branch on. The YAML is still where everything is
written down.
Two of those three are about the release rather than the build: without distinct
artifact names the variants overwrite each other in one release, and without its
own update channel a slim install downloads the full installer next time and
quietly puts the 34 MB back.
What to look at
The updater.
main.tsdeliberately does not setautoUpdater.channel.electron-builder bakes
channel: slimintoapp-update.yml, which is thebuild's own statement of which variant it is; assigning the property would
override that with a value inferred from a file being absent. The inference is
used only by
channelYmlName(), which reads the yml before electron-updaterloads anything — so if it is ever wrong the result is "no update available"
rather than the wrong installer. Worth a second opinion.
Verified
Both variants packaged and launched on Windows against an isolated profile.
Slim produces
Gryt-Chat-1.9.14-win-x64-slim.exe,slim.yml, and resourceswith no
embedded-server.tar.gzorembedded-native/; the default build stillproduces
latest.ymland both embedded resources. Both start, show a window anda tray, and discover LAN servers.
check-builder-configvalidates both configsagainst electron-builder's schema and asserts the filter, the channel and the
artifact name.
The smoke test found one thing, fixed here: the startup log said "Embedded
server runtime ready" in a slim build, because
prepareEmbeddedServerRuntime()returns early when there is no archive and the line after it ran regardless.
Not verified: macOS and Linux. Signing and notarization differ, and the mac
path stages the native overlay separately.
Still to do, not in this PR
publishes a slim artifact until then.
🤖 Generated with Claude Code