pull/9442/head
baseballyama 3 years ago
parent f881e4a5cd
commit 176ef79c12

@ -13,5 +13,5 @@ export default defineConfig({
format: 'umd',
name: 'svelte'
},
plugins: [resolve(), commonjs(), terser()]
plugins: [resolve(), commonjs()]
});

@ -39,7 +39,7 @@ export type ComponentContext = {
s: MaybeSignal<Record<string, unknown>>;
/** accessors */
a: Record<string, any> | null;
/** effectgs */
/** effects */
e: null | Array<EffectSignal>;
/** mounted */
m: boolean;

@ -177,7 +177,7 @@ function init_update_callbacks() {
// TODO somehow beforeUpdate ran twice on mount in Svelte 4 if it causes a render
// possibly strategy to get this back if needed: analyse beforeUpdate function for assignements to state,
// if yes, add a call to the component to force-run beforeUpdate once.
untrack(() => update_callbacks.b.forEach(/** @param {any} c */ (c) => c()));
update_callbacks.b.forEach((c) => c());
flush_local_render_effects();
// beforeUpdate can run again once if afterUpdate causes another update,
// but afterUpdate shouldn't be called again in that case to prevent infinite loops
@ -185,7 +185,7 @@ function init_update_callbacks() {
user_effect(() => {
called_before = false;
called_after = true;
untrack(() => update_callbacks.a.forEach(/** @param {any} c */ (c) => c()));
update_callbacks.a.forEach((c) => c());
// managed_effect so that it's not cleaned up when the parent effect is cleaned up
const managed = managed_effect(() => {
destroy_signal(managed);

Loading…
Cancel
Save