Releases: pmndrs/koota
v0.2.3 - Trust
This release fixes some bugs and adds a new method for entities for checking if they are alive.
entity.isAlive() // ture
entity.destroy()
entity.isAlive() // false
What's Changed
- 🐛 core: query all removes destroyed entities by @krispya in #61
- ✨ core: add isAlive method to entity by @krispya in #59
- 🐛 core: query version was not incrementing on remove by @krispya in #60
- ♻️ core: replace entity methods with functions internally by @krispya in #62
Full Changelog: v0.2.1...v0.2.3
v0.2.1 - Lemon Days
This release simply makes Koota compatible to install with React 18 or 19.
What's Changed
Full Changelog: v0.2.0...v0.2.1
v0.2.0 - Words Without Sound
This release includes breaking changes so we are bumping to v0.2.0.
Querying the world with empty parameters now returns all queryable entities.
Previously querying a world with empty parameters (ie world.query()
) would give empty results. But there was two problems, one this doesn't really follow set theory where the empty set is the set of all entities, but also there was no public API for getting all queryable entities. What we mean by queryable entities? Some entities are system level and cannot be queried, but will still show up in world.entities
. This is any entity with the IsExcluded
trait and includes entities that represent the world and any other abstract entity that comes up for future features. This will exclude these entities. Thank you @wrangelvid and @DanAmador for your help here!
world.spawn(Position)
world.entities.length // Is 2 since a system entity is create for world
world.query().length // Is 1 since the system entity is excluded
useQuery
is immutable and more stable
Previously, useQuery
returned a memoized array that was mutated with rerenders being triggered. However, this led to subtle bugs as it broke React's rules about immutable state so we fixed it. useQuery
now returns a new array result each time it rerenders and effects will work as expected. Also, it will not longer rerender twice on first call even if the entities does not change.
What's Changed
- 💥 core: queries with empty params return all queryable entities by @krispya in #45
- 🔧 🐛 Peer dependencies are properly optional, including types by @krispya in #48
- Update README.md by @stephencorwin in #51
- 🐛 react: useQuery was unstable with the same params by @krispya in #52
- Fix relation store get type with get method by @krispya in #56
- Make
useQuery
immutable and more stable by @krispya in #55
New Contributors
- @stephencorwin made their first contribution in #51
- @wrangelvid
Full Changelog: v0.1.12...v0.2.0
v0.1.12 - Cloak and Dagger
Quick bug fix release to fix my oopsie. Last one of the day... I hope!
What's Changed
Full Changelog: v0.1.11...v0.1.12
v0.1.11 - Come Around
The last couple releases revealed some long standing bugs nestled deep inside of core. Tests are now updated to root them out along with fixes. Happy coding everyone.
What's Changed
- 🐛 core: fix entities sometimes not being destroyed properly by @krispya in #41
- 🐛 core: entity get works with multi-generation entities again by @krispya in #42
- 🐛 core: fix updateEach failing when it has a mix of tracked and untracked traits by @krispya in #43
Full Changelog: v0.1.10...v0.1.11
v0.1.10 - Sunday Night in Chicago
This is a quick maintenance release. The dist folders were getting polluted and I thought it might be causing bugs.
What's Changed
Full Changelog: v0.1.9...v0.1.10
v0.1.9 - Spatter/Splatter
The star update for this release is updateEach
will now automatically turn on change detection when a trait is subscribed to with onChange
or tracked with a query using the Changed
modifier. You no longer need to manually configure the loop for useTrait
to work!
What's Changed
- ✨ core: auto change detection for updateEach by @krispya #38
- 🏷️ core: wildcard string typed as
'*'
by @iwoplaza in #34 - 🐛 core:
entity.get
always returnsundefined
for missing trait. by @iwoplaza in #33
Full Changelog: v0.1.8...v0.1.9
v0.1.8 - Lemon Day
Highlights here are updating useTrait
to take undefined
or null
as its target so it can be used conditionally and then various fixes to types and internal edge cases. You'll notice Or
is properly exported now!
What's Changed
- 🐛 core: onChange properly registers traits being tracked by @krispya in #24
- 🐛 core: export Or modifier by @krispya in #26
- ✨ core: entity set can take a callback with previous state passed in by @krispya in #27
- ✨ react: useTrait allows conditional targets by @krispya in #28
- 🏷️ core: fix relation types by @krispya in #29
- fix: Wildcard relation is a valid RelationTarget. by @iwoplaza in #32
New Contributors
Full Changelog: v0.1.7...v0.1.8
v0.1.7 - Satellite Anthem Icarus
A small maintenance release that fixes bugs with useTrait
and action memoization.
What's Changed
- 🐛 react: fix useTrait re-render issue with effects by @Ctrlmonster in #21
- 🐛 core: multiple actions per world work again
Full Changelog: v0.1.6...v0.1.7
v0.1.6 - Lovers Melt
This update includes breaking changes to the React API.
We did some reshuffling to make working with React easier. Less code for more impact, and smarter separate of concerns. The docs and examples have been updated to reflect the changes! Also I am trying to submit all my changes as PRs now so hopefully logs will be more automatic in the future.
What's Changed
- useObserve renamed to useTrait
- useTraitEffect has been added to the React package
- useEntityRef has been removed
- createActions moved to core
- useActions now takes actions returned by createActions, the same pattern as Zustand
- ✨ react: useWorld uses a default world if there is no provider by @krispya in #18
- 📝 update React docs by @krispya in #19
Full Changelog: v0.1.5...v0.1.6