Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.4.0 breaks regexes in debug.enable() on purpose (but it was documented since ever) #985

Open
ibc opened this issue Dec 23, 2024 · 0 comments

Comments

@ibc
Copy link
Contributor

ibc commented Dec 23, 2024

Under the rationale that "it was never supported nor documented" (let's talk about this later), version 4.4.0 explicitly breaks the ability to pass regular expressions to debug.enable() function, which is a complete headache for me since I heavily rely on that feature for dynamic logging.

And not just for dynamic logging but also for making debug works in browser Worklets. Worklets cannot read localStorage from the browser so the only way to enable debug logging on them is by explicitly calling debug.enable(namespaces). And of course those namespaces are passed to those Worklets via internal message from the main browser JS application which of course reads them from localStorage.getItem('debug') which of course contains regular expressions because that's how debug library has always supposed to work, but since 4.4.0 this is no longer possible because those regexes only work when debug library reads the namespaces from localStorage.

With all respect, the rationale saying "it was never supported nor documented" is not very pleasant. The docs literally say (and have always said):

Set dynamically
You can also enable debug dynamically by calling the enable() method

Notice the "you can also". Where exactly should I assume that I can enable debug dynamically but without regexes? To be clear: The docs say today and the docs have always said that debug.enable() accepts wildcards:

CleanShot 2024-12-23 at 14 02 15@2x

So this is a total breaking change that makes debug library lose one of its nicest features while the docs still say that such a feature is present and the rationale for removing that feature is that "it was never documented". Well, it was.

Can I please ask this great library authors to restore this super useful feature?

@ibc ibc changed the title 4.4.0 breaks regexes in debug.enable() on purpose 4.4.0 breaks regexes in debug.enable() on purpose (but it was documented since ever) Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant