-
Notifications
You must be signed in to change notification settings - Fork 148
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
Dropping support for old Node versions + improving browser support? #418
Comments
Hi @valadaptive. Thanks for bringing this up and offering to help. A PR which migrates the codebase to ES6 and reduces Node-specific dependencies would be welcome. I'd be happy to review it and release a new major version from it. We'll also want to confirm there are no significant performance regressions, for example <5% slowdown on the benchmark schemas. |
With #481 merged in, the only polyfill needed to run avsc in the browser is It may be possible to redo Regarding streams more broadly, I could probably rewrite |
As part of the TypeScript migration, I was thinking of restructuring the repo into multiple packages. For example:
In the future, we could add other packages like WDYT @valadaptive? |
That sounds like a good idea. Once you get TypeScript set up here, I can look into setting up some sort of monorepo if you want. I prefer the idea of separate NB: you may want to choose a different name than |
SGTM.
Hmm. I see how Thank you for the monorepo setup offer. Switching to |
Since the days of Node 0.x, a lot of things have changed in the Node ecosystem.
When Node was first created, a lot of useful functionality was missing from the ECMAScript standard, so Node created its own set of APIs which were polyfilled by e.g. Browserify.
Over time, APIs covering the same or similar ground have been standardized to work in both Node and the browser, and browser-based polyfills for Node APIs have lost much of their utility--many aren't even being maintained anymore. Browserify has given way to bundlers like Webpack and Rollup which focus less on emulating Node in the browser and more on simply packaging all the code together.
I ran into this when trying to use avsc in my web application--the newest release of Webpack doesn't automatically polyfill Node features anymore, and I had to figure out which polyfills avsc did and did not require to function, then add each one to the Webpack configuration myself.
By dropping support for old Node versions (0.12 reached end-of-life at the end of 2016), a lot of Node-specific dependencies could be avoided, making the project easier to use in the browser. For example, avsc makes heavy use of
util.inherits
, which could be replaced by ES6 classes. See also #410, which proposes replacingBuffer
with the browser-compatibleUint8Array
.Do you have any interest in bumping the minimum Node version (not even to the latest version--just to one which supports ES6), migrating the codebase to ES6, and reducing Node-specific dependencies? I'd be more than happy to do it myself, but I don't want to make massive unsolicited PRs without knowing whether they'd actually be helpful.
The text was updated successfully, but these errors were encountered: