Performance: conditional rendering (dmx-if)
Improve App Connect performance by using conditional regions (dmx-if) and placing conditional-only data/components inside them so they don’t render or process until needed.
Introduction
Section titled “Introduction”This tour uses a focused example page to explain a practical App Connect performance decision: when to avoid rendering work entirely instead of merely hiding UI. You will compare conditional regions with show/hide behavior, then connect that choice to component scope, repeated DOM cost, and page readability.
Performance: render only when needed
Section titled “Performance: render only when needed”Improve performance by rendering less: use conditional regions (dmx-if) for UI that depends on a condition, and place conditional-only data/components inside that region so they don’t exist until the condition becomes true.
Repeaters: performance tips
Section titled “Repeaters: performance tips”Repeaters can generate a lot of DOM. Prefer the simplest repeater that matches your layout, and only set Unique Key when you truly need it (it slows down the repeater).
Conditional rendering vs show/hide
Section titled “Conditional rendering vs show/hide”Understand why dmx-if is recommended for performance and how it changes what gets rendered.
Conditional Region vs Show/Hide
Section titled “Conditional Region vs Show/Hide”Use a Conditional Region (dmx-if) when a part of the page depends on a condition or isn’t needed right away.
important: Best performance: use Conditional Region (dmx-if) for conditional UI, not Show/Hide dynamic attributes.
Conditional Region (dmx-if)
Section titled “Conditional Region (dmx-if)”This section uses a Conditional Region (dmx-if), so it only exists when the condition is true.
Place conditional-only data inside
Section titled “Place conditional-only data inside”If a Data View, Data Store, or Server Connect component is used only inside a section that’s shown conditionally, declare it inside that Conditional Region (dmx-if) so it isn’t processed until needed.
tip: When the condition is false, the Conditional Region and its child components don’t exist at all.
Show dynamic attribute (dmx-show)
Section titled “Show dynamic attribute (dmx-show)”This section uses the Show dynamic attribute (dmx-show), so it stays in the page structure and its child components exist even when hidden.
warning: Show/Hide dynamic attributes are visibility toggles (CSS). They do not prevent rendering/processing of the region’s components.
Local data inside Conditional Region
Section titled “Local data inside Conditional Region”This data component lives inside the Conditional Region. Keeping conditional-only data/components inside a Conditional Region (dmx-if) avoids always-on work.
tip: Rule of thumb: global for shared page-wide state; local for conditional-only sections.
Shared global data
Section titled “Shared global data”Shared state and data that multiple regions use can stay at the top for readability and reuse.
Repeaters: performance and key field
Section titled “Repeaters: performance and key field”Repeaters can generate lots of DOM. Learn when to use each repeater style, and when to avoid the key field for better performance.
Repeaters: Repeat vs Repeat Children
Section titled “Repeaters: Repeat vs Repeat Children”Repeaters can create many DOM nodes. Choose the simplest repeater that matches your layout needs.
Repeat (dynamic attribute)
Section titled “Repeat (dynamic attribute)”This example uses Repeat (dynamic attribute). It repeats the element itself. Great for simple repeated elements, but can lead to extra wrapper DOM if you repeat large containers. (dmx-repeat:*)
Repeat Children (component)
Section titled “Repeat Children (component)”This example uses Repeat Children (component). It repeats only the children, so your layout container stays single and clean when building grids/cards. (is=“dmx-repeat”)
Unique Key: only when needed
Section titled “Unique Key: only when needed”This Repeat Children repeater sets a Unique Key. Only do this when you need stable row identity (animations, or DOM identification).
warning: Choose the unique key field to identify the repeater’s record. Only needed when you want to use animations or need to identify repeater’s rows in DOM. Do not use if not needed as it will slow down the repeater.
Wrap-up
Section titled “Wrap-up”Review what you did and choose a next tour.
Next steps
Section titled “Next steps”Pick a related tour to continue.