Deprecate internal functions exposed in the public API #123

Closed
dduponchel opened this Issue Apr 27, 2014 · 3 comments

Projects

None yet

3 participants

@dduponchel
Collaborator

Currently, JSZip exposes a lot of internal functions :

JSZip.base64.decode
JSZip.base64.encode
JSZip.prototype.crc32
JSZip.prototype.utf8decode
JSZip.prototype.utf8encode

JSZip.utils.MAX_VALUE_16BITS
JSZip.utils.MAX_VALUE_32BITS
JSZip.utils.arrayBuffer2Blob
JSZip.utils.checkSupport
JSZip.utils.findCompression
JSZip.utils.getTypeOf
JSZip.utils.isRegExp
JSZip.utils.pretty
JSZip.utils.string2Blob
JSZip.utils.string2Uint8Array
JSZip.utils.string2binary
JSZip.utils.transformTo
JSZip.utils.uint8Array2String

These functions/objects are not documented and in my opinion not really useful outside JSZip. The base64/crc32/utf8 methods may have some uses for other people but their signatures are sometimes surprising (utf8encode takes a string and return a string for example).

I think we should deprecate the list above (keep them internally but flag their inclusion in the public API as deprecated).
Thoughts, anyone ?

@dduponchel dduponchel changed the title from Deprecate exposed internal functions. to Deprecate internal functions exposed in the public API Apr 27, 2014
@Stuk
Owner
Stuk commented Apr 28, 2014

Yep, deprecating from the public API sounds good to me

@dduponchel dduponchel added a commit to dduponchel/jszip that referenced this issue Jun 1, 2014
@dduponchel dduponchel Fix #123, deprecate functions 2e302df
@dduponchel dduponchel closed this in #138 Jun 12, 2014
This was referenced Jun 18, 2014
@shytikov

I have a question, why base64 should be abandoned?

So far as I can tell passing base64 string as an input for reading zip is the only common method for in-memory file handling between node and browser.

Or there are another ways I'm missing?

Thank you so much in advance for your answer.

@dduponchel
Collaborator

@shytikov this deprecates the object JSZip.base64, not the support of base64 input/output.
Regarding the node <-> browser communication, I would use xhr.responseType = "arraybuffer" (if you can ignore IE <= 9)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment