Skip to content

fix(svelte,vue): apply WebGL fallback re-initialization fix to all remaining components - #22

Merged
DavidHDev merged 21 commits into
DavidHDev:mainfrom
lulushuz:main
Jul 26, 2026
Merged

fix(svelte,vue): apply WebGL fallback re-initialization fix to all remaining components#22
DavidHDev merged 21 commits into
DavidHDev:mainfrom
lulushuz:main

Conversation

@lulushuz

@lulushuz lulushuz commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Extends the WebGL fallback re-initialization fix (previously merged in #20 for Liquid) to all remaining Svelte and Vue component wrappers in src/lib/.

Summary of Change

When native html-in-canvas initialization fails, Svelte (onMount) and Vue (onMounted) now wait for DOM re-render (tick() / nextTick()) after setting native = false and re-invoke create*() for the fallback DOM container.

Affected Components Updated (21 components)

  • Asciify (Svelte & Vue)
  • Bend (Svelte & Vue)
  • Blaze (Svelte & Vue)
  • Bubble (Svelte & Vue)
  • Cloth (Svelte & Vue)
  • Clouds (Svelte & Vue)
  • Droplets (Svelte & Vue)
  • Frost (Svelte & Vue)
  • Glass (Svelte & Vue)
  • Glitch (Svelte & Vue)
  • Grid (Svelte & Vue)
  • HexFloat (Svelte & Vue)
  • Laser (Svelte & Vue)
  • Magnify (Svelte & Vue)
  • ParticleReveal (Svelte & Vue)
  • ParticleScroll (Svelte & Vue)
  • Peel (Svelte & Vue)
  • RetroDither (Svelte & Vue)
  • Ripple (Svelte & Vue)
  • Shatter (Svelte & Vue)
  • VHS (Svelte & Vue)

Note: Each component fix has been committed individually to maintain a clean git history.

Type of change

  • Bug fix
  • New component
  • Component improvement
  • Docs / site
  • Other

Checklist

  • npx tsc --noEmit passes
  • npm run lint passes
  • npm run build passes
  • Tested in Chrome (with the html-in-canvas flag, if relevant)
  • Tested the WebGL overlay fallback (flag off / Safari / Firefox), if a component changed

lulushuz added 21 commits July 26, 2026 21:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR propagates the WebGL fallback re-initialization fix (previously applied to Liquid in #20) across the remaining Svelte and Vue component wrappers under src/lib/, ensuring that when native html-in-canvas initialization fails, the fallback DOM path is rendered and the engine is re-created against the fallback container.

Changes:

  • Vue wrappers: replace requestAnimationFrame-delayed init with await nextTick() and add a second create*() attempt after toggling native to false.
  • Svelte wrappers: add an await tick() after toggling native = false and re-invoke create*() against the fallback DOM container.
  • Add disposed guards to avoid post-unmount initialization during async lifecycle sequences.

Reviewed changes

Copilot reviewed 42 out of 42 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/Asciify/Asciify.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Asciify/Asciify.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Bend/Bend.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Bend/Bend.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Blaze/Blaze.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Blaze/Blaze.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Bubble/Bubble.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Bubble/Bubble.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Cloth/Cloth.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Cloth/Cloth.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Clouds/Clouds.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Clouds/Clouds.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Droplets/Droplets.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Droplets/Droplets.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Frost/Frost.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Frost/Frost.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Glass/Glass.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Glass/Glass.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Glitch/Glitch.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Glitch/Glitch.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Grid/Grid.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Grid/Grid.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/HexFloat/HexFloat.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/HexFloat/HexFloat.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Laser/Laser.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Laser/Laser.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Magnify/Magnify.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Magnify/Magnify.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/ParticleReveal/ParticleReveal.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/ParticleReveal/ParticleReveal.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/ParticleScroll/ParticleScroll.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/ParticleScroll/ParticleScroll.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Peel/Peel.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Peel/Peel.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/RetroDither/RetroDither.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/RetroDither/RetroDither.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Ripple/Ripple.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Ripple/Ripple.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/Shatter/Shatter.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/Shatter/Shatter.svelte Re-initialize engine after native init failure using tick() fallback path.
src/lib/VHS/VHS.vue Re-initialize engine after native init failure using nextTick() fallback path.
src/lib/VHS/VHS.svelte Re-initialize engine after native init failure using tick() fallback path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DavidHDev
DavidHDev merged commit e3ec3ab into DavidHDev:main Jul 26, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants