GitHubLoslegen

Diese Seite ist noch nicht auf Deutsch übersetzt und wird daher auf Englisch angezeigt.

Leitfäden

API Stability

Every package of the module is either stable or experimental. The status says how a package may change from one release to the next, how its changes are announced, and how long an app has to move off what it deprecates.

Statuses

Stable packages change only in ways an app can plan for:

  • From v1.0.0, a stable package keeps its exported API compatible within a major version, as Semantic Versioning and Go's own compatibility promise describe: no identifier is removed or renamed, no signature changes, and documented behavior holds. Adding methods, fields, functions and types is compatible when it does not change an existing interface's method set. Adding a method to an exported interface is a breaking change because existing implementations may no longer compile.
  • Before v1.0.0, where Semantic Versioning allows any change, a stable package breaks its API only in a minor release (v0.x.0, never a patch release), and only after deprecating what it removes or changes for at least one minor release, as Deprecation describes.
  • A stable package imports no experimental package of this module, so a change to an experimental package never breaks it.

Experimental packages are still finding their shape, usually because they wait on an NSGo primitive, a format decision or more use in the sample games:

  • An experimental package may change or remove any part of its API in any minor release, without a deprecation period. Patch releases still only fix bugs.
  • Every change to its API is listed in CHANGELOG.md under the release that makes it, so an upgrade is never a surprise.
  • An app may use experimental packages; it should pin the module's version and read the changelog before it upgrades.

What the promise covers

  • The exported Go API of a package: its identifiers, signatures, and the behavior its doc comments document.
  • The text formats a package defines, such as its YAML files. Each has a version field; a stable package keeps loading every version of its formats it has written since it became stable, and migrates them on load.
  • The formats of other tools a package reads, such as Tiled's and LDtk's maps and Aseprite's and TexturePacker's atlases. A stable package keeps reading every version of those exports it has read since it became stable.
  • For a command (a cmd directory), its flags, arguments, exit codes and the formats of its output files.

It does not cover:

  • Packages under internal/, which no other module can import.
  • Behavior a doc comment calls unspecified, and anything that depends on a bug: a fix to a bug is not a breaking change.
  • Performance, allocation counts and binary size, which are tracked by budgets rather than promised.
  • The minimum Go and NSGo versions, which a minor release may raise; the README's compatibility table lists them for each release.

Package moves and NSGo types

Moving an experimental package to a new import path is allowed in a minor release. The release changelog names the old and new paths and the package's guide links to the migration. A stable package keeps its old import path for at least one minor release as a forwarding package of aliases and wrappers, with a Deprecated: package comment that names the replacement. Removing that forwarding path follows the same deprecation period as any other stable API removal.

NSGo types in a stable signature are part of that package's compatibility contract. If an NSGo change makes a stable signature incompatible, the game release raises its minimum NSGo version and lists every affected package and identifier under ### Changed. Where Go permits aliases or wrappers, the old signature remains available for the deprecation period. Experimental packages may follow a newer NSGo signature in a minor release when the change is listed in the changelog.

Every experimental package starts its package documentation with a sentence that says it is experimental and links this policy. TestStabilityTable checks that sentence alongside the status table, so go doc and pkg.go.dev show the same status as the website.

Deprecation

The check workflow compares deterministic apidiff export artifacts from the pull request base and head. Stable incompatible changes fail CI. Experimental incompatible changes require a bullet under ### Changed or ### Removed in a changelog.d fragment that names the package in backticks, such as `editor` or `game/editor`. Release checks run the same comparison against the previous tag and put the report in the release notes. Package moves are recorded in internal/repocheck/api-moves.yaml.

