11 KiB
Changelog
This document records the version update history of the @esengine/ecs-framework core library.
v2.4.2 (2025-12-25)
Features
- IncrementalSerializer Entity Filter: Incremental serialization supports
entityFilteroption (#335)- Filter entities by condition when creating snapshots
- Support custom filter logic by tag, component type, etc.
- Suitable for scenarios that only sync partial entities (e.g., only sync players)
// Only snapshot player entities
const snapshot = IncrementalSerializer.createSnapshot(scene, {
entityFilter: (entity) => entity.tag === PLAYER_TAG
});
// Only snapshot entities with specific component
const snapshot = IncrementalSerializer.createSnapshot(scene, {
entityFilter: (entity) => entity.hasComponent(PlayerMarker)
});
Refactor
- Optimize
PlatformWorkerPoolcode style, extract as standalone module (#335) - Optimize
WorkerEntitySystemimplementation, improve code structure (#334) - Code standardization and dependency cleanup (#317)
- Code structure optimization, add
GlobalTypes.tsfor unified type definitions (#316)
v2.4.1 (2025-12-23)
Bug Fixes
- Fix
IntervalSystemtime accumulation bug, interval timing is now more accurate - Fix Cocos Creator compatibility issue, more complete type exports
Documentation
- Add
Core.pausedproperty documentation
v2.4.0 (2025-12-15)
Features
-
EntityHandle: Lightweight entity reference abstraction (#304)
- 28-bit index + 20-bit generation design for efficient reuse of destroyed entity slots
EntityHandleManagermanages handle lifecycle and validity verification- Support handle-to-entity conversion with dangling reference detection
-
SystemScheduler: Declarative system scheduling (#304)
- New
@Stage(name)decorator to specify system execution stage - New
@Before(SystemClass)/@After(SystemClass)decorators to declare dependencies - New
@InSet(setName)decorator to group systems logically - Automatic execution order resolution via topological sort with cycle detection
- New
-
EpochManager: Frame-level change detection mechanism (#304)
- Track component add/modify timestamps (epochs)
- Support querying "components changed since last check"
- Suitable for dirty checking, incremental updates, and other optimization scenarios
-
CompiledQuery: Pre-compiled type-safe queries (#304)
- Compile-time generated optimized query logic, reducing runtime overhead
- Full TypeScript type inference support
- Support
With,Without,Changedand other query condition combinations
-
PluginServiceRegistry: Type-safe plugin service registry (#300)
- Accessible via
Core.pluginServices - Support
ServiceToken<T>pattern for service retrieval
- Accessible via
-
Component Auto-Registration:
@ECSComponentdecorator enhancement (#302)- Decorator now automatically registers to
ComponentRegistry - Resolved
Decorators ↔ ComponentRegistrycircular dependency - New
ComponentTypeUtils.tsas low-level dependency-free module
- Decorator now automatically registers to
API Changes
EntitySystemaddsgetBefore()/getAfter()/getSets()getter methodsEntityaddsmarkDirty()helper method for manual change detection triggeringISceneaddsepochManagerpropertyCommandBuffer.pendingCountcorrected to return actual operation count (not entity count)
Documentation
- Updated system scheduling documentation with declarative dependency configuration
- Updated entity query documentation with compiled query usage
v2.3.2 (2025-12-08)
Features
- WeChat Mini Game Worker Support: Add complete Worker support for WeChat Mini Game platform (#297)
- New
workerScriptPathconfig option for pre-compiled Worker script path - Fix WeChat Mini Game Worker message format difference (
resis data directly, no.datawrapper) - Applicable to WeChat Mini Game and other platforms that don't support dynamic scripts
- New
New Package
- @esengine/worker-generator
v1.0.2: CLI tool to auto-generate Worker files fromWorkerEntitySystemsubclasses- Automatically scan and extract
workerProcessmethod body - Support
--wechatmode, use TypeScript compiler to convert to ES5 syntax - Read
workerScriptPathconfig from code, generate to specified path - Generate
worker-mapping.jsonmapping file
- Automatically scan and extract
Documentation
- Updated Worker system documentation with WeChat Mini Game support section
- Added English Worker system documentation (
docs/en/guide/worker-system.md)
v2.3.1 (2025-12-07)
Bug Fixes
- Type export fix: Fix type export issues in v2.3.0
- Resolve
ServiceTokencross-package type compatibility issues - Fix type references in
editor-appandbehavior-tree-editor
- Resolve
v2.3.0 (2025-12-06) ⚠️ DEPRECATED
Warning
: This version has type export issues. Please upgrade to v2.3.1 or later.
Features
-
Persistent Entity: Add entity cross-scene migration support (#285)
- New
EEntityLifecyclePolicyenum (SceneLocal/Persistent) - Entity adds
setPersistent(),setSceneLocal(),isPersistentAPI - Scene adds
findPersistentEntities(),extractPersistentEntities(),receiveMigratedEntities() SceneManager.setScene()automatically handles persistent entity migration- Use cases: global managers, player characters, cross-scene state persistence
- New
-
CommandBuffer Deferred Command System: Execute entity operations uniformly at end of frame (#281)
- Support deferred add/remove components, destroy entities, set entity active state
- Each system has its own
commandsproperty - Avoid modifying entity list during iteration, preventing iteration issues
- Scene automatically flushes all command buffers after
lateUpdate
Performance
- ReactiveQuery Snapshot Optimization: Optimize entity query iteration performance (#281)
- Add snapshot mechanism to avoid copying arrays every frame
- Only create new snapshots when entity list changes
- Multiple systems share the same snapshot in static scenes
v2.2.21 (2025-12-05)
Bug Fixes
- Iteration safety fix: Fix issue where component changes during
process/lateProcessiteration caused entities to be skipped (#272)- Adding/removing components during system processing no longer causes entities to be unexpectedly skipped
Performance
- HierarchySystem optimization: Optimize hierarchy system to avoid iterating all entities every frame (#279)
- Use dirty entity set instead of iterating all entities
- Static scene
process()optimized from O(n) to O(1) - 1000 entities static scene: 81.79μs → 0.07μs (1168x faster)
- 10000 entities static scene: 939.43μs → 0.56μs (1677x faster)
- Server simulation (100 rooms x 100 entities): 2.7ms → 1.4ms per tick
v2.2.20 (2025-12-04)
Bug Fixes
- System onAdded callback fix: Fix issue where system
onAddedcallback was affected by registration order (#270)- System initialization now triggers
onAddedcallback for existing matching entities - Added
matchesEntity(entity)method to check if an entity matches the system's query condition - Scene added
notifySystemsEntityAdded/Removedmethods to ensure all systems receive entity change notifications
- System initialization now triggers
v2.2.19 (2025-12-03)
Features
-
System stable sorting: Add stable sorting support for systems (#257)
- Added
addOrderproperty for stable sorting whenupdateOrderis the same - Ensures systems with same priority execute in add order
- Added
-
Module configuration: Add
module.jsonconfiguration file (#256)- Define module ID, name, version and other metadata
- Support module dependency declaration and export configuration
v2.2.18 (2025-11-30)
Features
-
Advanced Performance Profiler: Implement new performance analysis SDK (#248)
ProfilerSDK: Unified performance analysis interface- Manual sampling markers (
beginSample/endSample) - Automatic scope measurement (
measure/measureAsync) - Call hierarchy tracking and call graph generation
- Counter and gauge support
- Manual sampling markers (
AdvancedProfilerCollector: Advanced performance data collector- Frame time statistics and history
- Memory snapshots and GC detection
- Long task detection (Long Task API)
- Performance report generation
DebugManager: Debug manager- Unified debug tool entry point
- Profiler integration
-
Property decorator enhancement: Extend
@serializedecorator functionality (#247)- Support more serialization option configurations
Improvements
-
EntitySystem test coverage: Add complete system test cases (#240)
- Cover entity query, cache, lifecycle scenarios
-
Matcher enhancement: Optimize matcher functionality (#240)
- Improved matching logic and performance
v2.2.17 (2025-11-28)
Features
-
ComponentRegistry enhancement: Add new component registry features (#244)
- Support registering and querying component types by name
- Add component mask caching for performance optimization
-
Serialization decorator improvements: Enhance
@serializedecorator (#244)- Support more flexible serialization configuration
- Improved nested object serialization
-
EntitySystem lifecycle: Add new system lifecycle methods (#244)
onSceneStart(): Called when scene startsonSceneStop(): Called when scene stops
v2.2.16 (2025-11-27)
Features
-
Component lifecycle: Add component lifecycle callback support (#237)
onDeserialized(): Called after component is loaded from scene file or snapshot restore, used to restore runtime data
-
ServiceContainer enhancement: Improve service container functionality (#237)
- Support
Symbol.for()pattern for service identifiers - Added
@InjectPropertyproperty injection decorator - Improved service resolution and lifecycle management
- Support
-
SceneSerializer enhancement: New scene serializer features (#237)
- Support serialization of more component types
- Improved deserialization error handling
-
Property decorator extension: Extend
@serializedecorator (#238)- Support
@range,@sliderand other editor hints - Support
@dropdown,@colorand other UI types - Support
@assetresource reference type
- Support
Improvements
- Matcher tests: Add Matcher test cases (#240)
- EntitySystem tests: Add complete entity system test coverage (#240)
Version Notes
- Major version: Breaking changes
- Minor version: New features (backward compatible)
- Patch version: Bug fixes and improvements