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] Permit imports of Node buffer module in workflows #1108

Closed
silasdavis opened this issue Apr 25, 2023 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@silasdavis
Copy link

silasdavis commented Apr 25, 2023

Is your feature request related to a problem? Please describe.

It would be useful to permit uses of the builtin buffer on the import tree for workflows.

In my particular case I have parsing logic to convert workflow input types into richer domain types that relies on buffer.

Describe the solution you'd like

I note that all builtinModules are included in disallowedModules, I'm not sure if this is because you would need to shim them in the v8 isolate explicitly or if it is down to non-determinism issues with Buffer. unsafeAlloc and friends perhaps?

I would assume otherwise that buffer would be safe to us (I have BigNumber implementations depending on it).

The solution I would like is for an exemption to be made similar to that which exists for assert.

Additional context

Incidentally it would be really handy to emit some additional context when reporting problematic modules. The error message lists the modules but not their source, however data.context in the callback here:

this.foundProblematicModules.add(module);

Does have access to the module which actually made the call which helps a lot in narrowing down the source of the bad module import.

@silasdavis silasdavis added the enhancement New feature or request label Apr 25, 2023
@mjameswh
Copy link
Contributor

After discussion, our team has determined that it's preferable not to provide out-of-the-box support for Node's Buffer API, 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).

Instead, we encourage users to load appropriate polyfills from their Webpack bundler. A sample will soon be added demonstrating how to do so.

@mjameswh mjameswh closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants