-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: minor api changes, perf refactors
- Loading branch information
1 parent
12259b3
commit 68cb2b8
Showing
13 changed files
with
358 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@arancini/react": minor | ||
--- | ||
|
||
feat: throw meaningful errors when using hooks and components outside of required contexts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
"@arancini/core": minor | ||
"arancini": minor | ||
--- | ||
|
||
feat: remove world.id and world.entity | ||
|
||
Computing ids based on object identity is easy to do in userland if required. See below: | ||
|
||
```ts | ||
let entityIdCounter = 0 | ||
const entityToId = new Map<E, number>() | ||
const idToEntity = new Map<number, E>() | ||
|
||
const getEntityId = (entity: E) => { | ||
let id = entityToId.get(entity) | ||
|
||
if (id === undefined) { | ||
id = entityIdCounter++ | ||
entityToId.set(entity, id) | ||
} | ||
|
||
return id | ||
} | ||
|
||
const getEntityById = (id: number) => idToEntity.get(id) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@arancini/core": minor | ||
"arancini": minor | ||
--- | ||
|
||
feat: remove query.destroy(), use world.destroyQuery instead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@arancini/core": patch | ||
"arancini": patch | ||
--- | ||
|
||
feat: normalize 'not' conditions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@arancini/core": patch | ||
"arancini": patch | ||
--- | ||
|
||
fix: return correct type from world.create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@arancini/core": patch | ||
"arancini": patch | ||
--- | ||
|
||
feat: minor refactors for iteration performance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@arancini/react": patch | ||
--- | ||
|
||
feat: improve performance by removing a state update and rerender when initially adding components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.