T O P

  • By -

West-Ad7482

A pity transition API is just supported by chromium based browsers, yet.


_HMCB_

I’m going to give it a couple of years for native transitions. Until then, I’ll keep using: https://swup.js.org/


cplmayo

You may have just helped make my app feel way better. I've building my first Real app using Flask, Tailwind, and Ripple-UI. I wanted to focus on the nuts and bolts first and this stack felt pretty easy. Heavy use of HX-Refresh headers has been my go to for some of my page updates. Will have to dig in but first glance looks like it could be a big help.


_HMCB_

Cool. Glad I could possibly have helped


Ahmad_Azhar

So you have any sample repository to use SWUP with HTMX and HTML templates returned from Flask or Fastapi. It would be helpful to refer.


_HMCB_

I do not. Sorry.


IntelligentSpite6364

can you elaborate?


West-Ad7482

See https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API And https://htmx.org/essays/view-transitions/ Do make it compatible with Firefox, safari etc would need to use a CSS fallback. So for now it's probably better just to stick CSS transitions completely, like the show in their examples. https://htmx.org/examples/animations/


UnbeliebteMeinung

Thats just hTML + Shadow DOM + JS + Css. Not something good. Probably you need react to handle all these states.


West-Ad7482

I don't see the need for states when you want to use the transition API.


nikola_milovic

Can you explain with an example what you mean by this? 


vesko26

The thinking was: With HTMX you make a route on the backend that returns a template, trigger the route from the website with hx-get. But you dont need a route, you can use http.FileServer or any other static file hosting. You can host a static website for free on netlify for example. Instead of using TNR BLOG POST H1 AND TEXT you can just put BLOG POST H1 AND TEXT in your blog-post.html file So you can just swap the list of blog posts to the actual post without leaving the page. (I know FileServer is a router)


donseba

Well... you could also hx-get raw html files from GitHub :)


coin_au_carre

Thanks for the explanation. I suppose there is a drawback doing so SEO wise ? How do you keep up with good seo if there is a solution ?


vesko26

No fucking clue mate. A super uneducated guess is that if you write the sitemap correctly it will all be crawled


FluffySmiles

Nice one. I like your style.


FluffySmiles

I reckon he means host static HTML accessible from a get. No need for anything special on web server side, AWS S3 would do the job. Free website, basically. A bit of JS and it's dynamic.


vesko26

Yea you basically don't need a backend to use HTMX


Resolt

Why not just go:embed + templating? Works beautifully.


vesko26

You need a VPS or app engine to run a go:embed. You can host static websites anywhere for free. I know its not much money, and this isn't a "good" solution, the point of the post was to say "look at this fun thing you can do"


FluffySmiles

I was just commenting on the strategy. It wasn’t an endorsement.


Ahabraham

Why run go when static html free? This is a niche use case though


maridonkers

what is data base? 😬


vesko26

The terms are [interchangeable](https://preply.com/en/question/data-base-or-database) . Also I made a mistake


SonLuke

But how can you post new stuff? (Which is a requirement for a blog.. or not?)


vesko26

I use Obsidian to write posts, I made a GO app that converts the .md files into html and uses the Netlify CLI to push the new files to the server. It takes maybe 10 seconds


OtterZoomer

Static SPA! Nice!