Redocly / Redocly/redoc

About code quality

Open
#2,720 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

Dear community,

I've been drafting some changes to the code, in order to add support for the notion of representations, and I must say that it was way more difficult that I expected. Not because the project is particularly complex - it is actually quite simple - but because the code quality is sub-optimal.

I had to make some very unexpected changes, like applying interface segregation to a lot of components (they all expect a complete model interface even when they only need a subset of such interface attributes), or duplicating styles because there is no way to compose them from mixins, or adding children-aware logic to components because some of them knows about their children (typically the MenuItem one but there are others) instead of honoring the rules of composition, or having to create an actual h3 heading because, well, the one included in the project is an h2.

In the end, I got the job done, but it was not a pleasing moment.

Would you accept some code quality proposals? I'd like to start be applying interface segregation.

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

The issue does not name files or tests; start by reviewing the component interfaces and composition patterns involved in the proposed representations work. Agree on a focused interface-segregation change and its completion criteria with maintainers before editing.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
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.