-
Notifications
You must be signed in to change notification settings - Fork 196
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): remove system name from function signatures/selectors [M-05] #2160
Conversation
🦋 Changeset detectedLatest commit: b59e02f The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
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 |
|
||
Functions within namespaced systems are now registered on the world as `{namespace}_{functionName}` rather than `{namespace}_{systemName}_{functionName}`. This is more ergonomic and is more consistent with namespaced resources in other parts of the codebase (e.g. accessing tables in schemaful indexer). | ||
|
||
If you have a project using the `namespace` key in your `mud.config.ts` or are manually registering systems and function selectors on a namespace, you will likely need to codegen your system interfaces (`pnpm build`) and update any calls to these systems through the world's namespaced function signatures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to bubble this up as a breaking change aside from major
tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
major should be only breaking changes, no other way make it more prominent unfortunately
No suggestions yet but I wanna experiment with this a bit, think about what happens when you register multiple systems with the same name etc. Maybe document everything in tests if not already covered |
@alvrs and I chatted a bit about this IRL and we think it'll just end up with a compile error, because codegen will create interfaces for each system and those will get combined into a |
@qbzzt there might be a couple places in the docs we need to update with this! |
Random thought: Instead of Need to think on it more but maybe it would remove issues like this. Definitely out of scope for this PR! |
Oh, oops, they weren't. And you're right that the compiler error is pretty decent. |
The old format is `namespace_system_function`. The new format is `namespace__function`. This should be merged at the same time as #2160, which implements the change.
d25dfda
to
b179a1a
Compare
closes #1980