When a stable package replaces or removes part of its API:

  1. The release that deprecates it adds a paragraph starting Deprecated: to the identifier's doc comment, naming what to use instead, as Go's deprecation convention describes, so gopls, staticcheck and pkg.go.dev flag its uses:

    // DrawAll draws every sprite of the batch.
    //
    // Deprecated: Use Batch.Draw, which also orders the sprites by Z.
    func (b *Batch) DrawAll(d core.Drawing)
  2. The same release lists it under ### Deprecated in CHANGELOG.md, with the issue that tracks it.

  3. The deprecated identifier keeps working, unchanged, for at least one whole minor release after the one that deprecates it: deprecated in v0.4.0, it is removed in v0.6.0 at the earliest.

  4. The release that removes it lists it under ### Removed in CHANGELOG.md. From v1.0.0 nothing is removed from a stable package before the next major version.

The releases themselves, their tags, changelog sections and the NSGo version each one needs, are described in #39.

Changing a status

  • A package becomes stable in a minor release through a pull request that changes its row below, says so in the changelog, and has the package's guide in place. It should be used by at least one sample game in examples and depend only on stable packages.
  • A stable package never goes back to experimental. A design it outgrows is replaced by a new package or, from v1.0.0, a new major version.
  • A new package starts experimental.

Packages

Paths are relative to github.com/nsgo-dev. The table is checked by a test in the module, so every package has exactly one row.

Every package starts experimental. An experimental row means its exported API, documented behavior, and package-defined text formats may still change in a minor release. The row's guide is the place to find the current usage contract, while the release process in Release Checklist describes how changes are announced and verified.

Package Status Guide
game Stable Loop
game/cmd/accountsd Experimental accounts
game/cmd/cloudsaved Experimental cloudsave
game/cmd/editor Experimental Scene Editor
game/cmd/game Experimental Command Line
game/cmd/leaderboardd Experimental leaderboard/selfhost
game/cmd/nsgo-game Experimental Command Line
game/pkg/a11y Experimental a11y
game/pkg/ability Experimental ability
game/pkg/ai Stable ai
game/pkg/ai/cover3d Experimental ai
game/pkg/ai/perception3d Experimental ai
game/pkg/anim3d Experimental anim3d
game/pkg/animclip Experimental animclip
game/pkg/assets Experimental assets
game/pkg/battle Experimental battle
game/pkg/bullets Experimental bullets
game/pkg/cards Experimental cards
game/pkg/cards/deck Experimental cards
game/pkg/cues Experimental cues
game/pkg/cutscene Experimental cutscene
game/pkg/datatable Experimental datatable
game/pkg/datatable/datatablewatch Experimental datatable
game/pkg/dialogue Stable dialogue
game/pkg/editor Experimental editor
game/pkg/editor/agentdir Experimental editor
game/pkg/editor/diaglog Experimental editor
game/pkg/editor/editorcmd Experimental editor
game/pkg/editor/editormcp Experimental mcp
game/pkg/editor/keychain Experimental editor
game/pkg/editor/theme Experimental editor
game/pkg/entities Experimental entities
game/pkg/farming Experimental farming
game/pkg/fighting Experimental fighting
game/pkg/flow Stable flow
game/pkg/fog Experimental fog
game/pkg/framedata Experimental framedata
game/pkg/gameplugin Experimental Plugins
game/pkg/gameplugin/devplugin Experimental Plugins
game/pkg/gameplugin/manifest Experimental Plugins
game/pkg/gametest Experimental gametest
game/pkg/gametime Experimental gametime
game/pkg/gameui Experimental gameui
game/pkg/gltf Experimental 3D Models from Blender
game/pkg/hostbridge Experimental shipping
game/pkg/idle Experimental idle
game/pkg/importsettings Experimental Command Line
game/pkg/input Stable input
game/pkg/inventory Experimental inventory
game/pkg/jsonschema Experimental Schemas for YAML files
game/pkg/ktx2 Experimental render3d
game/pkg/l10n Experimental l10n
game/pkg/lights2d Experimental lights2d
game/pkg/loaderr Stable Errors
game/pkg/loot Experimental loot
game/pkg/match3 Experimental match3
game/pkg/math2d Stable math2d
game/pkg/math3d Experimental math3d
game/pkg/mcp Experimental mcp
game/pkg/mcp/mcp3d Experimental mcp
game/pkg/mcp/mcpui Experimental mcp
game/pkg/mempool Experimental mempool
game/pkg/mergegame Experimental formats
game/pkg/modding Experimental modding
game/pkg/motion Experimental scene
game/pkg/online/accounts Experimental accounts
game/pkg/online/accounts/authtoken Experimental accounts
game/pkg/online/accounts/identity Experimental accounts
game/pkg/online/accounts/pgstore Experimental accounts
game/pkg/online/accounts/sqlitestore Experimental accounts
game/pkg/online/accounts/sqlstore Experimental accounts
game/pkg/online/accounts/storetest Experimental accounts
game/pkg/online/achievements Experimental achievements
game/pkg/online/admin Experimental admin
game/pkg/online/antiaddiction Experimental Releasing in Mainland China
game/pkg/online/audit Experimental gameserver
game/pkg/online/backend Experimental backend
game/pkg/online/cloudsave Experimental cloudsave
game/pkg/online/cloudsave/pgstore Experimental cloudsave
game/pkg/online/cloudsave/sqlitestore Experimental cloudsave
game/pkg/online/cloudsave/sqlstore Experimental cloudsave
game/pkg/online/cloudsave/storetest Experimental cloudsave
game/pkg/online/economy Experimental economy
game/pkg/online/eos Experimental eos
game/pkg/online/gameserver Experimental gameserver
game/pkg/online/lan Experimental netplay
game/pkg/online/leaderboard Experimental leaderboard
game/pkg/online/leaderboard/selfhost Experimental leaderboard/selfhost
game/pkg/online/leaderboard/selfhost/pgstore Experimental leaderboard/selfhost
game/pkg/online/leaderboard/selfhost/sqlitestore Experimental leaderboard/selfhost
game/pkg/online/leaderboard/selfhost/sqlstore Experimental leaderboard/selfhost
game/pkg/online/liveops Experimental liveops
game/pkg/online/liveops/crashreport Experimental liveops
game/pkg/online/netplay Experimental netplay
game/pkg/online/netplay/roomstate Experimental netplay
game/pkg/online/netplay/wire Experimental netplay/wire
game/pkg/online/portmap Experimental portmap
game/pkg/online/presence Experimental presence
game/pkg/online/realtime Experimental social
game/pkg/online/records Experimental records
game/pkg/online/servicehealth Experimental Deploying backend services
game/pkg/online/social Experimental social
game/pkg/online/steam Experimental steam
game/pkg/online/steamworks Experimental steamworks
game/pkg/online/storeverify/wechatpay Experimental liveops
game/pkg/online/wsclient Experimental wsclient
game/pkg/particles Experimental particles
game/pkg/pathfind Stable pathfind
game/pkg/pathfind/navbake Experimental navbake
game/pkg/pathfind3d Experimental pathfind3d
game/pkg/pathfind3d/navbake3d Experimental navbake3d
game/pkg/physics Stable physics
game/pkg/physics3d Experimental physics3d
game/pkg/pixelfx Experimental pixelfx
game/pkg/pixelfx/arcane Experimental pixelfx
game/pkg/pixelfx/critters Experimental pixelfx
game/pkg/pixelfx/explosions Experimental pixelfx
game/pkg/pixelfx/fire Experimental pixelfx
game/pkg/pixelfx/holy Experimental pixelfx
game/pkg/pixelfx/ice Experimental pixelfx
game/pkg/pixelfx/impacts Experimental pixelfx
game/pkg/pixelfx/lightning Experimental pixelfx
game/pkg/pixelfx/melee Experimental pixelfx
game/pkg/pixelfx/moves Experimental pixelfx
game/pkg/pixelfx/nature Experimental pixelfx
game/pkg/pixelfx/pickups Experimental pixelfx
game/pkg/pixelfx/projectiles Experimental pixelfx
game/pkg/pixelfx/scifi Experimental pixelfx
game/pkg/pixelfx/shadow Experimental pixelfx
game/pkg/pixelfx/spawn Experimental pixelfx
game/pkg/pixelfx/status Experimental pixelfx
game/pkg/pixelfx/transitions Experimental pixelfx
game/pkg/pixelfx/ui Experimental pixelfx
game/pkg/pixelfx/water Experimental pixelfx
game/pkg/pixelfx/weather Experimental pixelfx
game/pkg/placeholder Experimental Placeholder Assets
game/pkg/placement Experimental placement
game/pkg/platformer Experimental platformer
game/pkg/postfx Experimental postfx
game/pkg/procgen Experimental procgen
game/pkg/progression Experimental progression
game/pkg/project Experimental Project File
game/pkg/quality Experimental quality
game/pkg/quest Experimental quest
game/pkg/random Stable Determinism
game/pkg/render3d Experimental render3d
game/pkg/replay Experimental replay
game/pkg/resource Experimental resources
game/pkg/rhythm Experimental rhythm
game/pkg/rooms Experimental rooms
game/pkg/rpgdata Experimental rpgdata
game/pkg/rts Experimental rts
game/pkg/save Stable save
game/pkg/save/savetest Experimental save
game/pkg/scene Stable scene
game/pkg/scene3d Experimental scene3d
game/pkg/sceneformat Experimental editor
game/pkg/scenemodel Experimental scenemodel
game/pkg/screen Stable screen
game/pkg/sessionstats Experimental sessionstats
game/pkg/skeletal Experimental skeletal
game/pkg/sound Stable sound
game/pkg/spatial Experimental spatial
game/pkg/spawn Experimental spawn
game/pkg/sprite Stable sprite
game/pkg/statedump Experimental statedump
game/pkg/stats Experimental stats
game/pkg/tags Experimental tags
game/pkg/text Experimental text
game/pkg/tilemap Stable tilemap
game/pkg/tilemap/tileshape Experimental tileshape
game/pkg/tooling/assetbuild Experimental Command Line
game/pkg/tooling/assetcheck Experimental Command Line
game/pkg/tooling/assets Experimental assets
game/pkg/tooling/atlaspack Experimental Command Line
game/pkg/tooling/audioconv Experimental Command Line
game/pkg/tooling/bench Experimental Command Line
game/pkg/tooling/credits Experimental Command Line
game/pkg/tooling/devstate Experimental File Formats
game/pkg/tooling/dlc Experimental assets
game/pkg/tooling/gamedebug Experimental gamedebug
game/pkg/tooling/genjob Experimental editor
game/pkg/tooling/genparams Experimental
game/pkg/tooling/godebug Experimental editor
game/pkg/tooling/hotreload Experimental Resources
game/pkg/tooling/library Experimental Asset and Plugin Library
game/pkg/tooling/manifest Experimental Command Line
game/pkg/tooling/playtest Experimental playtest
game/pkg/tooling/refs Experimental Packages
game/pkg/tooling/sizecheck Experimental Package Size Budgets
game/pkg/tooling/spriteframes Experimental assets
game/pkg/tooling/storecapture Experimental Building and Shipping
game/pkg/tooling/templatemeta Experimental Templates
game/pkg/tooling/texseam Experimental assets
game/pkg/tween Stable tween
game/pkg/undo Experimental undo
game/pkg/vehicle3d Experimental vehicle3d
game/pkg/vn Experimental vn
game/pkg/voxel Experimental voxel
game/pkg/world3d Experimental world3d
game/pkg/worldmap Experimental worldmap
game/skills Experimental Agent Skill

Package moves and NSGo types

A stable package keeps its old import path for one minor release when it moves, using deprecated aliases or wrappers. Experimental packages may move in a minor release with a changelog entry naming the new path. Changes to NSGo types in stable signatures follow the same compatibility policy and list affected identifiers when aliases are impossible.

Diese Seite bearbeiten