-
Notifications
You must be signed in to change notification settings - Fork 18
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
Use the server session to get bond names instead of parsing the notebook code #97
Conversation
@fonsp this is now ready for review |
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.
Inlcuding HypertextLiteral and running the notebook makes the tests run in 7 minutes instead of 5. Could you write a macro that does not use HypertextLiteral? Maybe a macro that just adds "123" to the bound variable name?
If that's not a good idea for some reason then the extra 2 minutes is fine 👍
@fonsp I did just use the example you gave me on zulip :D, didn't think about timing impact but I removed HypertextLiteral and just used Markdown now which should not impact the time |
The current way PlutoSliderServer finds bonds is by going through the parsed cell code and looking for the presence of the
@bind
variable:PlutoSliderServer.jl/src/MoreAnalysis.jl
Lines 14 to 28 in 01f6112
This unfortunately do not work for custom macros that internally create bonds.
The SliderServer already instantiate a Pluto Server session so we can directly access the bound variables that are recorded inside the PlutoRunner module. This makes it easier to track all possible bound variables without resorting to complex rules for parsing the code within the cell inputs
Discussed this approach 2 weeks ago with @fonsp.
I will fix/add test once the related Pluto PR (fonsp/Pluto.jl#2379) is merged