From 5544fca002e283eacef14600f52670a0f640b7b7 Mon Sep 17 00:00:00 2001 From: yhh <359807859@qq.com> Date: Thu, 25 Dec 2025 20:42:15 +0800 Subject: [PATCH] docs: update changelog for v2.4.2 --- docs/changelog.md | 30 ++++++++++++++++++++++++++++++ docs/en/changelog.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 7cc10f7b..eb1ae4fd 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -4,6 +4,36 @@ --- +## v2.4.2 (2025-12-25) + +### Features + +- **IncrementalSerializer 实体过滤**: 增量序列化支持 `entityFilter` 选项 (#335) + - 创建快照时可按条件过滤实体 + - 支持按标签、组件类型等自定义过滤逻辑 + - 适用于只同步部分实体的场景(如只同步玩家) + +```typescript +// 只快照玩家实体 +const snapshot = IncrementalSerializer.createSnapshot(scene, { + entityFilter: (entity) => entity.tag === PLAYER_TAG +}); + +// 只快照有特定组件的实体 +const snapshot = IncrementalSerializer.createSnapshot(scene, { + entityFilter: (entity) => entity.hasComponent(PlayerMarker) +}); +``` + +### Refactor + +- 优化 `PlatformWorkerPool` 代码规范,提取为独立模块 (#335) +- 优化 `WorkerEntitySystem` 实现,改进代码结构 (#334) +- 代码规范化与依赖清理 (#317) +- 代码结构优化,添加 `GlobalTypes.ts` 统一类型定义 (#316) + +--- + ## v2.4.1 (2025-12-23) ### Bug Fixes diff --git a/docs/en/changelog.md b/docs/en/changelog.md index 1300087b..56d5079f 100644 --- a/docs/en/changelog.md +++ b/docs/en/changelog.md @@ -4,6 +4,36 @@ This document records the version update history of the `@esengine/ecs-framework --- +## v2.4.2 (2025-12-25) + +### Features + +- **IncrementalSerializer Entity Filter**: Incremental serialization supports `entityFilter` option (#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) + +```typescript +// 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 `PlatformWorkerPool` code style, extract as standalone module (#335) +- Optimize `WorkerEntitySystem` implementation, improve code structure (#334) +- Code standardization and dependency cleanup (#317) +- Code structure optimization, add `GlobalTypes.ts` for unified type definitions (#316) + +--- + ## v2.4.1 (2025-12-23) ### Bug Fixes