Skip to content

Commit

Permalink
Version Packages (next)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 14, 2023
1 parent 4e0200f commit cecbdd6
Show file tree
Hide file tree
Showing 59 changed files with 474 additions and 34 deletions.
4 changes: 4 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"fuzzy-cars-stare",
"giant-masks-carry",
"great-cooks-dream",
"grumpy-files-heal",
"grumpy-geckos-raise",
"itchy-kids-relax",
"itchy-shoes-appear",
Expand Down Expand Up @@ -86,6 +87,7 @@
"pink-tips-give",
"pretty-hotels-drop",
"quick-numbers-flash",
"quiet-dancers-prove",
"quiet-squids-share",
"rare-planes-draw",
"rare-trainers-fry",
Expand All @@ -107,8 +109,10 @@
"strange-candles-shout",
"strange-ducks-float",
"strong-geckos-shake",
"strong-months-push",
"tame-lemons-play",
"thin-buses-reply",
"tricky-beds-kiss",
"tricky-carrots-talk",
"tricky-comics-remain",
"tricky-frogs-beam",
Expand Down
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
## Version 2.0.0-next.9

### Major changes

**[feat: replace Schema with FieldLayout for contract internals (#1336)](https://github.com/latticexyz/mud/commit/de151fec07b63a6022483c1ad133c556dd44992e)** (@latticexyz/cli, @latticexyz/protocol-parser, @latticexyz/store, @latticexyz/world)

- Add `FieldLayout`, which is a `bytes32` user-type similar to `Schema`.

Both `FieldLayout` and `Schema` have the same kind of data in the first 4 bytes.

- 2 bytes for total length of all static fields
- 1 byte for number of static size fields
- 1 byte for number of dynamic size fields

But whereas `Schema` has `SchemaType` enum in each of the other 28 bytes, `FieldLayout` has static byte lengths in each of the other 28 bytes.

- Replace `Schema valueSchema` with `FieldLayout fieldLayout` in Store and World contracts.

`FieldLayout` is more gas-efficient because it already has lengths, and `Schema` has types which need to be converted to lengths.

- Add `getFieldLayout` to `IStore` interface.

There is no `FieldLayout` for keys, only for values, because key byte lengths aren't usually relevant on-chain. You can still use `getKeySchema` if you need key types.

- Add `fieldLayoutToHex` utility to `protocol-parser` package.

- Add `constants.sol` for constants shared between `FieldLayout`, `Schema` and `PackedCounter`.

**[feat(world,store): add initialize method, initialize core tables in core module (#1472)](https://github.com/latticexyz/mud/commit/c049c23f48b93ac7881fb1a5a8417831611d5cbf)** (@latticexyz/store)

- `StoreCore`'s `initialize` function is split into `initialize` (to set the `StoreSwitch`'s `storeAddress`) and `registerCoreTables` (to register the `Tables` and `StoreHooks` tables).
The purpose of this is to give consumers more granular control over the setup flow.

- The `StoreRead` contract no longer calls `StoreCore.initialize` in its constructor.
`StoreCore` consumers are expected to call `StoreCore.initialize` and `StoreCore.registerCoreTable` in their own setup logic.

### Minor changes

**[feat(world,store): add initialize method, initialize core tables in core module (#1472)](https://github.com/latticexyz/mud/commit/c049c23f48b93ac7881fb1a5a8417831611d5cbf)** (@latticexyz/cli, @latticexyz/world)

- The `World` contract now has an `initialize` function, which can be called once by the creator of the World to install the core module.
This change allows the registration of all core tables to happen in the `CoreModule`, so no table metadata has to be included in the `World`'s bytecode.

```solidity
interface IBaseWorld {
function initialize(IModule coreModule) public;
}
```

- The `World` contract now stores the original creator of the `World` in an immutable state variable.
It is used internally to only allow the original creator to initialize the `World` in a separate transaction.

```solidity
interface IBaseWorld {
function creator() external view returns (address);
}
```

- The deploy script is updated to use the `World`'s `initialize` function to install the `CoreModule` instead of `registerRootModule` as before.

### Patch changes

**[fix(world): register Delegations table in CoreModule (#1452)](https://github.com/latticexyz/mud/commit/f1cd43bf9264d5a23a3edf2a1ea4212361a72203)** (@latticexyz/world)

Register `Delegations` table in the `CoreModule`

---

## Version 2.0.0-next.8

### Major changes
Expand Down
68 changes: 68 additions & 0 deletions docs/pages/changelog.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
## Version 2.0.0-next.9

### Major changes

**[feat: replace Schema with FieldLayout for contract internals (#1336)](https://github.com/latticexyz/mud/commit/de151fec07b63a6022483c1ad133c556dd44992e)** (@latticexyz/cli, @latticexyz/protocol-parser, @latticexyz/store, @latticexyz/world)

- Add `FieldLayout`, which is a `bytes32` user-type similar to `Schema`.

Both `FieldLayout` and `Schema` have the same kind of data in the first 4 bytes.

- 2 bytes for total length of all static fields
- 1 byte for number of static size fields
- 1 byte for number of dynamic size fields

But whereas `Schema` has `SchemaType` enum in each of the other 28 bytes, `FieldLayout` has static byte lengths in each of the other 28 bytes.

- Replace `Schema valueSchema` with `FieldLayout fieldLayout` in Store and World contracts.

`FieldLayout` is more gas-efficient because it already has lengths, and `Schema` has types which need to be converted to lengths.

- Add `getFieldLayout` to `IStore` interface.

There is no `FieldLayout` for keys, only for values, because key byte lengths aren't usually relevant on-chain. You can still use `getKeySchema` if you need key types.

- Add `fieldLayoutToHex` utility to `protocol-parser` package.

- Add `constants.sol` for constants shared between `FieldLayout`, `Schema` and `PackedCounter`.

**[feat(world,store): add initialize method, initialize core tables in core module (#1472)](https://github.com/latticexyz/mud/commit/c049c23f48b93ac7881fb1a5a8417831611d5cbf)** (@latticexyz/store)

- `StoreCore`'s `initialize` function is split into `initialize` (to set the `StoreSwitch`'s `storeAddress`) and `registerCoreTables` (to register the `Tables` and `StoreHooks` tables).
The purpose of this is to give consumers more granular control over the setup flow.

- The `StoreRead` contract no longer calls `StoreCore.initialize` in its constructor.
`StoreCore` consumers are expected to call `StoreCore.initialize` and `StoreCore.registerCoreTable` in their own setup logic.

### Minor changes

**[feat(world,store): add initialize method, initialize core tables in core module (#1472)](https://github.com/latticexyz/mud/commit/c049c23f48b93ac7881fb1a5a8417831611d5cbf)** (@latticexyz/cli, @latticexyz/world)

- The `World` contract now has an `initialize` function, which can be called once by the creator of the World to install the core module.
This change allows the registration of all core tables to happen in the `CoreModule`, so no table metadata has to be included in the `World`'s bytecode.

```solidity
interface IBaseWorld {
function initialize(IModule coreModule) public;
}
```

- The `World` contract now stores the original creator of the `World` in an immutable state variable.
It is used internally to only allow the original creator to initialize the `World` in a separate transaction.

```solidity
interface IBaseWorld {
function creator() external view returns (address);
}
```

- The deploy script is updated to use the `World`'s `initialize` function to install the `CoreModule` instead of `registerRootModule` as before.

### Patch changes

**[fix(world): register Delegations table in CoreModule (#1452)](https://github.com/latticexyz/mud/commit/f1cd43bf9264d5a23a3edf2a1ea4212361a72203)** (@latticexyz/world)

Register `Delegations` table in the `CoreModule`

---

## Version 2.0.0-next.8

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

## 2.0.0-next.9

## 2.0.0-next.8

## 2.0.0-next.7
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.8",
"version": "2.0.0-next.9",
"description": "Create TypeScript type declaration files (`.d.ts`) for your ABI JSON files.",
"repository": {
"type": "git",
Expand Down
7 changes: 7 additions & 0 deletions packages/block-logs-stream/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @latticexyz/block-logs-stream

## 2.0.0-next.9

### Patch Changes

- Updated dependencies []:
- @latticexyz/common@2.0.0-next.9

## 2.0.0-next.8

### 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.8",
"version": "2.0.0-next.9",
"description": "Create a stream of EVM block logs for events",
"repository": {
"type": "git",
Expand Down
60 changes: 60 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
# Change Log

## 2.0.0-next.9

### Major Changes

- [#1336](https://github.com/latticexyz/mud/pull/1336) [`de151fec`](https://github.com/latticexyz/mud/commit/de151fec07b63a6022483c1ad133c556dd44992e) Thanks [@dk1a](https://github.com/dk1a)! - - Add `FieldLayout`, which is a `bytes32` user-type similar to `Schema`.

Both `FieldLayout` and `Schema` have the same kind of data in the first 4 bytes.

- 2 bytes for total length of all static fields
- 1 byte for number of static size fields
- 1 byte for number of dynamic size fields

But whereas `Schema` has `SchemaType` enum in each of the other 28 bytes, `FieldLayout` has static byte lengths in each of the other 28 bytes.

- Replace `Schema valueSchema` with `FieldLayout fieldLayout` in Store and World contracts.

`FieldLayout` is more gas-efficient because it already has lengths, and `Schema` has types which need to be converted to lengths.

- Add `getFieldLayout` to `IStore` interface.

There is no `FieldLayout` for keys, only for values, because key byte lengths aren't usually relevant on-chain. You can still use `getKeySchema` if you need key types.

- Add `fieldLayoutToHex` utility to `protocol-parser` package.

- Add `constants.sol` for constants shared between `FieldLayout`, `Schema` and `PackedCounter`.

### Patch Changes

- [#1472](https://github.com/latticexyz/mud/pull/1472) [`c049c23f`](https://github.com/latticexyz/mud/commit/c049c23f48b93ac7881fb1a5a8417831611d5cbf) Thanks [@alvrs](https://github.com/alvrs)! - - The `World` contract now has an `initialize` function, which can be called once by the creator of the World to install the core module.
This change allows the registration of all core tables to happen in the `CoreModule`, so no table metadata has to be included in the `World`'s bytecode.

```solidity
interface IBaseWorld {
function initialize(IModule coreModule) public;
}
```

- The `World` contract now stores the original creator of the `World` in an immutable state variable.
It is used internally to only allow the original creator to initialize the `World` in a separate transaction.

```solidity
interface IBaseWorld {
function creator() external view returns (address);
}
```
- The deploy script is updated to use the `World`'s `initialize` function to install the `CoreModule` instead of `registerRootModule` as before.
- Updated dependencies [[`de151fec`](https://github.com/latticexyz/mud/commit/de151fec07b63a6022483c1ad133c556dd44992e), [`f1cd43bf`](https://github.com/latticexyz/mud/commit/f1cd43bf9264d5a23a3edf2a1ea4212361a72203), [`c049c23f`](https://github.com/latticexyz/mud/commit/c049c23f48b93ac7881fb1a5a8417831611d5cbf), [`c049c23f`](https://github.com/latticexyz/mud/commit/c049c23f48b93ac7881fb1a5a8417831611d5cbf)]:
- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
## 2.0.0-next.8
### Patch 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.8",
"version": "2.0.0-next.9",
"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.9

### Patch Changes

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

## 2.0.0-next.8

### 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.8",
"version": "2.0.0-next.9",
"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.9

### Patch Changes

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

## 2.0.0-next.8

### 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.8",
"version": "2.0.0-next.9",
"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.9

## 2.0.0-next.8

## 2.0.0-next.7
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.8",
"version": "2.0.0-next.9",
"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.9

### Patch Changes

- Updated dependencies [[`de151fec`](https://github.com/latticexyz/mud/commit/de151fec07b63a6022483c1ad133c556dd44992e), [`f1cd43bf`](https://github.com/latticexyz/mud/commit/f1cd43bf9264d5a23a3edf2a1ea4212361a72203), [`c049c23f`](https://github.com/latticexyz/mud/commit/c049c23f48b93ac7881fb1a5a8417831611d5cbf), [`c049c23f`](https://github.com/latticexyz/mud/commit/c049c23f48b93ac7881fb1a5a8417831611d5cbf)]:
- @latticexyz/store@2.0.0-next.9
- @latticexyz/world@2.0.0-next.9
- @latticexyz/store-sync@2.0.0-next.9
- @latticexyz/react@2.0.0-next.9
- @latticexyz/common@2.0.0-next.9
- @latticexyz/recs@2.0.0-next.9
- @latticexyz/utils@2.0.0-next.9

## 2.0.0-next.8

### 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.8",
"version": "2.0.0-next.9",
"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.8",
"@latticexyz/recs": "2.0.0-next.8",
"@latticexyz/store": "2.0.0-next.8",
"@latticexyz/store-sync": "2.0.0-next.8",
"@latticexyz/utils": "2.0.0-next.8",
"@latticexyz/world": "2.0.0-next.8"
"@latticexyz/common": "2.0.0-next.9",
"@latticexyz/recs": "2.0.0-next.9",
"@latticexyz/store": "2.0.0-next.9",
"@latticexyz/store-sync": "2.0.0-next.9",
"@latticexyz/utils": "2.0.0-next.9",
"@latticexyz/world": "2.0.0-next.9"
},
"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.9

## 2.0.0-next.8

## 2.0.0-next.7
Expand Down
Loading

0 comments on commit cecbdd6

Please sign in to comment.