Sync to upstream Jecs 0.6.0 #11
6 changed files with 554 additions and 384 deletions
1
.luaurc
1
.luaurc
|
@ -4,6 +4,7 @@
|
||||||
"testkit": "tools/testkit",
|
"testkit": "tools/testkit",
|
||||||
"mirror": "mirror",
|
"mirror": "mirror",
|
||||||
"tools": "tools",
|
"tools": "tools",
|
||||||
|
"addons": "addons"
|
||||||
},
|
},
|
||||||
"languageMode": "strict"
|
"languageMode": "strict"
|
||||||
}
|
}
|
||||||
|
|
63
CHANGELOG.md
63
CHANGELOG.md
|
@ -10,30 +10,53 @@ The format is based on [Keep a Changelog][kac], and this project adheres to
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.6.0] - 2025-05-10
|
||||||
|
|
||||||
- `[world]`:
|
- `[world]`:
|
||||||
- 16% faster `world:get`
|
- Added `world:range` to restrict entity range
|
||||||
- `world:has` no longer typechecks components after the 8th one.
|
- Changed `world:entity` to accept the overload to create an entity at the desired id
|
||||||
- `[typescript]`
|
- Changed `world:clear` to also look through the component record for the cleared `ID`
|
||||||
|
- Removes the cleared ID from every entity that has it
|
||||||
|
- Changed entity ID layouts by putting the index in the lower bits, which should make every world function 1-5 nanoseconds faster
|
||||||
|
- Fixed `world:delete` not removing every pair with an unalive target
|
||||||
|
- Specifically happened when you had at least two pairs of different relations with multiple targets each
|
||||||
|
- `[hooks]`:
|
||||||
|
- Replaced `OnSet` with `OnChange`
|
||||||
|
- The former was used to detect emplace/move actions. Now the behaviour for `OnChange` is that it will run only when the value has changed
|
||||||
|
- Changed `OnAdd` to specifically run after the data has been set for non-zero-sized components. Also returns the value that the component was set to
|
||||||
|
- This should allow a more lenient window for modifying data
|
||||||
|
- Changed `OnRemove` to lazily lookup which archetype the entity will move to
|
||||||
|
- Can now have interior structural changes within `OnRemove` hooks
|
||||||
|
- Optimized `world:has` for both single component and multiple component presence.
|
||||||
|
- This comes at the cost that it cannot check the component presence for more than 4 components at a time. If this is important, consider calling to this function multiple times.
|
||||||
|
|
||||||
- Fixed Entity type to default to `undefined | unknown` instead of just `undefined`
|
## [0.5.0] - 2024-12-26
|
||||||
|
|
||||||
|
- `[world]`:
|
||||||
|
- Fixed `world:target` not giving adjacent pairs
|
||||||
|
- Added `world:each` to find entities with a specific Tag
|
||||||
|
- Added `world:children` to find children of entity
|
||||||
- `[query]`:
|
- `[query]`:
|
||||||
- Fixed bug where `world:clear` did not invoke `jecs.OnRemove` hooks
|
- Added `query:cached`
|
||||||
- Changed `query.__iter` to drain on iteration
|
- Adds query cache that updates itself when an archetype matching the query gets created or deleted.
|
||||||
- It will initialize once wherever you left iteration off at last time
|
- `[luau]`:
|
||||||
- Changed `query:iter` to restart the iterator
|
- Changed how entities' types are inferred with user-defined type functions
|
||||||
- Removed `query:drain` and `query:next`
|
- Changed `Pair<First, Second>` to return `Second` if `First` is a `Tag`; otherwise, returns `First`.
|
||||||
- If you want to get individual results outside of a for-loop, you need to call `query:iter` to initialize the iterator and then call the iterator function manually
|
|
||||||
```lua
|
## [0.4.0] - 2024-11-17
|
||||||
local it = world:query(A, B, C):iter()
|
|
||||||
local entity, a, b, c = it()
|
- `[world]`:
|
||||||
entity, a, b, c = it() -- get next results
|
- Added recycling to `world:entity`
|
||||||
```
|
- If you see much larger entity ids, that is because its generation has been incremented
|
||||||
- `[world`
|
- `[query]`:
|
||||||
- Fixed a bug with `world:clear` not invoking `jecs.OnRemove` hooks
|
- Removed `query:drain`
|
||||||
- `[typescript]`:
|
- The default behaviour is simply to drain the iterator
|
||||||
- Changed pair to accept generics
|
- Removed `query:next`
|
||||||
- Improved handling of Tags
|
- Just call the iterator function returned by `query:iter` directly if you want to get the next results
|
||||||
|
- Removed `query:replace`
|
||||||
|
- `[luau]`:
|
||||||
|
- Fixed `query:archetypes` not taking `self`
|
||||||
|
- Changed so that the `jecs.Pair` type now returns the first element's type so you won't need to typecast anymore.
|
||||||
|
|
||||||
## [0.3.2] - 2024-10-01
|
## [0.3.2] - 2024-10-01
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ includes = [
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "marked/jecs"
|
name = "marked/jecs"
|
||||||
repository = "https://git.devmarked.win/marked/jecs-pesde"
|
repository = "https://git.devmarked.win/marked/jecs-pesde"
|
||||||
version = "0.6.0-rc.1"
|
version = "0.6.0"
|
||||||
|
|
||||||
[indices]
|
[indices]
|
||||||
default = "https://github.com/pesde-pkg/index"
|
default = "https://github.com/pesde-pkg/index"
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
format = 1
|
format = 1
|
||||||
name = "marked/jecs"
|
name = "marked/jecs"
|
||||||
version = "0.6.0-rc.1"
|
version = "0.6.0"
|
||||||
target = "luau"
|
target = "luau"
|
||||||
|
|
|
@ -11,7 +11,7 @@ includes = [
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "marked/jecs"
|
name = "marked/jecs"
|
||||||
repository = "https://git.devmarked.win/marked/jecs-pesde"
|
repository = "https://git.devmarked.win/marked/jecs-pesde"
|
||||||
version = "0.6.0-rc.1"
|
version = "0.6.0"
|
||||||
|
|
||||||
[indices]
|
[indices]
|
||||||
default = "https://github.com/pesde-pkg/index"
|
default = "https://github.com/pesde-pkg/index"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue