fix(embeds): address Phase 38 review findings in hydration runtime, plugin sync, and docs

This commit is contained in:
Jakub Zych
2026-11-28 13:13:09 +01:00
parent 47de196516
commit 14558e4677
4 changed files with 46 additions and 10 deletions

View File

@@ -4,13 +4,17 @@
// agree on the exact same provider set.
import { defineJournalEmbedProviders, type JournalEmbedProvider } from '../utils/embedRegistry.ts'
const syncedEmbedMaps = new WeakSet<object>()
export default defineNuxtPlugin({
name: 'journal-embeds',
enforce: 'pre',
setup() {
const appConfig = useAppConfig() as { journal?: { embeds?: Record<string, JournalEmbedProvider> } }
if (appConfig?.journal?.embeds) {
defineJournalEmbedProviders(appConfig.journal.embeds)
const embeds = appConfig?.journal?.embeds
if (embeds && typeof embeds === 'object' && !syncedEmbedMaps.has(embeds)) {
defineJournalEmbedProviders(embeds)
syncedEmbedMaps.add(embeds)
}
},
})