Frontend & browser·Modules, bundling and the build
you imported the replacement as a normal function instead of letting it patch the global object.
Ponyfill
The same functionality as a polyfill, exported as a module rather than installed globally. Nothing outside your imports is affected, so it cannot conflict with another library or with a future native implementation, and it can be tree-shaken away. The trade is that third-party code calling the native API still gets whatever the browser has.