-
-
Notifications
You must be signed in to change notification settings - Fork 231
Rewrite JS Bindings #879
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
Rewrite JS Bindings #879
Conversation
9f2d962 to
7aed404
Compare
|
Fantastic work! Thank you very much for the effort, this is a great step for the JS bindings. One nitpick I found is that the minify function accepts a JS object with the config parameters, Data and Type. Since Type and Data are essential, I suggest those should be the first two parameters to the function, and the third would be an optional parameter for configuration options. If left out (null) it should be the default options. What do you think?
or
|
I was debating writing it like this initially. I think this would've been good if there was only 1 required argument, but since it requires both data and type, I thought it would be less readable/harder to remember the arg order vs the explicit As a single config option, it's easier for code that builds options dynamically (for example config-based tools which is a valid use case for minifiers). What if we kept the current object but also included an optional overload? So the library would export both: Many popular ts modules use this pattern too, so I think this would be best. If you prefer, maybe we can document the main signature as |
|
Excellent, merged, thank you very much for the work. I haven't been able to test it but I suppose it is all right. |
Awesome! If any issues pop up feel free to tag me |
This PR completely rewrites and revamps the JS bindings. Summary of the changes:
minifyfunction which is used to minify a given string or buffer.configandfilehave been removed. File handling should be done in the script not offloaded to the native library.Closes #517, #518, #520, #578, #727, #733, #878
Let me know if you have any questions about the design choices or if you notice any issues.
Note: this PR introduces breaking changes to the node module from the previous implementation.