-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add API to enable/disable debug logging (in development) #35
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
For some reason, it looks like the Adding the following to import { isDevelopment } from "#is-development";
console.log("[createCache] isDevelopment:", isDevelopment);
console.log("[createCache] NODE_ENV:", process.env.NODE_ENV); Prints:
Not sure what needs to change to connect these two. I've updated parcel deps to the latest release (2.9.2). Based on the Parcel documentation, I would expect the import/export to work. Parcel says it supports Out of curiosity, I split the "suspense" package exports into development, production, and default– and Parcel seems to be importing the default path. Edit Fix inbound! parcel-bundler/parcel#9108 |
Were you able to figure out everything here? I wonder if there is still anything that is unclear when it comes to those exports and stuff that I could help you out with. |
Only that it was a Parcel bug. In the meanwhile, I just hard-coded the condition to true so I could test what I was working on. |
Debug logging can be useful to correlate Suspense data fetching with other things going on in an application. For a while, I've had debugging built into this library locally but not exported for applications that use the library.
This PR adds the ability to turn debug logging on for an individual cache or for all caches.
For all caches:
For an individual cache:
Note that this logging is only in development builds of this package (see c21c562). The above code will have no observable impact on production builds.