- 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 2:41pm 18 October 2023 - πΊπΈ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.