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

Partial Updates, Reaactivity #5

Open
SchlenkR opened this issue May 8, 2023 · 0 comments
Open

Partial Updates, Reaactivity #5

SchlenkR opened this issue May 8, 2023 · 0 comments

Comments

@SchlenkR
Copy link
Owner

SchlenkR commented May 8, 2023

Currently, the app evaluates it's root and all descendents when a "Vide mutable value" changes (or when the app is requested to update itself explicitly). That might have significant (bad) influence on performance. However, the comfort of the current Vide API provides should be preserved as much as possible, meaning:

Control Flow
if/else, for, and all other control flow language constructs shall be usable in the expected way.

Dependencies

Component dependencies (on external mutable values) and necessary updates shall either be detected automatically, or with a minimal annotation.

Continuations

A first attempt could be to understand which node of the view tree has changed and only update the view from there downwards.

Solid Similarities

Similar concepts are implemented in SolidJS or Svelte, but with drawbacks. E.g. in Solid, this doesn't work, but should work in Vide:

function MyComponent() {
    const [count, setCount] = createSignal(0);

    if (count() > 5) {
        return <div>Count limit reached</div>
    }

    return (
        <div>
            <p>Count: {count()}</p>
            <button onClick={() => setCount(count() + 1)}>Increment</button>
        </div>
    )
}
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

No branches or pull requests

1 participant