← Back to docs

v0.18.0

Changelog

All notable changes to ECSpresso are documented here. Format loosely follows Keep a Changelog.

0.18.0

Breaking

ScreenDefinition<Config> now defaults State to Config instead of Record<string, never>.

That means code like this may now fail typecheck:

type Screens = {

playing: ScreenDefinition<{ level: number }>;

};

const playing: Screens['playing'] = {

initialState: () => ({}),

};

Before, omitted State meant empty state. Now omitted State means state mirrors config, so initialState must return { level: number }.

Added

- SystemProcessFn<Cfg, Queries, ResourceKeys?, Singletons?> names the .setProcess(...) callback shape.

- SystemLifecycleFn<Cfg> names the .setOnInitialize(...) / .setOnDetach(...) callback shape.

- AssetConfiguratorFn<Assets, AssetGroups?> names the .withAssets(...) callback shape.

- ScreenConfiguratorFn<Screens> names the .withScreens(...) callback shape.

- ComponentsConfig<T>, EventsConfig<T>, ResourcesConfig<T>, AssetsConfig<T>, and ScreensConfig<T> build single-slot configs without spelling empty WorldConfigFrom parameters.

- spritesheetLoader<S>(url)AssetConfigurator-compatible loader; lazy-loads pixi.js and runtime-shape-checks the resolved value so non-atlas URLs error at load time instead of deep in the play loop.

- clipFromSheet(sheet, name, options?) and animationSetFromSheet(id, sheet, options?) — build clips/sets from a loaded Spritesheet<S>. Animation-name union is inferred when S is declared as an interface ... extends SpritesheetData. Both throw on zero-frame animations.

- clipFromGrid({ source, frameWidth, frameHeight, columns, rows?, count?, indices?, ... }) — slice a grid-arranged image without atlas JSON. Async (lazy-loads pixi) and validates inputs: exactly one of rows/count/indices is required, indices are integer- and bounds-checked when rows is given.

- New exported types: SheetClipOverrides<A>, SheetAnimationKeys<S>.

Internal

0.17.0

No breaking changes from 0.16.3.

Added

Performance

Internal