RafidMuhymin / astro-spa

An Astro JS component that turns a website into an SPA and boost performance using various techniques
MIT License
393 stars 14 forks source link

Is astro-spa project alive? #9

Open obask opened 1 year ago

obask commented 1 year ago

Hi! I tried this example with a new version of Astro and it seems to be broken. https://codesandbox.io/s/enteleform-test--astro-spa--partial-update-ebbbf7

Brentlok commented 1 year ago

Hi, I'm using astro-spa in my project and it is working fine, I guess astro-spa has some problems working in codesandbox. Have you tried it on your machine?

obask commented 1 year ago

I tried all combinations: my own project didn't work, this downloaded example too. Maybe the problem was caused by me using "npm run dev" version of Astro, but I gave up after not being able to find a single working example.

Brentlok commented 1 year ago

run dev and start does exactly the same. I've created simple example, try this out astro-spa-example

obask commented 1 year ago

Thank you for providing an example, I really appreciate that! Is asto-spa behaves like a static site by default? Here is my network tab on the first load(it prefetched all links 2 times):

Screenshot 2023-01-02 at 3 58 58 PM

(I added a heavy chunk of html on page C) When I navigate between link it only loads 2kb of css, and doesn't update content.

function getCurrentTimestamp() {
    var today = new Date();
    return today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
}

---

<Layout title="C">
    <main>
        <p>{getCurrentTimestamp()}</p>

This time doesn't change unless I comment out the SPA plugin... *I also tried using data saver by setting <Spa limit=1, but it just makes it act like a regular MPA:

Screenshot 2023-01-02 at 4 20 25 PM

I'm going to stick to an experimental feature of Solid for now https://solid-hn-islands.netlify.app/ I found it in this article Here is what I expected to see when I click on page C:

Screenshot 2023-01-02 at 4 21 59 PM