-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
Reactive re-run does not trigger for function defining HypertextLiteral result #2838
Comments
This can be caused by docstrings + |
Ah, yes, it looks like the issue reported there is caused by the same underlying issue. I'll check if I can get a minimum working example by combining docstrings + |
Indeed, the combination of docstrings and Here is that notebook after I open it: After I change the return value of the function: So the issue is:
Thanks, this at least helped me find a work-around: you can comment out docstrings while working on the body of the function. That's not really a fix, just a tip for anyone else running into the same issue. |
Workaround in JuliaPluto/PlutoDependencyExplorer.jl#9 |
Fix issue from Pluto, see fonsp/Pluto.jl#2811 and fonsp/Pluto.jl#2838
I was working on a notebook that creates a function with
HypertextLiteral.Result
output. This is intended to create an interactive HTML element with Javascript.A minimal version is something like this:
https://gist.github.com/lukavdplas/ebf28806752fba4cb999e0e3c573dc1a
where there is a cell
and a cell
I'm adding this simplified version for the sake of clarity, but I could not replicate the issue there. The actual notebook is this one: https://github.com/lukavdplas/PlutoMapPicker.jl/blob/main/src/map-picker.jl
The linked notebook defines two such functions
MapPicker()
andMapPickerMultiple()
, which follow the same principle as the example above, but with much bigger functions.The issue I encountered is that when I update the HTML (or Javascript) in the function body of
MapPicker()
orMapPickerMultiple()
, the cell with the function call (@bind place MapPicker()
) does not seem to re-run. It still shows the "old" version of the output. I need to manually hit Shift + Enter in the cell with the function call to get it to update.Strangely enough, the dependency also seems broken in the other direction, The notebook contains a cell that defines a struct
TileLayer
, that is used in the body ofMapPicker()
andMapPickerMultiple()
, and one "normal" Julia cell. When I renameTileLayer
so any references to it should break, the "normal" cell" immediately shows an error, but the cells definingMapPicker()
andMapPickerMultiple()
don't react until I use Shift + Enter to rerun them.Another weird issue that may or may not be related is that re-running the cell with the function definition for
MapPickerMultiple()
seems to somehow cause duplicates in the cell output that shows the docstring:I encountered this in a different notebook a few weeks ago, which had a similar structure: a function that defines a sizable
HypertextLiteral.Result
. So it doesn't seem to be a one-off, but both notebooks were written by me, so they might have the same "quirk".(I am using: Pluto, v0.19.38 / Julia 1.6)
The text was updated successfully, but these errors were encountered: