Show HN: Single JavaScript API Client for sheet2api.com(github.com)
github.com
Show HN: Single JavaScript API Client for sheet2api.com
https://github.com/odwyersoftware/sheet2api-js
10 コメント
Thanks for the constructive feedback. I'll improve those mentioned areas.
I agree about the last part. It seems a like a library from several years ago. I couldn't stop the willing to send some PRs to improve it and make it modern.
> it's based on the old XMLHttpRequest API rather than the more modern, and much better in my opinion, fetch() API.
I fail to see what is wrong about it.
I fail to see what is wrong about it.
XMLHttpRequest is callback based and has an interesting API. fetch was written to be a sensible replacement. It does nice things like supporting promises by default and handling request cancellation.
XHR and fetch were in a "old thing is deprecated, new thing is not ready" sort of state for the longest time.
XHR always supported aborting requests, along with progress callbacks. Also, IE11 doesn't support fetch, so you'd need to bring in a polyfill for it and for Promise there. (And FormData, and Blob and etc, if we're talking full spec compliance)
Considering this history, I wouldn't dismiss an XHR-based implementation so fast.
XHR always supported aborting requests, along with progress callbacks. Also, IE11 doesn't support fetch, so you'd need to bring in a polyfill for it and for Promise there. (And FormData, and Blob and etc, if we're talking full spec compliance)
Considering this history, I wouldn't dismiss an XHR-based implementation so fast.
Ok, we've changed the title to that from "Show HN: Single JavaScript API Client for Google Sheets and MS Excel APIs"
Nice, this looks like something i might use to mock an api server in the early stages of a project.
You're better using Postman for this case: https://learning.postman.com/docs/designing-and-developing-y...
I think authorization is the most important part to avoid randos flood your "database". Otherwise, why do not just use the Google Sheets API.
The title really should be "Show HN: Single JavaScript API Client for sheet2api.com"
From a JS front end dev perspective it's not actually very good as a library. There's literally no error handling at all (it just passes you the error from XMLHttpRequest; it could do so much more), there's no auth, and it's based on the old XMLHttpRequest API rather than the more modern, and much better in my opinion, fetch() API.