-
-
Notifications
You must be signed in to change notification settings - Fork 172
CSV Response #187
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
CSV Response #187
Conversation
I'm thinking that a built in parser + convertor (to the same object format we're using now) would be amazing. What's the stance on using something like |
Very nice PR @andreivreja 👍 |
The main concern with including a csv parser is the bundle size Andrei. Our bundle is 15kb minified+gzipped now and fast-csv itself is 13.6 kb and papaparse is 6.5 kb. |
Oh, I never actually checked the size of I'll mess around with |
🎉 This PR is included in version 0.29.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Neat that this landed. Just some nitpicking, which I came across replicating this in dart: You could also use the response header to determine if res.headers['content-type'] == 'text/csv', instead of checking the request headers. Seems cleaner, but should still work the same in both cases I would guess. |
Wanted to do that initially but the fact that it has Might just be my micro-optimization mindset, didn't actually check if it would've made any noticeable difference - probably it wouldn't haha. And rather than checking if |
I see, then I will mirror your implementation, just to have it the same. Consistency is probably better here ^^ |
What kind of change does this PR introduce?
Feature
What is the current behavior?
Response is always a JSON.
What is the new behavior?
Ability to set response type to CSV. Usage:
Additional context
CSV responses can be super convenient for some use cases (#186) but also save plenty of resources used (wasted) by large response sizes (supabase/supabase-js#189)