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

ViewTransitions memory leak - Svelte components and Image #8512

Closed
1 task
jerzakm opened this issue Sep 11, 2023 · 5 comments
Closed
1 task

ViewTransitions memory leak - Svelte components and Image #8512

jerzakm opened this issue Sep 11, 2023 · 5 comments
Labels
feat: view transitions Related to the View Transitions feature (scope)

Comments

@jerzakm
Copy link
Contributor

jerzakm commented Sep 11, 2023

Astro Info

Astro                    v3.0.12
Node                     v19.7.0
System                   Windows (x64)/ linux / MacOS
Package Manager          npm
Output                   static
Adapter                  none
Integrations             auto-import
                         @astrojs/tailwind
                         @astrojs/svelte
                         @astrojs/mdx
                         @astrojs/preact

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

This is a continuation of #8435 . I reported the bug a few days ago and initially it seemed that @natemoo-re 's PR fixed it (#8448) but the issue still persists.

Reproduction is still this PR threlte/threlte#601 . Astro is in apps/docs.

We added routes /test/a and /test/b with links "NAVIGATE TO: B" to quickly go between them and spawn tens of thousands of DOM nodes.

Url to live preview of repro:
https://threlte-7ej474mrl-threlte.vercel.app/test/a

Our repro is a page based on MainLayout.astro and making changes there we got it 'fixed' a few times but it was very unreliable.
We tried for several hours and weren't able to pinpoint what the exact problem is we found a few fickle "fixes". Here are a few things that changed how the leak behaved and what "fixed" it sometimes:

  • changing or removing client:* directive on svelte component - most reliable
  • there were some odd interactions with the astro's <Image/> component and sometimes those had to be removed off of the page
  • putting Astro component in svelte named slots had impact at times

This was also difficult to reproduce in Windows, but happened reliably on Linux/MacOS (different dependency version for windows of something like sharp, turbo etc then?).

I think the main issue is the client:load etc directives, and other weird behaviour is a side product.

What's the expected result?

DOM nodes get removed/GC after navigation

Link to Minimal Reproducible Example

threlte/threlte#601

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 11, 2023
@matthewp matthewp added feat: view transitions Related to the View Transitions feature (scope) and removed needs triage Issue needs to be triaged labels Sep 11, 2023
@matthewp
Copy link
Contributor

I have a reduced example now. I can recreate this with a minimal document. It is either something leaking in the ViewTransitions component's script, or a leak in Chrome.

@jerzakm
Copy link
Contributor Author

jerzakm commented Oct 7, 2023

I have a reduced example now. I can recreate this with a minimal document. It is either something leaking in the ViewTransitions component's script, or a leak in Chrome.

Have you had any chance to have a look if this was an astro or a Chrome issue? We miss our transitions :) I'm not very familiar with astro internals but I'm happy to provide any help needed to move this forward, if you can point me in the right direction.

@ematipico
Copy link
Member

@matthewp @martrapp do you have any hints on how to fix the issue?

@martrapp
Copy link
Member

martrapp commented Jan 23, 2024

@matthewp @martrapp do you have any hints on how to fix the issue?

I have tried for a while but was not able to reproduce it.

@martrapp
Copy link
Member

martrapp commented Dec 3, 2024

Hi @jerzakm 👋🏼, i close this Astro v3 issue now because there was no progress to reproduce this in more than 12 month. Feel free to reopen when you found a minimal reproduction that is simple to reproduce.

@martrapp martrapp closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: view transitions Related to the View Transitions feature (scope)
Projects
None yet
Development

No branches or pull requests

4 participants