honeycombio / libhoney-js

Javascript library for sending data to Honeycomb
Apache License 2.0
49 stars 29 forks source link

fix: Use url-join instead of urljoin #342

Closed adamsmasher closed 1 year ago

adamsmasher commented 1 year ago

Which problem is this PR solving?

libhoney is pulling in a helper library called urljoin to fuse URL components together. urljoin expects to be run in a Node environment, and uses the Node standard library (notably the path module). Because of this dependency, libhoney fails for us when run under Webpack 5, which no longer bundles Node libraries in.

Short description of the changes

This PR swaps urljoin out for an alternative library with equivalent functionality, called url-join. url-join has no dependencies, and is newer than urljoin and still maintained.

Because it's new, it uses ES Modules; I needed to configure Jest to use Babel to transform it.

adamsmasher commented 1 year ago

Just saw that this is failing a check because it needs a proper prefix in its title. I'm going to update this to be a "fix:", although I'm not sure if it should be a "maint:" or "chore:" instead. Happy to make any changes requested 🙂