With Node.js 13.7.0 we finally have a standard way to make dual-packages which support both ESM and CJS with backwards compatibility with older Node.js versions, via conditional exports.
import foo from 'bar/module.mjs';).
Obviously nobody wants to write these out manually, but this presents some new challenges for transpilers, which unfortunately no transpilers have yet tried to solve.
So what can we do about this?
Recently I published a new open-source webpack loader named
smart-source-map-loader to enable Webpack to load the source maps from existing compiled code. Now you might be thinking, there’s already a loader for that, what makes this alternative “smart”?
Necessity is the mother of pull requests, so that’s what I did.
If you ever wanted to use scroll events in your web app, you’ve probably found what a mess it is. I know I did when I was developing the theme used on this website. There are snippets out there to try to resolve legacy browser issues, but all of them are half-baked and missing basic functionality such as proper feature-detection and the ability to remove an event listener. All of these issues seems simple, but are actually quite complex to implement properly, and without memory leaks.
We can do better! That’s why I created this library.
Recently I decided to try out webpack as a replacement for Browserify, and it didn’t disappoint! Out-of-the-box, webpack even support’s AMD, so RequireJS-based libraries can be used as-is. This got me thinking, jQuery switched to RequireJS a while back for their source code and build process, so I questioned:
Could webpack be used to load individual jQuery modules?
My latest open source contribution to the world is jquery-ajaxreadystate, a jQuery plugin which adds a new AJAX function with
readystatechange capabilities, available for download on GitHub, NPM, and Bower.