-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat: forking #17004
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: forking #17004
Conversation
🦋 Changeset detectedLatest commit: 3a27726 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff! Added a few comments + we might have a short description of this in the await documentation
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
…it's not really meant for non-framework authors
|
Added some docs and whatnot, though realised in the course of creating this example that there's a memory leak at the moment — if you discard a fork, the effects that were created inside it don't get destroyed. You can see that my hovering over the button, hovering out, waiting a second, then immediately clicking on it — that should redo the work (since we |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love it, just a nit. it's amazing that this is as simple as it is
Definitely WIP. Opening this so that we can discuss the API and start coming up with more test cases. I've no doubt that this is missing all sorts of details, though at the same time I'm very pleasantly surprised at how little code it took to get this far. It gives me faith in the primitives we've built.
The idea is that you need to be able to change some state 'offscreen' in such a way that you can discover any async work resulting from the state change without committing it to the screen. This allows you to, for example, load the data that will be needed on the next page before the user navigates there. Future SvelteKit will use this to preload remote function calls, much as it preloads
loadfunctions today.You can see an example here — if you click on the
<a>elements fast enough, there will be a delay before navigation occurs, since it's doing async work (though the nav bar updates immediately, courtesy of$state.eager(...). But if you hover for a beat before clicking — which users generally do — the fork will be ready by the time navigation occurs.Before submitting the PR, please make sure you do the following
feat:,fix:,chore:, ordocs:.packages/svelte/src, add a changeset (npx changeset).Tests and linting
pnpm testand lint the project withpnpm lint