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

How do we do prefetching? #95

Open
saikatdas0790 opened this issue Oct 11, 2021 · 3 comments
Open

How do we do prefetching? #95

saikatdas0790 opened this issue Oct 11, 2021 · 3 comments

Comments

@saikatdas0790
Copy link

Like hovering on an anchor tag sends the corresponding request and we save a couple of hundred milliseconds in delay that leads to a snappier end user experience.

Coming from SvelteKit, this is the corresponding documentation
https://kit.svelte.dev/docs#anchor-options-sveltekit-prefetch

@AlexxNB
Copy link
Owner

AlexxNB commented Nov 12, 2021

There is no way to prefetch right now. I have no idea how to implement this in routers type like tinro where routes structure doesn't known by router.

@saikatdas0790
Copy link
Author

@AlexxNB Thinking out aloud, couldn't Tinro support a <script context="module></script> block that runs code on the client side before the route component gets loaded. And prefetching/preloading logic could be coded there by the dev. And we annotate the anchor tags with a tinro:prefetch to indicate that this route needs to prefetch content?

@katriellucas
Copy link

@AlexxNB Thinking out aloud, couldn't Tinro support a <script context="module></script> block that runs code on the client side before the route component gets loaded. And prefetching/preloading logic could be coded there by the dev. And we annotate the anchor tags with a tinro:prefetch to indicate that this route needs to prefetch content?

That is an interesting take on it, seems declarative enough just like Tinro.

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

3 participants