sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
78.04k stars 4.08k forks source link

svelte5: reactivity package classes are not fine-grained #11727

Closed FoHoOV closed 2 months ago

FoHoOV commented 3 months ago

Describe the bug

URL

  1. in this REPL things that didn't change still run the effects. (click on buttons mulitple times, see the effects rerun and they also run for things that didn't change)
  2. see this REPL. changes on url.searchParams dont reflect on url object.

SET

  1. In this REPL items that don't exist in the set will cause reactivity when they shouldn't. clicking on delete 1 btn shouldn't rerun the effect for has
  2. In this REPL click on clear and then try the add/delete buttons, nothing is fine-grained anymore everything gets called

MAP

same problems as SET. in this REPL, click on clear then click on set 2 to 2.

DATE

anything that changes internal time value of Date will cause reactivity for every read method.

  1. go to this REPL
  2. clicking on setMillis should not be logging anything
  3. clicking on setMinutes should not log anything for getUTCHours

Reproduction

see description

Logs

No response

System Info

svelte5-next137

Severity

annoyance

FoHoOV commented 2 months ago

Just wanted to mention that Date also has a similar issue. Any updates to the date object will cause reactivity for every read method. There is a fix for date in #11774 (if #11504 is accepted)

FoHoOV commented 2 months ago

@dummdidumm can you reopen this issue because its not fixed. I've also edited the original issue to add date examples.