TryGhost / TryGhost/NQL

Refactor converter.js

Open
#14 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

cleanup/refactoring
Dominant language
JavaScript
Stars
7
Forks
7
Avg merge
9h 4m
Merged PRs (30d)
22

Description

Problem

We are currently adding support for filtering on relations.

With every case, the converter becomes:

  • harder to read
  • a little bit hacky to fulfil the cases

Reasons

  • everything lives in one file
  • the relation cases are quite challenging, the complexity is high

Goal

Try to add all relation cases and then refactor the converter.js.
We should first learn from the use cases and see which refactoring direction makes sense.

I think what we need is a detection in the code base what this case is and then react on it.
Currently, the converter.js is too generic, which makes it hard to deal with all the cases.
IMO be explicit and more readable.

Contributor guide

No contributing guide indexed for this repository

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 reading converter.js and examining the relation-filtering use cases described in the issue. Identify the relation cases that must be supported before choosing a refactoring direction; done means those cases work and the converter is more explicit and readable, with its complexity reduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.