Skip to content

chore(deps)!: build against NSGo main and migrate core.FlexShrink - #2723

Merged
houko merged 2 commits into
mainfrom
chore/nsgo-main-flexshrink
Dec 1, 2026
Merged

houko merged 2 commits into
mainfrom
chore/nsgo-main-flexshrink

Conversation

@houko

@houko houko commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Moves the root module, tools and the ten example modules from NSGo v0.4.0 to NSGo main at 8e5c1cc (v0.4.1-0.20261201013927-8e5c1cc14ee7), regenerating go.sum with go mod tidy. Tidy also adds the indirect requirements of nsgo's cmd/nsgo that caverun, starburst, fountain and observatory were missing, and lists modelcontextprotocol/go-sdk as a direct requirement of tools, which imports it.
  • Migrates every numeric core.Style.FlexShrink to the core.FlexShrink type that feat(core)!: shrink growing boxes and scroll views by default nsgo#2739 introduced. There are 906 sites: 278 FlexShrink: 1 become core.Shrink(1) and 628 FlexShrink: 0 become core.NoShrink. They are in pkg/editor (835), pkg/scene, pkg/online/admin/console, internal/repocheck, the templates and their internal/gamecli/_templates copies, and the examples. Three st.FlexShrink = 0 and two = 1 assignments are migrated the same way. The docs (en and zh) and the nsgo-game skill now show the new form. Each factor keeps its old value; the upstream advice to drop FlexShrink: 1 next to FlexGrow: 1 is left for a separate cleanup.
  • Regenerates the operator console's embedded web build (pkg/online/admin/console/dist, dist.inputs) for the changed sources and NSGo version.
  • Second commit: pins every template's go.mod.tmpl, and the embedded copies, to the first commit's game pseudo-version (v0.3.1-0.20261201021414-a2876d276c9e) with NSGo main, and regenerates their go.sum with GOWORK=off go mod tidy. The release step repins them to the released version, as the template pin policy note describes.
  • Adds a changelog fragment and .agents/notes/implemented/process/2026-12-01-nsgo-main-flexshrink-upgrade.md.

Why now

