sveltejs / sveltejs/kit

Dynamic update

Open
#12,073 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

size:large
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the problem

Sometimes the changes in the new version are so minor that updating the page and all the resources to apply them is very inefficient.
I suggest creating a dynamic update feature similar to hot reload.

Describe the proposed solution

The idea is very crude.

I suggest:

  • plan_dynamic_update - a function that will schedule dynamic_update to run on navigation
  • dynamic_update - a function that triggers a dynamic update

Dynamic update:

  1. a certain manifest is updated
  2. it is compared with the current version manifest
  3. only the modified parts of the application are updated
    • static assets are being reloaded
    • sw is being updated (https://github.com/sveltejs/kit/issues/3667)
    • server side and endpoints with load dependencies are updated, live connections are not interrupted
    • components are being updated, other components are not affected and their state does not change
      • for example, the page component has changed, it is being reloaded, but the layout component is not affected, as if normal navigation had occurred
      • for example, a component has changed in the depth of the page, and if the component is usually imported and treated as a constant, now it becomes a reactive variable and restarts the dependent code when updating

It seems like it's going to be difficult or impossible.

Alternatives considered

No response

Importance

nice to have

Additional Information

https://rauchg.com/2014/7-principles-of-rich-web-applications#push-code-updates
https://github.com/gaearon/react-hot-loader/issues/38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by breaking down the proposed plan_dynamic_update and dynamic_update entry points and reviewing the linked service-worker issue (#3667). Define how manifest comparison, asset and service-worker updates, server-side dependencies, and component state preservation would work; done would require an agreed design and implementation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.