Skip to content

Commit

Permalink
Revert "fix: address bug in before/after update (#9448)"
Browse files Browse the repository at this point in the history
This reverts commit 9eb969d.
  • Loading branch information
trueadm authored Nov 15, 2023
1 parent 7e94dee commit cf55a5d
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 60 deletions.
5 changes: 0 additions & 5 deletions .changeset/nasty-clocks-exercise.md

This file was deleted.

14 changes: 3 additions & 11 deletions packages/svelte/src/internal/client/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -960,18 +960,10 @@ export function set_signal_value(signal, value) {
schedule_effect(current_effect, false);
}
mark_signal_consumers(signal, DIRTY, true);
// This logic checks if there are any render effects queued after the above marking
// of consumers. If there are render effects that have the same component context as
// the source signal we're writing to, then we can bail-out of this logic as there
// will be a render effect in the queue that hopefully takes case of triggering the
// beforeUpdate/afterUpdate logic (doing it again here would duplicate them). However,
// if the render effects scheduled in the queue are unrelated to the component context,
// then we need to trigger the beforeUpdate/afterUpdate logic here instead.
// If we have afterUpdates locally on the component, but we're within a render effect
// then we will need to manually invoke the beforeUpdate/afterUpdate logic.
// TODO: should we put this being a is_runes check and only run it in non-runes mode?
if (
current_effect === null &&
current_queued_pre_and_render_effects.every((e) => e.context !== component_context)
) {
if (current_effect === null && current_queued_pre_and_render_effects.length === 0) {
const update_callbacks = component_context?.update_callbacks;
if (update_callbacks != null) {
update_callbacks.before.forEach(/** @param {any} c */ (c) => c());
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit cf55a5d

Please sign in to comment.