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

RFC: Intent to implement stable Svelte bindings #1007

Closed
kitten opened this issue Sep 28, 2020 · 2 comments · Fixed by #1016
Closed

RFC: Intent to implement stable Svelte bindings #1007

kitten opened this issue Sep 28, 2020 · 2 comments · Fixed by #1016
Labels
future 🔮 An enhancement or feature proposal that will be addressed after the next release

Comments

@kitten
Copy link
Member

kitten commented Sep 28, 2020

Summary

Currently I see our current @urql/svelte package and its past and current implementation as nice experiments which helped check the boundaries of Svelte and test APIs and the understanding of users.

The latest PR allowed all modes of Svelte's stateful stores to be used somehow, with similar semantics to the other bindings, See #862

It's becoming increasingly clear that this is confusing and doesn't feel idiomatic to Svelte.
The next implementation of @urql/svelte should start from a clean slate and be idiomatic to Svelte and intuitively avoid confusion. It is allowed to stray away from feeling like the urql and @urql/preact bindings, even forgoing permanent state memory if necessary.

Problems with the approach

The current approach attempts to allow three modes of usage:

  • Store usage without memoised state
  • Store usage with memoised state via an intermediate factory function
  • Async-await/Promise usage

The last option of these feels idiomatic to Svelte but should be discouraged. We never aim to show results that can never reactively update. This is objectively bad.

The memoised usage is confusing and Svelte simply does not have a full reactivity model that allows us to observe changes. The user can do this manually and this may feel wrong to us, trying to implement complex hooks flows in Svelte, however this is not our problem to solve.

Bugs to avoid

@frederikhors
Copy link
Contributor

frederikhors commented Oct 1, 2020

❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️

@kitten
Copy link
Member Author

kitten commented Oct 1, 2020

An update has been published as @urql/[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future 🔮 An enhancement or feature proposal that will be addressed after the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants