Skip to content

Conversation

billiegoose
Copy link
Member

@billiegoose billiegoose commented May 25, 2019

I'm making a BREAKING CHANGE

Relax! I won't merge this for a while. And it's not really that big a change. In fact it's possible that it won't be a breaking change on Node, since Node Buffers are instances of ArrayBuffer, you'd still be able to pass in Buffers to all the APIs. And depending on where the internal ArrayBuffers are sourced from (i.e. a call to fs.readFile), the processed objects might still be Buffer instances when they get returned from the APIs.

Background

I really want isomorphic-git to be used in PWAs. I really think that git provides an excellent backbone for making some really interesting P2P social networking apps. So I really want the library to provide a good experience on mobile, which means fast to download (among other things). I'm really close to under 1 second download over 3G internet connections:
Screen Shot 2019-05-25 at 12 27 31 PM

but the low-hanging fruit to trim off is mostly gone. Unless there's a replacement for pako (native zlib in the browser please?!) or I remove full error messages from the production bundle similar to React, it's gonna be hard to get the bundle size smaller. The last low-hanging fruit is the Node.js Buffer polyfill that is provided by Webpack - a polyfill so huge largely because it still supports ancient browsers that the rest of isomorphic-git doesn't work on anyway.

Screen Shot 2019-05-25 at 12 16 59 PM

That juicy almost-9% has been tempting me for almost half a year now, ever since I wrote lightning-fs@3.0 which provides a browser filesystem that doesn't use the Buffer polyfill at all.

I'm not 100% sure that none of my dependencies aren't using Buffer though. :-( So it's possible that even after eliminating Buffer from my code it'll still be present in the bundle. So this is a WIP / experiment.

Edit: Oh eliminating Buffer also gets us closer to a good experience for Angular users (#597) and other environments (#698).

@isomorphic-git-bot
Copy link

Thank you wmhilton! I auto-formatted the code using prettier-standard. 🤖

@karma-pr-reporter
Copy link

Test Results for 4079e47:

Browser Passed Skipped Failed Time Disconnected Error
HeadlessChrome 0.0.0 (Linux 0.0.0) 255 1 0 1 min 19.287 secs false undefined
Firefox 66.0.0 (Ubuntu 0.0.0) 190 1 65 1 min 53.8 secs false undefined
Chrome Mobile 67.0.3396 (Android 7.1.1) 255 1 0 5 mins 27.347 secs false undefined
Safari 11.1.2 (Mac OS X 10.13.6) 255 1 0 5 mins 42.865 secs false undefined
Mobile Safari 11.0.0 (iOS 11.2.0) 255 1 0 5 mins 48.827 secs false undefined
Edge 17.17134.0 (Windows 10 0.0.0) 255 1 0 7 mins 38.651 secs false undefined

@karma-pr-reporter
Copy link

Test Results for 4079e47:

Browser Passed Skipped Failed Time Disconnected Error
Firefox 66.0.0 (Ubuntu 0.0.0) 190 1 65 1 min 34.885 secs false undefined

@karma-pr-reporter
Copy link

Test Results for 4079e47:

Browser Passed Skipped Failed Time Disconnected Error
Firefox 66.0.0 (Ubuntu 0.0.0) 190 1 65 1 min 32.414 secs false undefined

@karma-pr-reporter
Copy link

Test Results for f072726:

Browser Passed Skipped Failed Time Disconnected Error
HeadlessChrome 0.0.0 (Linux 0.0.0) 255 1 0 1 min 11.377 secs false undefined
Firefox 66.0.0 (Ubuntu 0.0.0) 191 1 64 1 min 42.092 secs false undefined
Safari 11.1.2 (Mac OS X 10.13.6) 255 1 0 3 mins 23.061 secs false undefined
Chrome Mobile 67.0.3396 (Android 7.1.1) 255 1 0 3 mins 55.965 secs false undefined
Mobile Safari 11.0.0 (iOS 11.2.0) 255 1 0 4 mins 1.829 secs false undefined
Edge 17.17134.0 (Windows 10 0.0.0) 255 1 0 5 mins 34.929 secs false undefined

@karma-pr-reporter
Copy link

Test Results for f072726:

Browser Passed Skipped Failed Time Disconnected Error
Firefox 66.0.0 (Ubuntu 0.0.0) 191 1 64 1 min 28.589 secs false undefined

@karma-pr-reporter
Copy link

Test Results for f072726:

Browser Passed Skipped Failed Time Disconnected Error
Firefox 66.0.0 (Ubuntu 0.0.0) 191 1 64 1 min 25.547 secs false undefined

Base automatically changed from master to main December 17, 2020 03:53
@willstott101 willstott101 mentioned this pull request Feb 4, 2022
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

Successfully merging this pull request may close these issues.

3 participants