Deprecation/Graduation policy for experimental APIs proposal #43091
Replies: 7 comments 11 replies
-
Thanks for writing this @alexflorisca!
I don't agree that we should graduate all cases actually, for example the slot fills. These can be replaced by extensions rendering their own blocks as children of a specific block. So, maybe keep slot fills experimental with a view to deprecating them in 2 years?
I don't know if this would work on the current setup of
Seems OK to me. Alignment with Gutenberg is always a nice idea. Two years should long enough for us to advertise the changes and for developers to pick up on them and update their code.
Seems OK, but my gut feeling is this may be a little too frequent, would 4 or 6 months be better? Whichever we choose, this timeframe could also be used to review the points that have been deprecated for more than 2 years, and to open an issue to remove them. |
Beta Was this translation helpful? Give feedback.
-
Yep good point here, happy to keep slot fills as experimental for the time being and encourage people to create inner blocks instead. We can also review everything properly and make a final decision as to what is to be stable and what is to remain experimental.
I was thinking that we store the checkout filters in an object here. And part of that object could be locked with any filters that are experimental. For example, say we had a
I haven't actually tried to see if this works yet, but that's my thinking anyway. it's also worth mentioning that this is still an experimental API (it comes from the
Happy with a 6 month review yep. As long as they get scheduled in, that's what we've been missing so far. |
Beta Was this translation helpful? Give feedback.
-
My problem with this point and the reluctant nature of it is that we don't have strong feedback about if they're being used or not. The problem with stability isn't that it will trigger errors, but will it accommodate the several possible use cases, and will the current approach have performance limitations (which we can't fully test). Sadly, it's a bit hard to get people to use experimental stuff, so we don't have strong feedback about them yet. The concept of limiting certain data stores actions is to prevent abuse, which is hard to detect until it happens. I also agree that a 2 year time window is good, a bit on the long side, but still fine. Exception can be made if we found out an extensibility point can be abused to the advantage of a plugin over the others. |
Beta Was this translation helpful? Give feedback.
-
My understanding of the current situation is that, just because an action (or filter) is triggered from within the internal namespace, that doesn't implicitly mean it is considered off-limits for third party code. Instead, they are also part of the public API surface. I'm a little unsure if we really need or want experimental/private hooks but, if we do, couldn't they live anywhere (including locations outside of the internal namespace)? |
Beta Was this translation helpful? Give feedback.
-
While this sounds ideal, I'm in agreement with @opr on this point. There are just too many factors to consider here and while we can strive to make the "base" API stable, the lifecycle of code almost guarantees that we will have some newly implemented features that have not yet had time to mature. Also, while it might be implicitly understood, I think it's worth noting that any experimental APIs that were prefixed with "experimental" should be aliased to their non-experimental counterparts for the deprecation period.
I'm on board with this 👍
Noted above but confirming that any hooks exposed inside of this namespace are public API and considered fair game. Using pub-sub patterns or internal registries, depending on the use case, is favorable over hooks if you don't want it externally consumed.
I want to push back on this point given how long a window this is, but
Sounds great! I've seen Gutenberg's threads on reviewing experimental features. I'm wondering:
|
Beta Was this translation helpful? Give feedback.
-
A few suggestions for moving this forward:
|
Beta Was this translation helpful? Give feedback.
-
To summarise what's been said:
Some questions I still have
|
Beta Was this translation helpful? Give feedback.
-
We need to formalise a policy around the experimental APIs for WooCommerce Blocks (and WooCommerce at large). This is important as we become the default Woo checkout experience, more developers will make use of our APIs and we need to make sure there is a plan in place to keep this stable.
Lessons from Gutenberg
The first thing I looked at is what Gutenberg does which I’ll summarise here
Almost everyone agrees there needs to be a compromise between the two.
Lessons from Woo
Woo Core is working on bringing all its feature plugins in house and shifting the mindset from “everything must be stable” to allow for some experimental work directly in Woo Core. This is re-assuring as we tend to have a lot of experimental interfaces, and probably more to come as the developer requests come in. They should be able to support us developing work behind feature flags once we move to core.
Proposal
1. Graduate all experimental features to stable before the default release
We need to provide a stable base from which to build on. Most of our experimental extensibility points have been around for a while and I would consider them stable. This was also a learning from Gutenberg, they found it difficult to maintain a lot of experimental APIs once they had been introduced into WP Core. Although saying that, it doesn’t mean we shouldn’t experiment, and this is a good opportunity for us to review our experimental interfaces before we become default.
2. Use the lock / unlock API for experimental filters, slots and methods on the front end.
The lock / unlock API from Gutenberg allows for encapsulation of private information inside public objects. This is a great way, for example, to export a filters object and encapsulate any experimental filters inside it. The consuming third party developers will get only the public filters by default, and must explicitly opt in for experimental filters. This keeps the public API stable, while allowing the introduction of experimental features.
The details of this need to be fleshed out a little more and I’m happy to get a try/ PR up to prove this concept.
3. Explore using the
Automattic\WooCommerce\Internal
namespace for experimental PHP filters and actions@ObliviousHarmony wrote about this
This needs a little more discussion and I would be keen to hear from the PHP gurus on this.
4. Use a 2 year deprecation window.
This is a bit controversial as initially we said around 6 months. But my thinking here is
5. Review experimental features every 3 months.
I think we need to be a little flexible when graduating experimental features, as not all features are created equal. It’s difficult to say something like “Once an experimental feature has launched, we will graduate it in 6 months”, because there are a lot of variable that will determine what eventually happens to that feature. It may be axed, graduated or fleshed out, and there’s no one size fits all. What I propose is to review all our experimental features every 3 months and determine what to do with them (much like we do right now before WC Core releases).
Whad’a think? What have I not thought of? What does the community think?
Some useful links
Lock an unlock functionality in Gutenberg
Original GH PR about what to do with experimental APIs
Available Extensibility Interfaces for the Cart and Checkout blocks
Beta Was this translation helpful? Give feedback.
All reactions