Skip to content

Commit

Permalink
Version Packages (next) (#1419)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Sep 7, 2023
1 parent 18d3aea commit c0aba56
Show file tree
Hide file tree
Showing 58 changed files with 419 additions and 34 deletions.
3 changes: 3 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"fluffy-moles-march",
"four-coats-pull",
"funny-paws-admire",
"fuzzy-cars-stare",
"giant-masks-carry",
"great-cooks-dream",
"grumpy-geckos-raise",
Expand All @@ -64,6 +65,7 @@
"late-spies-cover",
"lazy-ladybugs-return",
"little-ravens-yawn",
"long-lizards-admire",
"many-phones-study",
"mean-pans-study",
"metal-cats-double",
Expand All @@ -88,6 +90,7 @@
"seven-flies-chew",
"sharp-worms-kneel",
"short-ads-jog",
"silver-mangos-thank",
"six-cats-agree",
"smooth-elephants-wave",
"smooth-pots-nail",
Expand Down
84 changes: 84 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,87 @@
# Version 2.0.0-next.7

## Major changes

**[feat(store,world): more granularity for onchain hooks (#1399)](https://github.com/latticexyz/mud/commit/c4d5eb4e4e4737112b981a795a9c347e3578cb15)** (@latticexyz/store, @latticexyz/world)

- The `onSetRecord` hook is split into `onBeforeSetRecord` and `onAfterSetRecord` and the `onDeleteRecord` hook is split into `onBeforeDeleteRecord` and `onAfterDeleteRecord`.
The purpose of this change is to allow more fine-grained control over the point in the lifecycle at which hooks are executed.

The previous hooks were executed before modifying data, so they can be replaced with the respective `onBefore` hooks.

```diff
- function onSetRecord(
+ function onBeforeSetRecord(
bytes32 table,
bytes32[] memory key,
bytes memory data,
Schema valueSchema
) public;

- function onDeleteRecord(
+ function onBeforeDeleteRecord(
bytes32 table,
bytes32[] memory key,
Schema valueSchema
) public;
```

- It is now possible to specify which methods of a hook contract should be called when registering a hook. The purpose of this change is to save gas by avoiding to call no-op hook methods.

```diff
function registerStoreHook(
bytes32 tableId,
- IStoreHook hookAddress
+ IStoreHook hookAddress,
+ uint8 enabledHooksBitmap
) public;

function registerSystemHook(
bytes32 systemId,
- ISystemHook hookAddress
+ ISystemHook hookAddress,
+ uint8 enabledHooksBitmap
) public;
```

There are `StoreHookLib` and `SystemHookLib` with helper functions to encode the bitmap of enabled hooks.

```solidity
import { StoreHookLib } from "@latticexyz/store/src/StoreHook.sol";

uint8 storeHookBitmap = StoreBookLib.encodeBitmap({
onBeforeSetRecord: true,
onAfterSetRecord: true,
onBeforeSetField: true,
onAfterSetField: true,
onBeforeDeleteRecord: true,
onAfterDeleteRecord: true
});
```

```solidity
import { SystemHookLib } from "@latticexyz/world/src/SystemHook.sol";

uint8 systemHookBitmap = SystemHookLib.encodeBitmap({
onBeforeCallSystem: true,
onAfterCallSystem: true
});
```

- The `onSetRecord` hook call for `emitEphemeralRecord` has been removed to save gas and to more clearly distinguish ephemeral tables as offchain tables.

## Patch changes

**[fix(abi-ts): remove cwd join (#1418)](https://github.com/latticexyz/mud/commit/2459e15fc9bf49fff2d769b9efba07b99635f2cc)** (@latticexyz/abi-ts)

Let `glob` handle resolving the glob against the current working directory.

**[feat(world): allow callFrom from own address without explicit delegation (#1407)](https://github.com/latticexyz/mud/commit/18d3aea55b1d7f4b442c21343795c299a56fc481)** (@latticexyz/world)

Allow `callFrom` with the own address as `delegator` without requiring an explicit delegation

---

# Version 2.0.0-next.6

## Major changes
Expand Down
6 changes: 6 additions & 0 deletions packages/abi-ts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @latticexyz/abi-ts

## 2.0.0-next.7

### Patch Changes

- [#1418](https://github.com/latticexyz/mud/pull/1418) [`2459e15f`](https://github.com/latticexyz/mud/commit/2459e15fc9bf49fff2d769b9efba07b99635f2cc) Thanks [@holic](https://github.com/holic)! - Let `glob` handle resolving the glob against the current working directory.

## 2.0.0-next.6

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/abi-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/abi-ts",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"description": "Create TypeScript type declaration files (`.d.ts`) for your ABI JSON files.",
"repository": {
"type": "git",
Expand Down
9 changes: 9 additions & 0 deletions packages/block-logs-stream/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @latticexyz/block-logs-stream

## 2.0.0-next.7

### Patch Changes

- Updated dependencies []:
- @latticexyz/common@2.0.0-next.7
- @latticexyz/config@2.0.0-next.7
- @latticexyz/schema-type@2.0.0-next.7

## 2.0.0-next.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/block-logs-stream/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/block-logs-stream",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"description": "Create a stream of EVM block logs for events",
"repository": {
"type": "git",
Expand Down
16 changes: 16 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Change Log

## 2.0.0-next.7

### Patch Changes

- Updated dependencies [[`c4d5eb4e`](https://github.com/latticexyz/mud/commit/c4d5eb4e4e4737112b981a795a9c347e3578cb15), [`2459e15f`](https://github.com/latticexyz/mud/commit/2459e15fc9bf49fff2d769b9efba07b99635f2cc), [`18d3aea5`](https://github.com/latticexyz/mud/commit/18d3aea55b1d7f4b442c21343795c299a56fc481)]:
- @latticexyz/store@2.0.0-next.7
- @latticexyz/world@2.0.0-next.7
- @latticexyz/abi-ts@2.0.0-next.7
- @latticexyz/common@2.0.0-next.7
- @latticexyz/config@2.0.0-next.7
- @latticexyz/gas-report@2.0.0-next.7
- @latticexyz/protocol-parser@2.0.0-next.7
- @latticexyz/schema-type@2.0.0-next.7
- @latticexyz/services@2.0.0-next.7
- @latticexyz/utils@2.0.0-next.7

## 2.0.0-next.6

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/cli",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"description": "Command line interface for mud",
"repository": {
"type": "git",
Expand Down
7 changes: 7 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 2.0.0-next.7

### Patch Changes

- Updated dependencies []:
- @latticexyz/schema-type@2.0.0-next.7

## 2.0.0-next.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/common",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"description": "Common low level logic shared between packages",
"repository": {
"type": "git",
Expand Down
8 changes: 8 additions & 0 deletions packages/config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 2.0.0-next.7

### Patch Changes

- Updated dependencies []:
- @latticexyz/common@2.0.0-next.7
- @latticexyz/schema-type@2.0.0-next.7

## 2.0.0-next.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/config",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"description": "Config for Store and World",
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions packages/create-mud/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

## 2.0.0-next.7

## 2.0.0-next.6

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/create-mud/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-mud",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"description": "Create a new MUD project",
"license": "MIT",
"author": "Lattice <[email protected]>",
Expand Down
13 changes: 13 additions & 0 deletions packages/dev-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @latticexyz/dev-tools

## 2.0.0-next.7

### Patch Changes

- Updated dependencies [[`c4d5eb4e`](https://github.com/latticexyz/mud/commit/c4d5eb4e4e4737112b981a795a9c347e3578cb15), [`18d3aea5`](https://github.com/latticexyz/mud/commit/18d3aea55b1d7f4b442c21343795c299a56fc481)]:
- @latticexyz/store@2.0.0-next.7
- @latticexyz/world@2.0.0-next.7
- @latticexyz/react@2.0.0-next.7
- @latticexyz/store-sync@2.0.0-next.7
- @latticexyz/common@2.0.0-next.7
- @latticexyz/recs@2.0.0-next.7
- @latticexyz/utils@2.0.0-next.7

## 2.0.0-next.6

### Patch Changes
Expand Down
14 changes: 7 additions & 7 deletions packages/dev-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/dev-tools",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"description": "MUD developer tools",
"repository": {
"type": "git",
Expand Down Expand Up @@ -51,12 +51,12 @@
"vitest": "0.31.4"
},
"peerDependencies": {
"@latticexyz/common": "2.0.0-next.6",
"@latticexyz/recs": "2.0.0-next.6",
"@latticexyz/store": "2.0.0-next.6",
"@latticexyz/store-sync": "2.0.0-next.6",
"@latticexyz/utils": "2.0.0-next.6",
"@latticexyz/world": "2.0.0-next.6"
"@latticexyz/common": "2.0.0-next.7",
"@latticexyz/recs": "2.0.0-next.7",
"@latticexyz/store": "2.0.0-next.7",
"@latticexyz/store-sync": "2.0.0-next.7",
"@latticexyz/utils": "2.0.0-next.7",
"@latticexyz/world": "2.0.0-next.7"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 2 additions & 0 deletions packages/ecs-browser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @latticexyz/ecs-browser

## 2.0.0-next.7

## 2.0.0-next.6

## 2.0.0-next.5
Expand Down
2 changes: 1 addition & 1 deletion packages/ecs-browser/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@latticexyz/ecs-browser",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"private": true
}
2 changes: 2 additions & 0 deletions packages/gas-report/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

## 2.0.0-next.7

## 2.0.0-next.6

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/gas-report/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/gas-report",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"description": "Gas reporter for specific lines within forge tests",
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions packages/network/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @latticexyz/network

## 2.0.0-next.7

## 2.0.0-next.6

## 2.0.0-next.5
Expand Down
2 changes: 1 addition & 1 deletion packages/network/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@latticexyz/network",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"private": true
}
2 changes: 2 additions & 0 deletions packages/noise/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

## 2.0.0-next.7

## 2.0.0-next.6

## 2.0.0-next.5
Expand Down
2 changes: 1 addition & 1 deletion packages/noise/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/noise",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"license": "MIT",
"type": "module",
"exports": {
Expand Down
7 changes: 7 additions & 0 deletions packages/phaserx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 2.0.0-next.7

### Patch Changes

- Updated dependencies []:
- @latticexyz/utils@2.0.0-next.7

## 2.0.0-next.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/phaserx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/phaserx",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"repository": {
"type": "git",
"url": "https://github.com/latticexyz/mud.git",
Expand Down
8 changes: 8 additions & 0 deletions packages/protocol-parser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @latticexyz/protocol-parser

## 2.0.0-next.7

### Patch Changes

- Updated dependencies []:
- @latticexyz/common@2.0.0-next.7
- @latticexyz/schema-type@2.0.0-next.7

## 2.0.0-next.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/protocol-parser",
"version": "2.0.0-next.6",
"version": "2.0.0-next.7",
"description": "Parser utilities for the MUD protocol",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit c0aba56

Please sign in to comment.