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(store-sync): recs sync adapter #3486

Merged
merged 7 commits into from
Jan 22, 2025
Merged

feat(store-sync): recs sync adapter #3486

merged 7 commits into from
Jan 22, 2025

Conversation

holic
Copy link
Member

@holic holic commented Jan 22, 2025

pulled out of #3485

  • consolidated how we derive components from config and tables
  • updated storage adapter to lean on components already registered in RECS world
  • lifted the registration of components out of storage adapter, so they're accessible outside async context

@holic holic requested a review from alvrs as a code owner January 22, 2025 14:32
Copy link

changeset-bot bot commented Jan 22, 2025

🦋 Changeset detected

Latest commit: 73778d6

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

This PR includes changesets to release 29 packages
Name Type
@latticexyz/store-sync Patch
@latticexyz/cli Patch
@latticexyz/dev-tools Patch
@latticexyz/explorer Patch
@latticexyz/store-indexer Patch
@latticexyz/world-module-erc20 Patch
@latticexyz/world-modules Patch
@latticexyz/abi-ts Patch
@latticexyz/block-logs-stream Patch
@latticexyz/common Patch
@latticexyz/config Patch
create-mud Patch
@latticexyz/entrykit Patch
@latticexyz/faucet Patch
@latticexyz/gas-report Patch
@latticexyz/paymaster Patch
@latticexyz/protocol-parser Patch
@latticexyz/react Patch
@latticexyz/recs Patch
@latticexyz/schema-type Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/stash Patch
@latticexyz/store-consumer Patch
@latticexyz/store Patch
@latticexyz/utils Patch
vite-plugin-mud Patch
@latticexyz/world-module-metadata Patch
@latticexyz/world 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

@@ -5,6 +5,7 @@ export type InternalComponents = ReturnType<typeof defineInternalComponents>;

export function defineInternalComponents(world: World) {
return {
/** @deprecated */
RegisteredTables: defineComponent<{ table: Type.T }, Metadata, Table>(
Copy link
Member Author

@holic holic Jan 22, 2025

Choose a reason for hiding this comment

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

was torn on what to do with this! this is no longer needed as part of the storage adapter because we now use the component.metadata.table for things like schemas

I removed the populating of this table/component from the storage adapter and deprecated this (rather than removed) because it used to be part of the components return type of syncToRecs

I could just remove because it was considered "internal" and doesn't appear to be used: https://github.com/search?q=RegisteredTables+%28path%3A*.ts+OR+path%3A*.tsx%29+-org%3Alatticexyz&type=code

thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

i would be fine with removing


export type StoreComponentMetadata = Metadata & {
componentName: string;
tableName: string;
table: Table;
// TODO: migrate to store's KeySchema/ValueSchema
keySchema: KeySchema;
valueSchema: ValueSchema;
Copy link
Member Author

@holic holic Jan 22, 2025

Choose a reason for hiding this comment

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

these aren't technically needed anymore but was also worried about breaking downstream usage by removing
https://github.com/search?q=%28%22metadata.keySchema%22+OR+%22metadata.valueSchema%22%29+%28path%3A*.ts+OR+path%3A*.tsx%29+-org%3Alatticexyz&type=code

alvrs
alvrs previously approved these changes Jan 22, 2025
@holic holic merged commit 227db4d into main Jan 22, 2025
14 of 16 checks passed
@holic holic deleted the holic/recs-sync-adapter branch January 22, 2025 15:31
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