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

feat(stash): add stash, the new MUD client state library #3040

Merged
merged 18 commits into from
Aug 30, 2024
Merged

Conversation

alvrs
Copy link
Member

@alvrs alvrs commented Aug 15, 2024

No description provided.

Copy link

changeset-bot bot commented Aug 15, 2024

🦋 Changeset detected

Latest commit: 3a5e059

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
@latticexyz/stash Patch
@latticexyz/abi-ts Patch
@latticexyz/block-logs-stream Patch
@latticexyz/cli Patch
@latticexyz/common Patch
@latticexyz/config Patch
create-mud Patch
@latticexyz/dev-tools Patch
@latticexyz/explorer Patch
@latticexyz/faucet Patch
@latticexyz/gas-report Patch
@latticexyz/protocol-parser Patch
@latticexyz/query Patch
@latticexyz/react Patch
@latticexyz/recs Patch
@latticexyz/schema-type Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/store-indexer Patch
@latticexyz/store-sync Patch
@latticexyz/store Patch
@latticexyz/utils Patch
@latticexyz/world-module-metadata Patch
@latticexyz/world-modules Patch
@latticexyz/world Patch
mock-game-contracts Patch
ts-benchmarks Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

packages/stash/src/common.ts Outdated Show resolved Hide resolved
packages/stash/src/common.ts Outdated Show resolved Hide resolved
actions: actions;
};

export type ExtendResult<stash extends Stash, actions> = stash & actions;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the expectation/assumption here is there are no overlapping keys?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah exactly (otherwise you'd get never on that key)

Copy link
Member

@holic holic Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting, would have expected (() => void) & (() => number) to be collapsed to never since a function can't have both of those return types at the same time. Updated the type to be similar to merge from arktype by first omitting the existing keys and then combining with the extended keys (which is what already happened in js under the hood). That means it is now technically possible to override existing functions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(first used merge from arktype but then realized if we only use this one type it's pretty simple to just add it here instead of a dependency)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That means it is now technically possible to override existing functions.

this was already happening at runtime, the types just better reflect it now

packages/stash/README.md Outdated Show resolved Hide resolved
packages/stash/README.md Outdated Show resolved Hide resolved
packages/stash/package.json Show resolved Hide resolved
@alvrs alvrs merged commit 0a20d81 into main Aug 30, 2024
14 checks passed
@alvrs alvrs deleted the alvrs/stash branch August 30, 2024 13:33
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.

2 participants