You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Single-threaded worlds use the same executor as multithreaded worlds. As a
result, they will respect passed dependencies. Unfortunately, they now
require Atomics.waitAsync - this will be resolved in a future release.
Components can no longer be used as Resources (i.e., class MyResource extends Component({ ... }) {} no longer works as
expected). The Resource() function is now provided to serve this purpose. Resource() is nearly identical to Component(), but requires a schema.
EntityManager has been replaced with WorldCommands - see below for
details. Systems using P.Entities() must be updated to P.Commands() and
the new Commands API.
The Thread class is no longer exposed (not intended for consumer use). To
access the Send and Receive symbols, you can instead import { ThreadProtocol } from 'thyseus'.
✨ Features
New Commands API!
Commands can be accessed on any thread, and is disjoint with all other
parameters - including itself.
Commands functionally queues modifications to entities - updates to
queries occurs in a system that intersects with all other systems. If
you need systems to run after entity modification, you can import { applyCommands } from 'thyseus' and specify it as a
dependency. Be aware that for multithreaded worlds, doing so will create
a hard sync point. Last, WorldBuilders always add the applyCommands
system - you don't need to add it yourself.
New minimal plugin API!
Plugins are just functions that accept a WorldBuilder instance. They can
add systems to the world just as normal, and are useful for creating
shared groups of systems that may depend on eachother.
Add plugins to a world with the addPlugin method.
The definePlugin function is provided for type help.
New World system parameter.
This provides direct access to the World and all of its data. It
intersects with all other system parameters (creating a sync point for
multithreaded worlds). Systems that access World always run on the
main thread, and can therefore access main-thread-only resources if
needed.
New methods for WorldBuilder, and some previously internal properties on World and WorldBuilder are exposed thru getters! Most of these are
designed for internal use, but could be useful for advanced use cases.
As a result of this and other refactors, user-defined system parameter
descriptors are now possible. This is a more advanced pattern, and more
documentation around this will be available in the future.
🔧 Maintenance
Improved annotations on classes/methods.
Cleaned up type names - Component Classes are now ComponentType, Resource
Classes are now ResourceType.