-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(store): default off storeArgument (#1741)
- Loading branch information
Showing
56 changed files
with
182 additions
and
5,636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
"@latticexyz/cli": patch | ||
"@latticexyz/store": major | ||
"@latticexyz/world-modules": patch | ||
"@latticexyz/world": patch | ||
"create-mud": patch | ||
--- | ||
|
||
Store config now defaults `storeArgument: false` for all tables. This means that table libraries, by default, will no longer include the extra functions with the `_store` argument. This default was changed to clear up the confusion around using table libraries in tests, `PostDeploy` scripts, etc. | ||
|
||
If you are sure you need to manually specify a store when interacting with tables, you can still manually toggle it back on with `storeArgument: true` in the table settings of your MUD config. | ||
|
||
If you want to use table libraries in `PostDeploy.s.sol`, you can add the following lines: | ||
|
||
```diff | ||
import { Script } from "forge-std/Script.sol"; | ||
import { console } from "forge-std/console.sol"; | ||
import { IWorld } from "../src/codegen/world/IWorld.sol"; | ||
+ import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; | ||
|
||
contract PostDeploy is Script { | ||
function run(address worldAddress) external { | ||
+ StoreSwitch.setStoreAddress(worldAddress); | ||
+ | ||
+ SomeTable.get(someKey); | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.