[PP-1] Reduce unnecessary api calls when opening Components list

Created on 4 June 2025, about 2 months ago

Overview

We fetch the list of components on page load (and when a new code component is added). However due to the transformResponse implementation for the Components and Dynamic Components lists, we call the same end point again when opening the Library/expanding the Dynamic Components list.

This results in a) unnecessary calls to the server b) janky UI where we briefly show the loading state for the component list.

Postponed on ✨ Move "Dynamic Components" into the Library Active where it was originally spotted by @lauriii in #comment 10 ✨ Move "Dynamic Components" into the Library Active

Proposed resolution

Instead of transformResponse (which will create a cache entry per transform passed in) we can create a custom hook that requests the base URL and uses useMemo to filter the response.

User interface changes

πŸ› Bug report
Status

Active

Version

0.0

Component

Page builder

Created by

πŸ‡¬πŸ‡§United Kingdom jessebaker

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