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

SDK: Create DotCMSLayoutBody React Component to render page content #31178

Closed
8 tasks done
rjvelazco opened this issue Jan 21, 2025 · 5 comments · Fixed by #31306 or #31463
Closed
8 tasks done

SDK: Create DotCMSLayoutBody React Component to render page content #31178

rjvelazco opened this issue Jan 21, 2025 · 5 comments · Fixed by #31306 or #31463

Comments

@rjvelazco
Copy link
Contributor

rjvelazco commented Jan 21, 2025

Parent Issue

#30943

Background

The DotcmsLayout component was originally designed to render the page and listen for changes from the UVE. However, its responsibilities have grown too complex by combining layout rendering with editor-specific logic. To address this, we will deprecate the DotcmsLayout component and introduce a new, cleaner component called DotCMSLayoutBody.

DotCMSLayoutBody will focus solely on rendering the content, ensuring a separation of concerns. UVE-related logic will no longer be included in this component, and developers can rely on other mechanisms for editor communication.

Tasks

  • Deprecate DotcmsLayout with appropriate warnings in the codebase and documentation.
  • Build the new DotCMSLayoutBody component, ensuring it focuses solely on rendering the content.
  • Verify the DotCMSLayoutBody component works in both Edit and Live modes.
  • Update SDK documentation to highlight the deprecation of DotcmsLayout and promote DotCMSLayoutBody.
  • Ensure no regressions in the layout rendering process after migration.
  • All existing use cases for DotcmsLayout are migrated to DotCMSLayoutBody.
  • If Components is not passed, the app does not break, and console a warning.
  • Include a devMode prop to show the Container is EMPTY and No Component for ${Contenty} messages outside the UVE.

Proposed Objective

Same as Parent Issue

Proposed Priority

Priority 3 - Average

Acceptance Criteria

Important

Make sure the withExperiments works with this new component.

  • Deprecate DotcmsLayout.
  • Build DotCMSLayoutBody.
  • Test Compatibility.
  • Update Examples and Documentation.
  • DotcmsLayout should still work.

Pseudo-code

Use Case

Important

The new implementation should emphasize simplicity and flexibility.

import { DotCMSLayoutBody } from '@dotcms/client/next';

export function MyPage({ pageAsset }) {
    return (
        <DotCMSLayoutBody 
            pageAsset={pageAsset} 
            components={componentsMap} 
        />
    );
}

Quality Assurance Notes

  • Test DotCMSLayoutBody with and without the components prop to ensure both scenarios are functional.
  • Verify rendering behavior in both Edit and Live modes to confirm consistent functionality.
  • Confirm no residual UVE-related logic is left in the new component.

Sub-Tasks & Estimates

  • Mark DotcmsLayout as deprecated in the SDK.
  • Build DotCMSLayoutBody as a standalone component.
  • Update SDK examples and documentation to reflect the changes.
  • Perform regression testing to ensure no breaking changes.
@rjvelazco rjvelazco changed the title SDK: make DotcmsLayout Component render SDK: Refactor DotcmsLayout Components to Remove UVE Communication Logic Jan 21, 2025
@rjvelazco rjvelazco changed the title SDK: Refactor DotcmsLayout Components to Remove UVE Communication Logic SDK: Create DotCMSPageBody Components to render page content Jan 23, 2025
@rjvelazco rjvelazco changed the title SDK: Create DotCMSPageBody Components to render page content SDK: Create DotCMSPageBody React Component to render page content Jan 23, 2025
@rjvelazco rjvelazco self-assigned this Feb 3, 2025
@rjvelazco rjvelazco changed the title SDK: Create DotCMSPageBody React Component to render page content SDK: Create DotCMSBodyRender React Component to render page content Feb 3, 2025
@rjvelazco rjvelazco moved this from New to In Progress in dotCMS - Product Planning Feb 4, 2025
@rjvelazco rjvelazco moved this from In Progress to Current Sprint Backlog in dotCMS - Product Planning Feb 4, 2025
@rjvelazco rjvelazco moved this from Current Sprint Backlog to In Progress in dotCMS - Product Planning Feb 12, 2025
@rjvelazco rjvelazco moved this to In Progress in dotCMS - Product Planning Feb 12, 2025
@rjvelazco rjvelazco changed the title SDK: Create DotCMSBodyRender React Component to render page content SDK: Create DotCMSLayoutBodyRender React Component to render page content Feb 13, 2025
@rjvelazco rjvelazco moved this from In Progress to In Review in dotCMS - Product Planning Feb 14, 2025
@rjvelazco rjvelazco changed the title SDK: Create DotCMSLayoutBodyRender React Component to render page content SDK: Create DotCMSLayoutBody React Component to render page content Feb 14, 2025
@github-project-automation github-project-automation bot moved this from In Review to Done in dotCMS - Product Planning Feb 17, 2025
@rjvelazco rjvelazco removed their assignment Feb 18, 2025
@rjvelazco rjvelazco reopened this Feb 18, 2025
@github-project-automation github-project-automation bot moved this from Done to Current Sprint Backlog in dotCMS - Product Planning Feb 18, 2025
@rjvelazco rjvelazco moved this from Current Sprint Backlog to QA in dotCMS - Product Planning Feb 18, 2025
@rjvelazco rjvelazco self-assigned this Feb 24, 2025
@rjvelazco rjvelazco moved this from Done to In Progress in dotCMS - Product Planning Feb 24, 2025
@rjvelazco
Copy link
Contributor Author

@fmontes I'm on it

@zJaaal
Copy link
Contributor

zJaaal commented Feb 27, 2025

IQA Passed

All examples are building correctly and types are correct.

Screenshots

Screen.Recording.2025-02-27.at.1.43.21.PM.mov
Screen.Recording.2025-02-27.at.1.45.39.PM.mov
Screen.Recording.2025-02-27.at.1.49.33.PM-1.mov

@zJaaal zJaaal closed this as completed Feb 27, 2025
@zJaaal zJaaal removed their assignment Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment