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

Merged
merged 1 commit into from
Sep 7, 2023
Merged

Version Packages (next) #1419

merged 1 commit into from
Sep 7, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 7, 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

@latticexyz/[email protected]

Major Changes

  • #1399 c4d5eb4e Thanks @alvrs! - - The onSetRecord hook is split into onBeforeSetRecord and onAfterSetRecord and the onDeleteRecord hook is split into onBeforeDeleteRecord and onAfterDeleteRecord.
    The purpose of this change is to allow more fine-grained control over the point in the lifecycle at which hooks are executed.

    The previous hooks were executed before modifying data, so they can be replaced with the respective onBefore hooks.

    - function onSetRecord(
    + function onBeforeSetRecord(
        bytes32 table,
        bytes32[] memory key,
        bytes memory data,
        Schema valueSchema
      ) public;
    
    - function onDeleteRecord(
    + function onBeforeDeleteRecord(
        bytes32 table,
        bytes32[] memory key,
        Schema valueSchema
      ) public;
    • It is now possible to specify which methods of a hook contract should be called when registering a hook. The purpose of this change is to save gas by avoiding to call no-op hook methods.

      function registerStoreHook(
        bytes32 tableId,
      - IStoreHook hookAddress
      + IStoreHook hookAddress,
      + uint8 enabledHooksBitmap
      ) public;
      
      function registerSystemHook(
        bytes32 systemId,
      - ISystemHook hookAddress
      + ISystemHook hookAddress,
      + uint8 enabledHooksBitmap
      ) public;

      There are StoreHookLib and SystemHookLib with helper functions to encode the bitmap of enabled hooks.

      import { StoreHookLib } from "@latticexyz/store/src/StoreHook.sol";
      
      uint8 storeHookBitmap = StoreBookLib.encodeBitmap({
        onBeforeSetRecord: true,
        onAfterSetRecord: true,
        onBeforeSetField: true,
        onAfterSetField: true,
        onBeforeDeleteRecord: true,
        onAfterDeleteRecord: true
      });
      import { SystemHookLib } from "@latticexyz/world/src/SystemHook.sol";
      
      uint8 systemHookBitmap = SystemHookLib.encodeBitmap({
        onBeforeCallSystem: true,
        onAfterCallSystem: true
      });
    • The onSetRecord hook call for emitEphemeralRecord has been removed to save gas and to more clearly distinguish ephemeral tables as offchain tables.

Patch Changes

@latticexyz/[email protected]

Major Changes

  • #1399 c4d5eb4e Thanks @alvrs! - - The onSetRecord hook is split into onBeforeSetRecord and onAfterSetRecord and the onDeleteRecord hook is split into onBeforeDeleteRecord and onAfterDeleteRecord.
    The purpose of this change is to allow more fine-grained control over the point in the lifecycle at which hooks are executed.

    The previous hooks were executed before modifying data, so they can be replaced with the respective onBefore hooks.

    - function onSetRecord(
    + function onBeforeSetRecord(
        bytes32 table,
        bytes32[] memory key,
        bytes memory data,
        Schema valueSchema
      ) public;
    
    - function onDeleteRecord(
    + function onBeforeDeleteRecord(
        bytes32 table,
        bytes32[] memory key,
        Schema valueSchema
      ) public;
    • It is now possible to specify which methods of a hook contract should be called when registering a hook. The purpose of this change is to save gas by avoiding to call no-op hook methods.

      function registerStoreHook(
        bytes32 tableId,
      - IStoreHook hookAddress
      + IStoreHook hookAddress,
      + uint8 enabledHooksBitmap
      ) public;
      
      function registerSystemHook(
        bytes32 systemId,
      - ISystemHook hookAddress
      + ISystemHook hookAddress,
      + uint8 enabledHooksBitmap
      ) public;

      There are StoreHookLib and SystemHookLib with helper functions to encode the bitmap of enabled hooks.

      import { StoreHookLib } from "@latticexyz/store/src/StoreHook.sol";
      
      uint8 storeHookBitmap = StoreBookLib.encodeBitmap({
        onBeforeSetRecord: true,
        onAfterSetRecord: true,
        onBeforeSetField: true,
        onAfterSetField: true,
        onBeforeDeleteRecord: true,
        onAfterDeleteRecord: true
      });
      import { SystemHookLib } from "@latticexyz/world/src/SystemHook.sol";
      
      uint8 systemHookBitmap = SystemHookLib.encodeBitmap({
        onBeforeCallSystem: true,
        onAfterCallSystem: true
      });
    • The onSetRecord hook call for emitEphemeralRecord has been removed to save gas and to more clearly distinguish ephemeral tables as offchain tables.

Patch Changes

@latticexyz/[email protected]

Patch Changes

  • #1418 2459e15f Thanks @holic! - Let glob handle resolving the glob against the current working directory.

@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]

Patch Changes

[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]

@latticexyz/[email protected]

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