-
-
Notifications
You must be signed in to change notification settings - Fork 20
Add environment variable control for debug mode #22
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
Open
elalemanyo
wants to merge
2
commits into
marcoroth:main
Choose a base branch
from
dotruby:feat/configurable-debug-mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@t27duck Thanks for the feedback! You make a great point about the simplicity of checking for the presence of the environment variable rather than its specific value.
You're absolutely right that this is cleaner - any value ("1", "yes", "TRUE", etc.) would disable debug mode, which is more intuitive and follows common Unix conventions.
My initial implementation was more verbose because I like environment variables that explicitly say what they're doing (like
REACTIONVIEW_DEBUG_MODE=false), but at the end of the day, this is really just a matter of taste and your approach is definitely more concise.The important thing is that we're solving the core problem: allowing individual developers in a team to control debug mode through their personal environment setup without changing code that affects everyone else. Whether someone prefers
REACTIONVIEW_DISABLE_DEBUG_MODE=1orREACTIONVIEW_DEBUG_MODE=falseis secondary to having that flexibility.I'm open to updating the implementation either way 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I think I also like "opt-out" DISABLE approach more, since it's more intuitive.
But also, I'm wondering why you would want to disable it? I get that now in the beginning there might be some bugs and that might be why you'd want to disable it. But ideally, I want as many people to use it so we are able to surface these bugs and can make it better for everyone 🙈
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcoroth I totally understand your point and I’m also in favor of having it enabled by default so more people use it and we can improve it step by step. 🙌
At the same time, I’ve run into some bugs that might not be so easy to fix quickly, which is why I thought having the option to disable it could be useful in certain cases 😬.
The reason I suggested the disable option is that I’ve run into some issues when using
ViewComponent slots(renders_one / renders_many).I’ve put together a small repo: ReactionView + Bootstrap.
One issue I noticed is that the extra HTML that ReactionView injects for the debug console can interfere with CSS selectors. For example, selectors like
:first-child,:last-childor adjacent sibling selectors (.selector + .selector) no longer match as expected because the injected elements change the DOM structure. This can cause layouts or designs to break visually 😔.Sure, it’s definitely something we can help fix (and we will 👍), but just in case, it would be nice to have a way to disable it locally for a moment — that way we can quickly confirm whether the issue comes from ReactionView or the app code itself.