From d92319fc98c0ae3f19f66ba2f0de4d3df332e565 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Nov 2023 11:59:06 +0000 Subject: [PATCH] Version Packages (next) --- .changeset/pre.json | 11 ++ CHANGELOG.md | 183 +++++++++++++++++++++++ docs/pages/changelog.mdx | 183 +++++++++++++++++++++++ packages/abi-ts/CHANGELOG.md | 2 + packages/abi-ts/package.json | 2 +- packages/block-logs-stream/CHANGELOG.md | 8 + packages/block-logs-stream/package.json | 2 +- packages/cli/CHANGELOG.md | 22 +++ packages/cli/package.json | 2 +- packages/common/CHANGELOG.md | 11 ++ packages/common/package.json | 2 +- packages/config/CHANGELOG.md | 10 ++ packages/config/package.json | 2 +- packages/create-mud/CHANGELOG.md | 6 + packages/create-mud/package.json | 2 +- packages/dev-tools/CHANGELOG.md | 18 +++ packages/dev-tools/package.json | 14 +- packages/ecs-browser/CHANGELOG.md | 2 + packages/ecs-browser/package.json | 2 +- packages/faucet/CHANGELOG.md | 2 + packages/faucet/package.json | 2 +- packages/gas-report/CHANGELOG.md | 2 + packages/gas-report/package.json | 2 +- packages/network/CHANGELOG.md | 2 + packages/network/package.json | 2 +- packages/noise/CHANGELOG.md | 2 + packages/noise/package.json | 2 +- packages/phaserx/CHANGELOG.md | 7 + packages/phaserx/package.json | 2 +- packages/protocol-parser/CHANGELOG.md | 9 ++ packages/protocol-parser/package.json | 2 +- packages/react/CHANGELOG.md | 7 + packages/react/package.json | 2 +- packages/recs/CHANGELOG.md | 8 + packages/recs/package.json | 2 +- packages/schema-type/CHANGELOG.md | 2 + packages/schema-type/package.json | 2 +- packages/services/CHANGELOG.md | 2 + packages/services/package.json | 2 +- packages/solecs/CHANGELOG.md | 2 + packages/solecs/package.json | 2 +- packages/solhint-config-mud/CHANGELOG.md | 2 + packages/solhint-config-mud/package.json | 2 +- packages/solhint-plugin-mud/CHANGELOG.md | 2 + packages/solhint-plugin-mud/package.json | 2 +- packages/std-client/CHANGELOG.md | 2 + packages/std-client/package.json | 2 +- packages/std-contracts/CHANGELOG.md | 2 + packages/std-contracts/package.json | 2 +- packages/store-cache/CHANGELOG.md | 2 + packages/store-cache/package.json | 2 +- packages/store-indexer/CHANGELOG.md | 30 ++++ packages/store-indexer/package.json | 2 +- packages/store-sync/CHANGELOG.md | 73 +++++++++ packages/store-sync/package.json | 2 +- packages/store/CHANGELOG.md | 10 ++ packages/store/package.json | 2 +- packages/utils/CHANGELOG.md | 23 +++ packages/utils/package.json | 2 +- packages/world-modules/CHANGELOG.md | 68 +++++++++ packages/world-modules/package.json | 2 +- packages/world/CHANGELOG.md | 11 ++ packages/world/package.json | 2 +- 63 files changed, 762 insertions(+), 36 deletions(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 4a736359d9..f4d9c6ce27 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -43,6 +43,7 @@ "brave-needles-love", "brave-rings-tickle", "breezy-cameras-switch", + "breezy-seahorses-prove", "bright-flies-hug", "brown-garlics-lie", "brown-icons-burn", @@ -67,6 +68,8 @@ "eighty-pots-report", "eighty-tigers-argue", "empty-planes-kiss", + "empty-starfishes-lick", + "fair-buckets-dress", "fast-ears-hug", "fast-zebras-drum", "fast-zebras-promise", @@ -75,6 +78,7 @@ "few-mirrors-reflect", "few-papayas-leave", "fifty-squids-eat", + "fifty-suits-itch", "fifty-suits-shout", "flat-trainers-marry", "fluffy-moles-march", @@ -84,9 +88,11 @@ "fuzzy-cars-stare", "giant-masks-carry", "gold-rings-switch", + "gorgeous-swans-hide", "great-cooks-dream", "grumpy-files-heal", "grumpy-geckos-raise", + "happy-pants-try", "heavy-eyes-smile", "hip-tables-check", "honest-months-boil", @@ -168,21 +174,25 @@ "serious-plants-itch", "seven-flies-chew", "seven-mangos-roll", + "sharp-falcons-tie", "sharp-worms-kneel", "short-ads-jog", "short-dragons-shout", "shy-monkeys-wonder", "shy-sheep-wait", + "silent-buttons-peel", "silent-carrots-glow", "silent-rice-argue", "silly-snakes-fold", "silver-dolls-shave", "silver-mangos-thank", + "silver-nails-explain", "six-cats-agree", "six-kangaroos-sneeze", "slimy-glasses-tickle", "small-boxes-rush", "small-chicken-repair", + "small-dots-poke", "small-pots-press", "smooth-elephants-wave", "smooth-pots-nail", @@ -210,6 +220,7 @@ "thin-terms-lay", "thirty-cups-provide", "three-lizards-shave", + "three-scissors-smile", "tough-flowers-breathe", "tricky-beds-kiss", "tricky-carrots-talk", diff --git a/CHANGELOG.md b/CHANGELOG.md index 55d6b56011..9c5ca4c38c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,186 @@ +## Version 2.0.0-next.13 + +Release date: Thu Nov 02 2023 + +### Major changes + +**[feat(utils): remove hash utils and ethers (#1783)](https://github.com/latticexyz/mud/commit/52182f70d350bb99cdfa6054cd6d181e58a91aa6)** (@latticexyz/utils) + +Removed `keccak256` and `keccak256Coord` hash utils in favor of [viem's `keccak256`](https://viem.sh/docs/utilities/keccak256.html#keccak256). + +```diff +- import { keccak256 } from "@latticexyz/utils"; ++ import { keccak256, toHex } from "viem"; + +- const hash = keccak256("some string"); ++ const hash = keccak256(toHex("some string")); +``` + +```diff +- import { keccak256Coord } from "@latticexyz/utils"; ++ import { encodeAbiParameters, keccak256, parseAbiParameters } from "viem"; + + const coord = { x: 1, y: 1 }; +- const hash = keccak256Coord(coord); ++ const hash = keccak256(encodeAbiParameters(parseAbiParameters("int32, int32"), [coord.x, coord.y])); +``` + +**[feat(store-indexer,store-sync): filter by table and key (#1794)](https://github.com/latticexyz/mud/commit/f6d214e3d79f9591fddd3687aa987a57f417256c)** (@latticexyz/store-indexer) + +Removed `tableIds` filter option in favor of the more flexible `filters` option that accepts `tableId` and an optional `key0` and/or `key1` to filter data by tables and keys. + +If you were using an indexer client directly, you'll need to update your query: + +```diff + await indexer.findAll.query({ + chainId, + address, +- tableIds: ['0x...'], ++ filters: [{ tableId: '0x...' }], + }); +``` + +### Minor changes + +**[feat(store-sync): extra table definitions (#1840)](https://github.com/latticexyz/mud/commit/de47d698f031a28ef8d9e329e3cffc85e904c6a1)** (@latticexyz/store-sync) + +Added an optional `tables` option to `syncToRecs` to allow you to sync from tables that may not be expressed by your MUD config. This will be useful for namespaced tables used by [ERC20](https://github.com/latticexyz/mud/pull/1789) and [ERC721](https://github.com/latticexyz/mud/pull/1844) token modules until the MUD config gains [namespace support](https://github.com/latticexyz/mud/issues/994). + +Here's how we use this in our example project with the `KeysWithValue` module: + +```ts +syncToRecs({ + ... + tables: { + KeysWithValue: { + namespace: "keywval", + name: "Inventory", + tableId: resourceToHex({ type: "table", namespace: "keywval", name: "Inventory" }), + keySchema: { + valueHash: { type: "bytes32" }, + }, + valueSchema: { + keysWithValue: { type: "bytes32[]" }, + }, + }, + }, + ... +}); +``` + +**[feat(world-modules): add ERC721 module (#1844)](https://github.com/latticexyz/mud/commit/d7325e517ce18597d55e8bce41036e78e00c3a78)** (@latticexyz/world-modules) + +Added the `ERC721Module` to `@latticexyz/world-modules`. +This module allows the registration of `ERC721` tokens in an existing World. + +Important note: this module has not been audited yet, so any production use is discouraged for now. + +````solidity +import { PuppetModule } from "@latticexyz/world-modules/src/modules/puppet/PuppetModule.sol"; +import { ERC721MetadataData } from "@latticexyz/world-modules/src/modules/erc721-puppet/tables/ERC721Metadata.sol"; +import { IERC721Mintable } from "@latticexyz/world-modules/src/modules/erc721-puppet/IERC721Mintable.sol"; +import { registerERC721 } from "@latticexyz/world-modules/src/modules/erc721-puppet/registerERC721.sol"; + +// The ERC721 module requires the Puppet module to be installed first +world.installModule(new PuppetModule(), new bytes(0)); + +// After the Puppet module is installed, new ERC721 tokens can be registered +IERC721Mintable token = registerERC721(world, "myERC721", ERC721MetadataData({ name: "Token", symbol: "TKN", baseURI: "" }));``` +```` + +**[feat(world-modules): add puppet module (#1793)](https://github.com/latticexyz/mud/commit/35348f831b923aed6e9bdf8b38bf337f3e944a48)** (@latticexyz/world-modules) + +Added the `PuppetModule` to `@latticexyz/world-modules`. The puppet pattern allows an external contract to be registered as an external interface for a MUD system. +This allows standards like `ERC20` (that require a specific interface and events to be emitted by a unique contract) to be implemented inside a MUD World. + +The puppet serves as a proxy, forwarding all calls to the implementation system (also called the "puppet master"). +The "puppet master" system can emit events from the puppet contract. + +```solidity +import { PuppetModule } from "@latticexyz/world-modules/src/modules/puppet/PuppetModule.sol"; +import { createPuppet } from "@latticexyz/world-modules/src/modules/puppet/createPuppet.sol"; + +// Install the puppet module +world.installModule(new PuppetModule(), new bytes(0)); + +// Register a new puppet for any system +// The system must implement the `CustomInterface`, +// and the caller must own the system's namespace +CustomInterface puppet = CustomInterface(createPuppet(world, )); +``` + +**[feat(store-indexer,store-sync): filter by table and key (#1794)](https://github.com/latticexyz/mud/commit/f6d214e3d79f9591fddd3687aa987a57f417256c)** (@latticexyz/store-sync) + +Added a `filters` option to store sync to allow filtering client data on tables and keys. Previously, it was only possible to filter on `tableIds`, but the new filter option allows for more flexible filtering by key. + +If you are building a large MUD application, you can use positional keys as a way to shard data and make it possible to load only the data needed in the client for a particular section of your app. We're using this already in Sky Strife to load match-specific data into match pages without having to load data for all matches, greatly improving load time and client performance. + +```ts +syncToRecs({ + ... + filters: [{ tableId: '0x...', key0: '0x...' }], +}); +``` + +The `tableIds` option is now deprecated and will be removed in the future, but is kept here for backwards compatibility. + +**[feat(world-modules): add ERC20 module (#1789)](https://github.com/latticexyz/mud/commit/83638373450af5d8f703a183a74107ef7efb4152)** (@latticexyz/world-modules) + +Added the `ERC20Module` to `@latticexyz/world-modules`. +This module allows the registration of `ERC20` tokens in an existing World. + +Important note: this module has not been audited yet, so any production use is discouraged for now. + +```solidity +import { PuppetModule } from "@latticexyz/world-modules/src/modules/puppet/PuppetModule.sol"; +import { IERC20Mintable } from "@latticexyz/world-modules/src/modules/erc20-puppet/IERC20Mintable.sol"; +import { registerERC20 } from "@latticexyz/world-modules/src/modules/erc20-puppet/registerERC20.sol"; + +// The ERC20 module requires the Puppet module to be installed first +world.installModule(new PuppetModule(), new bytes(0)); + +// After the Puppet module is installed, new ERC20 tokens can be registered +IERC20Mintable token = registerERC20(world, "myERC20", ERC20MetadataData({ decimals: 18, name: "Token", symbol: "TKN" })); +``` + +**[feat(store-sync): sync to zustand (#1843)](https://github.com/latticexyz/mud/commit/fa77635839e760a9de5fc8959ee492b7a4d8a7cd)** (@latticexyz/store-sync) + +Added a Zustand storage adapter and corresponding `syncToZustand` method for use in vanilla and React apps. It's used much like the other sync methods, except it returns a bound store and set of typed tables. + +```ts +import { syncToZustand } from "@latticexyz/store-sync/zustand"; +import config from "contracts/mud.config"; + +const { tables, useStore, latestBlock$, storedBlockLogs$, waitForTransaction } = await syncToZustand({ + config, + ... +}); + +// in vanilla apps +const positions = useStore.getState().getRecords(tables.Position); + +// in React apps +const positions = useStore((state) => state.getRecords(tables.Position)); +``` + +This change will be shortly followed by an update to our templates that uses Zustand as the default client data store and sync method. + +**[feat(store): add experimental config resolve helper (#1826)](https://github.com/latticexyz/mud/commit/b1d41727d4b1964ad3cd907c1c2126b02172b413)** (@latticexyz/common) + +Added a `mapObject` helper to map the value of each property of an object to a new value. + +### Patch changes + +**[fix(create-mud): set store address in PostDeploy script (#1817)](https://github.com/latticexyz/mud/commit/c5148da763645e0adc1250245ea447904014bef2)** (create-mud) + +Updated templates' PostDeploy script to set store address so that tables can be used directly inside PostDeploy. + +**[fix(common,config): remove chalk usage (#1824)](https://github.com/latticexyz/mud/commit/3e057061da17dd2d0c5fd23e6f5a027bdf9a9223)** (@latticexyz/common, @latticexyz/config) + +Removed chalk usage from modules imported in client fix downstream client builds (vite in particular). + +--- + ## Version 2.0.0-next.12 Release date: Fri Oct 20 2023 diff --git a/docs/pages/changelog.mdx b/docs/pages/changelog.mdx index 55d6b56011..9c5ca4c38c 100644 --- a/docs/pages/changelog.mdx +++ b/docs/pages/changelog.mdx @@ -1,3 +1,186 @@ +## Version 2.0.0-next.13 + +Release date: Thu Nov 02 2023 + +### Major changes + +**[feat(utils): remove hash utils and ethers (#1783)](https://github.com/latticexyz/mud/commit/52182f70d350bb99cdfa6054cd6d181e58a91aa6)** (@latticexyz/utils) + +Removed `keccak256` and `keccak256Coord` hash utils in favor of [viem's `keccak256`](https://viem.sh/docs/utilities/keccak256.html#keccak256). + +```diff +- import { keccak256 } from "@latticexyz/utils"; ++ import { keccak256, toHex } from "viem"; + +- const hash = keccak256("some string"); ++ const hash = keccak256(toHex("some string")); +``` + +```diff +- import { keccak256Coord } from "@latticexyz/utils"; ++ import { encodeAbiParameters, keccak256, parseAbiParameters } from "viem"; + + const coord = { x: 1, y: 1 }; +- const hash = keccak256Coord(coord); ++ const hash = keccak256(encodeAbiParameters(parseAbiParameters("int32, int32"), [coord.x, coord.y])); +``` + +**[feat(store-indexer,store-sync): filter by table and key (#1794)](https://github.com/latticexyz/mud/commit/f6d214e3d79f9591fddd3687aa987a57f417256c)** (@latticexyz/store-indexer) + +Removed `tableIds` filter option in favor of the more flexible `filters` option that accepts `tableId` and an optional `key0` and/or `key1` to filter data by tables and keys. + +If you were using an indexer client directly, you'll need to update your query: + +```diff + await indexer.findAll.query({ + chainId, + address, +- tableIds: ['0x...'], ++ filters: [{ tableId: '0x...' }], + }); +``` + +### Minor changes + +**[feat(store-sync): extra table definitions (#1840)](https://github.com/latticexyz/mud/commit/de47d698f031a28ef8d9e329e3cffc85e904c6a1)** (@latticexyz/store-sync) + +Added an optional `tables` option to `syncToRecs` to allow you to sync from tables that may not be expressed by your MUD config. This will be useful for namespaced tables used by [ERC20](https://github.com/latticexyz/mud/pull/1789) and [ERC721](https://github.com/latticexyz/mud/pull/1844) token modules until the MUD config gains [namespace support](https://github.com/latticexyz/mud/issues/994). + +Here's how we use this in our example project with the `KeysWithValue` module: + +```ts +syncToRecs({ + ... + tables: { + KeysWithValue: { + namespace: "keywval", + name: "Inventory", + tableId: resourceToHex({ type: "table", namespace: "keywval", name: "Inventory" }), + keySchema: { + valueHash: { type: "bytes32" }, + }, + valueSchema: { + keysWithValue: { type: "bytes32[]" }, + }, + }, + }, + ... +}); +``` + +**[feat(world-modules): add ERC721 module (#1844)](https://github.com/latticexyz/mud/commit/d7325e517ce18597d55e8bce41036e78e00c3a78)** (@latticexyz/world-modules) + +Added the `ERC721Module` to `@latticexyz/world-modules`. +This module allows the registration of `ERC721` tokens in an existing World. + +Important note: this module has not been audited yet, so any production use is discouraged for now. + +````solidity +import { PuppetModule } from "@latticexyz/world-modules/src/modules/puppet/PuppetModule.sol"; +import { ERC721MetadataData } from "@latticexyz/world-modules/src/modules/erc721-puppet/tables/ERC721Metadata.sol"; +import { IERC721Mintable } from "@latticexyz/world-modules/src/modules/erc721-puppet/IERC721Mintable.sol"; +import { registerERC721 } from "@latticexyz/world-modules/src/modules/erc721-puppet/registerERC721.sol"; + +// The ERC721 module requires the Puppet module to be installed first +world.installModule(new PuppetModule(), new bytes(0)); + +// After the Puppet module is installed, new ERC721 tokens can be registered +IERC721Mintable token = registerERC721(world, "myERC721", ERC721MetadataData({ name: "Token", symbol: "TKN", baseURI: "" }));``` +```` + +**[feat(world-modules): add puppet module (#1793)](https://github.com/latticexyz/mud/commit/35348f831b923aed6e9bdf8b38bf337f3e944a48)** (@latticexyz/world-modules) + +Added the `PuppetModule` to `@latticexyz/world-modules`. The puppet pattern allows an external contract to be registered as an external interface for a MUD system. +This allows standards like `ERC20` (that require a specific interface and events to be emitted by a unique contract) to be implemented inside a MUD World. + +The puppet serves as a proxy, forwarding all calls to the implementation system (also called the "puppet master"). +The "puppet master" system can emit events from the puppet contract. + +```solidity +import { PuppetModule } from "@latticexyz/world-modules/src/modules/puppet/PuppetModule.sol"; +import { createPuppet } from "@latticexyz/world-modules/src/modules/puppet/createPuppet.sol"; + +// Install the puppet module +world.installModule(new PuppetModule(), new bytes(0)); + +// Register a new puppet for any system +// The system must implement the `CustomInterface`, +// and the caller must own the system's namespace +CustomInterface puppet = CustomInterface(createPuppet(world, )); +``` + +**[feat(store-indexer,store-sync): filter by table and key (#1794)](https://github.com/latticexyz/mud/commit/f6d214e3d79f9591fddd3687aa987a57f417256c)** (@latticexyz/store-sync) + +Added a `filters` option to store sync to allow filtering client data on tables and keys. Previously, it was only possible to filter on `tableIds`, but the new filter option allows for more flexible filtering by key. + +If you are building a large MUD application, you can use positional keys as a way to shard data and make it possible to load only the data needed in the client for a particular section of your app. We're using this already in Sky Strife to load match-specific data into match pages without having to load data for all matches, greatly improving load time and client performance. + +```ts +syncToRecs({ + ... + filters: [{ tableId: '0x...', key0: '0x...' }], +}); +``` + +The `tableIds` option is now deprecated and will be removed in the future, but is kept here for backwards compatibility. + +**[feat(world-modules): add ERC20 module (#1789)](https://github.com/latticexyz/mud/commit/83638373450af5d8f703a183a74107ef7efb4152)** (@latticexyz/world-modules) + +Added the `ERC20Module` to `@latticexyz/world-modules`. +This module allows the registration of `ERC20` tokens in an existing World. + +Important note: this module has not been audited yet, so any production use is discouraged for now. + +```solidity +import { PuppetModule } from "@latticexyz/world-modules/src/modules/puppet/PuppetModule.sol"; +import { IERC20Mintable } from "@latticexyz/world-modules/src/modules/erc20-puppet/IERC20Mintable.sol"; +import { registerERC20 } from "@latticexyz/world-modules/src/modules/erc20-puppet/registerERC20.sol"; + +// The ERC20 module requires the Puppet module to be installed first +world.installModule(new PuppetModule(), new bytes(0)); + +// After the Puppet module is installed, new ERC20 tokens can be registered +IERC20Mintable token = registerERC20(world, "myERC20", ERC20MetadataData({ decimals: 18, name: "Token", symbol: "TKN" })); +``` + +**[feat(store-sync): sync to zustand (#1843)](https://github.com/latticexyz/mud/commit/fa77635839e760a9de5fc8959ee492b7a4d8a7cd)** (@latticexyz/store-sync) + +Added a Zustand storage adapter and corresponding `syncToZustand` method for use in vanilla and React apps. It's used much like the other sync methods, except it returns a bound store and set of typed tables. + +```ts +import { syncToZustand } from "@latticexyz/store-sync/zustand"; +import config from "contracts/mud.config"; + +const { tables, useStore, latestBlock$, storedBlockLogs$, waitForTransaction } = await syncToZustand({ + config, + ... +}); + +// in vanilla apps +const positions = useStore.getState().getRecords(tables.Position); + +// in React apps +const positions = useStore((state) => state.getRecords(tables.Position)); +``` + +This change will be shortly followed by an update to our templates that uses Zustand as the default client data store and sync method. + +**[feat(store): add experimental config resolve helper (#1826)](https://github.com/latticexyz/mud/commit/b1d41727d4b1964ad3cd907c1c2126b02172b413)** (@latticexyz/common) + +Added a `mapObject` helper to map the value of each property of an object to a new value. + +### Patch changes + +**[fix(create-mud): set store address in PostDeploy script (#1817)](https://github.com/latticexyz/mud/commit/c5148da763645e0adc1250245ea447904014bef2)** (create-mud) + +Updated templates' PostDeploy script to set store address so that tables can be used directly inside PostDeploy. + +**[fix(common,config): remove chalk usage (#1824)](https://github.com/latticexyz/mud/commit/3e057061da17dd2d0c5fd23e6f5a027bdf9a9223)** (@latticexyz/common, @latticexyz/config) + +Removed chalk usage from modules imported in client fix downstream client builds (vite in particular). + +--- + ## Version 2.0.0-next.12 Release date: Fri Oct 20 2023 diff --git a/packages/abi-ts/CHANGELOG.md b/packages/abi-ts/CHANGELOG.md index 07767ee824..babf4db542 100644 --- a/packages/abi-ts/CHANGELOG.md +++ b/packages/abi-ts/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/abi-ts +## 2.0.0-next.13 + ## 2.0.0-next.12 ### Minor Changes diff --git a/packages/abi-ts/package.json b/packages/abi-ts/package.json index 9b6ffc048e..5fe71a78af 100644 --- a/packages/abi-ts/package.json +++ b/packages/abi-ts/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/abi-ts", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Create TypeScript type declaration files (`.d.ts`) for your ABI JSON files.", "repository": { "type": "git", diff --git a/packages/block-logs-stream/CHANGELOG.md b/packages/block-logs-stream/CHANGELOG.md index 20d1b42ae8..abebc30ec2 100644 --- a/packages/block-logs-stream/CHANGELOG.md +++ b/packages/block-logs-stream/CHANGELOG.md @@ -1,5 +1,13 @@ # @latticexyz/block-logs-stream +## 2.0.0-next.13 + +### Patch Changes + +- Updated dependencies [3e057061] +- Updated dependencies [b1d41727] + - @latticexyz/common@2.0.0-next.13 + ## 2.0.0-next.12 ### Patch Changes diff --git a/packages/block-logs-stream/package.json b/packages/block-logs-stream/package.json index 72b3160d01..4a9b94f4f3 100644 --- a/packages/block-logs-stream/package.json +++ b/packages/block-logs-stream/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/block-logs-stream", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Create a stream of EVM block logs for events", "repository": { "type": "git", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index c148d7618d..44abb2a615 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,27 @@ # Change Log +## 2.0.0-next.13 + +### Patch Changes + +- Updated dependencies [52182f70] +- Updated dependencies [d7325e51] +- Updated dependencies [35348f83] +- Updated dependencies [83638373] +- Updated dependencies [3e057061] +- Updated dependencies [b1d41727] + - @latticexyz/utils@2.0.0-next.13 + - @latticexyz/world-modules@2.0.0-next.13 + - @latticexyz/common@2.0.0-next.13 + - @latticexyz/config@2.0.0-next.13 + - @latticexyz/protocol-parser@2.0.0-next.13 + - @latticexyz/store@2.0.0-next.13 + - @latticexyz/world@2.0.0-next.13 + - @latticexyz/abi-ts@2.0.0-next.13 + - @latticexyz/gas-report@2.0.0-next.13 + - @latticexyz/schema-type@2.0.0-next.13 + - @latticexyz/services@2.0.0-next.13 + ## 2.0.0-next.12 ### Major Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index 4c6b5a74ff..bfe013ddde 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/cli", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Command line interface for mud", "repository": { "type": "git", diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md index 423c7a176f..1427545058 100644 --- a/packages/common/CHANGELOG.md +++ b/packages/common/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 2.0.0-next.13 + +### Minor Changes + +- b1d41727: Added a `mapObject` helper to map the value of each property of an object to a new value. + +### Patch Changes + +- 3e057061: Removed chalk usage from modules imported in client fix downstream client builds (vite in particular). + - @latticexyz/schema-type@2.0.0-next.13 + ## 2.0.0-next.12 ### Minor Changes diff --git a/packages/common/package.json b/packages/common/package.json index 97419abb1f..9e8f3e3488 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/common", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Common low level logic shared between packages", "repository": { "type": "git", diff --git a/packages/config/CHANGELOG.md b/packages/config/CHANGELOG.md index 5e729fc211..e737aadc3f 100644 --- a/packages/config/CHANGELOG.md +++ b/packages/config/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## 2.0.0-next.13 + +### Patch Changes + +- 3e057061: Removed chalk usage from modules imported in client fix downstream client builds (vite in particular). +- Updated dependencies [3e057061] +- Updated dependencies [b1d41727] + - @latticexyz/common@2.0.0-next.13 + - @latticexyz/schema-type@2.0.0-next.13 + ## 2.0.0-next.12 ### Patch Changes diff --git a/packages/config/package.json b/packages/config/package.json index 64231ff6d0..0c0f39cbb0 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/config", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Config for Store and World", "repository": { "type": "git", diff --git a/packages/create-mud/CHANGELOG.md b/packages/create-mud/CHANGELOG.md index 666f04ec2f..2a2f738de2 100644 --- a/packages/create-mud/CHANGELOG.md +++ b/packages/create-mud/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 2.0.0-next.13 + +### Patch Changes + +- c5148da7: Updated templates' PostDeploy script to set store address so that tables can be used directly inside PostDeploy. + ## 2.0.0-next.12 ### Patch Changes diff --git a/packages/create-mud/package.json b/packages/create-mud/package.json index 50ac9ff2c0..db1f427944 100644 --- a/packages/create-mud/package.json +++ b/packages/create-mud/package.json @@ -1,6 +1,6 @@ { "name": "create-mud", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Create a new MUD project", "license": "MIT", "author": "Lattice ", diff --git a/packages/dev-tools/CHANGELOG.md b/packages/dev-tools/CHANGELOG.md index f92cca33a5..6c770a2d1f 100644 --- a/packages/dev-tools/CHANGELOG.md +++ b/packages/dev-tools/CHANGELOG.md @@ -1,5 +1,23 @@ # @latticexyz/dev-tools +## 2.0.0-next.13 + +### Patch Changes + +- Updated dependencies [52182f70] +- Updated dependencies [de47d698] +- Updated dependencies [f6d214e3] +- Updated dependencies [fa776358] +- Updated dependencies [3e057061] +- Updated dependencies [b1d41727] + - @latticexyz/utils@2.0.0-next.13 + - @latticexyz/store-sync@2.0.0-next.13 + - @latticexyz/common@2.0.0-next.13 + - @latticexyz/recs@2.0.0-next.13 + - @latticexyz/store@2.0.0-next.13 + - @latticexyz/world@2.0.0-next.13 + - @latticexyz/react@2.0.0-next.13 + ## 2.0.0-next.12 ### Patch Changes diff --git a/packages/dev-tools/package.json b/packages/dev-tools/package.json index 91b69bf074..1fd2ceb198 100644 --- a/packages/dev-tools/package.json +++ b/packages/dev-tools/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/dev-tools", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "MUD developer tools", "repository": { "type": "git", @@ -50,12 +50,12 @@ "vitest": "0.31.4" }, "peerDependencies": { - "@latticexyz/common": "2.0.0-next.12", - "@latticexyz/recs": "2.0.0-next.12", - "@latticexyz/store": "2.0.0-next.12", - "@latticexyz/store-sync": "2.0.0-next.12", - "@latticexyz/utils": "2.0.0-next.12", - "@latticexyz/world": "2.0.0-next.12" + "@latticexyz/common": "2.0.0-next.13", + "@latticexyz/recs": "2.0.0-next.13", + "@latticexyz/store": "2.0.0-next.13", + "@latticexyz/store-sync": "2.0.0-next.13", + "@latticexyz/utils": "2.0.0-next.13", + "@latticexyz/world": "2.0.0-next.13" }, "publishConfig": { "access": "public" diff --git a/packages/ecs-browser/CHANGELOG.md b/packages/ecs-browser/CHANGELOG.md index cba492e611..1962bbb9d5 100644 --- a/packages/ecs-browser/CHANGELOG.md +++ b/packages/ecs-browser/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/ecs-browser +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/ecs-browser/package.json b/packages/ecs-browser/package.json index 35a52fe215..16bc62adac 100644 --- a/packages/ecs-browser/package.json +++ b/packages/ecs-browser/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/ecs-browser", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "private": true } diff --git a/packages/faucet/CHANGELOG.md b/packages/faucet/CHANGELOG.md index 05f8a1e151..0cfdda502a 100644 --- a/packages/faucet/CHANGELOG.md +++ b/packages/faucet/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/faucet +## 2.0.0-next.13 + ## 2.0.0-next.12 ### Minor Changes diff --git a/packages/faucet/package.json b/packages/faucet/package.json index 9e74955f2d..978b22e7c7 100644 --- a/packages/faucet/package.json +++ b/packages/faucet/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/faucet", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Faucet API for Lattice testnet", "repository": { "type": "git", diff --git a/packages/gas-report/CHANGELOG.md b/packages/gas-report/CHANGELOG.md index c77560338d..f30804a2aa 100644 --- a/packages/gas-report/CHANGELOG.md +++ b/packages/gas-report/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/gas-report/package.json b/packages/gas-report/package.json index a458228147..4a6320057d 100644 --- a/packages/gas-report/package.json +++ b/packages/gas-report/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/gas-report", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Gas reporter for specific lines within forge tests", "repository": { "type": "git", diff --git a/packages/network/CHANGELOG.md b/packages/network/CHANGELOG.md index c0e3c75dc9..aa5045b3d2 100644 --- a/packages/network/CHANGELOG.md +++ b/packages/network/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/network +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/network/package.json b/packages/network/package.json index e558cf5032..b190195f64 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/network", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "private": true } diff --git a/packages/noise/CHANGELOG.md b/packages/noise/CHANGELOG.md index e00d038dd2..a539fd9659 100644 --- a/packages/noise/CHANGELOG.md +++ b/packages/noise/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/noise/package.json b/packages/noise/package.json index 34afeb292a..9f9a80b8ed 100644 --- a/packages/noise/package.json +++ b/packages/noise/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/noise", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "license": "MIT", "type": "module", "exports": { diff --git a/packages/phaserx/CHANGELOG.md b/packages/phaserx/CHANGELOG.md index fdfd052112..c92e83c463 100644 --- a/packages/phaserx/CHANGELOG.md +++ b/packages/phaserx/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 2.0.0-next.13 + +### Patch Changes + +- Updated dependencies [52182f70] + - @latticexyz/utils@2.0.0-next.13 + ## 2.0.0-next.12 ### Patch Changes diff --git a/packages/phaserx/package.json b/packages/phaserx/package.json index 682f6b443f..e35e387fd0 100644 --- a/packages/phaserx/package.json +++ b/packages/phaserx/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/phaserx", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/protocol-parser/CHANGELOG.md b/packages/protocol-parser/CHANGELOG.md index d847173b34..76f6698723 100644 --- a/packages/protocol-parser/CHANGELOG.md +++ b/packages/protocol-parser/CHANGELOG.md @@ -1,5 +1,14 @@ # @latticexyz/protocol-parser +## 2.0.0-next.13 + +### Patch Changes + +- Updated dependencies [3e057061] +- Updated dependencies [b1d41727] + - @latticexyz/common@2.0.0-next.13 + - @latticexyz/schema-type@2.0.0-next.13 + ## 2.0.0-next.12 ### Patch Changes diff --git a/packages/protocol-parser/package.json b/packages/protocol-parser/package.json index 73996e4380..258dcc8a71 100644 --- a/packages/protocol-parser/package.json +++ b/packages/protocol-parser/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/protocol-parser", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Parser utilities for the MUD protocol", "repository": { "type": "git", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 898a4318a2..1ca1f0727e 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 2.0.0-next.13 + +### Patch Changes + +- @latticexyz/recs@2.0.0-next.13 +- @latticexyz/store@2.0.0-next.13 + ## 2.0.0-next.12 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index a818a80b5c..28f969d25e 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/react", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "React tools for MUD client.", "repository": { "type": "git", diff --git a/packages/recs/CHANGELOG.md b/packages/recs/CHANGELOG.md index f45017b478..88f42c10c1 100644 --- a/packages/recs/CHANGELOG.md +++ b/packages/recs/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 2.0.0-next.13 + +### Patch Changes + +- Updated dependencies [52182f70] + - @latticexyz/utils@2.0.0-next.13 + - @latticexyz/schema-type@2.0.0-next.13 + ## 2.0.0-next.12 ### Patch Changes diff --git a/packages/recs/package.json b/packages/recs/package.json index a7ba7fe539..396d055ba5 100644 --- a/packages/recs/package.json +++ b/packages/recs/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/recs", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/schema-type/CHANGELOG.md b/packages/schema-type/CHANGELOG.md index 586237932d..ef7d10996a 100644 --- a/packages/schema-type/CHANGELOG.md +++ b/packages/schema-type/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/schema-type/package.json b/packages/schema-type/package.json index bf9cc7b7a2..b74052bbe4 100644 --- a/packages/schema-type/package.json +++ b/packages/schema-type/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/schema-type", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "SchemaType enum for various languages", "repository": { "type": "git", diff --git a/packages/services/CHANGELOG.md b/packages/services/CHANGELOG.md index 7bc5d14ae1..961c4f19aa 100644 --- a/packages/services/CHANGELOG.md +++ b/packages/services/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/services/package.json b/packages/services/package.json index bd9bcc0dd2..ca2073c527 100644 --- a/packages/services/package.json +++ b/packages/services/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/services", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "MUD services for enhanced interactions with on-chain ECS state", "repository": { "type": "git", diff --git a/packages/solecs/CHANGELOG.md b/packages/solecs/CHANGELOG.md index e3281cc00f..6950079cd5 100644 --- a/packages/solecs/CHANGELOG.md +++ b/packages/solecs/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/solecs +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/solecs/package.json b/packages/solecs/package.json index 2afd8b795a..1618a4c995 100644 --- a/packages/solecs/package.json +++ b/packages/solecs/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/solecs", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "private": true } diff --git a/packages/solhint-config-mud/CHANGELOG.md b/packages/solhint-config-mud/CHANGELOG.md index 5612268a88..54ec3b2049 100644 --- a/packages/solhint-config-mud/CHANGELOG.md +++ b/packages/solhint-config-mud/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/solhint-config-mud/package.json b/packages/solhint-config-mud/package.json index b254f1481b..08433a1c53 100644 --- a/packages/solhint-config-mud/package.json +++ b/packages/solhint-config-mud/package.json @@ -1,6 +1,6 @@ { "name": "solhint-config-mud", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/solhint-plugin-mud/CHANGELOG.md b/packages/solhint-plugin-mud/CHANGELOG.md index 5612268a88..54ec3b2049 100644 --- a/packages/solhint-plugin-mud/CHANGELOG.md +++ b/packages/solhint-plugin-mud/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/solhint-plugin-mud/package.json b/packages/solhint-plugin-mud/package.json index 4e1231aada..a7ac22f1e3 100644 --- a/packages/solhint-plugin-mud/package.json +++ b/packages/solhint-plugin-mud/package.json @@ -1,6 +1,6 @@ { "name": "solhint-plugin-mud", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/std-client/CHANGELOG.md b/packages/std-client/CHANGELOG.md index 561c97e8de..daa703c338 100644 --- a/packages/std-client/CHANGELOG.md +++ b/packages/std-client/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/std-client +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/std-client/package.json b/packages/std-client/package.json index fbdf43d587..0cea0e89c8 100644 --- a/packages/std-client/package.json +++ b/packages/std-client/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/std-client", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "private": true } diff --git a/packages/std-contracts/CHANGELOG.md b/packages/std-contracts/CHANGELOG.md index 565fffc1ec..9a4fde4381 100644 --- a/packages/std-contracts/CHANGELOG.md +++ b/packages/std-contracts/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/std-contracts +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/std-contracts/package.json b/packages/std-contracts/package.json index bb96360408..4551c35def 100644 --- a/packages/std-contracts/package.json +++ b/packages/std-contracts/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/std-contracts", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "private": true } diff --git a/packages/store-cache/CHANGELOG.md b/packages/store-cache/CHANGELOG.md index 15bb1e9c74..188aef70f9 100644 --- a/packages/store-cache/CHANGELOG.md +++ b/packages/store-cache/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/store-cache +## 2.0.0-next.13 + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/store-cache/package.json b/packages/store-cache/package.json index 3dd2877ddb..c7d60a627d 100644 --- a/packages/store-cache/package.json +++ b/packages/store-cache/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/store-cache", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "private": true } diff --git a/packages/store-indexer/CHANGELOG.md b/packages/store-indexer/CHANGELOG.md index 7acada1d3c..8e2f1fa5e9 100644 --- a/packages/store-indexer/CHANGELOG.md +++ b/packages/store-indexer/CHANGELOG.md @@ -1,5 +1,35 @@ # @latticexyz/store-indexer +## 2.0.0-next.13 + +### Major Changes + +- f6d214e3: Removed `tableIds` filter option in favor of the more flexible `filters` option that accepts `tableId` and an optional `key0` and/or `key1` to filter data by tables and keys. + + If you were using an indexer client directly, you'll need to update your query: + + ```diff + await indexer.findAll.query({ + chainId, + address, + - tableIds: ['0x...'], + + filters: [{ tableId: '0x...' }], + }); + ``` + +### Patch Changes + +- Updated dependencies [de47d698] +- Updated dependencies [f6d214e3] +- Updated dependencies [fa776358] +- Updated dependencies [3e057061] +- Updated dependencies [b1d41727] + - @latticexyz/store-sync@2.0.0-next.13 + - @latticexyz/common@2.0.0-next.13 + - @latticexyz/block-logs-stream@2.0.0-next.13 + - @latticexyz/protocol-parser@2.0.0-next.13 + - @latticexyz/store@2.0.0-next.13 + ## 2.0.0-next.12 ### Minor Changes diff --git a/packages/store-indexer/package.json b/packages/store-indexer/package.json index da20550a2b..674460dae3 100644 --- a/packages/store-indexer/package.json +++ b/packages/store-indexer/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/store-indexer", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Minimal Typescript indexer for Store", "repository": { "type": "git", diff --git a/packages/store-sync/CHANGELOG.md b/packages/store-sync/CHANGELOG.md index fa1a070d09..e64c8c10e9 100644 --- a/packages/store-sync/CHANGELOG.md +++ b/packages/store-sync/CHANGELOG.md @@ -1,5 +1,78 @@ # @latticexyz/store-sync +## 2.0.0-next.13 + +### Minor Changes + +- de47d698: Added an optional `tables` option to `syncToRecs` to allow you to sync from tables that may not be expressed by your MUD config. This will be useful for namespaced tables used by [ERC20](https://github.com/latticexyz/mud/pull/1789) and [ERC721](https://github.com/latticexyz/mud/pull/1844) token modules until the MUD config gains [namespace support](https://github.com/latticexyz/mud/issues/994). + + Here's how we use this in our example project with the `KeysWithValue` module: + + ```ts + syncToRecs({ + ... + tables: { + KeysWithValue: { + namespace: "keywval", + name: "Inventory", + tableId: resourceToHex({ type: "table", namespace: "keywval", name: "Inventory" }), + keySchema: { + valueHash: { type: "bytes32" }, + }, + valueSchema: { + keysWithValue: { type: "bytes32[]" }, + }, + }, + }, + ... + }); + ``` + +- f6d214e3: Added a `filters` option to store sync to allow filtering client data on tables and keys. Previously, it was only possible to filter on `tableIds`, but the new filter option allows for more flexible filtering by key. + + If you are building a large MUD application, you can use positional keys as a way to shard data and make it possible to load only the data needed in the client for a particular section of your app. We're using this already in Sky Strife to load match-specific data into match pages without having to load data for all matches, greatly improving load time and client performance. + + ```ts + syncToRecs({ + ... + filters: [{ tableId: '0x...', key0: '0x...' }], + }); + ``` + + The `tableIds` option is now deprecated and will be removed in the future, but is kept here for backwards compatibility. + +- fa776358: Added a Zustand storage adapter and corresponding `syncToZustand` method for use in vanilla and React apps. It's used much like the other sync methods, except it returns a bound store and set of typed tables. + + ```ts + import { syncToZustand } from "@latticexyz/store-sync/zustand"; + import config from "contracts/mud.config"; + + const { tables, useStore, latestBlock$, storedBlockLogs$, waitForTransaction } = await syncToZustand({ + config, + ... + }); + + // in vanilla apps + const positions = useStore.getState().getRecords(tables.Position); + + // in React apps + const positions = useStore((state) => state.getRecords(tables.Position)); + ``` + + This change will be shortly followed by an update to our templates that uses Zustand as the default client data store and sync method. + +### Patch Changes + +- Updated dependencies [3e057061] +- Updated dependencies [b1d41727] + - @latticexyz/common@2.0.0-next.13 + - @latticexyz/recs@2.0.0-next.13 + - @latticexyz/block-logs-stream@2.0.0-next.13 + - @latticexyz/protocol-parser@2.0.0-next.13 + - @latticexyz/store@2.0.0-next.13 + - @latticexyz/world@2.0.0-next.13 + - @latticexyz/schema-type@2.0.0-next.13 + ## 2.0.0-next.12 ### Patch Changes diff --git a/packages/store-sync/package.json b/packages/store-sync/package.json index 3939841bc0..4a4cffd93a 100644 --- a/packages/store-sync/package.json +++ b/packages/store-sync/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/store-sync", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Utilities to sync MUD Store events with a client or cache", "repository": { "type": "git", diff --git a/packages/store/CHANGELOG.md b/packages/store/CHANGELOG.md index ce845d8743..6ffbb80fcd 100644 --- a/packages/store/CHANGELOG.md +++ b/packages/store/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## 2.0.0-next.13 + +### Patch Changes + +- Updated dependencies [3e057061] +- Updated dependencies [b1d41727] + - @latticexyz/common@2.0.0-next.13 + - @latticexyz/config@2.0.0-next.13 + - @latticexyz/schema-type@2.0.0-next.13 + ## 2.0.0-next.12 ### Major Changes diff --git a/packages/store/package.json b/packages/store/package.json index 58ddb59f98..2eb5299df0 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/store", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "Store", "repository": { "type": "git", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index a9482c2661..e77f1e7c56 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,5 +1,28 @@ # Change Log +## 2.0.0-next.13 + +### Major Changes + +- 52182f70: Removed `keccak256` and `keccak256Coord` hash utils in favor of [viem's `keccak256`](https://viem.sh/docs/utilities/keccak256.html#keccak256). + + ```diff + - import { keccak256 } from "@latticexyz/utils"; + + import { keccak256, toHex } from "viem"; + + - const hash = keccak256("some string"); + + const hash = keccak256(toHex("some string")); + ``` + + ```diff + - import { keccak256Coord } from "@latticexyz/utils"; + + import { encodeAbiParameters, keccak256, parseAbiParameters } from "viem"; + + const coord = { x: 1, y: 1 }; + - const hash = keccak256Coord(coord); + + const hash = keccak256(encodeAbiParameters(parseAbiParameters("int32, int32"), [coord.x, coord.y])); + ``` + ## 2.0.0-next.12 ## 2.0.0-next.11 diff --git a/packages/utils/package.json b/packages/utils/package.json index dee5c7593c..ee602ac41a 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/utils", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/world-modules/CHANGELOG.md b/packages/world-modules/CHANGELOG.md index 6d16878ded..e287cde716 100644 --- a/packages/world-modules/CHANGELOG.md +++ b/packages/world-modules/CHANGELOG.md @@ -1,5 +1,73 @@ # Change Log +## 2.0.0-next.13 + +### Minor Changes + +- d7325e51: Added the `ERC721Module` to `@latticexyz/world-modules`. + This module allows the registration of `ERC721` tokens in an existing World. + + Important note: this module has not been audited yet, so any production use is discouraged for now. + + ````solidity + import { PuppetModule } from "@latticexyz/world-modules/src/modules/puppet/PuppetModule.sol"; + import { ERC721MetadataData } from "@latticexyz/world-modules/src/modules/erc721-puppet/tables/ERC721Metadata.sol"; + import { IERC721Mintable } from "@latticexyz/world-modules/src/modules/erc721-puppet/IERC721Mintable.sol"; + import { registerERC721 } from "@latticexyz/world-modules/src/modules/erc721-puppet/registerERC721.sol"; + + // The ERC721 module requires the Puppet module to be installed first + world.installModule(new PuppetModule(), new bytes(0)); + + // After the Puppet module is installed, new ERC721 tokens can be registered + IERC721Mintable token = registerERC721(world, "myERC721", ERC721MetadataData({ name: "Token", symbol: "TKN", baseURI: "" }));``` + ```` + +- 35348f83: Added the `PuppetModule` to `@latticexyz/world-modules`. The puppet pattern allows an external contract to be registered as an external interface for a MUD system. + This allows standards like `ERC20` (that require a specific interface and events to be emitted by a unique contract) to be implemented inside a MUD World. + + The puppet serves as a proxy, forwarding all calls to the implementation system (also called the "puppet master"). + The "puppet master" system can emit events from the puppet contract. + + ```solidity + import { PuppetModule } from "@latticexyz/world-modules/src/modules/puppet/PuppetModule.sol"; + import { createPuppet } from "@latticexyz/world-modules/src/modules/puppet/createPuppet.sol"; + + // Install the puppet module + world.installModule(new PuppetModule(), new bytes(0)); + + // Register a new puppet for any system + // The system must implement the `CustomInterface`, + // and the caller must own the system's namespace + CustomInterface puppet = CustomInterface(createPuppet(world, )); + ``` + +- 83638373: Added the `ERC20Module` to `@latticexyz/world-modules`. + This module allows the registration of `ERC20` tokens in an existing World. + + Important note: this module has not been audited yet, so any production use is discouraged for now. + + ```solidity + import { PuppetModule } from "@latticexyz/world-modules/src/modules/puppet/PuppetModule.sol"; + import { IERC20Mintable } from "@latticexyz/world-modules/src/modules/erc20-puppet/IERC20Mintable.sol"; + import { registerERC20 } from "@latticexyz/world-modules/src/modules/erc20-puppet/registerERC20.sol"; + + // The ERC20 module requires the Puppet module to be installed first + world.installModule(new PuppetModule(), new bytes(0)); + + // After the Puppet module is installed, new ERC20 tokens can be registered + IERC20Mintable token = registerERC20(world, "myERC20", ERC20MetadataData({ decimals: 18, name: "Token", symbol: "TKN" })); + ``` + +### Patch Changes + +- Updated dependencies [3e057061] +- Updated dependencies [b1d41727] + - @latticexyz/common@2.0.0-next.13 + - @latticexyz/config@2.0.0-next.13 + - @latticexyz/store@2.0.0-next.13 + - @latticexyz/world@2.0.0-next.13 + - @latticexyz/schema-type@2.0.0-next.13 + ## 2.0.0-next.12 ### Major Changes diff --git a/packages/world-modules/package.json b/packages/world-modules/package.json index d659e0ec46..5e679ca270 100644 --- a/packages/world-modules/package.json +++ b/packages/world-modules/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/world-modules", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "World modules", "repository": { "type": "git", diff --git a/packages/world/CHANGELOG.md b/packages/world/CHANGELOG.md index e30d8f85fd..6401c9cd36 100644 --- a/packages/world/CHANGELOG.md +++ b/packages/world/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 2.0.0-next.13 + +### Patch Changes + +- Updated dependencies [3e057061] +- Updated dependencies [b1d41727] + - @latticexyz/common@2.0.0-next.13 + - @latticexyz/config@2.0.0-next.13 + - @latticexyz/store@2.0.0-next.13 + - @latticexyz/schema-type@2.0.0-next.13 + ## 2.0.0-next.12 ### Minor Changes diff --git a/packages/world/package.json b/packages/world/package.json index 596cf8ae47..87b97d9e94 100644 --- a/packages/world/package.json +++ b/packages/world/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/world", - "version": "2.0.0-next.12", + "version": "2.0.0-next.13", "description": "World framework", "repository": { "type": "git",