Code Components should render with their auto-saved state(if any) when rendered in the XB UI

Created on 16 January 2025, 3 months ago

Overview

In โœจ Auto-save code components Active will allow Code Component that are edited in the UI to have an auto-saved state.

This means the edits to them should not affect the live site if they have already been placed. See also โœจ Publishing code components Active

Since we are not using Workspaces in ๐ŸŒฑ Milestone 0.2.0: Experience Builder-rendered nodes Active we can't do a real config entity save until we publish the changes in the Code Component because otherwise that would affect the live site.

As far as I know this is the only case where when are rendering Component inside XB(which itself is using an auto-save state) we need to consider that Component will have an auto-save state that should override the config. SDC and Block components don't have this dynamic

Proposed resolution

When rendering a Code Component inside XB it should use the auto save if there is one. When we render the code component in regular entity render it should not use the auto-save state

When thinking of a solution we should keep in the mind that after ๐ŸŒฑ Milestone 0.2.0: Experience Builder-rendered nodes Active when we can use Workspace we might not need this functionality because we may be able to rely on a real config save if using Workspaces Extras module โ†’ which has a sub-module Workspaces Config

Possible solutions

  1. Code Components implementation of \Drupal\experience_builder\ComponentSource\ComponentSourceInterface::renderComponent could check if the current route is experience_builder.api.preview and if it is rendering using the auto-save state

    this might be we could encapsulate the logic in CodeComponent as this might be the only part of the system. It also might be easy to remove if we determine using Workspaces Config is better for this when it is available

User interface changes

๐Ÿ“Œ Task
Status

Active

Version

0.0

Component

Page builder

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024