Skip to content
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

Collect all initial bind values into a single call #928

Closed
fonsp opened this issue Feb 18, 2021 · 5 comments · Fixed by #975
Closed

Collect all initial bind values into a single call #928

fonsp opened this issue Feb 18, 2021 · 5 comments · Fixed by #975
Assignees
Labels
frontend Concerning the HTML editor reactivity The Pluto programming paradigm

Comments

@fonsp
Copy link
Owner

fonsp commented Feb 18, 2021

(internal issue)

# ╔═╡ a20bfeac-c3bd-4726-8ba2-e1af3e87539c
using PlutoUI

# ╔═╡ 21472529-e24d-4880-a2ce-acf4e24598f2
@bind x Slider(1:100)

# ╔═╡ b27878d5-444e-4dff-b1fd-a2433c5f62a4
@bind y Slider(1:100)

# ╔═╡ d2dae848-d03f-48e9-8e78-74d5a53b8bb9
md"""
It's the same if you use html inputs:
"""

# ╔═╡ 9a3bb8b6-721a-11eb-1f96-ef8691af6dfa
# @bind x html"<input type=range>"

# ╔═╡ ab5181a4-4d37-492e-be42-5646ab6cc9ba
# @bind y html"<input type=range>"

# ╔═╡ a29566f0-11f9-4172-9a94-055851a2282c
numberoftimes = Ref(0)

# ╔═╡ b7a05e7a-0e0a-4464-9635-aa364c828c5e
md"""
## When you refresh the page, the counter should increment **by zero**, not by two.
"""

# ╔═╡ f4fef5bd-1bd6-4ac8-824e-3ba2fb20bf78
let
	x
	y
	numberoftimes[] += 1
end

image

@fonsp fonsp mentioned this issue Mar 4, 2021
29 tasks
@dralletje
Copy link
Collaborator

This is kinda fixed now by #975, but not because it is all in a single call now, but because the bonds won't be re-initialized when you refresh (like they used to before Firebasey). To make it one call, we need to make set_bond_value_reactive (https://github.com/fonsp/Pluto.jl/blob/master/src/webserver/Dynamic.jl#L403) take multiple bonds to update at once. The client->server state update is already in one request, but the mutator runs for all bonds one by one.

@fonsp
Copy link
Owner Author

fonsp commented Mar 7, 2021

Oh nice! I actually have already here https://github.com/fonsp/Pluto.jl/blob/bind-server-client-1/src/webserver/Dynamic.jl#L399

@dralletje
Copy link
Collaborator

Nice! Should I copy this over, or will bind-server-client-1 (reasonable soon) be merged into master? 🤔

@pankgeorg
Copy link
Collaborator

It is not bind-server related so no reason to wait I guess?

@fonsp fonsp changed the title Dralbase TODO: collect all initial bind values into a single call Collect all initial bind values into a single call Mar 31, 2021
@fonsp
Copy link
Owner Author

fonsp commented Mar 31, 2021

I moved that code over to main: 5ad1faf

@fonsp fonsp linked a pull request Apr 13, 2021 that will close this issue
@fonsp fonsp added frontend Concerning the HTML editor reactivity The Pluto programming paradigm labels Apr 13, 2021
@fonsp fonsp closed this as completed in #975 Jun 8, 2021
@fonsp fonsp mentioned this issue Jun 23, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Concerning the HTML editor reactivity The Pluto programming paradigm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants