Closed Tahul closed 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.
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?
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.
Good for me to merge and see what it gives
Hey; preparing v0.4.0 release
components
path are resolvedsilent
for debug, supportsfalse
,true
and2
false
will hide all errors/debug messagestrue
will show global parse time and parsing errors2
displays parsing timings for each component, this made me find potential optimizationsuseComponentMetaParser
composable fromnuxt-component-meta/parser
for outside usage@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 usetransform
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.