Skip to content

Commit fbde82e

Browse files
committed
perf: get module-transforms in next tick
1 parent e3df51d commit fbde82e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/devtools/src/app/components/flowmap/ModuleFlowLoader.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import type { ModuleInfo, RolldownModuleTransformInfo, SessionContext } from '~~/shared/types'
33
import { computedAsync } from '@vueuse/core'
4-
import { ref, watchEffect } from 'vue'
4+
import { nextTick, ref, watchEffect } from 'vue'
55
import { backend } from '~/state/backend'
66
77
const props = defineProps<{
@@ -15,7 +15,10 @@ watchEffect(async () => {
1515
session: props.session.id,
1616
module: props.module,
1717
}
18-
transforms.value = await backend.value!.functions['vite:rolldown:get-module-transforms']?.(arg)
18+
// fetch transforms in the next tick to avoid race conditions with module info
19+
nextTick(async () => {
20+
transforms.value = await backend.value!.functions['vite:rolldown:get-module-transforms']?.(arg)
21+
})
1922
})
2023
2124
const info = computedAsync(async () => {

0 commit comments

Comments
 (0)