@latticexyz/gas-report
Advanced tools
Changelog
Version 2.1.0
Release date: Mon Aug 05 2024
docs: update resource labels changeset (#2985) (@latticexyz/config, @latticexyz/store, @latticexyz/world)
Tables and systems in config output now include a label
property. Labels are now used throughout the codebase as a user-friendly way to reference the given resource: config keys, contract names, generated libraries, etc.
Inside namespaces
config output, keys for tables and systems and their filenames will always correspond to their labels. This should make MUD tooling more intuitive and predictable. For backwards compatibility, tables
config output still uses namespace-prefixed keys.
Labels replace the previous resource name
usage, which is truncated to bytes16
to be used as part of the resource ID and, in the future, may not always be human-readable.
These labels will soon be registered onchain so that developers can initialize a new MUD project from an existing world, generating config and interfaces with user-friendly names.
docs: update namespaces changeset (#2989) (@latticexyz/cli, @latticexyz/store, @latticexyz/world)
MUD projects can now use multiple namespaces via a new top-level namespaces
config option.
import { defineWorld } from "@latticexyz/world";
export default defineWorld({
namespaces: {
game: {
tables: {
Player: { ... },
Position: { ... },
},
},
guilds: {
tables: {
Guild: { ... },
},
systems: {
MembershipSystem: { ... },
TreasurySystem: { ... },
},
},
},
});
Once you use the top-level namespaces
config option, your project will be in "multiple namespaces mode", which expects a source directory structure similar to the config structure: a top-level namespaces
directory with nested namespace directories that correspond to each namespace label in the config.
~/guilds
├── mud.config.ts
└── src
└── namespaces
├── game
│ └── codegen
│ └── tables
│ ├── Player.sol
│ └── Position.sol
└── guilds
├── MembershipSystem.sol
├── TreasurySystem.sol
└── codegen
└── tables
└── Guild.sol
fix(cli,store): don't deploy disabled tables (#2982) (@latticexyz/store)
Disabled deploy of Hooks
table, as this was meant to be a generic, codegen-only table.
refactor(store-sync): remove remaining refs to old config (#2938) (@latticexyz/store-sync)
Refactored package to use the new Store/World configs under the hood, removing compatibility layers and improving performance.
refactor(store-sync): remove remaining refs to old config (#2938) (@latticexyz/store-indexer)
Updated return values to match updated types in @latticexyz/store-sync
.
refactor(world): update worldgen with namespaces output (#2974) (@latticexyz/world)
Refactored worldgen in preparation for multiple namespaces.
chore(store-sync): simplify types (#2946) (@latticexyz/store-sync)
Adjusted SyncToRecsOptions
type intersection to improve TypeScript performance.
refactor(cli): move off of old config (#2941) (@latticexyz/cli)
Refactored package to use the new Store/World configs under the hood, removing compatibility layers.
Removed --srcDir
option from all commands in favor of using sourceDirectory
in the project's MUD config.
fix: preserve JsDoc on defineWorld output, bump @arktype/util (#2815) (@latticexyz/config, @latticexyz/query, @latticexyz/store, @latticexyz/world)
Bumped @arktype/util
and moved evaluate
/satisfy
usages to its show
/satisfy
helpers.
refactor(store-sync): use config namespaces for tables (#2963) (@latticexyz/store-sync)
Refactored syncToRecs
and syncToZustand
to use tables from config namespaces output. This is a precursor for supporting multiple namespaces.
Note for library authors: If you were using createStorageAdapter
from @latticexyz/store-sync/recs
, this helper no longer appends MUD's built-in tables from Store and World packages. This behavior was moved into syncToRecs
for consistency with syncToZustand
and makes createStorageAdapter
less opinionated.
You can achieve the previous behavior with:
import { createStorageAdapter } from "@latticexyz/store-sync/recs";
+import { mudTables } from "@latticexyz/store-sync";
createStorageAdapter({
- tables,
+ tables: { ...tables, ...mudTables },
...
});
refactor(cli): move off of old config (#2941) (@latticexyz/world)
Refactored how worldgen resolves systems from the config and filesystem.
fix(cli,store): don't deploy disabled tables (#2982) (@latticexyz/cli)
mud deploy
will now correctly skip tables configured with deploy: { disabled: true }
.
refactor(cli): use config namespaces for tables (#2965) (@latticexyz/cli)
Refactored CLI commands to use tables from config namespaces output. This is a precursor for supporting multiple namespaces.
fix: preserve JsDoc on defineWorld output, bump @arktype/util (#2815) (@latticexyz/common)
Removed evaluate
and satisfy
type utils in favor of show
and satisfy
from @arktype/util
.
refactor(cli): move off of old config (#2941) (@latticexyz/world-modules)
Moved build scripts to mud build
now that CLI doesn't depend on this package.
Removed generated world interfaces as this package isn't meant to be used as a "world", but as a set of individual modules.
refactor(store-sync): move syncToZustand to new config (#2936) (@latticexyz/dev-tools)
Updated Zustand components after changes to syncToZustand
.
refactor(cli): remove last ethers usage (#2952) (@latticexyz/cli)
Refactored mud trace
command to use Viem instead of Ethers and removed Ethers dependencies from the package.
refactor(store): update tablegen with namespaces output (#2972) (@latticexyz/store)
Refactored tablegen in preparation for multiple namespaces and addressed a few edge cases:
filePath
are now resolved relative to the project root (where the mud.config.ts
lives) rather than the current working directory.LibraryName.UserTypeName
).chore: bump glob (#2922) (@latticexyz/abi-ts, @latticexyz/cli, @latticexyz/world-modules, @latticexyz/world, create-mud)
Bumped glob
dependency.
feat(common): throw instead of truncating namespace (#2917) (@latticexyz/common)
resourceToHex
will now throw if provided namespace is >14 characters. Since namespaces are used to determine access control, it's not safe to automatically truncate to fit into bytes14
as that may change the indended namespace for resource access.
refactor(store,world): simplify table shorthands (#2969) (@latticexyz/store, @latticexyz/world)
Refactored how the config handles shorthand table definitions, greatly simplifying the codebase. This will make it easier to add support for multiple namespaces.