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

Deprecate internal functions exposed in the public API #123

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

Comments

Projects
None yet
3 participants
@dduponchel
Collaborator

dduponchel commented Apr 27, 2014

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

This comment has been minimized.

Show comment
Hide comment
@Stuk

Stuk Apr 28, 2014

Owner

Yep, deprecating from the public API sounds good to me

Owner

Stuk commented Apr 28, 2014

Yep, deprecating from the public API sounds good to me

@shytikov

This comment has been minimized.

Show comment
Hide comment
@shytikov

shytikov Jul 27, 2015

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.

shytikov commented Jul 27, 2015

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

This comment has been minimized.

Show comment
Hide comment
@dduponchel

dduponchel Jul 27, 2015

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)

Collaborator

dduponchel commented Jul 27, 2015

@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