Overview

Following the logic from https://www.drupal.org/node/2997122

Proposed resolution

Move all methods from SdcController and create separate invokable method.

Similar to these

Drupal\experience_builder\Controller\ExperienceBuilderController: {}
Drupal\experience_builder\Controller\ComponentStatusController: {}

(added in #3469684: Surface the REASON for an SDC not being made available in XB (i.e. not meeting criteria) and #3469856: The component preview should have a background: include theme's global asset libraries for component preview, in those MRs you can see what it took to take an existing controller and make it use this pattern).

⚠️ With two exceptions! #3452581: [META] XB Permissions identified that there are two unused routes. Those of coursedon't need to be lifted, they can just be removed. They are the routes with the paths /xb-render-component/{component_id} and /xb-component/{component_id}.

User interface changes

None

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

deepakkm created an issue. See original summary.

wim leers’s picture

Priority: Major » Normal
Issue summary: View changes
Issue tags: +DX (Developer Experience)
Parent issue: » #3450586: [META] Back-end Kanban issue tracker

👍

(Added some extra context to the issue summary.)

wim leers’s picture

Also if its ok with you can we go ahead and merge smaller MR's so that it becomes easier for you to review too.

+1

Just one last nit, then this first MR can land. I retitled the MR to convey that it's only addressing a subset of the scope.

wim leers’s picture

#3452581: [META] XB Permissions identified that there are two unused routes. Those of coursedon't need to be lifted, they can just be removed. They are the routes with the paths /xb-render-component/{component_id} and /xb-component/{component_id}.

So the next MR on this issue should just remove those 2 routes.

  • wim leers committed 51eb9158 on 0.x authored by deepakkm
    Issue #3477164 by deepakkm, wim leers: Lift `SdcController::preview()`...

traviscarden’s picture

Assigned: deepakkm » Unassigned
Status: Needs work » Reviewed & tested by the community

I think this was only waiting on my weigh-in. Approved. 🙂 I don't know who should merge it.

  • wim leers committed a10127d4 on 0.x authored by deepakkm
    Issue #3477164 by deepakkm, wim leers, traviscarden: Remove 2 unused API...
wim leers’s picture

Status: Reviewed & tested by the community » Needs work

Thanks, @traviscarden! Merged https://git.drupalcode.org/project/experience_builder/-/merge_requests/342, now back to Needs work for the remaining MRs that are needed.

wim leers’s picture

Assigned: Unassigned » deepakkm

deepakkm’s picture

Assigned: deepakkm » Unassigned
Status: Needs work » Needs review

MR !343 is now ready for review.

wim leers changed the visibility of the branch 3477164-lift-all-methods to hidden.

wim leers’s picture

Assigned: Unassigned » deepakkm
Status: Needs review » Needs work

Some tiny nits, then this will be done! 😄

wim leers’s picture

I'd have landed this first, but it wasn't ready. #3455942: HTTP API: update /xb-components to use Component config entity's default values has landed now, so this will need to be rebased.

deepakkm’s picture

Status: Needs work » Needs review
deepakkm’s picture

Assigned: deepakkm » Unassigned
wim leers’s picture

Title: Lift all methods out of `SdcController` into separate invokable services-as-controllers » [PP-1] Lift all methods out of `SdcController` into separate invokable services-as-controllers
Status: Needs review » Postponed

This MR is failing tests. Hence it's not ready for review.

Turns out 0.x CI pipelines are failing too, due to disruptive upstream changes in Drupal core. Created issue to get 0.x passing tests again, after which this will be able to land: #3478720: [upstream] Test expectations must be updated to match Drupal 10.4.0/11.1.0 changed behavior of (Dynamic) Page Cache response headers.

wim leers’s picture

Title: [PP-1] Lift all methods out of `SdcController` into separate invokable services-as-controllers » Lift all methods out of `SdcController` into separate invokable services-as-controllers
Status: Postponed » Reviewed & tested by the community

  • wim leers committed ba13164c on 0.x authored by deepakkm
    Issue #3477164 by deepakkm, wim leers, traviscarden: Lift all methods...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

So much cleaner and clearer! 🥳

Status: Fixed » Closed (fixed)

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