12 Commits

Author SHA1 Message Date
Misko Hevery
40035380e7 fix(core): Remove debugger statement when assert is thrown ()
Fix 
Fix FW-1925

PR Close 
2020-02-28 12:23:50 -08:00
Misko Hevery
ee8b8f52aa feat(ivy): Change static priority resolution to be same level as directive it belongs to ()
This change changes the priority order of static styling.

Current priority:
```
(least priority)
- Static
  - Component
  - Directives
  - Template
- Dynamic Binding
  - Component
    - Map/Interpolation
    - Property
  - Directives
    - Map/Interpolation
    - Property
  - Template
    - Map/Interpolation
    - Property
(highest priority)
```

The issue with the above priority is this use case:

```
<div style="color: red;" directive-which-sets-color-blue>
```
In the above case the directive will win and the resulting color will be `blue`. However a small change of adding interpolation to the example like so. (Style interpolation is coming in https://github.com/angular/angular/pull/34202)
```
<div style="color: red; width: {{exp}}px" directive-which-sets-color-blue>
```
Changes the priority from static binding to interpolated binding which means now the resulting color is `red`. It is very surprising that adding an unrelated interpolation and style can change the `color` which was not changed. To fix that we need to make sure that the static values are associated with priority of the source (directive or template) where they were declared. The new resulting priority is:

```
(least priority)
- Component
  - Static
  - Map/Interpolation
  - Property
- Directives
  - Static
  - Map/Interpolation
  - Property
- Template
  - Static
  - Map/Interpolation
  - Property
(highest priority)
```

PR Close 
2020-01-29 15:41:47 -08:00
Misko Hevery
cf07d428a1 refactor(ivy): make assert conditions more readable ()
PR Close 
2020-01-29 15:41:47 -08:00
Miško Hevery
d56cf6a92d refactor: improve assert error by including the failed condition ()
PR Close 
2020-01-16 12:09:03 -05:00
Miško Hevery
e16f75db56 refactor(ivy): move bindingIndex from LView to LFrame ()
`bindingIndex` stores the current location of the bindings in the
template function. Because it used to be stored in `LView` that `LView`
was not reentrant. This could happen if a binding was a getter and had
a side-effect of calling `detectChanges()`.

By moving the `bindingIndex` to `LFrame` where all of the global state
is kept in reentrant way we correct the issue.

PR Close 
2019-10-28 10:59:29 -07:00
Misko Hevery
4495a46b99 refactor(ivy): clean up RNode retrieval; add better debug support for TNode ()
PR Close 
2019-07-18 16:46:54 -07:00
Misko Hevery
29a9909232 refactor(ivy): simplify walkTNodeTree method for readability ()
PR Close 
2019-06-25 17:03:51 -07:00
Pawel Kozlowski
016b3f16a3 refactor(ivy): improve debug message for assertDataInRange ()
PR Close 
2019-06-11 00:09:08 +00:00
Pawel Kozlowski
c34c223122 fix(ivy): avoid type coercion in binding-related instruction asserts ()
ivy's bindingUpdated instruction is using the assertNotEqual check to make
sure that NO_CHANGE value (of type Object) is not passed as a value to be
dirty-checked. In practice it means that any value passed as a binding
value would be compared to the NO_CHANGE object.

It turns out that the assertNotEqual is using == and given
that binding values are of different type and we always compare it to the
NO_CHANGE object we were doing lots of type coercion. It resulted in calls
to expensive types conversions and calls to Object.toString().

A profiler reported ~15% of the self time spent in the assertNotEqual
but it turns out that removing type coercion speeds up Material Chips with
input scenario much more (~40ms down to ~20ms).

This PR introduces new assert method `assertNotSame` that uses strict equality
check. The new assertion is used in binding instructions to compare to
NO_CHANGE object reference.

PR Close 
2019-03-25 09:34:13 -07:00
Ben Lesh
7bae49b419 fix(ivy): assertDomNode will now work properly in a worker ()
PR Close 
2019-02-22 13:17:30 -08:00
Ben Lesh
ba6aa93aa3 refactor(ivy): LContainer now stored in LView[PARENT] ()
- Removes CONTAINER_INDEX
- LView[PARENT] now contains LContainer when necessary
- Removes now unused arguments to methods after refactor

PR Close 
2019-02-22 13:17:30 -08:00
Misko Hevery
885f1af509 build: extract interface and util sub compilation from core ()
PR Close 
2019-01-10 16:31:44 -08:00