Skip to content

Remove @payloadcms/plugin-multi-tenant - #570

Merged
rchlfryn merged 11 commits into
mainfrom
migrate-off-multi-tenant
Oct 7, 2025
Merged

rchlfryn merged 11 commits into
mainfrom
migrate-off-multi-tenant

Conversation

@rchlfryn

@rchlfryn rchlfryn commented Oct 2, 2025 •

Copy link
Copy Markdown
Collaborator

Description

  • Remove @payloadcms/plugin-multi-tenant and adds the files we need locally
  • Move TenantSelector to plugin folder

Issue

Resolves #552

@rchlfryn
rchlfryn force-pushed the migrate-off-multi-tenant branch from 14d1156 to 37a3c8a Compare October 2, 2025 20:44
@github-actions

github-actions Bot commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

Comment thread src/plugins/multiTenant/README.md Outdated

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

What am I missing here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nada

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we make this a decision doc instead?

@rchlfryn
rchlfryn marked this pull request as ready for review October 2, 2025 21:29
@rchlfryn
rchlfryn requested a review from busbyk October 2, 2025 23:25

@stevekuznetsov stevekuznetsov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mechanically looks right

@busbyk busbyk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need to colocate the code we're taking from the multi tenant plugin in it's own @/plugins directory? I'm assuming that we're going to start modifying this code as some point and was thinking that we would integrate it fully into our codebase. So using our current organizational structure with fields, components, providers, utilities, etc.

I'm just thinking about how multi tenancy is core to our application vs. being truly a plugin. Thoughts?

I left comments on each file where I think they should go and the rest in the @/plugins/multiTenant folder could go in @/utilities/tenancy.

Comment on lines +1 to +14
.tenantField {
&__wrapper {
margin-top: calc(-0.75 * var(--spacing-field));
margin-bottom: var(--spacing-field);
width: 25%;
}
&__hr {
width: calc(100% + 2 * var(--gutter-h));
margin-left: calc(-1 * var(--gutter-h));
background-color: var(--theme-elevation-100);
height: 1px;
margin-bottom: var(--spacing-field);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We never display this field right? Could we remove these styles if they'll never be applied? Maybe we do actually want them for when the debug option is true in case we ever want that locally?

@rchlfryn rchlfryn Oct 6, 2025 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We do use this field as the field component - it should make more sense now with the code in the proper folders

Comment thread src/plugins/multiTenant/README.md Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we make this a decision doc instead?

@rchlfryn

rchlfryn commented Oct 7, 2025

Copy link
Copy Markdown
Collaborator Author

Do we need to colocate the code we're taking from the multi tenant plugin in it's own @/plugins directory? I'm assuming that we're going to start modifying this code as some point and was thinking that we would integrate it fully into our codebase. So using our current organizational structure with fields, components, providers, utilities, etc.

I'm just thinking about how multi tenancy is core to our application vs. being truly a plugin. Thoughts?

I left comments on each file where I think they should go and the rest in the @/plugins/multiTenant folder could go in @/utilities/tenancy.

I thought we wanted to try to maintain it as a plugin, but it makes sense to fold it into our current structure. I moved everything into their respective folders.

@rchlfryn
rchlfryn requested a review from busbyk October 7, 2025 00:07

@busbyk busbyk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good!

Are we still getting that behavior with the GlobalViewRedirect where there's an infinite redirect loop when a document doesn't exist yet for a tenant?

@rchlfryn

rchlfryn commented Oct 7, 2025

Copy link
Copy Markdown
Collaborator Author

Are we still getting that behavior with the GlobalViewRedirect where there's an infinite redirect loop when a document doesn't exist yet for a tenant?

I am not sure. I removed a home page locally for an AC and it did not loop. We might see it again when we add a new AC

@rchlfryn
rchlfryn added this pull request to the merge queue Oct 7, 2025
Merged via the queue into main with commit f297a10 Oct 7, 2025
@rchlfryn
rchlfryn deleted the migrate-off-multi-tenant branch October 7, 2025 22:51

This branch was previously deployed

1 inactive deployment
Preview — 67eb5ac9 Deployed Oct 7, 2025 by rchlfryn
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.

Migrate off of the Payload multi-tenant plugin components/functions

3 participants