refactor: vrm performance tracing and better lifecycle management (#1194)

* refactor: vrm performance tracing and better lifecycle management

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Rename lag-visualizer.vue to performance-visualizer.vue

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @sumimakito

Co-authored-by: Makito <i@maki.to>

* Apply suggestion from @sumimakito

Co-authored-by: Makito <i@maki.to>

* Apply suggestion from @sumimakito

Co-authored-by: Makito <i@maki.to>

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* [autofix.ci] apply automated fixes

* Apply suggestion from @Lilia-Chen

* [autofix.ci] apply automated fixes

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* [autofix.ci] apply automated fixes

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* [autofix.ci] apply automated fixes

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* Apply suggestion from @Lilia-Chen

* fix: some tiny bugs and model URL lifecycle

* fix: TresCanvas size=0 bug

* Delete .claude/settings.json

* fix: some clean-up

* [autofix.ci] apply automated fixes

* fix: use screen to wrap up TresCanvas

* Delete .claude/settings.json

---------

Co-authored-by: Makito <i@maki.to>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Neko <neko@ayaka.moe>
This commit is contained in:
Lilia_Chen
2026-03-12 09:20:20 +08:00
committed by GitHub
co-authored by Makito autofix-ci[bot] Neko
parent 7cb5ebe430
commit dec2b04924
64 changed files with 3325 additions and 911 deletions
@@ -7,7 +7,7 @@ type BroadcastChannelEvents
= | BroadcastChannelEventShouldUpdateView
interface BroadcastChannelEventShouldUpdateView {
type: 'should-update-view'
type: 'live2d-should-update-view'
}
export const defaultModelParameters = {
@@ -36,7 +36,7 @@ export const defaultModelParameters = {
}
export const useLive2d = defineStore('live2d', () => {
const { post, data } = useBroadcastChannel<BroadcastChannelEvents, BroadcastChannelEvents>({ name: 'airi-stores-live2d' })
const { post, data } = useBroadcastChannel<BroadcastChannelEvents, BroadcastChannelEvents>({ name: 'airi-stores-stage-ui-live2d' })
const shouldUpdateViewHooks = ref(new Set<() => void>())
const onShouldUpdateView = (hook: () => void) => {
@@ -47,12 +47,12 @@ export const useLive2d = defineStore('live2d', () => {
}
function shouldUpdateView() {
post({ type: 'should-update-view' })
post({ type: 'live2d-should-update-view' })
shouldUpdateViewHooks.value.forEach(hook => hook())
}
watch(data, (event) => {
if (event.type === 'should-update-view') {
if (event?.type === 'live2d-should-update-view') {
shouldUpdateViewHooks.value.forEach(hook => hook())
}
})