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) #1820

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Version Packages (next) #1820

merged 1 commit into from
Nov 2, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 24, 2023

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

main is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on main.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

[email protected]

Major Changes

  • 78949f2: Replaced the react template with a basic task list app using the new Zustand storage adapter and sync method. This new template better demonstrates the different ways of building with MUD and has fewer concepts to learn (i.e. just tables and records, no more ECS).

    For ECS-based React apps, you can use react-ecs template for the previous RECS storage adapter.

Minor Changes

Patch Changes

  • c5148da: Updated templates' PostDeploy script to set store address so that tables can be used directly inside PostDeploy.
  • 1b33a91: Fixed an issue when creating a new project from the react app, where React's expressions were overlapping with Handlebars expressions (used by our template command).

@latticexyz/[email protected]

Major Changes

  • f6d214e: 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:

      await indexer.findAll.query({
        chainId,
        address,
    -   tableIds: ['0x...'],
    +   filters: [{ tableId: '0x...' }],
      });

Patch Changes

@latticexyz/[email protected]

Major Changes

  • 52182f7: Removed keccak256 and keccak256Coord hash utils in favor of viem's keccak256.

    - import { keccak256 } from "@latticexyz/utils";
    + import { keccak256, toHex } from "viem";
    
    - const hash = keccak256("some string");
    + const hash = keccak256(toHex("some string"));
    - 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]));

@latticexyz/[email protected]

Minor Changes

  • b1d4172: Added a mapObject helper to map the value of each property of an object to a new value.

Patch Changes

  • 3e05706: Removed chalk usage from modules imported in client fix downstream client builds (vite in particular).

@latticexyz/[email protected]

Minor Changes

  • de47d69: 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 and ERC721 token modules until the MUD config gains namespace support.

    Here's how we use this in our example project with the KeysWithValue module:

    syncToRecs({
      ...
      tables: {
        KeysWithValue: {
          namespace: "keywval",
          name: "Inventory",
          tableId: resourceToHex({ type: "table", namespace: "keywval", name: "Inventory" }),
          keySchema: {
            valueHash: { type: "bytes32" },
          },
          valueSchema: {
            keysWithValue: { type: "bytes32[]" },
          },
        },
      },
      ...
    });
  • f6d214e: 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.

    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.

  • fa77635: 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.

    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

@latticexyz/[email protected]

Minor Changes

  • d7325e5: 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.

    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: "" }));```
  • 35348f8: 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.

    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, <systemId>));
  • 8363837: 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.

    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

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

[email protected]

[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@github-actions github-actions bot requested review from alvrs and holic as code owners October 24, 2023 13:49
@github-actions github-actions bot force-pushed the changeset-release/main branch from b90afd8 to b3b0b38 Compare October 24, 2023 17:25
@github-actions github-actions bot force-pushed the changeset-release/main branch from b3b0b38 to efabc55 Compare October 24, 2023 18:45
@vercel vercel bot temporarily deployed to Preview – mud-docs October 24, 2023 18:50 Inactive
@vercel vercel bot temporarily deployed to Preview – mud-docs October 24, 2023 18:50 Inactive
@vercel vercel bot temporarily deployed to Preview – mud-docs October 24, 2023 18:50 Inactive
@github-actions github-actions bot force-pushed the changeset-release/main branch from efabc55 to e8ad8f2 Compare October 25, 2023 09:21
@github-actions github-actions bot force-pushed the changeset-release/main branch from e8ad8f2 to e3b81a5 Compare October 27, 2023 13:11
@vercel vercel bot temporarily deployed to Preview – mud-next-docs October 27, 2023 13:16 Inactive
@vercel vercel bot temporarily deployed to Preview – mud-next-docs October 27, 2023 13:16 Inactive
@vercel vercel bot temporarily deployed to Preview – mud-next-docs October 27, 2023 13:16 Inactive
@github-actions github-actions bot force-pushed the changeset-release/main branch from e3b81a5 to 902b8bd Compare October 27, 2023 13:52
@github-actions github-actions bot force-pushed the changeset-release/main branch from 902b8bd to 429dd4c Compare October 30, 2023 10:53
@github-actions github-actions bot force-pushed the changeset-release/main branch from 429dd4c to e9a8389 Compare October 31, 2023 11:16
@github-actions github-actions bot force-pushed the changeset-release/main branch from e9a8389 to 1eadeff Compare October 31, 2023 12:40
@github-actions github-actions bot force-pushed the changeset-release/main branch from a627f7a to 0809cbd Compare November 1, 2023 15:39
@github-actions github-actions bot force-pushed the changeset-release/main branch from 0809cbd to 356c021 Compare November 2, 2023 11:40
@github-actions github-actions bot force-pushed the changeset-release/main branch from 356c021 to d92319f Compare November 2, 2023 11:59
@github-actions github-actions bot force-pushed the changeset-release/main branch from d92319f to 51cc6c8 Compare November 2, 2023 12:21
@github-actions github-actions bot force-pushed the changeset-release/main branch from 51cc6c8 to 53ca923 Compare November 2, 2023 12:42
@github-actions github-actions bot force-pushed the changeset-release/main branch from 53ca923 to 010f637 Compare November 2, 2023 12:49
@github-actions github-actions bot force-pushed the changeset-release/main branch from 010f637 to f0fdd4c Compare November 2, 2023 13:08
@github-actions github-actions bot force-pushed the changeset-release/main branch from f0fdd4c to 9e0681c Compare November 2, 2023 13:41
@github-actions github-actions bot force-pushed the changeset-release/main branch from 9e0681c to 65a57a3 Compare November 2, 2023 16:21
@alvrs alvrs merged commit d3edec2 into main Nov 2, 2023
@alvrs alvrs deleted the changeset-release/main branch November 2, 2023 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant