Declarative API development

Open
#392 0 comments 0 reactions 1 assignee View on GitHub

@patrick-tolosa is already working on this.

Since May 28, 2023.

Assessment

This issue has not been assessed yet.

Description

discussion

The case for Declerative APIs

The current API of the SDK is imperative.
@yoadsn mentioned in #382 that some users would benefit from a declarative API as well.

Points of interest

  • The API should be consistent across methods (Meaning we can't pick and choose which APIs have a declarative counterpart)
  • The API should avoid using magical strings since we aim to provide the best dev experience even to people with weak IDEs.
  • We might relax the constraint above if we consider the declarative API for more advanced users, but this needs to be explored before deciding.

Trivial example

Imperative
new Image().resize(scale().width(100).height(100)) 
Declerative
new Image().resize(scale({
  width: 100,
  height: 100
}))
Dominant language
HTML
Stars
56
Forks
11
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No 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.

More from cloudinary/js-url-gen

All issues in cloudinary/js-url-gen

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.