~henriquehbr

https://henriquehbr.xyz

Part time open-sourcerer, linux enthusiast, Rust fanatic

Trackers

~henriquehbr/svelte-typewriter

Last active 1 year, 1 month ago

~henriquehbr/ataraxis.lua

Last active 1 year, 11 months ago

~henriquehbr/docker-experiment

Last active 2 years ago

~henriquehbr/tagit

Last active 2 years ago

~henriquehbr/lua-vs-vimscript

Last active 2 years ago

~henriquehbr/nvim-startup.lua

Last active 2 years ago

#14 Feature: A way to skip typewriting 1 year, 29 days ago

Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter

REPORTED RESOLVED CLOSED

#14 Feature: A way to skip typewriting 1 year, 1 month ago

Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter

My apologies, you’re right, after taking a closer look on the problem, the culpirit turns out to be on some technical debt that was put in place in the years ago when the project was still getting started (around the time i was still learning Svelte)

The animation modes are dinamically invoked through use directives, all the props are grouped together and passed as a single object to these directives, once instantiated, the prop changes aren’t reflected back to these directives, which seems to be the root cause of the problem you’re describing, example below:


<script>
	let counter = 1

	const directive = (node, arg) => {
		console.log(arg)
	}
</script>

<h1 use:directive={{ counter }}>{counter}</h1>
<button on:click={() => counter++}>change</button>

I think changing something like this would require way too much time and effort, and also probably incur breaking changes, but that’s just my two cents

#14 Feature: A way to skip typewriting 1 year, 1 month ago

Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter

Whenever you change any component prop (or attribute, for that matter) it makes the whole Typewriter component reload, that's just how Svelte's reactivity works, i might be missing something here, but i'm not really sure if there's some way around that, but if you have any suggestions on how to get it done, i'm totally willing to implement it.

Regarding this Firefox-related issue, it has been fixed on v3.2.3 (check #13), but the fix implemented to make the library work on Firefox breaks on the repl, that's why i had to downgrade one version to get it to work, sorry if the comment i left there was confusing.

#14 Feature: A way to skip typewriting 1 year, 1 month ago

Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter

I'm not exactly sure if that's what you're looking for, but there's the data-static attribute for that, it skips the animation for the specified HTML elements marked with it

Example:

<Typewriter>
  <p data-static>Hello</p>
  <p>World!</p>
</Typewriter>

Demo

#13 Firefox Support? 1 year, 1 month ago

Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter

REPORTED RESOLVED CLOSED

#13 Firefox Support? 1 year, 2 months ago

Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter

The issue itself was fixed, but the fact that the chosen solution isn't natively supported on Firefox still stands, i've decided to just add a polyfill in the library instead of having each user go through this process themselves, a solution for this was released in version 3.2.3

I've tested it locally with Firefox 121.0 and everything seems to be working as expected, let me know if the problem persists for you

#13 Firefox Support? 1 year, 2 months ago

~henriquehbr assigned ~henriquehbr to #13 on ~henriquehbr/svelte-typewriter

#12 Doesn't work in SvelteKit 1 year, 3 months ago

Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter

As the issue could not be reproduced, i'll be closing this due to inactivity

REPORTED RESOLVED CLOSED

#12 Doesn't work in SvelteKit 1 year, 3 months ago

~henriquehbr assigned ~henriquehbr to #12 on ~henriquehbr/svelte-typewriter

#12 Doesn't work in SvelteKit 1 year, 3 months ago

Comment by ~henriquehbr on ~henriquehbr/svelte-typewriter

Yes, it's still being maintained, but i'm mostly focused on bug fixing nowadays, can you share the repository where you're facing this error so i can take a better look at the issue, please?