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

Feature request: Browser support #1883

Open
shaffeeullah opened this issue Apr 20, 2022 · 2 comments
Open

Feature request: Browser support #1883

shaffeeullah opened this issue Apr 20, 2022 · 2 comments
Labels
alt runtimes Questions / issues for non-Node runtimes api: storage Issues related to the googleapis/nodejs-storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. web

Comments

@shaffeeullah
Copy link
Contributor

This client library is not currently supported in the browser. We have received many requests for this feature and are working toward supporting this. We'll keep this issue updated with any progress we're able to share.

Existing requests: https://github.com/googleapis/nodejs-storage/issues?q=is%3Aissue+label%3Aweb

@shaffeeullah shaffeeullah added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Apr 20, 2022
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Apr 20, 2022
@FossPrime
Copy link

FossPrime commented Apr 20, 2022

I've made a sample sandbox with both a WebContainer and a browser implemation that will currently fail but should start working once fixes are implemented and published to npm under the latest tag

https://stackblitz.com/edit/public-bug-gcs-uploader

Dependencies that would need to be upgraded or made optional:

  • jws (deprecated safe-buffer dependency)
    • The browser version on jws should work in Node.js
  • Pumpify (Also has a safe-buffer dependency)

Screenshot 2022-04-20 12 09 12

WebContainers

Wrapping this in WebContainers might work quickly if the deprecated Node Crypto dependencies were dropped in favor of the Node 16 WHATWG WebCrypto api. The following error is what I got in my attempt to work around the lack of Chrome support.

TypeError: this[D].init is not a function
    at new Sign (https://vitejs-vite-tgnfu8.w.staticblitz.com/blitz.49c6d2ee58ce7c1528881cc6d46ebf056b3b42bf.js:6:1135213)
    at Object.createSign (https://vitejs-vite-tgnfu8.w.staticblitz.com/blitz.49c6d2ee58ce7c1528881cc6d46ebf056b3b42bf.js:6:808195)
    at Object.sign (/home/projects/vitejs-vite-tgnfu8/node_modules/jwa/index.js:151:25)
    at Object.jwsSign [as sign] (/home/projects/vitejs-vite-tgnfu8/node_modules/jws/lib/sign-stream.js:32:24)
    at GoogleToken.requestToken (/home/projects/vitejs-vite-tgnfu8/node_modules/gtoken/build/src/index.js:225:31)
    at GoogleToken.getTokenAsyncInner (/home/projects/vitejs-vite-tgnfu8/node_modules/gtoken/build/src/index.js:163:21)
    at GoogleToken.getTokenAsync (/home/projects/vitejs-vite-tgnfu8/node_modules/gtoken/build/src/index.js:142:55)
    at GoogleToken.getToken (/home/projects/vitejs-vite-tgnfu8/node_modules/gtoken/build/src/index.js:94:21)
    at JWT.refreshTokenNoCache (/home/projects/vitejs-vite-tgnfu8/node_modules/google-auth-library/build/src/auth/jwtclient.js:171:36)
    at JWT.refreshToken (/home/projects/vitejs-vite-tgnfu8/node_modules/google-auth-library/build/src/auth/oauth2client.js:152:24)

@shaffeeullah shaffeeullah removed their assignment Apr 26, 2022
@FossPrime
Copy link

FossPrime commented Jun 15, 2022

Relevant update, Bun bundler uses WebStreams for a 3x performance improvement over Node Streams

https://gist.github.com/Jarred-Sumner/90db1a06c5e7b1c1ab55b5581c62a86d

https://twitter.com/jarredsumner/status/1532322146713710592?s=20&t=yCa_LXu67NnPqzd5eFDsHg

@ddelgrosso1 ddelgrosso1 removed the priority: p3 Desirable enhancement or fix. May not be included in next release. label Jun 29, 2023
@ddelgrosso1 ddelgrosso1 added the alt runtimes Questions / issues for non-Node runtimes label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alt runtimes Questions / issues for non-Node runtimes api: storage Issues related to the googleapis/nodejs-storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. web
Projects
None yet
Development

No branches or pull requests

3 participants