refactored lib/types and lib/utils to make rollup friendly #224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is more of a request for comment than a real pull request. I would like to use avsc in the browser using the packager Rollup. Currently, I could not get that to work to with the standard distribution. I did try browserify and that worked of course, but it doesn't really help me with my bundle.
I'm also trying to minimize the weight of the library. With the included build.js and rollup I could push the size down to 68k after this refactor (which is mostly neutral but may have broken one or two things)
So in this pr I removed as much node.js code as I could from lib/util and lib.types. To do that I refactored the types to the es6 class syntax to remove the dependency on util.inherits. As removing the node.js formatting and debug functions. There are two places which I added @fixme notices where that probably broke something. I haven't run any of the tests yet.
Overall, it would be helpful if there was an esm distribution of avsc, which would probably be a different way to make this library rollup friendly.
So what would you recommend on how to proceed?