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

kubb-client: make client logic available in userspace #1517

Closed
nimo23 opened this issue Jan 13, 2025 · 2 comments
Closed

kubb-client: make client logic available in userspace #1517

nimo23 opened this issue Jan 13, 2025 · 2 comments
Labels

Comments

@nimo23
Copy link

nimo23 commented Jan 13, 2025

What is the problem this feature would solve?

Even though the user can provide their own fetch functions, exporting the default fetch.ts into the userspace can be a good idea for various reasons, for example:

  • It is no longer necessary to add kubb-client as a hard dependency (dev-dep is enough) in package.json.
  • The user can adapt or reuse the generated fetch function within its userland.
  • ..

See #1497 (comment) for more details.

External documents/projects?

No response

What is the feature you are proposing to solve the problem?

No response

What alternatives have you considered?

No response

@nimo23 nimo23 added the enhancement New feature or request label Jan 13, 2025
@stijnvanhulle
Copy link
Collaborator

The amount of complexity this is adding to Kubb does not seem to be worth it to me(see main...poc/1517-copy-client, the react-query and other plugins also need to access that newly created client.ts file.).

Let's stay with the current approach, @kubb/plugin-client/clients/axios contains some default clients. If a developer does not want to use those, override the importPath and just copy-paste the current client to their codebase. This will just work fine. See https://www.kubb.dev/plugins/plugin-client/#importpath

@stijnvanhulle stijnvanhulle closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2025
@nimo23
Copy link
Author

nimo23 commented Jan 23, 2025

Let's stay with the current approach,

Ok, nevertheless, the main...poc/1517-copy-client was a good attempt.

Maybe the following sentence should be in the docs at https://kubb.dev/plugins/plugin-client/:

When using the default clients, the dependency needs to be added as "save" rather than "--save-dev".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants