-
Notifications
You must be signed in to change notification settings - Fork 352
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
feat(adapter-fetch): Add support for handling binary data #332
Conversation
"detect-node": "^2.0.4" | ||
"buffer": "^5.6.0", | ||
"detect-node": "^2.0.4", | ||
"to-arraybuffer": "^1.0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to-arraybuffer
uses require('buffer').Buffer
so I'm confused how this all is built in our current build pipeline - is it some how "browserifying" the node implementation and also bundling the npm "buffer" package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so looked more into it to see what was actually being built. We current have rollup-plugin-node-builtins setup which has support for using Buffer
via buffer-es6.
If I imported the buffer via import { Buffer } from 'buffer'
it only inlines the polyfill for the UMD build but when I used from 'buffer/'
, it inlined it for all 3 builds (CJS, ES, and UMD). Since this is only meant for the browser, it would make sense for it to be be polyfilled in all 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explains a lot, was very confused - thanks for looking into it
packages/@pollyjs/adapter-fetch/tests/integration/adapter-test.js
Outdated
Show resolved
Hide resolved
@@ -3,8 +3,6 @@ node_js: | |||
- '10' | |||
- '12' | |||
|
|||
dist: trusty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dist is EOL and is no longer supported by Chrome. That was the reason for the failing builds.
Description
Add support for handling binary data.
Motivation and Context
#183
Types of Changes
Checklist