Open imlautaro opened 10 months ago
Not sure, what exactly causes this, but #93 (with nuxt/content#2422) might be related?
Not sure, what exactly causes this, but #93 (with nuxt/content#2422) might be related?
Actually it's weird because if I use the utility "parseMarkdown" from "@nuxtjs/MDC/runtime" but rendering it with the ContentRenderer from "nuxt/content", it's still heavy but not that much, it doesn't affect that much to the performance and it's "acceptable"
I have found the same issue. The MDC script is over 60% in size of the client bundle and seems to render client side. Which makes little to no sense to me.
I'm not sure if this is related, but I just opened an issue concerning the remark-emoji
dependency, which is quite heavy #187
And I agree that is a bit weird that this is client-side script.
I have managed to write a composable that uses MDC to render an HTML object and then returns this as a string. This renders server side and in my test repo, i have seen a block time decrease from 1270ms to just 420ms on mobile (Lighthouse).
Im pretty sure it can be written more effeciently, but it does the job!
EDIT: It still seems to still bundle the MDC script to the client, but the performance is already major (1270 to 420 ms as mentioned)
EDIT nr. 2:
Using the experimental feature: 'componentIslands' and adding the 'server' suffix to my component, the mobile performance index in Lighthouse went from 90 to 100. Using this feature before my composable didnt yield any difference.
Here's the composable: https://github.com/Sfolkerts89/Nuxt3-starter__Decap-cms/blob/main/composables/mdToHtml.js
And here is the component i use to mount/ render: https://github.com/Sfolkerts89/Nuxt3-starter__Decap-cms/blob/main/components/misc/ParseMarkdown.vue
I don't know what is the exact problem but there's something wrong for sure because it doesn't happens with the nuxt/content module.