-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
[STAGE-2] incomplete implementationRemove this label when implementation is completeRemove this label when implementation is complete[STAGE-2] not fully covered by tests yetRemove this label when tests are verified to cover the implementationRemove this label when tests are verified to cover the implementation[STAGE-2] unresolved discussions leftRemove this label when all critical discussions are resolved on the issueRemove this label when all critical discussions are resolved on the issue[STAGE-3] docs changes not added yetRemove this label when the necessary documentation for the feature / change is addedRemove this label when the necessary documentation for the feature / change is added[STAGE-3] missing 2 reviews for RFC PRsRemove this label when at least 2 core team members reviewed and approved the RFC implementationRemove this label when at least 2 core team members reviewed and approved the RFC implementation
Description
Is your feature request related to a problem?
Describe the solution you'd like
I have this page, where I have an animation that I want to complete before doing the navigation, it would be nice if there was a way to already start preloading the next page
const Page = component$(() => {
const submitting = useSignal(false);
const navigate = useNavigation();
const onChange = $((ev, el) => {
submitting.value = true;
const formData = new FormData(el);
const url = new URL("/next-step");
url.searchParams.append("some-value", formData.get("some-value"));
setTimeout(() => navigate(url.toString()), 1000);
});
return (
<form onChange$={onChange}>
<input type="text" class={submitting.value ? "flicker-input-navigation-to-indicate-submission" : ""} />
</form>
);
});
Describe alternatives you've considered
It would be nice if I could do something this to
preload(url)
setTimeout(() => navigate(url.toString()), 1000);
sort of what happens when you hover over a link
Additional context
additionally and a more broader but similar feature would be to have different prefetch behaviour like in remix:
prefetch
Defines the data and module prefetching behavior for the link.<> <Link /> {/* defaults to "none" */} <Link prefetch="none" /> <Link prefetch="intent" /> <Link prefetch="render" /> <Link prefetch="viewport" /> </>
none
- default, no prefetching
intent
- prefetches when the user hovers or focuses the link
render
- prefetches when the link renders
viewport
- prefetches when the link is in the viewport, very useful for mobile
Metadata
Metadata
Assignees
Labels
[STAGE-2] incomplete implementationRemove this label when implementation is completeRemove this label when implementation is complete[STAGE-2] not fully covered by tests yetRemove this label when tests are verified to cover the implementationRemove this label when tests are verified to cover the implementation[STAGE-2] unresolved discussions leftRemove this label when all critical discussions are resolved on the issueRemove this label when all critical discussions are resolved on the issue[STAGE-3] docs changes not added yetRemove this label when the necessary documentation for the feature / change is addedRemove this label when the necessary documentation for the feature / change is added[STAGE-3] missing 2 reviews for RFC PRsRemove this label when at least 2 core team members reviewed and approved the RFC implementationRemove this label when at least 2 core team members reviewed and approved the RFC implementation