angular-cn/tools/public_api_guard
Miško Hevery 9bd9590767 refactor(ivy): change styling to use programmatic API on updates (#34804)
Previously we would write to class/style as strings `element.className` and `element.style.cssText`. Turns out that approach is good for initial render but not good for updates. Updates using this approach are problematic because we have to check to see if there was an out of bound write to style and than perform reconciliation. This also requires the browser to bring up CSS parser which is expensive.

Another problem with old approach is that we had to queue the DOM writes and flush them twice. Once on element advance instruction and once in `hostBindings`. The double flushing is expensive but it also means that a directive can observe that styles are not yet written (they are written after directive executes.)

The new approach uses `element.classList.add/remove` and `element.style.setProperty/removeProperty` API for updates only (it continues to use `element.className` and `element.style.cssText` for initial render as it is cheaper.) The other change is that the styling changes are applied immediately (no queueing). This means that it is the instruction which computes priority. In some circumstances it may result in intermediate writes which are than overwritten with new value. (This should be rare)

Overall this change deletes most of the previous code and replaces it with new simplified implement. The simplification results in code savings.

PR Close #34804
2020-01-24 12:23:19 -08:00
..
animations docs: update animations to use `@publicApi` tags (#26595) 2018-10-19 14:35:53 -07:00
common refactor(ivy): Switch styling to new reconcile algorithm (#34616) 2020-01-24 12:23:00 -08:00
core refactor(ivy): change styling to use programmatic API on updates (#34804) 2020-01-24 12:23:19 -08:00
elements docs: update elements to use `@publicApi` tags (#26595) 2018-10-19 14:35:53 -07:00
forms build: typescript 3.7 support (#33717) 2020-01-14 16:42:21 -08:00
http build: typescript 3.7 support (#33717) 2020-01-14 16:42:21 -08:00
localize fix(ivy): i18n - use `MessageId` for matching translations (#32594) 2019-09-17 09:17:44 -07:00
platform-browser feat(ivy): make Hammer support tree-shakable (#32203) 2019-08-21 11:43:51 -07:00
platform-browser-dynamic docs: update platform-browser-dynamic to use `@publicApi` tags (#26595) 2018-10-19 14:35:53 -07:00
platform-server build: typescript 3.7 support (#33717) 2020-01-14 16:42:21 -08:00
platform-webworker docs(platform-webworker): mark all public APIs as deprecated (#33824) 2019-11-15 16:14:37 -08:00
platform-webworker-dynamic feat(platform-webworker): deprecate platform-webworker (#30642) 2019-05-23 15:09:48 -07:00
router build: typescript 3.7 support (#33717) 2020-01-14 16:42:21 -08:00
service-worker build: typescript 3.7 support (#33717) 2020-01-14 16:42:21 -08:00
upgrade feat(upgrade): provide unit test helpers for wiring up injectors (#16848) 2019-06-20 17:04:01 -07:00
BUILD.bazel refactor(upgrade): use Bazel packages to avoid symlinks in the source (#29466) 2019-04-02 10:38:01 -07:00
global_utils.d.ts feat(ivy): expose `window.ng.getDebugNode` helper (#32727) 2019-09-17 15:46:07 -07:00
public_api_guard.bzl build(ivy): remove the remains of ivy-jit mode (#27278) 2018-11-27 10:30:58 -08:00