Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ivy): implement unknown element detection in jit mode #33419

Closed

Conversation

crisbeto
Copy link
Member

In ViewEngine we used to throw an error if we encountered an unknown element while rendering. We have this already for Ivy in AoT, but we didn't in JiT. These changes implement the error for JiT mode.

errorMessage +=
`2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;
}
throw new Error(errorMessage);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question for reviewer: should we be throwing here or logging a warning? For the property validation we decided to warn.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be warning here. Unfortunately seeing this pretty late :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll submit another PR to switch it to a warning.

@crisbeto crisbeto marked this pull request as ready for review October 26, 2019 11:08
@crisbeto crisbeto requested a review from a team as a code owner October 26, 2019 11:08
@crisbeto crisbeto added comp: ivy action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release labels Oct 26, 2019
@ngbot ngbot bot added this to the needsTriage milestone Oct 26, 2019
@crisbeto crisbeto added action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 28, 2019
@AndrewKushnir
Copy link
Contributor

AndrewKushnir commented Oct 28, 2019

@AndrewKushnir
Copy link
Contributor

FYI, Ivy presubmit indicated a problem where the "unknown element" error (added in this PR) is thrown in the code where it was working before. I will investigate the problem on g3 side and will come up with a TestBed repro. Thank you.

@AndrewKushnir AndrewKushnir added target: patch This PR is targeted for the next patch release and removed target: major This PR is targeted for the next major release labels Oct 31, 2019
@AndrewKushnir
Copy link
Contributor

@crisbeto investigation in g3 revealed that failing tests are misconfigured (where some modules are imported via ngsummaries only and not present in imports list). The error message introduced in this PR and thrown in those tests, is actually a correct Ivy behavior. I will adjust the tests tomorrow to make sure they are passing with upcoming changes. Meanwhile, could you please rebase this PR on top of the latest master (so we run CI again) and may be change commit message to be fix(ivy) vs feat(ivy) (and keep master&patch as a target)? We can treat this change as a fix of incorrect behavior in Ivy where error was not thrown (vs being thrown in VE). Thank you.

In ViewEngine we used to throw an error if we encountered an unknown element while rendering. We have this already for Ivy in AoT, but we didn't in JiT. These changes implement the error for JiT mode.
@crisbeto crisbeto force-pushed the FW-1493/custom-elements-schema branch from 36fe443 to 00db79a Compare November 1, 2019 20:18
@AndrewKushnir
Copy link
Contributor

AndrewKushnir commented Nov 2, 2019

New set of presubmits:

@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker and removed action: presubmit The PR is in need of a google3 presubmit state: blocked labels Nov 2, 2019
@AndrewKushnir
Copy link
Contributor

AndrewKushnir commented Nov 2, 2019

FYI, VE and Ivy presubmits (including global for Ivy) are successful. Added "merge" label. Thank you.

@atscott atscott closed this in c83f501 Nov 4, 2019
atscott pushed a commit that referenced this pull request Nov 4, 2019
In ViewEngine we used to throw an error if we encountered an unknown element while rendering. We have this already for Ivy in AoT, but we didn't in JiT. These changes implement the error for JiT mode.

PR Close #33419
mohaxspb pushed a commit to mohaxspb/angular that referenced this pull request Nov 7, 2019
…3419)

In ViewEngine we used to throw an error if we encountered an unknown element while rendering. We have this already for Ivy in AoT, but we didn't in JiT. These changes implement the error for JiT mode.

PR Close angular#33419
mohaxspb pushed a commit to mohaxspb/angular that referenced this pull request Nov 7, 2019
…3419)

In ViewEngine we used to throw an error if we encountered an unknown element while rendering. We have this already for Ivy in AoT, but we didn't in JiT. These changes implement the error for JiT mode.

PR Close angular#33419
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants