Stupid (and objectively wrong) restriction #468
Replies: 3 comments 5 replies
-
@patrik-simunic-cz Thanks for bringing this up here. I was just start to look at using ky, but might have to reconsider now. Are you familiar with ofetch and wretch? They seem like good fetch-based candidates. |
Beta Was this translation helpful? Give feedback.
-
I decided to just use |
Beta Was this translation helpful? Give feedback.
-
I plan to fix this situation but It may be a while until I can get around to it. The plan is roughly:
I believe this will satisfy everyone. The API will have the flexibility that is needed for both use cases while still being simple via reasonable defaults. There will be no confusingly similar option names. Overall only one new option is actually added to the API. And Ky will no longer need to validate your input in an overly opinionated way unless, maybe, you opt into it. In the meantime, cooperate on workarounds. We know there's demand for improvement. Calling all of the work that went into Ky "worthless" doesn't help and only demotivates open source contribution, which is all based on volunteer work. A dented Lamborghini is still a Lamborghini. People are building awesome things with Ky every day despite its flaws. |
Beta Was this translation helpful? Give feedback.
-
Hello, firstly let me say, this library looks amazing. I was looking for a maintained and lightweight alternative to Axios when I came across
ky
and this library blew my mind. Simple, powerful and most of all, really lightweight. Kudos!This being said, it just all the more breaks my heart that this library is completely unusable and I won't be using it on any project, probably ever. All for a tiny and seemingly stupid reason that you can't use a slash in the beginning of an input if you have a
prefixUrl
set. This is simply a big no-no, rationally, objectively.I won't go into a detailed analysis, I think the mistake (with big M) has been largely covered here by @Spomky and @aintHuman: #70
But in short, you've basically created a huge deal-breaker (evidently for more people than just me) to solve an absolute non-issue (which a library like this shouldn't even remotely care about) and hence made this library and all the amazing work that went into it totally worthless. You're introducing an opinion, where none should exist. You're introducing a feature, which should not exist. If you need to request a path on the same host you don't set
prefixUrl
in the first place (like every other library like this does) - the feature to request a path on the samo host even ifprefixUrl
is set is just purely unnecessary and BS reason to introduce such restriction.@sholladay said in that issue that he considered adding a second option (
baseUrl
) next toprefixUrl
, that went nowhere. Do I really understand it correctly that because it „would be confusing to have both options“, you've decided to implement only the objectively wrong way, instead of at least giving developers the choice between objectively right and objectively wrong way? Rly??But well, what can you do. I don't have the time to fork and FIX THIS ERROR, so good ol'
fetch
it is. It not as pretty as a lightweight library with fancy API, but still better to write a custom wrapper aroundfetch
than to sacrifice decades old convention that exists for objectively sane reasons. Really breaks my heart... 💔Beta Was this translation helpful? Give feedback.
All reactions