Skip to content

Commit

Permalink
Add changelog files for 2d and core
Browse files Browse the repository at this point in the history
  • Loading branch information
suchipi committed Feb 2, 2020
1 parent 11c8a6a commit 5595ce5
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
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)
60 changes: 60 additions & 0 deletions packages/2d/CHANGELOG.md
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
55 changes: 55 additions & 0 deletions packages/core/CHANGELOG.md
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

0 comments on commit 5595ce5

Please sign in to comment.