HCK-14465: replace axios with @hackolade/fetch library#239
HCK-14465: replace axios with @hackolade/fetch library#239Vitalii4as merged 4 commits intodevelopfrom
Conversation
| + Response: null, | ||
| + } | ||
| +}); | ||
| const URL = require('node:url').URL; |
There was a problem hiding this comment.
@Vitalii4as i know that under certain condition the node protocol doesn't play well with our webpack. So just to make sure did you build it for browser and electron?
| .then(res => (res.ok ? res.json() : Promise.reject())) | ||
| .catch(err => { | ||
| return authToken ? {} : Promise.reject(oktaCredentialsError); | ||
| }); |
There was a problem hiding this comment.
maybe it's just me but this looks like formatting glitch
There was a problem hiding this comment.
The formatting is fine, it follow our rules
There was a problem hiding this comment.
I manually fixed it
package.json
Outdated
| "description": "Hackolade plugin for Snowflake", | ||
| "disabled": false, | ||
| "dependencies": { | ||
| "@hackolade/fetch": "^1.3.0", |
There was a problem hiding this comment.
don't we have save-exact in npm config?
There was a problem hiding this comment.
In Studio - yes. In plugins - no. I'll add that
| minify: true, | ||
| logLevel: 'info', | ||
| external: ['lodash'], | ||
| external: ['lodash', '@hackolade/fetch'], |
There was a problem hiding this comment.
@Vitalii4as like for lodash if you put fetch as external you need to copy it into the node_modules (see below)
There was a problem hiding this comment.
Thanks, I forgot about that(
bigorn0
left a comment
There was a problem hiding this comment.
- please use exact version in package.json
- esbuild config is missing the copy of fetch into node_modules like lodash
- check formatting (but not a real issue)
|



Content
In this PR the
snowflake-sdkis upgraded to the latest library, and it is patched to use@hackolade/fetch. The axios in the plugin is replaced by the@hackolade/fetchas well.NOTE: We patched only those parts of the
snowflake-sdk, there are some functionality that still uses older approaches, like file transfer API. By changing it all we will create a very large patch file, so we decided to adapt only those parts that are used by the application.