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

Expose Blob as a global #42220

Closed
Jamesernator opened this issue Mar 5, 2022 · 1 comment
Closed

Expose Blob as a global #42220

Jamesernator opened this issue Mar 5, 2022 · 1 comment
Labels
feature request Issues that request new features to be added to Node.js.

Comments

@Jamesernator
Copy link

What is the problem this feature will solve?

Increase parity with web APIs. In particular allowing interfaces to more generally associate a content type with a chunk of data in a portable way (leaving it up to the host how the data is actually stored).

And while APIs could accept blobs without having the global, one can't do checks like value instanceof Blob (i.e. in cases where an API accepts other kinds of objects), or construct blobs directly using the constructor.

What is the feature you are proposing to solve the problem?

Expose buffer.Blob as a global Blob like is on the web.

I am not proposing changing the experimental status however.

What alternatives have you considered?

No response

@Jamesernator Jamesernator added the feature request Issues that request new features to be added to Node.js. label Mar 5, 2022
@aduh95
Copy link
Contributor

aduh95 commented Mar 5, 2022

Fixed by #41270, should land in v18.0.0 scheduled for April.

FWIW adding now globals is considered a breaking change and therefore is not backported to LTS lines – in case some code out there is using this kind of pattern:

if (!globalThis.Blob) {
  // Node.js only code here
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js.
Projects
None yet
Development

No branches or pull requests

2 participants