Skip to content

Commit

Permalink
fix(ssr): task sorting during SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
wmertens committed Feb 13, 2024
1 parent ecb1ddf commit fccd4cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/qwik/src/core/render/dom/notify-render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,9 @@ const sortNodes = (elements: QContext[]) => {
};

const sortTasks = (tasks: SubscriberEffect[]) => {
const isServer = isServerPlatform();
tasks.sort((a, b) => {
if (a.$el$ === b.$el$) {
if (isServer || a.$el$ === b.$el$) {
return a.$index$ < b.$index$ ? -1 : 1;
}
return (a.$el$.compareDocumentPosition(getRootNode(b.$el$)) & 2) !== 0 ? 1 : -1;
Expand Down

0 comments on commit fccd4cc

Please sign in to comment.