A project that requires NSGo main, for example for nsgo.WindowMaximized (nsgo-dev/nsgo#2822), cannot build the game layer today. MVS picks NSGo main, and pkg/scene/hud3d.go:300 and the rest of the numeric FlexShrink sites stop compiling. nsgo-dev/nsgo#2739 is the only breaking commit between v0.4.0 and NSGo main at 8e5c1cc. After this change, go vet on the root module reports nothing else.

The templates have to move in the same change. game new from main embeds the template code and requires game at main, which now requires NSGo main, so that code must use the new API. CI's templates job builds each template against its pinned game version, and the only version that builds against NSGo main is this branch's first commit. That is why the templates pin it. GitHub keeps the pull request's head commits reachable, so the pseudo-version still resolves after a rebase merge.

Behavior: by NSGo's new default, growing boxes, scroll views along their scroll axis and auto-sized wrappers around them that set no factor now shrink. Explicit factors are unchanged. No golden image or screenshot test changed.

Testing

All runs were on the Mac Studio via rbuild. Its system disk was full (230 MB free), so test runs used TMPDIR/GOTMPDIR on /Volumes/Workspace. An earlier run with the default temp dir failed 27 tests, all with no space left on device.

  • go tool nsgo test ./... -- -timeout=40m (root): 8108 passed, 0 failed, 10 skipped. The skips are Postgres, fish and an existing viewport-capture skip.
  • go tool nsgo check: passed.
  • go tool nsgo test ./internal/gamecli, which builds new projects from every template against this checkout: passed with the second commit's pins.
  • tools: go tool nsgo test ./... passed.
  • Every example module (caverun, cryptquest, dedicatedserver, fieldmedic, fountain, lantern3d, observatory, slidegem, starburst, tutorial): go tool nsgo test ./... passed.
  • All 18 templates the way CI's templates job tests them: copy out of the workspace, render go.mod, GOWORK=off go tool nsgo test ./... against the pinned game pseudo-version from the proxy. All passed.
  • go run ./tools/changelog check: passed.
  • go run ./pkg/online/admin/console/internal/consolebuild -check: passed.
  • bun run verify-notes: passed.

Screenshots

None.

houko added 2 commits December 1, 2026 11:14
Moves the game layer, the tools module and the sample games from NSGo v0.4.0 to NSGo main at 8e5c1cc (v0.4.1-0.20261201013927-8e5c1cc14ee7), so a project that requires NSGo main, such as for nsgo.WindowMaximized (nsgo-dev/nsgo#2822), can build the game layer.

NSGo's only breaking change since v0.4.0 (nsgo-dev/nsgo#2739) makes core.Style.FlexShrink a core.FlexShrink and shrinks growing boxes, scroll views along their scroll axis and the auto-sized boxes around them by default. Every numeric factor keeps its value: FlexShrink: 1 becomes core.Shrink(1) and FlexShrink: 0 becomes core.NoShrink (906 sites in pkg/editor, pkg/scene, pkg/online/admin/console, internal, the templates and their embedded copies, and the examples), and the docs and the nsgo-game skill show the new form. The operator console's embedded web build is regenerated for the new sources and NSGo version.

go mod tidy also adds the indirect requirements the examples were missing for nsgo's cmd/nsgo tool (quic-go and friends) and lists modelcontextprotocol/go-sdk as a direct requirement of the tools module, which imports it.

BREAKING CHANGE: the game layer requires an NSGo newer than v0.4.0, whose core.Style.FlexShrink is a core.FlexShrink.
Every template required github.com/nsgo-dev/game at eee96e7 with NSGo v0.4.0, while the template code now writes core.Shrink and core.NoShrink, which only NSGo main has, and game at eee96e7 does not build against NSGo main. Pin them all, and the copies game new embeds, to the previous commit (v0.3.1-0.20261201021414-a2876d276c9e), which builds against NSGo main, with NSGo v0.4.1-0.20261201013927-8e5c1cc14ee7, and regenerate go.sum with GOWORK=off go mod tidy. The release step repins them to the released game version.

Adds the changelog fragment and a note on the migration and the pin, and updates the NSGo version the nsgo-game skill says the templates require.
@houko
houko merged commit be78552 into main Dec 1, 2026
86 of 98 checks passed
@houko
houko deleted the chore/nsgo-main-flexshrink branch December 1, 2026 02:53
houko added a commit to nsgo-dev/orbit-academy-game that referenced this pull request Dec 1, 2026
…ayer main

Move to nsgo main (8e5c1cc), which opens the main window maximized from its first frame (nsgo-dev/nsgo#2822) and brings the environment refresh (nsgo-dev/nsgo#2821) and sprite-frame crop cache (nsgo-dev/nsgo#2817) fixes, and to the game layer main (be78552), which builds against it (nsgo-dev/game#2723). Replace maximizeOnce, which waited for the first window frame to toggle maximize, with nsgo.WindowMaximized in main.go, and migrate the one numeric FlexShrink to core.Shrink.
houko added a commit to nsgo-dev/orbit-academy-game that referenced this pull request Dec 1, 2026
…ayer main (#5)

Move to nsgo main (8e5c1cc), which opens the main window maximized from its first frame (nsgo-dev/nsgo#2822) and brings the environment refresh (nsgo-dev/nsgo#2821) and sprite-frame crop cache (nsgo-dev/nsgo#2817) fixes, and to the game layer main (be78552), which builds against it (nsgo-dev/game#2723). Replace maximizeOnce, which waited for the first window frame to toggle maximize, with nsgo.WindowMaximized in main.go, and migrate the one numeric FlexShrink to core.Shrink.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant