-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
perf(js-sdk): remove axios #615
base: main
Are you sure you want to change the base?
Conversation
This is awesome! @MonsterDeveloper Thank you! Excited for it. |
@nickscamara @mogery hi! Any updates on the related PR's #611 and #614? Looking forward to get going on this one. |
Sorry, slipped my mind. Taking a look today. |
Merged both related PRs! Excited about this one :) |
@mogery hi again! I ended up cooking up something big, starting with the
Points up for debate:
So far, I've completed:
Could you please review these files and their respective tests? The |
Looking great! (clicked the wrong button when in un-drafted there haha) Will talk with Nick today on whether we need to retain v0 tests for FirecrawlApp or if only v1 tests need to be ported. Prettier and ESLint is a good call. Thanks! |
Please do:) Let me know how it goes. I'm not quite sure what is the status of v0 for now (deprecated or still receiving patches), but if it's no longer maintained you could do a major version bump for |
v0 is still actively receiving patches, we will not deprecate it yet. We've already done a major bump on |
Got it. Does this mean that |
v0 is meant to get server-side fixes only. |
@mogery hi! Sorry for a delayed response, was doing some travels. So since both v0 and v1 support is needed, the optimal solution would be to have 2 separate classes for the different versions of the API. Mixing these 2 together in one class would require weird prefixes which don't contribute to readability and structure, to say the least. I've just looked through the API reference and I can't seem to find the WebSocket docs for v0. It was only introduced in v1, am I right? |
Hey! Sorry for the delayed response haha. Yes, that's in V1 only. |
|
Haven't heard about it being faster than fetch. I guess that depends on the runtime you're running it in. But anyway, the goal here is to eliminate dependencies, as the millisecond performance of making an HTTP request is not a priority in this lib I assume. |
It is indeed slower than undici.request as mentioned in nodejs/undici#1203 (comment) Plus, Node's global fetch is actually coming from undici. |
Changes made
fetch
instead ofaxios
FirecrawlApiError
classcross-fetch
(only in environments where fetch is not available)mapUrl
methodschema
optionTODO
I would recommend merging #611 first, then #614 and finally this PR.