-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
119 additions
and
0 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,4 @@ | ||
See the following package-specific changelogs: | ||
|
||
- [`@hex-engine/core`](packages/core/CHANGELOG.md) | ||
- [`@hex-engine/2d`](packages/2d/CHANGELOG.md) |
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,60 @@ | ||
# Changelog | ||
|
||
# 0.3.0 | ||
|
||
## Upgraded `@hex-engine/core` to 0.3.0 (breaking change) | ||
|
||
- `useIsEnabled` has been removed; use `useEnableDisable().isEnabled` instead | ||
- `StateAccumulator` APIs (`useStateAccumulator`, `useListenerAccumulator`, `Component.stateAccumulator`, `Entity.stateAccumulator`) have been removed. Persist state in components instead: | ||
|
||
```ts | ||
// Before | ||
const FRUITS = Symbol("FRUITS"); | ||
|
||
function MyComponent() { | ||
// To persist state per-MyComponent: | ||
const fruits = useStateAccumulator<string>(FRUITS); | ||
// Or, to persist state per-entity: | ||
const fruits = useEntity().stateAccumulator<string>(FRUITS); | ||
// Or, to persist state in the root entity: | ||
const fruits = useRootEntity().stateAccumulator<string>(FRUITS); | ||
|
||
// Do something with fruits | ||
} | ||
|
||
// After | ||
function FruitStorage() { | ||
useType(FruitStorage); | ||
|
||
return { | ||
fruits: new Set<string>(); | ||
} | ||
} | ||
|
||
function MyComponent() { | ||
// To persist state per-MyComponent: | ||
const {fruits} = useNewComponent(FruitStorage); | ||
// Or, to persist state per-entity: | ||
const {fruits} = useEntity().getComponent(FruitStorage) || useNewComponent(FruitStorage); | ||
// Or, to persist state in the root entity: | ||
const {fruits} = useRootEntity().getComponent(FruitStorage) || useNewRootComponent(FruitStorage); | ||
|
||
// Do something with fruits | ||
} | ||
``` | ||
|
||
## Implicit `Physics.Engine` | ||
|
||
If you try to use a `Physics.Body` without having a `Physics.Engine` on the root component, it used to throw an error asking you to add one to the root component. Now, it will instead create one for you (with default settings). If you create your own `Physics.Engine` on the root component, then the behaviour is the same as it was prior to 0.3.0. | ||
|
||
# 0.2.0 | ||
|
||
## `Vector`, `Angle`, and `Point` changes (breaking change) | ||
|
||
- `Vector` and `Angle` have been removed; their methods and properties have been moved into `Point`. | ||
- `Point` has been renamed to `Vector`. | ||
- All places where `Angle` instances were present before, now bare numbers are used. For instance, `Geometry`'s `rotation` property used to be an `Angle`, but now it's a `number`. | ||
|
||
# 0.1.0 | ||
|
||
Not documented |
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,55 @@ | ||
# Changelog | ||
|
||
# 0.3.0 | ||
|
||
## `useIsEnabled` removed | ||
|
||
Use `useEnableDisable().isEnabled` instead. | ||
|
||
## `StateAccumulator` APIs removed | ||
|
||
`useStateAccumulator`, `useListenerAccumulator`, `Component.stateAccumulator`, and `Entity.stateAccumulator` have been removed. Persist state in components instead: | ||
|
||
```ts | ||
// Before | ||
const FRUITS = Symbol("FRUITS"); | ||
|
||
function MyComponent() { | ||
// To persist state per-MyComponent: | ||
const fruits = useStateAccumulator<string>(FRUITS); | ||
// Or, to persist state per-entity: | ||
const fruits = useEntity().stateAccumulator<string>(FRUITS); | ||
// Or, to persist state in the root entity: | ||
const fruits = useRootEntity().stateAccumulator<string>(FRUITS); | ||
|
||
// Do something with fruits | ||
} | ||
|
||
// After | ||
function FruitStorage() { | ||
useType(FruitStorage); | ||
|
||
return { | ||
fruits: new Set<string>(); | ||
} | ||
} | ||
|
||
function MyComponent() { | ||
// To persist state per-MyComponent: | ||
const {fruits} = useNewComponent(FruitStorage); | ||
// Or, to persist state per-entity: | ||
const {fruits} = useEntity().getComponent(FruitStorage) || useNewComponent(FruitStorage); | ||
// Or, to persist state in the root entity: | ||
const {fruits} = useRootEntity().getComponent(FruitStorage) || useNewRootComponent(FruitStorage); | ||
|
||
// Do something with fruits | ||
} | ||
``` | ||
|
||
## Implicit `RunLoop` | ||
|
||
Previously, if you tried to use `useFrame` without a `RunLoop` present on the root component, an error would be thrown. Now, a `RunLoop` will be created for you. If there is already a `RunLoop` present when you call `useFrame`, it won't create another one. | ||
|
||
# 0.1.0 | ||
|
||
Not documented |