Skip to content

Commit

Permalink
perf: allow detectComponents() to free event loop (#1739)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwouts committed Jun 16, 2023
1 parent c69ee87 commit c5d0c7f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions framework-plugins/preact/src/index.ts
Expand Up @@ -43,6 +43,8 @@ const preactFrameworkPlugin: FrameworkPluginFactory = {
absoluteFilePath
)
);
// Ensure this potentially long-running function doesn't block the thread.
await 0;
}
return components;
},
Expand Down
2 changes: 2 additions & 0 deletions framework-plugins/react/src/index.ts
Expand Up @@ -62,6 +62,8 @@ const reactFrameworkPlugin: FrameworkPluginFactory = {
absoluteFilePath
)
);
// Ensure this potentially long-running function doesn't block the thread.
await 0;
}
return components;
},
Expand Down
2 changes: 2 additions & 0 deletions framework-plugins/solid/src/index.ts
Expand Up @@ -43,6 +43,8 @@ const solidFrameworkPlugin: FrameworkPluginFactory = {
absoluteFilePath
)
);
// Ensure this potentially long-running function doesn't block the thread.
await 0;
}
return components;
},
Expand Down
2 changes: 2 additions & 0 deletions framework-plugins/svelte/src/index.ts
Expand Up @@ -54,6 +54,8 @@ const svelteFrameworkPlugin: FrameworkPluginFactory = {
absoluteFilePath
))
);
// Ensure this potentially long-running function doesn't block the thread.
await 0;
}
return components;
},
Expand Down
2 changes: 2 additions & 0 deletions framework-plugins/vue2/src/index.ts
Expand Up @@ -55,6 +55,8 @@ const vue2FrameworkPlugin: FrameworkPluginFactory = {
absoluteFilePath
)
);
// Ensure this potentially long-running function doesn't block the thread.
await 0;
}
return components;
},
Expand Down
2 changes: 2 additions & 0 deletions framework-plugins/vue3/src/index.ts
Expand Up @@ -57,6 +57,8 @@ const vue3FrameworkPlugin: FrameworkPluginFactory = {
absoluteFilePath
)
);
// Ensure this potentially long-running function doesn't block the thread.
await 0;
}
return components;
},
Expand Down

0 comments on commit c5d0c7f

Please sign in to comment.