Hacker News new | ask | show | jobs
by phire 1004 days ago
There are two separate questions:

"Should libraries still be polyfilling to support ancient runtimes?" and "How should that polyfilling be implemented?"

Even if a library wants to maintain backwards compatibility, we can still argue this method of polyfilling (especially the phony polyfills) is damaging to the wider javascript ecosystem.

In an ideal world, the cost of polyfills for developers who don't need them should be zero.

For developers using bundlers, the bundler is expected to implement any required polyfills for the developer's targeted runtimes, and having the library ship with it's own polyfills is counterproductive at best. However, I suspect these libraries wish to maintain compatibility for developers not using bundlers.

Maybe npm should be upgraded to support multiple variants of packages? That way these libraries could ship both polyfilled and non-polyfilled versions of their packages in parallel.