WIP: Show call stack of a node in DOM comments #354
Closed
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.
When ran on the

obeliskskeleton:It would be convenient being able to know what place in the codebase a widget is coming from. The idea here being that one can directly right-click it, choose 'Inspect element' and read the comment immediately before the node. That said, this brings several annoying concerns to the table.
Security
It sounds like a very bad idea to allow easily deploying closed source code which leaks this much info about itself. I was planning to gate this behavior based on whether
--interactivewas being passed to ghc, but there seems to be no way to detect that with CPP? Maybe we could add a cabal flag for this purpose that would both force--interactiveand add a CPP flag to gate on instead? I don't know how this sort of configuration is usually handled.Scope
is very fuzzy given all the factoring, (re)composing and delegating that happens - I see things divided in
elementand theelfamily of functions are calledreflex-dom(e.g. theDomBuilderchain coming fromobeliskin the screenshot)I think it should mean at least 1 since this is the usual way of telling
reflex-domto create nodes (hence where the execution "leaves" your code), but depending on use case one might want to include 2 and/or 3.From a quick look, it seems 3 can be "turned on globally" in an application by adding
CallStackto the typical all-the-app-wide-constraints synonym (AppWidgetor something similar).@tomsmalley suggested adding a transformer for controlling this behavior, which would make it easy to control scope, e.g.
obelisk, filtering outliftedelemententries coming fromreflex-dom(seeremoveSelf)Performance
I'm assuming this will never ever ever ever run outside
ghci, where we can quickly toggle it off if in the unlikely case it turns out to have a remotely noticeable effect at some point.