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

consider moving all internal tables to an internal namespace #733

Closed
holic opened this issue May 4, 2023 · 6 comments · Fixed by #1601
Closed

consider moving all internal tables to an internal namespace #733

holic opened this issue May 4, 2023 · 6 comments · Fixed by #1601
Assignees

Comments

@holic
Copy link
Member

holic commented May 4, 2023

We already namespace tables like mudstore:schema, it'd be great to do the same treatment to NamespaceOwner, InstalledModules, etc. I wouldn't mind these living together under a mud or mudinternal namespace or creating namespaces for each type of thing, e.g. mudstore, mudworld.

Ultimately my goal is to clear the root namespace for users and to make it a bit easier for us+users to know when they're looking at user-defined things vs mud-internal things.

image

@dk1a
Copy link
Contributor

dk1a commented May 4, 2023

depends on #734 (world systems need to retain root namespace)

@holic
Copy link
Member Author

holic commented May 4, 2023

world systems need to retain root namespace

why?

@dk1a
Copy link
Contributor

dk1a commented May 4, 2023

root methods get registered with just their name
non-root methods get prefixed with the namespace
so I assume we want short method names like grantAccess, not mudnamespace_grantAccess for all the core API
and unlike tables, the internal system API is not quite as useless to end-users, not quite as distracting on the frontend (maybe)

@holic
Copy link
Member Author

holic commented May 4, 2023

I know that access control is somewhat tied to the function selector pattern (to determine namespace etc without an extra lookup) but I wonder if there's some special treatment we could do to world methods where we get best of both worlds (namespaced internal tables, non-namespaced world methods like grantAccess).

That said, I feel like mudinternal_grantAccess isn't bad either and very explicit that you're reaching into mud internals/interacting with mud APIs.

@alvrs
Copy link
Member

alvrs commented Sep 16, 2023

since we register all tables and systems in the CoreModule, it should be easy to move their mud config namespace to eg world and still register the system function selectors in the root namespace, and give the systems access to the world namespace.

@alvrs alvrs assigned holic and unassigned alvrs Sep 18, 2023
@alvrs alvrs moved this from Planned to Next up in MUD v2 stable release (deprecated) Sep 18, 2023
@holic
Copy link
Member Author

holic commented Sep 18, 2023

I just took a stab at this and it's going to be a bit more involved than initially expected. Once I added a namespace to World's MUD config, it prefixed all system methods with that namespace, thus changing the interfaces, which bubbles up to IBaseWorld, which a bunch of internal stuff uses.

Some possible next steps:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
3 participants