Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into entrykit
Browse files Browse the repository at this point in the history
  • Loading branch information
frolic committed Oct 24, 2024
2 parents df8b6bc + e3ec42b commit bcef423
Show file tree
Hide file tree
Showing 155 changed files with 1,609 additions and 755 deletions.
5 changes: 0 additions & 5 deletions .changeset/brown-panthers-melt.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/gentle-carrots-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/cli": patch
---

Added support for deploying public libraries used within modules.
16 changes: 0 additions & 16 deletions .changeset/giant-birds-argue.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/little-ways-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@latticexyz/world-module-erc20": patch
"@latticexyz/world-modules": patch
---

Changed ERC20 and ERC721 related modules to use public library methods instead of manual `delegatecall`s.
5 changes: 0 additions & 5 deletions .changeset/nine-numbers-yell.md

This file was deleted.

32 changes: 32 additions & 0 deletions .changeset/twenty-boats-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
"@latticexyz/stash": patch
---

Added `useStash` React hook. It's heavily inspired by Zustand's `useStore` and accepts a stash, a state selector, an an optional equality function to avoid unnecessary re-render cycles when returning unstable values.

Also updated `getRecord` and `getRecords` to each take either a `stash` or `state` object for more ergonomic use with `useStash`.

```ts
import { useStash } from "@latticexyz/stash/react";
import { getRecord } from "@latticexyz/stash";
import config from "../mud.config";

const tables = config.namespaces.app.tables;

export function PlayerName({ playerId }) {
const record = useStash(stash, (state) => getRecord({ state, table: tables.Player, key: { playerId } }));
...
}
```

```ts
import isEqual from "fast-deep-equal";
import { useStash } from "@latticexyz/stash/react";
import { getRecords } from "@latticexyz/stash";
import config from "../mud.config";

export function PlayerNames() {
const record = useStash(stash, (state) => getRecords({ state, table: tables.Player }), { isEqual });
...
}
```
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
## Version 2.2.13

Release date: Wed Oct 23 2024

### Patch changes

