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

Old Browser Support With Browserify #456

Closed
dwighthouse opened this issue Jan 23, 2019 · 7 comments
Closed

Old Browser Support With Browserify #456

dwighthouse opened this issue Jan 23, 2019 · 7 comments

Comments

@dwighthouse
Copy link

When testing in IE10 (and probably lower) with Tape, an error will occur:

This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.

Browserify switched its dependency on Buffer from v4 to v5 on January 24th, 2017. Buffer v5 officially drops support for IE8 through IE10.

I was able to determine that it is Tape (or one of its dependencies), and not my code, that is making use of Buffer, and therefore triggering Browserify to attempt to include its polyfill(?), which then triggers the error in older versions of IE.

Like Tape, I'm attempting to build my library to support (and be testable) in as many browsers as possible, including older versions of IE. This means that while I can certainly use an older version of Browserify, or build my tests with two different versions of Browserify at the same time, there are some major potential side-effects of doing so:

  1. I may be harming performance or compatibility with more recent or future browsers.
  2. Simply by including old versions of libraries (like Browserify), I am indirectly including dependencies that represent a greater attack surface for security vulnerabilities. Even if there is no real danger, due to the potential vulnerabilities only occurring in test code, it could negatively effect the perceived security of my codebase in the eyes of NPM security audits and the like.
  3. If building two different versions of my test code for the two different Browserify versions, I would have to deal with duplication of test code and pages (a minor problem).

Since Browserify is the "recommended" method of bundling Tape tests for the Browser, and since Tape claims to support IE6 through IE10, yet current versions of Browserify don't fully support Tape, how does one square this circle?

@ljharb
Copy link
Collaborator

ljharb commented Jan 23, 2019

That's an interesting dilemma.

I'd be happy to accept a PR into tape that uses v4 of buffer, if that would address the issue.

In general, though, I think browserify should either use v4, or should provide a config option that allows it to be used (and I think filing an issue on browserify is a good idea).

@dwighthouse
Copy link
Author

@ljharb I don't suppose there's a way to simply remove the reliance on Buffer at all in Tape, therefore preventing Browserify from trying to add its polyfill?

I just tested on IE9. The tests don't even start because something (probably again related to Buffer) triggers an uncaught error about Uint8Array not being supported by the browser (which is correct, but unhelpful).

@ljharb
Copy link
Collaborator

ljharb commented Jan 23, 2019

It looks like the usage of Buffer is in tap-parser as well as lib/assert. I don't think it's practical to remove it.

@dwighthouse
Copy link
Author

Checking in. Any progress on this front?

@ljharb
Copy link
Collaborator

ljharb commented Jan 29, 2019

There’s no progress because there’s nothing actionable yet.

I’d suggest filing an issue on browserify itself to use v4 of Buffer.

@dwighthouse
Copy link
Author

I’d suggest filing an issue on browserify itself to use v4 of Buffer.

Given that the author of Tape personally approved of the change from Buffer v4 to v5 in Browserify, where he is listed as a collaborator, and acknowledged that this would break old IE support, I highly doubt he'd be willing to roll that back.

However, I have asked him for assistance in what to do there too.

@ljharb
Copy link
Collaborator

ljharb commented Dec 27, 2019

Closing in favor of discussion: browserify/browserify#1678 (comment)

@ljharb ljharb closed this as completed Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants