Skip to content

iOS browserify #830

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

Closed
rubensayshi opened this issue Jul 31, 2017 · 12 comments
Closed

iOS browserify #830

rubensayshi opened this issue Jul 31, 2017 · 12 comments

Comments

@rubensayshi
Copy link
Contributor

the README says "NOTE: If you expect this library to run on an iOS 10 device, ensure that you are using [email protected] or greater."
I assume that is for the Buffer.prototype.reverse issue that I'm running into, but it doesn't seem to actually fix it ...
also I don't see anything in the buffer package that indicates a fix for the missing reverse method, or was that about Buffer.from?

Uint8Array doesnt have reverse in my iOS emulator.

@dcousens
Copy link
Contributor

dcousens commented Jul 31, 2017

@rubensayshi
Copy link
Contributor Author

rubensayshi commented Jul 31, 2017

npm -g ls | grep browserify

npm -g ls | grep buffer

│ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ │ │ └── [email protected]
│ │ │   │ ├── [email protected]
│ │ │   │ ├── [email protected]
│ │ │   │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │     │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ │ │ └── [email protected]
│ │ │ │   │ ├── [email protected]
npm ERR! peer dep missing: eslint@^3.19.0, required by [email protected]
npm ERR! peer dep missing: eslint-plugin-flowtype@^2.33.0, required by [email protected]
npm ERR! peer dep missing: eslint-plugin-import@^2.2.0, required by [email protected]
npm ERR! peer dep missing: eslint-plugin-jsx-a11y@^5.0.3, required by [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │   │ ├── [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│ │ │   ├── [email protected]
│ │ │   │ └── [email protected]
│ │ │   │ └── [email protected]
│ │   │ ├── [email protected]
│ │   │ │ └── [email protected]
│ │ ├── [email protected]
│ │ │   │ ├── [email protected]
│ │     │ │ │ │ └── [email protected]
│ │   │     │ ├── [email protected]
│   │   │ ├── [email protected]
│ │ │ │ │ ├── [email protected]
  │ ├── [email protected]
  │ │ ├── [email protected]
// test.js

var b = Buffer.from('00ffee00ffee', 'hex')

alert(b.toString('hex'))
alert(b.reverse().toString('hex'));
alert(typeof b.reverse);

running this on iPhone6 iOS8 and iOS9 simulator fails with reverse being undefined, iOS10 is fine, can't we bring back buffer-reverse? (https://github.com/bitcoinjs/bitcoinjs-lib/compare/master...rubensayshi:bufferreverse?expand=1)

or we dont want to support ios <10 ?

hmm, quickly looking at stats for our app we see 2.4% iOS 9.3 and rest is all 10+

@rubensayshi rubensayshi reopened this Jul 31, 2017
@dcousens
Copy link
Contributor

@rubensayshi I think this is the wrong repository to report this... maybe https://github.com/feross/buffer ?

@rubensayshi
Copy link
Contributor Author

feross/buffer#167

reported it there, I guess you prefer waiting for a fix there instead of brining back buffer-reverse?

@dcousens
Copy link
Contributor

dcousens commented Aug 3, 2017

@rubensayshi ideally yes, if there is such an issue, upstream is the best place to resolve it.
Do you agree?

@dcousens
Copy link
Contributor

dcousens commented Aug 10, 2017

@rubensayshi apparently it isn't an upstream thing.
Enforcing buffer-reverse through your stack, is going to be painful.

I think drop iOS<10, re-open if you think otherwise.

@rubensayshi
Copy link
Contributor Author

I'd strongly prefer bringing back buffer-reverse then ...

from our business perspective ~2% users is too much to ignore for us, as a FOSS project you can be a bit more "focused on the future instead of the past", but the cost is pretty low in this case I think

@rubensayshi rubensayshi reopened this Aug 13, 2017
@dcousens
Copy link
Contributor

@rubensayshi is bitcoinjs-lib the only place to change?

@rubensayshi
Copy link
Contributor Author

yes, reversing buffers is not something that is done often, if at all ;)

@dcousens
Copy link
Contributor

@rubensayshi PR it up

@dcousens
Copy link
Contributor

@rubensayshi and please submit a safe-buffer PR to https://github.com/crypto-browserify/buffer-reverse

@dcousens
Copy link
Contributor

dcousens commented Dec 1, 2017

I too have experienced this on my stack, but I opted to drop the support.
It wans't specifically a bitcoinjs-lib issue, as I had other libraries using Buffer.prototype.reverse too.

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

No branches or pull requests

2 participants