API Client Inspiration

Created on 2 August 2023, over 1 year ago
Updated 18 October 2023, about 1 year ago

Dear API Client team,

I recently stumbled across this project and wanted to share with you our Drupal API client that we built at our company. Maybe it can serve as inspiration for your project.

https://github.com/wunderwerkio/drupal-kit

πŸ“Œ Task
Status

Fixed

Component

Miscellaneous

Created by

πŸ‡¦πŸ‡ΉAustria chfoidl Salzburg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @chfoidl
  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    Hi @chfoidl! I was aware of your project - we have a project at Pantheon with the same name that has some overlap :) https://www.npmjs.com/package/@pantheon-systems/drupal-kit

    I have it on my list to take a closer look and go hands on with your Drupal Kit. The api-client would also love to have your perspective any way you'd be interested in contributing. The more we can learn from maintainers of similar projects I think the better chance we have at creating something that can meet the wide needs of the Drupal community.

    We have a channel #api-client in Drupal Slack if you're interested in dropping by at some point.

  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    Did a tiny bit of experimenting in a codesandbox: https://codesandbox.io/s/drupal-kit-example-zxlyjw

    A couple of quick thoughts:
    * The before and after hooks are an interesting concept. I wonder if something like that could be useful for the apiClient base class. Seems like a natural fit for logging. Also like how it could support use cases we're not yet thinking about.
    * I like the implementation of the plugin system as well, but I still feel like working directly with classes is more appropriate for this library given the ways we want it to be repurposed and extended.

  • πŸ‡¦πŸ‡ΉAustria chfoidl Salzburg

    Hi @brianperry,

    thank you for your answer / thoughts.

    The main reason for this somewhat hacky-looking plugin system is that it enables true composability of the api client.
    A traditional class based approach would of course be cleaner but the main limitation here is that it only allows for a linear inheritance path.

    I am currently re-evaluating the usefullness / cleanliness of the current implementation of the plugin-system myself.
    During my research I stumbled apon TypeScript Mixins: https://www.typescriptlang.org/docs/handbook/mixins.html
    Maybe those are the sweet spot between traditional classes and my plugin system.

  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    Appreciate the feedback here - feel free to check back in as the project evolves :)

    Marking as fixed.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024