angular-cn/packages/core/test/bundling
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
..
animation_world build: set default ts_devserver serving_path to /app_bundle.js to match g3 (#33996) 2019-11-26 16:09:32 -08:00
core_all build: migrate determining if Ivy is enabled in typescript genrule files to use angular_ivy_enabled (#33983) 2019-11-26 16:38:40 -05:00
cyclic_import refactor(ivy): change styling to use programmatic API on updates (#34804) 2020-01-24 12:23:19 -08:00
hello_world refactor(ivy): change styling to use programmatic API on updates (#34804) 2020-01-24 12:23:19 -08:00
hello_world_i18n build: update to rules_nodejs 0.38 (#32889) 2019-10-08 09:27:11 -07:00
hello_world_r2 build: update to rules_nodejs 0.38 (#32889) 2019-10-08 09:27:11 -07:00
injection fix(ivy): incorrect injectable name logged in warning message on IE (#34305) 2019-12-13 14:19:57 -08:00
todo refactor(ivy): change styling to use programmatic API on updates (#34804) 2020-01-24 12:23:19 -08:00
todo_i18n build: set default ts_devserver serving_path to /app_bundle.js to match g3 (#33996) 2019-11-26 16:09:32 -08:00
todo_r2 build: set default ts_devserver serving_path to /app_bundle.js to match g3 (#33996) 2019-11-26 16:09:32 -08:00
util build: migrate determining if Ivy is enabled in typescript genrule files to use angular_ivy_enabled (#33983) 2019-11-26 16:38:40 -05:00
README.md refactor(ivy): delete `ɵɵallocHostVars` instruction (#34708) 2020-01-24 12:22:10 -08:00

README.md

Bundle

js_expected_symbol_test

This folder contains tests which assert that most of the code is tree shaken away. This is asserted by keeping gold files of all symbols which are expected to be retained. When doing renaming it is often necessary to update the gold files, to do so use this commands:

yarn bazel run --config=ivy //packages/core/test/bundling/cyclic_import:symbol_test.accept
yarn bazel run --config=ivy //packages/core/test/bundling/hello_world:symbol_test.accept
yarn bazel run --config=ivy //packages/core/test/bundling/injection:symbol_test.accept
yarn bazel run --config=ivy //packages/core/test/bundling/todo:symbol_test.accept