cloudinary / cloudinary/js-url-gen

Declarative API development

Open
#392 0 comments 0 reactions 1 assignee Claimed by @patrick-tolosa View on GitHub
discussion
Dominant language
HTML
Stars
55
Forks
11
PR merge metrics
No merged PRs in 30d

Description

# 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
}))
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.