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

Deprecate endpoint aliases #234

Merged
merged 1 commit into from
Nov 9, 2021
Merged

Deprecate endpoint aliases #234

merged 1 commit into from
Nov 9, 2021

Conversation

Pimm
Copy link
Collaborator

@Pimm Pimm commented Nov 5, 2021

Deprecated endpoint aliases such as:

  • client.payments.all (which is synonymous with client.payments.page)
  • client.payments.delete (which is synonymous with client.payments.cancel)

Con

This is another breaking change.

Pros

The pros of #233 apply here as well:

  1. Aliases are a potential cause for confusion.
  2. A narrower API promotes discoverability.
  3. This removal promotes consistency in code which uses this library.

page vs all or list

I've chosen page over all or list. I don't like all, because the name is misleading: endpoints apply pagination, therefore all sometimes returns "some" instead of "all". list is a decent name; but page has the advantages of being consistent with the PHP client, and making it even more obvious that there is pagination in effect.

This includes payments.all (which is synonymous with payments.page); and payments.delete (which is synonymous with payments.cancel).
@Pimm Pimm merged commit 06c4415 into master Nov 9, 2021
@Pimm Pimm deleted the pimm/v3.6.0 branch November 9, 2021 10:06
Pimm added a commit that referenced this pull request Mar 10, 2023
These endpoint aliases were deprecated in #234. The first version to include this deprecation is 3.6.0, released on 10 February 2022.

In the era of TypeScript, I feel the confusion caused by having two (or sometimes three) separate functions in the type definition outweighs the backwards compatibility. Consumers of an API expect every part of it to be significant.
@Pimm Pimm mentioned this pull request Mar 10, 2023
Pimm added a commit that referenced this pull request May 25, 2023
These endpoint aliases were deprecated in #234. The first version to include this deprecation is 3.6.0, released on 10 February 2022.

In the era of TypeScript, I feel the confusion caused by having two (or sometimes three) separate functions in the type definition outweighs the backwards compatibility. Consumers of an API expect every part of it to be significant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants