GitHubНачать

Эта страница ещё не переведена на русский язык, поэтому ниже показан английский оригинал.

Руководства

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.
  • 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.

Deprecation

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.

Package Status Guide
game Stable Loop
game/cmd/editor Experimental Scene Editor
game/cmd/game Experimental Command Line
game/cmd/gameapi Experimental
game/cmd/gameproject Experimental Project File
game/cmd/gameschema Experimental Schemas for YAML files
game/cmd/nsgo-game Experimental Command Line
game/cmd/sizecheck Experimental Package Size Budgets
game/cmd/wasmprobe Experimental Package Size Budgets
game/pkg/a11y Experimental a11y
game/pkg/ability Experimental ability
game/pkg/accounts Experimental accounts
game/pkg/accounts/cmd/accountsd Experimental accounts
game/pkg/accounts/pgstore Experimental accounts
game/pkg/accounts/sqlitestore Experimental accounts
game/pkg/accounts/sqlstore Experimental accounts
game/pkg/accounts/storetest Experimental accounts
game/pkg/accounts/token Experimental accounts
game/pkg/achievements Experimental achievements
game/pkg/ai Stable ai
game/pkg/ai/perception3d Experimental ai
game/pkg/anim3d Experimental anim3d
game/pkg/animclip Experimental animclip
game/pkg/assets Experimental assets
game/pkg/bullets Experimental bullets
game/pkg/cards Experimental cards
game/pkg/cloudsave Experimental cloudsave
game/pkg/cloudsave/cmd/cloudsaved Experimental cloudsave
game/pkg/cloudsave/sqlstore Experimental cloudsave
game/pkg/cloudsave/storetest Experimental cloudsave
game/pkg/cutscene Experimental cutscene
game/pkg/debug Experimental debug
game/pkg/editor Experimental editor
game/pkg/editor/editorcmd Experimental editor
game/pkg/editor/editormcp Experimental mcp
game/pkg/effects Experimental effects
game/pkg/entities Experimental entities
game/pkg/fighting Experimental fighting
game/pkg/flow Stable flow
game/pkg/fog Experimental fog
game/pkg/framedata Experimental framedata
game/pkg/gametest Experimental
game/pkg/gameui Experimental gameui
game/pkg/gltf Experimental 3D Models from Blender
game/pkg/idle Experimental idle
game/pkg/input Stable input
game/pkg/inventory Experimental inventory
game/pkg/l10n Experimental l10n
game/pkg/leaderboard Experimental leaderboard
game/pkg/leaderboard/selfhost Experimental leaderboard/selfhost
game/pkg/leaderboard/selfhost/cmd/leaderboardd Experimental leaderboard/selfhost
game/pkg/lights2d Experimental lights2d
game/pkg/liveops Experimental liveops
game/pkg/loaderr Stable Errors
game/pkg/loot Experimental loot
game/pkg/math2d Stable math2d
game/pkg/math3d Experimental math3d
game/pkg/mcp Experimental mcp
game/pkg/modding Experimental modding
game/pkg/navbake Experimental navbake
game/pkg/navbake3d Experimental navbake3d
game/pkg/net Experimental net
game/pkg/particles Experimental particles
game/pkg/perf Experimental perf
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/platformer Experimental platformer
game/pkg/playtest Experimental playtest
game/pkg/presence Experimental presence
game/pkg/procgen Experimental procgen
game/pkg/project Experimental Project File
game/pkg/quality Experimental quality
game/pkg/quest Experimental quest
game/pkg/random Stable Determinism
game/pkg/refs Experimental Project File
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/rts Experimental rts
game/pkg/save Stable 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/server Experimental server
game/pkg/server/cmd/dedicatedserver Experimental server
game/pkg/skeletal Experimental skeletal
game/pkg/sound Stable sound
game/pkg/sprite Stable sprite
game/pkg/statedump Experimental statedump
game/pkg/stats Experimental stats
game/pkg/text Experimental text
game/pkg/tilemap Stable tilemap
game/pkg/tileshape Experimental tileshape
game/pkg/tooling/apiref Experimental
game/pkg/tooling/assetbuild Experimental Command Line
game/pkg/tooling/assetcheck Experimental Command Line
game/pkg/tooling/audioconv Experimental
game/pkg/tooling/bench Experimental Command Line
game/pkg/tooling/credits Experimental Command Line
game/pkg/tooling/datatable Experimental
game/pkg/tooling/devstate Experimental
game/pkg/tooling/hotreload Experimental
game/pkg/tooling/importsettings Experimental Command Line
game/pkg/tooling/jsonschema Experimental Schemas for YAML files
game/pkg/tooling/ktx2 Experimental
game/pkg/tooling/library Experimental Asset and Plugin Library
game/pkg/tooling/manifest Experimental
game/pkg/tooling/pack Experimental
game/pkg/tween Stable tween
game/pkg/undo Experimental undo
game/pkg/vehicle Experimental vehicle
game/pkg/vn Experimental vn
game/pkg/vn/cmd/vnsample Experimental vn
game/pkg/voxel Experimental voxel
game/pkg/world3d Experimental world3d
game/pkg/worldmap Experimental worldmap
Редактировать страницу