Skip to content

Commit

Permalink
Use queueMicrotask for side effect import of referenced types as it m…
Browse files Browse the repository at this point in the history
…ay cause issues for circular deps (noticed with swc tests)
  • Loading branch information
volkanceylan committed Oct 13, 2024
1 parent c833bdf commit 745c60b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void GenerateColumns(TypeDefinition type, CustomAttribute columnsAttribu
if (referencedTypeAliases.Count != 0)
{
sb.AppendLine();
sb.AppendLine($"[" + string.Join(", ", referencedTypeAliases.Select(x => x.alias)) + "]; // referenced types");
sb.AppendLine($"queueMicrotask(() => [" + string.Join(", ", referencedTypeAliases.Select(x => x.alias)) + "]); // referenced types");
}

RegisterGeneratedType(codeNamespace, identifier, typeOnly: false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ private void GenerateForm(TypeDefinition type, CustomAttribute formScriptAttribu
if (referencedTypeAliases.Count != 0)
{
sb.AppendLine();
sb.AppendLine($"[" + string.Join(", ", referencedTypeAliases.Select(x => x.alias)) + "]; // referenced types");
sb.AppendLine($"queueMicrotask(() => [" + string.Join(", ", referencedTypeAliases.Select(x => x.alias)) + "]); // referenced types");
}

RegisterGeneratedType(codeNamespace, identifier, typeOnly: false);
Expand Down

0 comments on commit 745c60b

Please sign in to comment.