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(world): add config resolution at runtime #2421

Merged
merged 3 commits into from
Mar 13, 2024
Merged

Conversation

alvrs
Copy link
Member

@alvrs alvrs commented Mar 13, 2024

Copy link

changeset-bot bot commented Mar 13, 2024

⚠️ No Changeset found

Latest commit: b5d6902

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@alvrs alvrs changed the title feat(world): add config runtime resolution feat(world): add config resolution at runtime Mar 13, 2024
@alvrs alvrs marked this pull request as ready for review March 13, 2024 14:57
@alvrs alvrs requested review from holic and yonadaa as code owners March 13, 2024 14:57
@@ -2,4 +2,4 @@ export * from "./defaults";
export * from "./storeConfig";

export * from "./experimental/resolveConfig";
export * from "./v2/store";
export * from "./v2";
Copy link
Member

@holic holic Mar 13, 2024

Choose a reason for hiding this comment

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

thoughts on a separate config entry point for now?
https://github.com/latticexyz/mud/pull/2415/files#diff-9b298d2cadfb9600e8878ee44b4064e32664a2c00322309b5cf434e75ab87f31

thinking that'll make it easier to grep for things when we inevitably move stuff around

Copy link
Member

Choose a reason for hiding this comment

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

doin it here #2422

Object.entries(namespaces)
.map(([namespaceKey, namespace]) => {
const tables = get(namespace, "tables") ?? {};
return Object.entries(tables).map(([tableKey, table]) => [`${namespaceKey}__${tableKey}`, table]);
Copy link
Member

Choose a reason for hiding this comment

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

not sure if we wanna use this here but we have resourceLabel in @latticexyz/common

);

return {
tables: resolveStoreTablesConfig({ ...(get(input, "tables") ?? {}), ...namespacedTables }, scope),
Copy link
Member

Choose a reason for hiding this comment

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

do we need to do any validation that there are no overlaps?

@holic holic merged commit 154c7f7 into main Mar 13, 2024
11 checks passed
@holic holic deleted the alvrs/world-runtime branch March 13, 2024 15:37
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