ecspresso 0.19.2 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/ecspresso.d.ts +0 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +5 -5
- package/dist/resource-manager.d.ts +4 -8
- package/dist/system-builder.d.ts +3 -3
- package/package.json +4 -8
|
@@ -135,13 +135,11 @@ export default class ResourceManager<ResourceTypes extends Record<string, any> =
|
|
|
135
135
|
/**
|
|
136
136
|
* Subscribe to changes for a specific resource key.
|
|
137
137
|
*
|
|
138
|
-
* Subscribing marks the resource as "observed." Observed resources
|
|
139
|
-
* -
|
|
140
|
-
*
|
|
141
|
-
* so in-place mutations are detected and subscribers notified
|
|
138
|
+
* Subscribing marks the resource as "observed." Observed resources are
|
|
139
|
+
* shallow-diffed at the end of each frame via `flushObserved()`, so in-place
|
|
140
|
+
* mutations are detected and subscribers notified.
|
|
142
141
|
*
|
|
143
|
-
* When the last subscriber unsubscribes,
|
|
144
|
-
* normal (cached, no per-frame diff).
|
|
142
|
+
* When the last subscriber unsubscribes, per-frame diffing stops.
|
|
145
143
|
*
|
|
146
144
|
* @param key The resource key to watch
|
|
147
145
|
* @param callback Function called with (newValue, oldValue) when the resource changes
|
|
@@ -158,8 +156,6 @@ export default class ResourceManager<ResourceTypes extends Record<string, any> =
|
|
|
158
156
|
notifyChange<K extends keyof ResourceTypes>(key: K, newValue: ResourceTypes[K], oldValue: ResourceTypes[K]): void;
|
|
159
157
|
/**
|
|
160
158
|
* Whether a resource has active change subscribers.
|
|
161
|
-
* Observed resources should not be cached by systems — they need
|
|
162
|
-
* to be re-resolved each frame so external mutations are visible.
|
|
163
159
|
*/
|
|
164
160
|
isObserved<K extends keyof ResourceTypes>(key: K): boolean;
|
|
165
161
|
/**
|
package/dist/system-builder.d.ts
CHANGED
|
@@ -86,8 +86,8 @@ export declare class SystemBuilder<Cfg extends WorldConfig = EmptyConfig, Querie
|
|
|
86
86
|
*/
|
|
87
87
|
runWhenEmpty(): this;
|
|
88
88
|
/**
|
|
89
|
-
* Declare resource dependencies for this system.
|
|
90
|
-
*
|
|
89
|
+
* Declare resource dependencies for this system. Resource values are resolved
|
|
90
|
+
* before each process call, while the containing object is reused every frame.
|
|
91
91
|
* The resolved resources are available as ctx.resources in setProcess.
|
|
92
92
|
* @param keys Array of resource keys to resolve
|
|
93
93
|
* @returns This SystemBuilder instance for method chaining
|
|
@@ -229,7 +229,7 @@ type QueryResults<ComponentTypes extends Record<string, any>, Queries extends Re
|
|
|
229
229
|
* Context object passed to system process functions.
|
|
230
230
|
* Pre-allocated per system and reused every frame (zero per-frame allocation).
|
|
231
231
|
* When resources are declared via withResources(), the context includes a
|
|
232
|
-
* `resources` field
|
|
232
|
+
* `resources` field whose values are refreshed before each process call.
|
|
233
233
|
*/
|
|
234
234
|
export type ProcessContext<Cfg extends WorldConfig, Queries extends Record<string, QueryDefinition<Cfg['components']>>, ResourceKeys extends keyof Cfg['resources'] = never, Singletons extends Record<string, QueryDefinition<Cfg['components']>> = {}> = {
|
|
235
235
|
queries: QueryResults<Cfg['components'], Queries, Singletons>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ecspresso",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -182,15 +182,14 @@
|
|
|
182
182
|
"react": "^19.2.5",
|
|
183
183
|
"react-dom": "^19.2.5",
|
|
184
184
|
"three": "^0.184.0",
|
|
185
|
-
"typedoc": "^0.28.19"
|
|
185
|
+
"typedoc": "^0.28.19",
|
|
186
|
+
"typescript": "^6.0.3"
|
|
186
187
|
},
|
|
187
188
|
"peerDependencies": {
|
|
188
|
-
"typescript": "^6.0.3",
|
|
189
189
|
"pixi.js": "^8.0.0",
|
|
190
190
|
"howler": "^2.2.0",
|
|
191
191
|
"three": "^0.184.0",
|
|
192
|
-
"react": "^19.0.0"
|
|
193
|
-
"react-dom": "^19.0.0"
|
|
192
|
+
"react": "^19.0.0"
|
|
194
193
|
},
|
|
195
194
|
"peerDependenciesMeta": {
|
|
196
195
|
"pixi.js": {
|
|
@@ -204,9 +203,6 @@
|
|
|
204
203
|
},
|
|
205
204
|
"react": {
|
|
206
205
|
"optional": true
|
|
207
|
-
},
|
|
208
|
-
"react-dom": {
|
|
209
|
-
"optional": true
|
|
210
206
|
}
|
|
211
207
|
},
|
|
212
208
|
"files": [
|