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

Admin UI: explicit list config #2874

Merged
merged 2 commits into from
May 5, 2020

Conversation

Vultraz
Copy link
Contributor

@Vultraz Vultraz commented May 2, 2020

The client-side List objects were storing a ton of duplicated and unnecessary data.

Here's what one of the Admin UI List objects looked like before:
image

Notice how not only was the entire adminMeta object duplicated in every list, but the config object was being saved despite being assigneded to the List object. This meant that the entire config object was being saved twice, and it also meant completely unnecessary keys like views were being saved too (these are used by the field view loader and aren't needed here).

This removes the copy of adminMeta (it wasn't used anywhere) and the config copy + assignment in favor of explicitly picking out the pieces of config we want to save. Note this does mean the raw field config is no longer accessible at list.config.fields, but it's still available via the field controller in list.fields.

Lot cleaner!

@changeset-bot
Copy link

changeset-bot bot commented May 2, 2020

🦋 Changeset is good to go

Latest commit: 8dbeddc

We got this.

This PR includes changesets to release 1 package
Name Type
@keystonejs/app-admin-ui 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

@MadeByMike MadeByMike requested a review from timleslie May 3, 2020 23:37
@MadeByMike
Copy link
Contributor

I think this is ok. @timleslie has been looking at some stuff parallel to this so he might want to get eyes on this one as well.

@jesstelford
Copy link
Contributor

Possibly related: #1039

@timleslie
Copy link
Contributor

Yes, love this, very much in line with the PRs I've got lined up to make all the adminMeta more explicit and more constrained so that we can get a really tight grip on this API surface area. I'm still doing a bit of fine tooth comb work to understand all the implications of this change and be 100% confident nothing will break, but I'm very hopeful to give this a ✅ today.

Copy link
Contributor

@timleslie timleslie left a comment

Choose a reason for hiding this comment

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

❤️ 🚀 👍

@timleslie timleslie merged commit bfa3a28 into keystonejs:master May 5, 2020
@Vultraz Vultraz deleted the admin-ui-list-config-cleanup branch May 5, 2020 00:57
This was referenced May 5, 2020
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.

4 participants