joshuamorony / svelte-giflist

svelte-giflist
2 stars 1 forks source link

Some observations re your tweet #2

Open Tommertom opened 1 year ago

Tommertom commented 1 year ago

Hi there leaving some thoughts here on this project. With disclaimers etc.

Enjoy SvelteKit - a bit different from Angular, but just as nice

joshuamorony commented 1 year ago

Awesome, thanks for the pointers! It's great to get some feedback from someone who's been using Svelte a lot. The SSR side of things is definitely something I will need to experiment with more.

The RxJS usage in this project is probably a bit too in-depth to be useful as a comparison example - I chose it because it was one of the wackier examples I have (though it still serves its purpose). The idea here is to declaratively create a gifs$ stream, and have a whole bunch of functionality included with that like combining settings, reacting to subreddit changes, auto refetching from the Reddit API until there is enough data to fill a page and more.

I created another simpler repo here to highlight why I am interested in RxJS with Svelte: https://github.com/joshuamorony/svelte-pagination-example and for some additional context, a Twitter thread where Jonathan Gamble provided the store alternative: https://twitter.com/joshuamorony/status/1612747334143864832

Tommertom commented 1 year ago

SSR is pretty neat even in combination with Ionic.

For a company project, I made a landing page using a tailwind template in Svelte. That root/landing page route was SSR and blazingly fast rendered and interactive. Something I cannot achieve with a SPA.

The landing page was to sell and promote an Ionic UI PWA which the use could install with a click on a button on that page.

In order to max the performance of the SPA, I use a service worker on the root route that starts caching in the PWA while the user looks at all the info of the landing page. So that all happens under the hood.

Once the use clicks "install", the SPA launches from a subroute with SSR disabled. And then signup+terms/conditions screen pops up. While that happens, I instruct svelte to prefetch all routes of the app, so all subsequent navigations go very fast.

After installation, a simple guard prevents showing the landing page in the installed app - and starts with a splash page.

The lighthouse scores for this all were great (close to 100). Not sure if SEO test of Lighthouse is a good test, but the score was 100 - easily.

All in one SvelteKit project.

And probably true SvelteKit lovers will say I would have the ditch the static adapter even....To me a minor detail.

But this shows me that I can achieve super performing Ionic PWAs that can also serve landing pages so I don't loose users with marketing campaigns.

Try doing this with Angular... I challenge you! :)

joshuamorony commented 1 year ago

Nice that's a really cool use case for making use of the mixed SSR/SPA abilities - P.S. you may be pleased to know my YT video next week will be on SvelteKit ;)