Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there's an
emitOnlyDtsFiles
option for the.emit
callback that we call here:https://github.com/ionic-team/stencil/blob/4fd0ecd17e72f6892c96b8256a0206f6e583be13/src/compiler/transpile/run-program.ts#L91-L92
possibly I'm misunderstanding the comment here - but if we ran a dts-only emit first and then the whole program would that prevent the error? Probably that would be slower so not necessarily saying we want to, more just wondering if that's indeed how it works here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there'd still be an issue since we don't generate the
components.d.ts
file until after the TS program has ran/emitted the files. What we really need to do is generate thecomponents.d.ts
file before we run the TS program so that the file exists before the build. We can do this, just need to restructure things a bit more since we don't have the components metadata on theBuildCtx
until the build callback, at which point the TS program has already ran and generated the diagnostics. This was just intended as a quick fix to remedy the regression until we can take the step for the desired, long term solutionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh I think I sort of forgot that the
components.d.ts
is so artisanal, makes sense!