Problem/Motivation

We're close to being able to close #2797169: Mark BigPipe as stable/non-experimental, which will mark BigPipe stable. As of that time, BigPipe's APIs will be frozen.

Except that's the thing: the BigPipe module provides no API, it only provides functionality.. BigPipe simply uses the Render API and the request processing system's APIs.

We guarantee BC for its functionality/behavior, but not for the exact code implementation details.

In the future, we may add APIs. For example in #2632750: Interface previews/skeleton screens through optional "preview" or "placeholder" templates.

Proposed resolution

Mark all of BigPipe's classes as @internal.

Remaining tasks

None.

User interface changes

None.

API changes

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers created an issue. See original summary.

Wim Leers’s picture

Status: Active » Needs review
FileSize
4.58 KB
effulgentsia’s picture

Thanks for this issue. https://www.drupal.org/core/d8-bc-policy already says that service and controller implementations are not part of the public API. So I think we only need @internal added to BigPipeInterface and BigPipeResponse. I think we should also add a sentence to each of those two explaining why they're internal.

Wim Leers’s picture

Assigned: Unassigned » Wim Leers
FileSize
1.32 KB
4.69 KB

Ok. Did that.

But https://www.drupal.org/core/d8-bc-policy says Note: This document is still under discussion. See #2550249: [meta] Document @internal APIs both explicitly in phpdoc and implicitly in d.o documentation… so wouldn't it be safer to mark all of these @internal?

Wim Leers’s picture

Issue tags: +Documentation

This is a documentation-only patch.

effulgentsia’s picture

How about this instead? This changes some wording, and also moves the @internal from BigPipeInterface to just the sendContent() method. That way, contrib modules such as big_pipe_sessionless, or whatever else is experimenting with extending big_pipe, can safely type hint to BigPipeInterface without IDE warnings. Meanwhile, https://www.drupal.org/core/d8-bc-policy#interfaces gives room for us to add new methods to the interface.

effulgentsia’s picture

wouldn't it be safer to mark all of these @internal?

I don't think so. I don't see why big_pipe services and controllers should be considered any more internal than any other module's services and controllers. If at some point we want to change our bc policy across the board for services and controllers, then at that point we'll need to add @internal to those classes in many modules, and can cover big_pipe ones as part of that.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

#6: That's even better, thanks!

#7: Okay, that's fair!

Wim Leers’s picture

  • catch committed 5021260 on 8.3.x
    Issue #2835604 by Wim Leers, effulgentsia: BigPipe provides...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed pushed to 8.3.x and cherry-picked to 8.2.x, thanks!

  • catch committed 9d4b368 on 8.2.x
    Issue #2835604 by Wim Leers, effulgentsia: BigPipe provides...
Wim Leers’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

xjm’s picture

I wonder, why do we provide an interface at all if we don't mean it as an extension point? Should we remove it? We can do so even though the API was not @internal before since BigPipe was only ever in alpha.

BTW, I do think everything that's internal should be explicitly marked so, rather than relying on the handbook page. See #2550249: [meta] Document @internal APIs both explicitly in phpdoc and implicitly in d.o documentation. So IMO Wim's first patch was fine, although we can scope

Wim Leers’s picture

I wonder, why do we provide an interface at all if we don't mean it as an extension point?

Exactly! This, +100. I was wondering the exact same thing while working on this. We just have the rule that "type hints must use interfaces", that's why we \Drupal\big_pipe\Render\BigPipeInterface exists at all.

Should we remove it?

I'd be strongly in favor.

BTW, I do think everything that's internal should be explicitly marked so, rather than relying on the handbook page.

Right, exactly — that removes all doubt.

If that feels a bit strange/excessive, I agree, but the reality is that "what is an API?" is an opt-out thing in Drupal, not an opt-in thing. When we have @api, that will become opt-in, and then we wouldn't have to do anything here.

Shall I create a new issue then, to:

  1. Remove BigPipeInterface and move all of its docs to the implementation.
  2. Add @internal to all other classes like in #2?
xjm’s picture

Remove BigPipeInterface and move all of its docs to the implementation.

+1.

Add @internal to all other classes like in #2?

Per @catch's suggestion, let's instead do this in bulk patches across core for each of the "kinds of thing" the other classes are in #2550249: [meta] Document @internal APIs both explicitly in phpdoc and implicitly in d.o documentation. That way each kind of internal-by-default thing will be consistent.

Wim Leers’s picture

  1. Done: #2835758: Remove BigPipeInterface and move all of its docs to the implementation.
  2. Hm, I'm not sure how that would guarantee that this would ever happen. Can you link to a specific comment or quote a specific part of #2550249: [meta] Document @internal APIs both explicitly in phpdoc and implicitly in d.o documentation? Or should I create a follow-up issue that points to #2550249, and which can be closed in case #2550249 is marked fixed?
xjm’s picture

Hm, I'm not sure how that would guarantee that this would ever happen.

#2550249: [meta] Document @internal APIs both explicitly in phpdoc and implicitly in d.o documentation will not be marked fixed without the child issues being done for each of the kinds of internal things . (And it's a pet concern for committers since API visibility and stability is the hardest problem we have to hash out on a daily basis.) :) We could also kick things off by filing child issues of the meta for (e.g.) "Mark controllers as @internal", "Mark foo services as internal", etc. for the things we would have fixed here.

Wim Leers’s picture

Hah, works for me! :D

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.