Closed jvilk closed 8 years ago
When we initially settled on using JazzLib, we'd tried to implement the required natives for zip support in Javascript. The problem with that plan is that the natives are highly coupled to java.util.zip's implementation, so using a pre-existing JS zip lib was out of the question.
I think we should trap the higher-level public methods from java.util.zip and use a JS library (maybe the one derived from BrowserFS) to handle them.
I looked at JamVM's implementation of zip, and it looks like the natives are pretty straightforward. We shall see...
I did some archaeology and found the commit where we switched to JazzLib in the first place: https://github.com/plasma-umass/doppio/commit/73d50aaf87fc5c1bbf4bb08898c286c51a84d7df
Amazingly, the old hacky code did work for some limited cases.
Haha, I forgot: it only worked if the jar was "classes.jar", which we manually unzipped in the build process. Good times.
We no longer rely on JazzLib.
We currently include JazzLib in the DoppioJCL to avoid needing to implement zip file natives. However, we could implement these natives using the zip file support in BrowserFS, making JAR file extraction much quicker.
Since DoppioJVM runs in both Node and the browser, I would need to separate the zip support into a separate environment-agnostic library, and update BrowserFS and Doppio to reference this library.