Skip to content
Snippets Groups Projects
Open Code Insight: Move away from FE shared models
  • View options
  • Code Insight: Move away from FE shared models

  • View options
  • Open Issue created by Administrator

    Created by: vovakulikov

    Background

    At the moment most code insights pages use the same models for rendering information on the page, for example, the insight card on the dashboard page shows

    • insight title
    • insight data (chart itself)
    • insight series (as a legend in the legend block)

    If we go to the edit UI page for this insight from the dashboard page we have to have more detailed information about insights such as a list of repositories this insight was run over, series query values, and time interval,...

    At the moment we have one big "fat" FE model where we store all information about insight for all consumers (pages that render this model). This leads to a few problems

    • It's getting complicated to add new fields to the model because we have to go through all consumers and fix how they work with it model in order to not mess up with newly added fields
    • Over-fetching, we don't need to fetch repo information if we render insight on the dashboard page.

    Why is this important

    If we want to integrate code insights with other core workflows we need to have clean and reusable components/features that require only what only they need and fetch only what they need to fetch in order to be efficient enough to not slow down the core workflows.

    Proposal

    Separate FE models by page. In other words, we would have a separate model for the dashboard page and a separate model for the creation UI. Ideally, we won't need to have any FE models as soon as we improve our GQL API. But this issue might be a good start for solving this problem with FE models.

    • Merge request
    • Branch

    Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first