nuxt-component-meta icon indicating copy to clipboard operation
nuxt-component-meta copied to clipboard

Get screenshot of the component

Open atinux opened this issue 2 years ago • 5 comments

Using data64, this could be an option disabled by default.

Would love to explore the best way to do this @farnabaz @kevinmarrec

atinux avatar Jul 21 '22 07:07 atinux

I think it would be possible once https://github.com/nuxt/framework/pull/5689 land, can you confirm @danielroe @pi0 ?

atinux avatar Jul 26 '22 12:07 atinux

Components prefixed wth .island and .server are possible to be individually rendered with linked PR with a specific endpoint.

pi0 avatar Jul 26 '22 12:07 pi0

Yes. Currently the PR returns a result like:

{
  "rendered": [ { "html": "<pre data-v-a0337c84> Route: /foo </pre>" } ],
  "scripts": "<script type=\"module\" src=\"/_nuxt/entry.65591c03.mjs\" crossorigin></script><script type=\"module\" src=\"/_nuxt/RouteComponent.96ab4d69.mjs\" crossorigin></script>",
  "styles": "<link rel=\"stylesheet\" href=\"/_nuxt/entry.4e0f8d43.css\"><link rel=\"stylesheet\" href=\"/_nuxt/RouteComponent.2df1bd45.css\">"
}

(API may change as the PR is refined.)

This allows for a completely independent HTML document to be constructed which renders that component only, including all needed CSS. (scripts should be ignored in this context.)

danielroe avatar Jul 26 '22 12:07 danielroe

Who should we assign @Atinux ?

Tahul avatar Nov 27 '22 14:11 Tahul

We can start without screenshots for now on Studio, let's keep it for now and do not assigne anyone.

atinux avatar Dec 05 '22 11:12 atinux