Skip to content

Commit d14b77a

Browse files
committed
upd: Minor changes.
1 parent 28a13c0 commit d14b77a

5 files changed

Lines changed: 6 additions & 506 deletions

File tree

README.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class MovementSystem extends System {
8686
}
8787
public override update(deltaTime: number): void {
8888

89-
for (const [entity, [position]] of this.view!) {
89+
for (const [position] of this.view!.components) {
9090
position.x += 1 * deltaTime;
9191
position.y += 1 * deltaTime;
9292
}
@@ -157,22 +157,6 @@ world.getComponentView(Position, Velocity);
157157

158158
## Roadmap
159159

160-
### 🔴 Critical
161-
162-
Issues that block or compromise production usage.
163-
164-
- [ ] **Minification-safe type identification**
165-
166-
The `QueryManager` currently uses `Type.name` to generate query keys.
167-
In minified builds, class names are reduced to single letters (`a`, `b`, `c`...), causing potential collisions between different queries.
168-
169-
Possible solutions:
170-
- Numeric registry with auto-incrementing ID for each component type
171-
- `Symbol()` associated with each class
172-
- Decorator or static method that assigns a unique identifier
173-
174-
---
175-
176160
### 🟠 Improvements
177161

178162
Optimizations and refinements that improve quality and performance.
@@ -193,12 +177,6 @@ Ideas and possible evolutions to evaluate based on needs.
193177

194178
> ⚠️ Evaluate carefully: could complicate the API and go against the project's "DX-first" philosophy.
195179
196-
- [ ] **Archetypes**
197-
198-
Consider an archetype system to group entities with the same component "signature", optimizing queries.
199-
200-
> ⚠️ In a JavaScript context, the traditional benefits of archetypes (cache locality, contiguous memory) are not exploitable. The cached View system already present in `QueryManager` covers part of these advantages. Actual utility to be evaluated.
201-
202180
---
203181

204182
## License

src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ export { default as World } from "./world.js";
1010
export { EntityContext, WorldContext } from "./contexts/index.js";
1111
export { AttachmentException, DependencyException } from "./exceptions.js";
1212

13-
export { default as QueryManager } from "./query-manager.js";
14-
export { default as QueryView } from "./query-view.js";
13+
export { QueryManager, QueryView } from "./query/index.js";
14+
export type { ReadonlyQueryView } from "./query/view.js";
1515

1616
export type { Instances, Resourceable, SignalEventsMap } from "./types.js";
17-
export type { ReadonlyQueryView } from "./query-view.js";

src/query-manager.ts

Lines changed: 0 additions & 330 deletions
This file was deleted.

0 commit comments

Comments
 (0)