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

fix(ivy): throw on bindings to unknown properties #28537

Closed
wants to merge 1 commit into from

Conversation

kara
Copy link
Contributor

@kara kara commented Feb 5, 2019

This commit adds a devMode check which will throw if a user
attempts to bind a property that does not match a directive
input or a known HTML property.

@kara kara added state: WIP target: major This PR is targeted for the next major release comp: ivy labels Feb 5, 2019
@kara kara requested review from a team as code owners February 5, 2019 07:55
@ngbot ngbot bot added this to the needsTriage milestone Feb 5, 2019
@kara kara changed the title fix(ivy): throw on bindings to unknown properties WIP - fix(ivy): throw on bindings to unknown properties Feb 5, 2019
@kara kara force-pushed the unknown branch 3 times, most recently from b89f9d7 to a625e1e Compare February 6, 2019 01:18
@kara kara changed the title WIP - fix(ivy): throw on bindings to unknown properties fix(ivy): throw on bindings to unknown properties Feb 6, 2019
@kara kara force-pushed the unknown branch 2 times, most recently from 52db716 to f88848c Compare February 6, 2019 01:34
@kara kara added action: review The PR is still awaiting reviews from at least one requested reviewer and removed state: WIP labels Feb 6, 2019
@kara kara requested a review from a team as a code owner February 6, 2019 02:16
@kara
Copy link
Contributor Author

kara commented Feb 6, 2019

Oof, seems like this PR uncovered an unrelated bug with inheriting host bindings inappropriately :(

packages/core/src/render3/instructions.ts Outdated Show resolved Hide resolved
packages/core/src/render3/instructions.ts Show resolved Hide resolved
packages/core/src/render3/instructions.ts Outdated Show resolved Hide resolved
packages/core/src/render3/instructions.ts Outdated Show resolved Hide resolved
This commit adds a devMode-only check which will throw if a user
attempts to bind a property that does not match a directive
input or a known HTML property.

Example:
```
<div [unknownProp]="someValue"></div>
```

The above will throw because "unknownProp" is not a known
property of HTMLDivElement.

This check is similar to the check executed in View Engine during
template parsing, but occurs at runtime instead of compile-time.

Note: This change uncovered an existing bug with host binding
inheritance, so some Material tests had to be turned off. They
will be fixed in an upcoming PR.
@kara
Copy link
Contributor Author

kara commented Feb 7, 2019

presubmit

@kara kara added action: presubmit The PR is in need of a google3 presubmit action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: review The PR is still awaiting reviews from at least one requested reviewer action: presubmit The PR is in need of a google3 presubmit labels Feb 7, 2019
@kara
Copy link
Contributor Author

kara commented Feb 7, 2019

merge-assistance: global approval not working

@mhevery mhevery closed this in 1950e2d Feb 7, 2019
kara added a commit to kara/angular that referenced this pull request Feb 7, 2019
The behavior tested here was fixed by angular#28537, but I missed updating
the test in the original PR. This commit turns on the test to run
in Ivy mode, using "onlyInIvy" because the timing of the error message
is slightly different and requires CD to run.
kara added a commit to kara/angular that referenced this pull request Feb 7, 2019
The behavior tested here was fixed by angular#28537, but I missed updating
the test in the original PR. This commit turns on the test to run
in Ivy mode, using "onlyInIvy" because the timing of the error message
is slightly different and requires CD to run.
mhevery pushed a commit that referenced this pull request Feb 8, 2019
The behavior tested here was fixed by #28537, but I missed updating
the test in the original PR. This commit turns on the test to run
in Ivy mode, using "onlyInIvy" because the timing of the error message
is slightly different and requires CD to run.

PR Close #28604
@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 Sep 14, 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 merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants