samples-typescript icon indicating copy to clipboard operation
samples-typescript copied to clipboard

[Feature Request] Add sample for using `Buffer` polyfills

Open mjameswh opened this issue 2 years ago • 1 comments

Describe the solution you'd like

Add a sample that demonstrate how to add support for using the Buffer class from sandboxed code, by loading an appropriate polyfill through a custom Webpack configuration.

Context

Some users have expressed their need for using the Buffer class in code that runs inside the Workflow sandbox. After discussion, however, our team has determined that it's preferable not to provide out-of-the-box support for that module, since that goes against some of our mid-term and long-term objectives, notably regarding the possibly of supporting other JavaScript runtimes (eg. Deno, browser, etc). Users may easily work around missing APIs by loading appropriate polyfills from their Webpack bundler.

mjameswh avatar Jul 18 '23 20:07 mjameswh

Hi, just want to bump this. Using Buffer to decode base64 is quite common. An example for how to enable Buffer would be very helpful for people who is not familiar with webpack.

cirias avatar Mar 22 '24 13:03 cirias