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

Recomendation - switch from Snekfetch to node-fetch #20

Closed
favna opened this issue Oct 2, 2018 · 3 comments
Closed

Recomendation - switch from Snekfetch to node-fetch #20

favna opened this issue Oct 2, 2018 · 3 comments
Assignees

Comments

@favna
Copy link
Contributor

favna commented Oct 2, 2018

Honestly... it's a tough story to explain. Snekfetch was made by a developer on the DiscordJS library and through that it got the most usage but starting v4.X it got a lot of issues and DiscordJS ended up switching to Node-Fetch instead. You can read the full story on this PR.

Anyway to the point, now that DiscordJS has dropped usage of Snekfetch the usage base for the lib has dropped enormously with it and now when installing booru through yarn it will even tell users to switch to node-fetch:

yarn install v1.10.1
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning booru > snekfetch@3.6.4: use node-fetch instead
warning snekfetch@4.0.4: use node-fetch instead
[3/5] Fetching packages...
[4/5] Linking dependencies..

I personally made the jump from snekfetch to node-fetch a while ago for my Discord bot and while I have to admit it was quite an undertaking due to the different code structure it uses, it wasn't all too bad and I suppose that for a lib such as Booru it would take at most 2-3 hours if not less (depending on how quickly you can grasp the way node-fetch works)

@AtoraSuunva
Copy link
Owner

I've used node-fetch before for a small script, since booru only does GET requests (at least for now) it should be a fairly simple fix.

Snekfetch is only used in https://github.com/AtlasTheBot/booru/blob/master/src/boorus/Booru.js and https://github.com/AtlasTheBot/booru/blob/master/src/boorus/Derpibooru.js (Where the latter shouldn't be doing in the first place), so it would (hopefully) just be a few-line fix.

I'll get on this & checking the latest PR tonight

@AtoraSuunva AtoraSuunva self-assigned this Oct 2, 2018
@AtoraSuunva
Copy link
Owner

Done in 41ad7a8

@favna
Copy link
Contributor Author

favna commented Oct 6, 2018

Very nice! Thanks :)

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

No branches or pull requests

2 participants