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

Document the separation between private APIs and experimental APIs #47973

Merged
merged 6 commits into from
Apr 13, 2023

Conversation

adamziel
Copy link
Contributor

@adamziel adamziel commented Feb 10, 2023

What?

Documents the separation between private APIs and experimental APIs. Part of #47785

Rich text preview

cc @youknowriad @mcsf @gziolo @dmsnell @jsnajdr @peterwilsoncc

@adamziel adamziel self-assigned this Feb 10, 2023
@adamziel adamziel added [Type] Developer Documentation Documentation for developers [Type] Experimental Experimental feature or API. Developer Experience Ideas about improving block and theme developer experience labels Feb 10, 2023
@github-actions
Copy link

github-actions bot commented Feb 10, 2023

Flaky tests detected in 682d859.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4629651383
📝 Reported issues:

@adamziel adamziel changed the title Update boding guidelines experimental Document the separation between private APIs and experimental APIs Feb 10, 2023
@peterwilsoncc
Copy link
Contributor

These docs read well to me, thank you!

There's some jumping between the terms experimental and private from one section to another. I think I understand the difference (experimental === may change, private === not exported) but I think this could be highlighted a bit more.

@adamziel
Copy link
Contributor Author

adamziel commented Apr 6, 2023

@peterwilsoncc I now start this entire section with an explanation of what's a private API and what's an experimental API – I hope it's clearer now!

Also cc @ockham @luisherranz – I'd love your review in particular since you're directly interested in applying these ideas. Is the writing clear? Is anything confusing?

Experimental APIs are temporary values exported from a module whose existence is either pending future revision or provides an immediate means to an end.
There are two important API types in the Gutenberg codebase:

* **Experimental APIs** – they are public APIs that are only shipped in Gutenberg and not merged into WordPress core. Their existence is either pending future revision or provides an immediate means to an end.
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally, I think that experimental APIs that are only meant for the Gutenberg plugin are useless. I think we can omit them.

Copy link
Contributor Author

@adamziel adamziel Apr 11, 2023

Choose a reason for hiding this comment

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

@youknowriad Oh! I thought they’re a good way of getting extenders feedback for APIs that are not mature yet?

Copy link
Contributor

@youknowriad youknowriad Apr 11, 2023

Choose a reason for hiding this comment

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

The thing I'm not sure that we need anything for that since the Gutenberg plugin is an alpha version. In other words, if we want to ship something into core, there's not specific to be done and if we want to limit something for the Gutenberg plugin for some time, we use IS_GUTENBERG_PLUGIN

In other words, I'm not sure we really need to formalize "experimental APIs" unless there's a way to ship these into core.

Copy link
Contributor Author

@adamziel adamziel Apr 12, 2023

Choose a reason for hiding this comment

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

Oh I see! Yeah IS_GUTENBERG_PLUGIN is key. I guess the only value in having an __experimental prefix is that you can find out which APIs may not be in core just by looking at the code of my theme or plugin. Personally I like that, but I'm also happy to remove it from the docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@youknowriad I updated the document – what do you think now?

@luisherranz
Copy link
Member

Also cc @ockham @luisherranz – I'd love your review in particular since you're directly interested in applying these ideas. Is the writing clear? Is anything confusing?

At first glance, it looks good to me, but I would need to try implementing something real before giving you full feedback on whether it's enough or if something is missing.

@adamziel
Copy link
Contributor Author

Makes sense @luisherranz! I'd say let's get this PR in to make this information visible to everyone and then iterate on it further once you have more feedback.

Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

Thanks Adam, these changes make the experimental/private distinction much clearer.

I think it's good to go but will leave final approval to someone who works in the GB repo more frequently than I.

@adamziel
Copy link
Contributor Author

adamziel commented Apr 13, 2023

Yay, thank you @peterwilsoncc! And I'm glad it's helpful.

}
```

### Exposing private APIs publicly
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need this part of the document, seems a bit redundant with plugin only APIs. I don't feel strongly though.

Copy link
Contributor Author

@adamziel adamziel Apr 13, 2023

Choose a reason for hiding this comment

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

I only put it there because a few different people asked me that exact question. It's obvious once you make the mental connection, but even I needed some time to figure out this is possible.

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@adamziel adamziel merged commit 5b3cd06 into trunk Apr 13, 2023
@adamziel adamziel deleted the update-boding-guidelines-experimental branch April 13, 2023 12:47
@github-actions github-actions bot added this to the Gutenberg 15.7 milestone Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience [Type] Developer Documentation Documentation for developers [Type] Experimental Experimental feature or API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants