nuxtlabs / nuxt-component-meta

Gather Nuxt components metadata on build time and make them available on production.
69 stars 6 forks source link

feat(up): refactor and expose parser #47

Closed Tahul closed 1 year ago

Tahul commented 1 year ago

Hey; preparing v0.4.0 release


@antfu ; do you think it would be possible to start the parsing asynchronously when components are resolved and use HMR API to send the result parsed to runtime?

Another way of not blocking the dev server would maybe be to switch for a .nuxt/component-meta/{ComponentName}.js structure instead of a single global file and use transform step to parse?

That would also force the parsing to only be done on components that are actually used in the stack?

Looking for suggestions on this, as I think it could be really great being able to run this module in development too, but it is currently too harmful for startup time.

antfu commented 1 year ago

To improve the parsing time, I think we could move the promise to component-meta.get.ts to make it on demand. We could do that by adding a server middleware on dev.

stafyniaksacha commented 1 year ago

To improve the parsing time, I think we could move the promise to component-meta.get.ts to make it on demand. We could do that by adding a server middleware on dev.

What about also allowing libraries to share prebuilt meta? So they can be optionally generated only once when author publish their library?

Tahul commented 1 year ago

Both are excellent ideas ; @antfu @stafyniaksacha would you mind opening issues with your thoughts on both subjects so that we can track for next versions?

If no additional comments for this PR I will merge it and release 0.4.0.

atinux commented 1 year ago

Good for me to merge and see what it gives