Skip to content

Use Node.js built-in debug and deprecated utilities instead of relying on external packages. #459

@bjohansebas

Description

@bjohansebas

Since this is a change I would like to propose for major versions of the packages, I am opening this discussion here.

Currently, we use the depd and debug packages both for emitting deprecation warnings and for debug logging. I believe we should start using Node.js built-in utilities util.debuglog and util.deprecate for these purposes.

This would primarily reduce our dependency footprint and lower the risk of our packages being affected if those dependencies were ever compromised. In addition, while these packages are maintained by Doug, he has been inactive for some time.

As a result, if any package could previously be used in the browser, it will no longer work out of the box and users will need to bundle it themselves (e.g. using Webpack) to transpile it and make it browser-compatible, additionally, the way deprecation warnings are disabled will change to using Node.js options as described in the official documentation, which makes this a breaking change. Debug logging will also now be enabled via NODE_DEBUG instead of DEBUG.

This is not a major concern, as the only package we currently support for browser usage is iconv-lite, and it does not rely on either of these dependencies. None of the other packages claim browser compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discusstc agendatop priorityIssues which the TC deem our current highest priorities for the project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions