nextcloud-libraries / nextcloud-libraries/nextcloud-vue

[RFC] Proposal: Decompose super-components

Open
#6,848 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion
Dominant language
Vue
Stars
246
Forks
99
Avg merge
1d 20h
Merged PRs (30d)
103

Description

Proposal: decompose "super" components.

A super-component is a large component that tries to do too much work for different, sometimes very narrow, cases.

Why

Such components often have tens of props, complex implementation and 1000-2000+ lines of code, while 200-400 is a limit for a good component.

Examples
  • NcActions, covers:
    • Simple menus, including navigation and inline feature
    • Custom menus with custom button contents
    • Dialogs with forms
  • NcAvatar
    • Minimal: just an image
    • Maximum: user metadata fetching + user status + contacts menu
  • NcAppSidebar
    • On one hand - a universal sidebar
    • On another - contents Files-specific app features such as "favorite"
    • Same with NcModal with viewer-only features
  • NcSelect
What to do
  • Decompose to base components and more specific components
    • e.g. NcSelect => NcSelect + NcSelectUsers
  • Make a base component extendable and customize in place where needed
    • e.g. NcAppSidebar for Files app use cases

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the listed super-components: NcActions, NcAvatar, and NcAppSidebar, along with the completed NcSelect decomposition and linked pull request. Determine which component should be addressed first, identify its distinct use cases, and define base and specialized components whose responsibilities are separated without losing existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.