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

feat: move RPC client response in a lazy way #80

Merged
merged 3 commits into from
Feb 10, 2024
Merged

feat: move RPC client response in a lazy way #80

merged 3 commits into from
Feb 10, 2024

Conversation

aralroca
Copy link
Collaborator

@aralroca aralroca commented Feb 10, 2024

Preparing the ground for #73
Related to #47

The first time the _rpc-lazy script is downloaded in parallel with the action request. Then once it has loaded it loads only the action. The requests are made at the same time so the action is not delayed. This makes sense for two reasons:

  • It reduces the initial size of the actual RPC
  • It prepares the ground to support the rerender from the server, the idea is that the actions can return HTML rendered by the server (page or component), then from this _rpc-lazy a couple of tree walker will be used to reactively update the DOM.

All this reconcilation does not make sense to be when loading the page, since it will always happen when executing an action, since in the web components the signals are used, and the grace is that this system will react with the web components and the signals properly because when going through the DOM tree walker it will not go inside the web components but it can update its attributes and making them react internally preserving its state and without unmounting itself.

@aralroca aralroca merged commit 5f7c172 into main Feb 10, 2024
1 check passed
@aralroca aralroca deleted the rpc-lazy branch February 10, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant