verify standalone component imports and declarations in JiT#45777
verify standalone component imports and declarations in JiT#45777pkozlowski-opensource wants to merge 2 commits intoangular:masterfrom
Conversation
JoostK
left a comment
There was a problem hiding this comment.
LGTM; I do wonder though if we've got the same error checking in the AOT compiler.
ef4a5c9 to
261ac4c
Compare
This commits adds verifications assuring that items imported into standalone components are one of: - standalone component / directive / pipe; - NgModule; - forwardRef resolving to one of the above. It explicitly disallows modules with providers.
…gModule This commits adds JiT checks to verify that a standalone component, directive, pipe are not declared in any NgModule.
261ac4c to
74a3ccc
Compare
| stringifyForError(importingType)}", to return a standalone entity or NgModule but got "${ | ||
| stringifyForError(depType) || depType}".`); |
There was a problem hiding this comment.
| stringifyForError(importingType)}", to return a standalone entity or NgModule but got "${ | |
| stringifyForError(depType) || depType}".`); | |
| stringifyForError(importingType)}", to return a standalone entity or an NgModule but got "${ | |
| stringifyForError(depType) || depType}".`); |
Quick question: do we need the || depType here?
There was a problem hiding this comment.
We don't strictly need it but I did it for cases where something funky (null / undefined or '') ends up there. So yeh, not necessary but shouldn't do any harm either.
There was a problem hiding this comment.
False-y values will be handled by the underlying renderStringify function, so we should not need it (I'm ok to keep it as well :)).
There was a problem hiding this comment.
yeh, but renderStringify would convert, say undefined to an empty string and we wouldn't see it in the error message. I think that it would be preferable to see undefined in the error message.
Again, those are minor details.
|
This PR was merged into the repository by commit 2f5fd41. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
2 commits with JiT verifications: