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

Editor: Specify _fields for parent page selector request #15115

Closed
aduth opened this issue Apr 22, 2019 · 3 comments
Closed

Editor: Specify _fields for parent page selector request #15115

aduth opened this issue Apr 22, 2019 · 3 comments
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Editor /packages/editor [Type] Performance Related to performance efforts

Comments

@aduth
Copy link
Member

aduth commented Apr 22, 2019

Previously: #12930
Related: #15114

Posts responses can be slow to generate by the REST API. For this reason, it should be considered to optimize the current Parent Page field query to include only the necessary properties to present options in the interface.

Relevant code:

const query = {
per_page: -1,
exclude: postId,
parent_exclude: postId,
orderby: 'menu_order',
order: 'asc',
};
return {
parent: getEditedPostAttribute( 'parent' ),
items: isHierarchical ? getEntityRecords( 'postType', postTypeSlug, query ) : [],
postType,
};

@aduth aduth added Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Performance Related to performance efforts [Package] Editor /packages/editor labels Apr 22, 2019
@iandunn
Copy link
Member

iandunn commented Jun 6, 2019

#13618 seems related as a quick glance.

@aduth
Copy link
Member Author

aduth commented Jun 7, 2019

#13618 seems related as a quick glance.

Good call. Let's consolidate there.

@aduth
Copy link
Member Author

aduth commented Jun 7, 2019

Duplicate of #13618

@aduth aduth closed this as completed Jun 7, 2019
@aduth aduth marked this as a duplicate of #13618 Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Editor /packages/editor [Type] Performance Related to performance efforts
Projects
None yet
Development

No branches or pull requests

2 participants