Conversation
| }, | ||
| "dependencies": { | ||
| "create-react-context": "^0.2.2", | ||
| "debug": "^4.1.1", |
There was a problem hiding this comment.
preference is not to add extra dependancies when they are not absolutely necessary - can you add a debug helper script (which does console logs) instead of a 3rd party lib?
There was a problem hiding this comment.
yeh I agree, can't say I've seen this much in OSS. Maybe if it accepted debug as an optional prop that would be better. Any examples of other libraries solving this problem @danielbush?
There was a problem hiding this comment.
Probably the size is less than 7k when bundled and minified down a bit more but I get the point.
Yeh, it's not as common in the browser. I've used it in a complex spa where I can selectively enable debugging to see what the system is doing, eg localStorage.debug='containers*,system1,foo,bar' etc. and it gives nice coloured output and might complement a similar use of debug in the consumer of this component to allow us to trace failed variant activation.
However, given the situation, maybe we just JSON.parse localStorage.debugReactExperimentify and if truthy/falsey behave accordingly; if it fails, reset it to falsey and warn the user?
Feels more straightforward to me than passing in debug.
This is a
I have
CHANGELOG.mdREADME.mdpackage.jsonare up to dateWhat's changed
debug module is about 7k gzipped. Hmmm
Might go down a bit more when bundled.