**[fix(gas-report): include contract name in file of output (#3317)](https://github.com/latticexyz/mud/commit/d5c270023abc325f25af868d3db1a0bdc3e62d6d)** (@latticexyz/gas-report)

Gas report output now include contract name as part of the `file` to help with stable ordering when sorting output.

**[chore(world-module-erc20): export erc20 module from internal (#3319)](https://github.com/latticexyz/mud/commit/90803770ee72bfd2b9ba9a7990285d1c5866f362)** (@latticexyz/world-module-erc20)

The new ERC20 World Module provides a simpler alternative to the ERC20 Puppet Module, while also being structured in a more extendable way so users can create tokens with custom functionality.

To install this module, you can import and define the module configuration from the NPM package:

```typescript
import { defineERC20Module } from "@latticexyz/world-module-erc20/internal";

// Add the output of this function to your World's modules
const erc20Module = defineERC20Module({ namespace: "erc20Namespace", name: "MyToken", symbol: "MTK" });
```

For detailed installation instructions, please check out the [`@latticexyz/world-module-erc20` README.md](https://github.com/latticexyz/mud/blob/main/packages/world-module-erc20/README.md).

**[feat(explorer): multi-line sql editor (#3311)](https://github.com/latticexyz/mud/commit/79d273a20b3dd50ab733b3261b830b0ef47bcebf)** (@latticexyz/explorer)

The SQL query editor now supports multi-line input.

**[feat(abi-ts): extension option (#3315)](https://github.com/latticexyz/mud/commit/75e93bac492f9000c482d6a26a5c8e29079dd32d)** (@latticexyz/abi-ts)

Added an `--extension` option to customize the resulting TS or DTS output. It defaults to the previous behavior of `.json.d.ts`, but can now be set to `.d.json.ts` for compatibility with newer TS versions and `.json.ts` or just `.ts` for a pure TS file.

**[fix(store-sync): update latest block for live logs API (#3323)](https://github.com/latticexyz/mud/commit/dfc2d6439ee7076cdccbf1a24b7423fb19a7771d)** (@latticexyz/store-sync)

Fixed an issue where the sync progress was not moving to "live" when synced from the MUD indexer's live logs API.

---

## Version 2.2.12

Release date: Fri Oct 18 2024
Expand Down
39 changes: 39 additions & 0 deletions docs/pages/changelog.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
## Version 2.2.13

Release date: Wed Oct 23 2024

### Patch changes

**[fix(gas-report): include contract name in file of output (#3317)](https://github.com/latticexyz/mud/commit/d5c270023abc325f25af868d3db1a0bdc3e62d6d)** (@latticexyz/gas-report)

Gas report output now include contract name as part of the `file` to help with stable ordering when sorting output.

**[chore(world-module-erc20): export erc20 module from internal (#3319)](https://github.com/latticexyz/mud/commit/90803770ee72bfd2b9ba9a7990285d1c5866f362)** (@latticexyz/world-module-erc20)

The new ERC20 World Module provides a simpler alternative to the ERC20 Puppet Module, while also being structured in a more extendable way so users can create tokens with custom functionality.

To install this module, you can import and define the module configuration from the NPM package:

```typescript
import { defineERC20Module } from "@latticexyz/world-module-erc20/internal";

// Add the output of this function to your World's modules
const erc20Module = defineERC20Module({ namespace: "erc20Namespace", name: "MyToken", symbol: "MTK" });
```

For detailed installation instructions, please check out the [`@latticexyz/world-module-erc20` README.md](https://github.com/latticexyz/mud/blob/main/packages/world-module-erc20/README.md).

**[feat(explorer): multi-line sql editor (#3311)](https://github.com/latticexyz/mud/commit/79d273a20b3dd50ab733b3261b830b0ef47bcebf)** (@latticexyz/explorer)

The SQL query editor now supports multi-line input.

**[feat(abi-ts): extension option (#3315)](https://github.com/latticexyz/mud/commit/75e93bac492f9000c482d6a26a5c8e29079dd32d)** (@latticexyz/abi-ts)

Added an `--extension` option to customize the resulting TS or DTS output. It defaults to the previous behavior of `.json.d.ts`, but can now be set to `.d.json.ts` for compatibility with newer TS versions and `.json.ts` or just `.ts` for a pure TS file.

**[fix(store-sync): update latest block for live logs API (#3323)](https://github.com/latticexyz/mud/commit/dfc2d6439ee7076cdccbf1a24b7423fb19a7771d)** (@latticexyz/store-sync)

Fixed an issue where the sync progress was not moving to "live" when synced from the MUD indexer's live logs API.

---

## Version 2.2.12

Release date: Fri Oct 18 2024
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CollapseCode } from "../../../components/CollapseCode";
import { CollapseCode } from "../../components/CollapseCode";

# Extending a World Permissionlessly
# Extending a World

On this page you learn how to modify a `World` that is already deployed to the blockchain, without using a privileged address, such as the one that initially deployed it.
If you want to learn how to modify a `World` before it is deployed, [see the hello world page](../hello-world).
Expand Down Expand Up @@ -660,7 +660,7 @@ We will fix these problems now.
1. Now you can click **Increment** in the user interface and create messages.
The user interface does not display those messages, but you can open the **MUD Dev Tools**, click the **Components** tab, and select **messagings\_\_Messages** to view them.

![The extended UI with the messages shown in the MUD Dev Tools](./extend-ui-with-msgs.png)
![The extended UI with the messages shown in the MUD Dev Tools](./extending-a-world/extend-ui-with-msgs.png)

### Read the counter

Expand Down Expand Up @@ -696,7 +696,7 @@ We will now fix this.

<CollapseCode>

```ts filename="setupNetwork.ts" copy showLineNumbers {24-25,38,96}
```ts filename="setupNetwork.ts" copy showLineNumbers {34,92}
/*
* The MUD client code is built on top of viem
* (https://viem.sh/docs/getting-started.html).
Expand All @@ -719,10 +719,6 @@ We will now fix this.
import IWorldAbi from "contracts/out/IWorld.sol/IWorld.abi.json";
import { createBurnerAccount, transportObserver, ContractWrite } from "@latticexyz/common";
import { transactionQueue, writeObserver } from "@latticexyz/common/actions";

import { resolveConfig } from "@latticexyz/store/internal";
import { storeToV1 } from "@latticexyz/store/config/v2";

import { Subject, share } from "rxjs";

/*
Expand Down Expand Up @@ -792,7 +788,7 @@ We will now fix this.
address: networkConfig.worldAddress as Hex,
publicClient,
startBlock: BigInt(networkConfig.initialBlockNumber),
tables: resolveConfig(storeToV1(counterConfig)).tables,
tables: counterConfig.tables,
});

return {
Expand Down
3 changes: 0 additions & 3 deletions docs/pages/guides/extending-a-world/_meta.js

This file was deleted.

38 changes: 3 additions & 35 deletions e2e/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"type": "module",
"scripts": {
"all-build": "for dir in packages/store packages/world packages/world-modules packages/cli test/mock-game-contracts e2e/packages/contracts examples/*/packages/contracts examples/multiple-namespaces templates/*/packages/contracts; do (cd \"$dir\" && pwd && pnpm build); done",
"all-build": "for dir in packages/store packages/world packages/world-modules packages/cli test/mock-game-contracts test/puppet-modules e2e/packages/contracts examples/*/packages/contracts examples/multiple-namespaces templates/*/packages/contracts; do (cd \"$dir\" && pwd && pnpm build); done",
"all-install": "for dir in . docs e2e examples/* templates/*; do (cd \"$dir\" && pwd && pnpm install); done",
"bench": "pnpm run --recursive bench",
"build": "turbo run build --concurrency=100%",
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.2.13

### Patch Changes

- 75e93ba: Added an `--extension` option to customize the resulting TS or DTS output. It defaults to the previous behavior of `.json.d.ts`, but can now be set to `.d.json.ts` for compatibility with newer TS versions and `.json.ts` or just `.ts` for a pure TS file.

## 2.2.12

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

## 2.2.13

### Patch Changes

- @latticexyz/common@2.2.13

## 2.2.12

### 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.2.12",
"version": "2.2.13",
"description": "Create a stream of EVM block logs for events",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit bcef423

Please sign in to comment.