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

Add a Tabs example to the documentation #9

Closed
imacrayon opened this issue Jan 5, 2023 · 4 comments
Closed

Add a Tabs example to the documentation #9

imacrayon opened this issue Jan 5, 2023 · 4 comments

Comments

@imacrayon
Copy link
Owner

People like tabs.

@imacrayon
Copy link
Owner Author

I haven’t found a big need for server-powered tabs yet. They’re fairly simple to build client-side with Alpine already.

I’ll reopen this if I get more requests for tabs in the future.

@Jipok
Copy link

Jipok commented Nov 22, 2024

I'm new to hateoas. What's the best way to organize tabs using your plugin?
I saw an example in htmx, but it seems terrible to me. No matter how fast the server code is, there is still a noticeable network delay. It's okay when a tab opens for the first time, but loading it on each repeated click is terrible.

Well, actually, in some situations you really need to get new content every time. But for example, I'm making a site for chatting with llm where there is a list of chats. And I definitely want to cache each chat after opening. But I don't know how to do it nicely and correctly.

@imacrayon
Copy link
Owner Author

Yeah I don’t think we have any special tricks to solve this UI pattern at the moment. It sounds like this might be another situation where feature request #103 could be helpful though!

Service workers might be another avenue worth exploring. I think you could cache the tab contents with a service worker, then when Alpine AJAX requests the tab on repeated clicks, the service worker can handle the request locally instead of making a round-trip to the server. Using a service worker would have the added bonus of providing some basic offline support for your users too.

@imacrayon
Copy link
Owner Author

https://github.com/DannyMoerkerke/basic-service-worker is a great service worker resource.

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

2 participants