Overview

In the code review of #3459229: Allow saving component compositions as sections (frontend only) @hooroomoo made a good observation that the TS definitions around LayoutNode, Node and RootNode are a bit loose. This issue proposes that we try to reduce that ambiguity to make the layoutUtils and layoutModelSlice reducers a bit tighter and easier to use.

Proposed resolution

Numerous utility functions can accept any Node with children but some specifically expect to have the RootNode passed in as they apply to the whole layout. These should be changed to explicitly expect a RootNode input and provide a RootNode output.

Marking as postponed as this MR builds on the changes implemented in #3459229: Allow saving component compositions as sections (frontend only) and should be merged afterwards.

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

jessebaker created an issue. See original summary.

jessebaker’s picture

Title: [PP-1] Tighten up TS definitions around LayoutNodes/RootNodes etc » Tighten up TS definitions around LayoutNodes/RootNodes etc
Status: Active » Needs review
jessebaker’s picture

Assigned: jessebaker » Unassigned
hooroomoo’s picture

Status: Needs review » Needs work

minor comments

wim leers’s picture

@hooroomoo++
@jessebaker++

jessebaker’s picture

Status: Needs work » Needs review

hooroomoo’s picture

Status: Needs review » Fixed

sweet

Status: Fixed » Closed (fixed)

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