Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages (next) #1685

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@
"blue-seals-relate",
"brave-needles-love",
"brave-rings-tickle",
"breezy-cameras-switch",
"brown-garlics-lie",
"brown-icons-burn",
"chilled-chicken-repair",
"chilled-cougars-smash",
"chilled-kangaroos-dream",
"chilly-kangaroos-clap",
"clever-items-appear",
"clever-rats-sip",
"cold-years-itch",
Expand All @@ -57,6 +59,7 @@
"cyan-timers-tan",
"dirty-items-retire",
"dry-chicken-love",
"eight-deers-confess",
"eighty-pots-report",
"eighty-tigers-argue",
"empty-planes-kiss",
Expand Down Expand Up @@ -88,6 +91,7 @@
"khaki-houses-whisper",
"large-drinks-sell",
"large-hats-walk",
"large-nails-suffer",
"large-sloths-camp",
"late-geese-guess",
"late-spies-cover",
Expand All @@ -96,6 +100,7 @@
"long-lizards-admire",
"lovely-buses-boil",
"lovely-fireants-behave",
"lucky-clocks-love",
"many-phones-study",
"many-pumpkins-cry",
"mean-islands-brake",
Expand All @@ -107,10 +112,12 @@
"mighty-eels-type",
"modern-bikes-build",
"modern-hornets-jam",
"modern-stingrays-kneel",
"modern-trains-remain",
"nasty-trains-drop",
"nasty-waves-divide",
"nervous-walls-knock",
"nice-avocados-poke",
"nice-bikes-double",
"nice-fishes-perform",
"nice-glasses-begin",
Expand Down Expand Up @@ -139,6 +146,7 @@
"real-students-exercise",
"red-falcons-do",
"red-turkeys-develop",
"rotten-beers-learn",
"rotten-cats-lay",
"selfish-cycles-retire",
"serious-ads-trade",
Expand All @@ -152,6 +160,7 @@
"shy-sheep-wait",
"silent-rice-argue",
"silly-snakes-fold",
"silver-dolls-shave",
"silver-mangos-thank",
"six-cats-agree",
"six-kangaroos-sneeze",
Expand Down Expand Up @@ -196,6 +205,7 @@
"unlucky-guests-cover",
"violet-insects-press",
"weak-mails-cross",
"wicked-cheetahs-cough",
"wicked-squids-do",
"wicked-tigers-return",
"wild-gorillas-care",
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.11

### Major changes

**[feat(cli): remove backup/restore/force options from set-version (#1687)](https://github.com/latticexyz/mud/commit/3d0b3edb46b266fccb40e26e8243d7628bea8baf)** (@latticexyz/cli)

Removes `.mudbackup` file handling and `--backup`, `--restore`, and `--force` options from `mud set-version` command.

To revert to a previous MUD version, use `git diff` to find the version that you changed from and want to revert to and run `pnpm mud set-version <prior-version>` again.

### Minor changes

**[feat(world-modules): add SystemSwitch util (#1665)](https://github.com/latticexyz/mud/commit/9352648b19800f28b1d96ec448283808342a41f7)** (@latticexyz/world-modules)

Since [#1564](https://github.com/latticexyz/mud/pull/1564) the World can no longer call itself via an external call.
This made the developer experience of calling other systems via root systems worse, since calls from root systems are executed from the context of the World.
The recommended approach is to use `delegatecall` to the system if in the context of a root system, and an external call via the World if in the context of a non-root system.
To bring back the developer experience of calling systems from other sysyems without caring about the context in which the call is executed, we added the `SystemSwitch` util.

```diff
- // Instead of calling the system via an external call to world...
- uint256 value = IBaseWorld(_world()).callMySystem();

+ // ...you can now use the `SystemSwitch` util.
+ // This works independent of whether used in a root system or non-root system.
+ uint256 value = abi.decode(SystemSwitch.call(abi.encodeCall(IBaseWorld.callMySystem, ()), (uint256));
```

Note that if you already know your system is always executed as non-root system, you can continue to use the approach of calling other systems via the `IBaseWorld(world)`.

**[refactor(common): move `createContract`'s internal write logic to `writeContract` (#1693)](https://github.com/latticexyz/mud/commit/d075f82f30f4969a353e4ea29ca2a25a04810523)** (@latticexyz/common)

- Moves contract write logic out of `createContract` into its own `writeContract` method so that it can be used outside of the contract instance, and for consistency with viem.
- Deprecates `createContract` in favor of `getContract` for consistency with viem.
- Reworks `createNonceManager`'s `BroadcastChannel` setup and moves out the notion of a "nonce manager ID" to `getNonceManagerId` so we can create an internal cache with `getNonceManager` for use in `writeContract`.

If you were using the `createNonceManager` before, you'll just need to rename `publicClient` argument to `client`:

```diff
const publicClient = createPublicClient({ ... });
- const nonceManager = createNonceManager({ publicClient, ... });
+ const nonceManager = createNonceManager({ client: publicClient, ... });
```

**[feat(gas-reporter): allow gas-reporter to parse stdin (#1688)](https://github.com/latticexyz/mud/commit/4385c5a4c0e2d5550c041acc4386ae7fc1cb4b7e)** (@latticexyz/gas-report)

Allow the `gas-report` CLI to parse logs via `stdin`, so it can be used with custom test commands (e.g. `mud test`).

Usage:

```sh
# replace `forge test -vvv` with the custom test command
GAS_REPORTER_ENABLED=true forge test -vvv | pnpm gas-report --stdin
```

### Patch changes

**[feat(store-sync): export postgres column type helpers (#1699)](https://github.com/latticexyz/mud/commit/08d7c471f9a2f4d6c237641eea316313d010373c)** (@latticexyz/store-sync)

Export postgres column type helpers from `@latticexyz/store-sync`.

**[fix(common): workaround for zero base fee (#1689)](https://github.com/latticexyz/mud/commit/16b13ea8fc5e7f63ce08bc6baa2087cab9c8089f)** (@latticexyz/common)

Adds viem workaround for zero base fee used by MUD's anvil config

**[fix(world): register store namespace during initialization (#1712)](https://github.com/latticexyz/mud/commit/430e6b29a9207122d48e386925bdb9fc12c201b9)** (@latticexyz/world)

Register the `store` namespace in the `CoreModule`.
Since namespaces are a World concept, registering the Store's internal tables does not automatically register the Store's namespace, so we do this manually during initialization in the `CoreModule`.

**[build: bump viem and abitype (#1684)](https://github.com/latticexyz/mud/commit/f99e889872e6881bf32bcb9a605b8b5c1b05fac4)** (@latticexyz/block-logs-stream, @latticexyz/cli, @latticexyz/common, @latticexyz/dev-tools, @latticexyz/faucet, @latticexyz/protocol-parser, @latticexyz/schema-type, @latticexyz/store-indexer, @latticexyz/store-sync, @latticexyz/store, create-mud)

Bump viem to 1.14.0 and abitype to 0.9.8

**[feat(gas-report): add more logs to stdin piping (#1694)](https://github.com/latticexyz/mud/commit/ba17bdab5c8b2a3aa56e86722134174e2799ddfa)** (@latticexyz/gas-report)

Pass through `stdin` logs in `gas-report`. Since the script piping in logs to `gas-report` can be long-running, it is useful to see its logs to know if it's stalling.

**[fix(protocol-parser): allow arbitrary key order when encoding values (#1674)](https://github.com/latticexyz/mud/commit/a2f41ade977a5374c400ef8bfc2cb8c8698f185e)** (@latticexyz/protocol-parser)

Allow arbitrary key order when encoding values

---

## Version 2.0.0-next.10

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

### Major changes

**[feat(cli): remove backup/restore/force options from set-version (#1687)](https://github.com/latticexyz/mud/commit/3d0b3edb46b266fccb40e26e8243d7628bea8baf)** (@latticexyz/cli)

Removes `.mudbackup` file handling and `--backup`, `--restore`, and `--force` options from `mud set-version` command.

To revert to a previous MUD version, use `git diff` to find the version that you changed from and want to revert to and run `pnpm mud set-version <prior-version>` again.

### Minor changes

**[feat(world-modules): add SystemSwitch util (#1665)](https://github.com/latticexyz/mud/commit/9352648b19800f28b1d96ec448283808342a41f7)** (@latticexyz/world-modules)

Since [#1564](https://github.com/latticexyz/mud/pull/1564) the World can no longer call itself via an external call.
This made the developer experience of calling other systems via root systems worse, since calls from root systems are executed from the context of the World.
The recommended approach is to use `delegatecall` to the system if in the context of a root system, and an external call via the World if in the context of a non-root system.
To bring back the developer experience of calling systems from other sysyems without caring about the context in which the call is executed, we added the `SystemSwitch` util.

```diff
- // Instead of calling the system via an external call to world...
- uint256 value = IBaseWorld(_world()).callMySystem();

+ // ...you can now use the `SystemSwitch` util.
+ // This works independent of whether used in a root system or non-root system.
+ uint256 value = abi.decode(SystemSwitch.call(abi.encodeCall(IBaseWorld.callMySystem, ()), (uint256));
```

Note that if you already know your system is always executed as non-root system, you can continue to use the approach of calling other systems via the `IBaseWorld(world)`.

**[refactor(common): move `createContract`'s internal write logic to `writeContract` (#1693)](https://github.com/latticexyz/mud/commit/d075f82f30f4969a353e4ea29ca2a25a04810523)** (@latticexyz/common)

- Moves contract write logic out of `createContract` into its own `writeContract` method so that it can be used outside of the contract instance, and for consistency with viem.
- Deprecates `createContract` in favor of `getContract` for consistency with viem.
- Reworks `createNonceManager`'s `BroadcastChannel` setup and moves out the notion of a "nonce manager ID" to `getNonceManagerId` so we can create an internal cache with `getNonceManager` for use in `writeContract`.

If you were using the `createNonceManager` before, you'll just need to rename `publicClient` argument to `client`:

```diff
const publicClient = createPublicClient({ ... });
- const nonceManager = createNonceManager({ publicClient, ... });
+ const nonceManager = createNonceManager({ client: publicClient, ... });
```

**[feat(gas-reporter): allow gas-reporter to parse stdin (#1688)](https://github.com/latticexyz/mud/commit/4385c5a4c0e2d5550c041acc4386ae7fc1cb4b7e)** (@latticexyz/gas-report)

Allow the `gas-report` CLI to parse logs via `stdin`, so it can be used with custom test commands (e.g. `mud test`).

Usage:

```sh
# replace `forge test -vvv` with the custom test command
GAS_REPORTER_ENABLED=true forge test -vvv | pnpm gas-report --stdin
```

### Patch changes

**[feat(store-sync): export postgres column type helpers (#1699)](https://github.com/latticexyz/mud/commit/08d7c471f9a2f4d6c237641eea316313d010373c)** (@latticexyz/store-sync)

Export postgres column type helpers from `@latticexyz/store-sync`.

**[fix(common): workaround for zero base fee (#1689)](https://github.com/latticexyz/mud/commit/16b13ea8fc5e7f63ce08bc6baa2087cab9c8089f)** (@latticexyz/common)

Adds viem workaround for zero base fee used by MUD's anvil config

**[fix(world): register store namespace during initialization (#1712)](https://github.com/latticexyz/mud/commit/430e6b29a9207122d48e386925bdb9fc12c201b9)** (@latticexyz/world)

Register the `store` namespace in the `CoreModule`.
Since namespaces are a World concept, registering the Store's internal tables does not automatically register the Store's namespace, so we do this manually during initialization in the `CoreModule`.

**[build: bump viem and abitype (#1684)](https://github.com/latticexyz/mud/commit/f99e889872e6881bf32bcb9a605b8b5c1b05fac4)** (@latticexyz/block-logs-stream, @latticexyz/cli, @latticexyz/common, @latticexyz/dev-tools, @latticexyz/faucet, @latticexyz/protocol-parser, @latticexyz/schema-type, @latticexyz/store-indexer, @latticexyz/store-sync, @latticexyz/store, create-mud)

Bump viem to 1.14.0 and abitype to 0.9.8

**[feat(gas-report): add more logs to stdin piping (#1694)](https://github.com/latticexyz/mud/commit/ba17bdab5c8b2a3aa56e86722134174e2799ddfa)** (@latticexyz/gas-report)

Pass through `stdin` logs in `gas-report`. Since the script piping in logs to `gas-report` can be long-running, it is useful to see its logs to know if it's stalling.

**[fix(protocol-parser): allow arbitrary key order when encoding values (#1674)](https://github.com/latticexyz/mud/commit/a2f41ade977a5374c400ef8bfc2cb8c8698f185e)** (@latticexyz/protocol-parser)

Allow arbitrary key order when encoding values

---

## Version 2.0.0-next.10

### 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.11

## 2.0.0-next.10

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

## 2.0.0-next.11

### Patch Changes

- f99e8898: Bump viem to 1.14.0 and abitype to 0.9.8
- Updated dependencies [16b13ea8]
- Updated dependencies [f99e8898]
- Updated dependencies [d075f82f]
- @latticexyz/[email protected]

## 2.0.0-next.10

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

## 2.0.0-next.11

### Major Changes

- 3d0b3edb: Removes `.mudbackup` file handling and `--backup`, `--restore`, and `--force` options from `mud set-version` command.

To revert to a previous MUD version, use `git diff` to find the version that you changed from and want to revert to and run `pnpm mud set-version <prior-version>` again.

### Patch Changes

- f99e8898: Bump viem to 1.14.0 and abitype to 0.9.8
- Updated dependencies [16b13ea8]
- Updated dependencies [430e6b29]
- Updated dependencies [f99e8898]
- Updated dependencies [9352648b]
- Updated dependencies [ba17bdab]
- Updated dependencies [d075f82f]
- Updated dependencies [4385c5a4]
- Updated dependencies [a2f41ade]
- @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]
- @latticexyz/[email protected]

## 2.0.0-next.10

### 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.10",
"version": "2.0.0-next.11",
"description": "Command line interface for mud",
"repository": {
"type": "git",
Expand Down
24 changes: 24 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Change Log

## 2.0.0-next.11

### Minor Changes

- d075f82f: - Moves contract write logic out of `createContract` into its own `writeContract` method so that it can be used outside of the contract instance, and for consistency with viem.

- Deprecates `createContract` in favor of `getContract` for consistency with viem.
- Reworks `createNonceManager`'s `BroadcastChannel` setup and moves out the notion of a "nonce manager ID" to `getNonceManagerId` so we can create an internal cache with `getNonceManager` for use in `writeContract`.

If you were using the `createNonceManager` before, you'll just need to rename `publicClient` argument to `client`:

```diff
const publicClient = createPublicClient({ ... });
- const nonceManager = createNonceManager({ publicClient, ... });
+ const nonceManager = createNonceManager({ client: publicClient, ... });
```

### Patch Changes

- 16b13ea8: Adds viem workaround for zero base fee used by MUD's anvil config
- f99e8898: Bump viem to 1.14.0 and abitype to 0.9.8
- Updated dependencies [f99e8898]
- @latticexyz/[email protected]

## 2.0.0-next.10

### 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.10",
"version": "2.0.0-next.11",
"description": "Common low level logic shared between packages",
"repository": {
"type": "git",
Expand Down
10 changes: 10 additions & 0 deletions packages/config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## 2.0.0-next.11

### Patch Changes

- Updated dependencies [16b13ea8]
- Updated dependencies [f99e8898]
- Updated dependencies [d075f82f]
- @latticexyz/[email protected]
- @latticexyz/[email protected]

## 2.0.0-next.10

### 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.10",
"version": "2.0.0-next.11",
"description": "Config for Store and World",
"repository": {
"type": "git",
Expand Down
Loading