Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declarative API development #392

Open
patrick-tolosa opened this issue May 27, 2021 · 0 comments
Open

Declarative API development #392

patrick-tolosa opened this issue May 27, 2021 · 0 comments
Assignees

Comments

@patrick-tolosa
Copy link
Contributor

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
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant