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

Make batch opt-in more expressive. #26292

Conversation

TimothyBJacobs
Copy link
Member

Description

This let's people opt-in to a specific version of batching, and allows us to
introduce in the future further flags to customize behavior.

How has this been tested?

Manually tested.

Types of changes

Breaking change to __experimental feature.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

This let's people opt-in to a specific version of batching, and allows us to
introduce in the future further flags to customize behavior.
@TimothyBJacobs TimothyBJacobs self-assigned this Oct 19, 2020
@TimothyBJacobs TimothyBJacobs added the REST API Interaction Related to REST API label Oct 19, 2020
@spacedmonkey
Copy link
Member

Can you explain a little more about this change? I am not sure I like merged experimental features into core. WordPress doesn't have private API. Once it is core, people will you it.

@TimothyBJacobs
Copy link
Member Author

This is to allow for versioning of the opt-in and provide additional flags for future features. So instead of having a simple true/false we have an expressive array.

Whether the endpoint ships as __experimental/batch or v1/batch is a separate conversation.

@spacedmonkey
Copy link
Member

That is confusing with the naming of __experimental of the key. Can we name this something different?

@TimothyBJacobs
Copy link
Member Author

It is named __experimental to match the current version of the batch endpoint.

Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

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

Tested this locally and works as expected. I wonder @TimothyBJacobs do we opt in to API versions anywhere else? I wonder if experimental opt in is just yes/no.

Nevertheless the idea to opt in to experimental is good!

@TimothyBJacobs
Copy link
Member Author

I wonder @TimothyBJacobs do we opt in to API versions anywhere else? I wonder if experimental opt in is just yes/no.

We historically don't version APIs at all. We try to support the old format in the new form of the endpoint. This is future proofing in the case that we do end up needing to do that which I think is more likely with the REST API. That's why we have the version in the route after all.

@draganescu draganescu merged commit ee0085b into WordPress:master Oct 19, 2020
@github-actions github-actions bot added this to the Gutenberg 9.2 milestone Oct 19, 2020
@spacedmonkey
Copy link
Member

I do not believe the format of this is correct. I don't want anything in WordPress core marked __experimental.

It can remain in the plugin, but should be changed before going into core.

@TimothyBJacobs
Copy link
Member Author

Naming can be discussed in the Core ticket, https://core.trac.wordpress.org/ticket/50244. If we decide to use v1 we'll just be changing the flag name from __experimental to v1 in turn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REST API Interaction Related to REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants