Commit Graph

5218 Commits

Author SHA1 Message Date
Paul Gschwendtner 5615928df9 build: no longer run tslint from within gulp task (#35800)
Switches our tslint setup to the standard `tslint.json` linter excludes.
The set of files that need to be linted is specified through a Yarn script.

For IDEs, open files are linted with the closest tslint configuration, if the
tslint IDE extension is set up, and the source file is not excluded.

We cannot use the language service plugin for tslint as we have multiple nested
tsconfig files, and we don't want to add the plugin to each tsconfig. We
could reduce that bloat by just extending from a top-level tsconfig that
defines the language service plugin, but unfortunately the tslint plugin does
not allow the use of tslint configs which are not part of the tsconfig project.

This is problematic since the tslint configuration is at the project root, and we
don't want to copy tslint configurations next to each tsconfig file.

Additionally, linting of `d.ts` files has been re-enabled. This has been
disabled in the past and a TODO has been left. This commit fixes the
lint issues and re-enables linting.

PR Close #35800
2020-03-03 09:20:49 -08:00
Wagner Maciel d5d9971c28 refactor(benchpress): delete outdated/unused folder (#35147)
PR Close #35147
2020-02-07 16:14:27 -08:00
Wagner Maciel 60471c092f refactor(benchpress): added tsconfig to ts_library rules and awaited floating promises (#35147)
* Note: we specify our own tsconfig bc the default tsconfig we provide for ts_library disables the must-use-promises rule

PR Close #35147
2020-02-07 16:14:26 -08:00
Wagner Maciel 5efe9be051 refactor(benchpress): linted (#35147)
PR Close #35147
2020-02-07 16:14:26 -08:00
Wagner Maciel 5ca7c2d40f refactor(benchpress): made all it callbacks async (#35147)
PR Close #35147
2020-02-07 16:14:26 -08:00
Wagner Maciel 991e665fba fix(benchpress): formatted spec files (#35127)
PR Close #35127
2020-02-04 10:41:06 -08:00
Wagner Maciel e210715958 refactor(benchpress): added tsconfig and fixed ts errors (#35127)
PR Close #35127
2020-02-04 10:41:06 -08:00
Joey Perrott 95383ee6a9 ci: don't run benchmark_tests on remote executors (#34996)
Since benchmarks are meant to test in a consistent environment, we
cannot execute the benchmark on RBE executors as executors do not
run in calibrated environments.

PR Close #34996
2020-01-29 14:15:25 -08:00
Paul Gschwendtner 53c4c8de8f test: ensure global options for benchmark tests can be set in bazel (#34753)
Previously, when the benchmark tests ran outside of Bazel, developers
had the posibility to control how the tests run through command line
options. e.g. `--dryrun`. This no longer works reliable in Bazel where
command line arguments are not passed to the text executable.

To make the global options still usable (as they could be still useful
in some cases), we just pass them through the Bazel `--test_env`. This
reduces the code we need to read the command line, but still preserves
the flexibility in a Bazel idiomatic way.

PR Close #34753
2020-01-29 09:22:27 -08:00
Paul Gschwendtner 9c55fc0f13 test: disambiguate e2e and perf spec files (#34753)
Currently, based on the file names it's not quite clear whether
a given `.spec.ts` file runs benchmark perf or benchmark e2e
functionality tests. To disambiguate these, we use new file
suffixs. i.e. `e2e-spec.ts` and `perf-spec.ts`.

PR Close #34753
2020-01-29 09:22:27 -08:00
Paul Gschwendtner 4d88b4bc26 ci: do not run benchmark measurements in circleci (#34753)
Currently we run all benchmark perf tests in CircleCI. Since we do not
collect any results, we unnecessarily waste CI/RBE resources. Instead,
we should just not run benchmark perf tests in CI, but still run the
functionality e2e tests which ensure that benchmarks are not broken.

We can do this by splitting the perf and e2e tests into separate
files/targets.

PR Close #34753
2020-01-29 09:22:27 -08:00
Miško Hevery 5aabe93abe refactor(ivy): Switch styling to new reconcile algorithm (#34616)
NOTE: This change must be reverted with previous deletes so that it code remains in build-able state.

This change deletes old styling code and replaces it with a simplified styling algorithm.

The mental model for the new algorithm is:
- Create a linked list of styling bindings in the order of priority. All styling bindings ere executed in compiled order and than a linked list of bindings is created in priority order.
- Flush the style bindings at the end of `advance()` instruction. This implies that there are two flush events. One at the end of template `advance` instruction in the template. Second one at the end of `hostBindings` `advance` instruction when processing host bindings (if any).
- Each binding instructions effectively updates the string to represent the string at that location. Because most of the bindings are additive, this is a cheap strategy in most cases. In rare cases the strategy requires removing tokens from the styling up to this point. (We expect that to be rare case)S Because, the bindings are presorted in the order of priority, it is safe to resume the processing of the concatenated string from the last change binding.

PR Close #34616
2020-01-24 12:23:00 -08:00
Pawel Kozlowski 31e9dda2c8 perf(ivy): add more styling use-cases to benchmarks (#34923)
New benchmarks focus on style bindings (style and ngStyle).

PR Close #34923
2020-01-24 08:58:29 -08:00
Adam e1fc44f5d6 build: remove @angular/http from modules (#34892)
PR Close #34892
2020-01-22 13:39:16 -08:00
Pawel Kozlowski 6cdfa73dd0 perf(ivy): add static style to the list of scenarios (#34775)
PR Close #34775
2020-01-14 10:27:26 -08:00
Pawel Kozlowski c2766f4e82 perf(ivy): add create scenario to the styling benchmark (#34775)
PR Close #34775
2020-01-14 10:27:26 -08:00
Pawel Kozlowski 4f6924c622 perf(ivy): add noop change detection scenario to the styling benchmark (#34775)
PR Close #34775
2020-01-14 10:27:26 -08:00
Pawel Kozlowski 55047eaa10 refactor: rename styling benchmark scenario (#34775)
PR Close #34775
2020-01-14 10:27:26 -08:00
Paul Gschwendtner 5f1f42ba54 test: run styling benchmarks in benchpress (#34664)
Runs the styling benchmarks that have been added with 2e0b237646863562e336f370372b4b7f9e52d818
in benchpress. The goal is that these benchmarks can be wired up in
Latency Lab.

PR Close #34664
2020-01-13 07:20:58 -08:00
Pawel Kozlowski 3dee2244da perf(ivy): styling algorithm benchmark (#34664)
PR Close #34664
2020-01-13 07:20:58 -08:00
Igor Minar ccb7bd0630 build: remove modules/payload_tests/hello_world (#34551)
This code is no longer being used or needed.

PR Close #34551
2020-01-07 10:42:30 -08:00
Igor Minar ff72751f13 build: remove modules/angular1_router (#34551)
This code is no longer being used or needed.

PR Close #34551
2020-01-07 10:42:30 -08:00
Keen Yee Liau 0d95c08cda perf: rename index to index_aot (#34258)
The renaming is needed so that js-web-frameworks benchmark test works
inside google.

PR Close #34258
2019-12-05 13:10:48 -08:00
Igor Minar 1421eff382 build: re-enable template type-checking for various targets across the repo (#34144)
Various targets have their template type-checking disabled in the past.

There is no reason for this any more.

The only target that was tricky was packages/examples/core:core_examples
which was quite broken and I had to fix it up.

Template typechecking is still disabled under blaze, see FW-1753 for more
info.

PR Close #34144
2019-12-02 11:24:18 -08:00
Greg Magolan bbce2ad7d4 build: update to nodejs rules 0.42.1 (#34073)
* This brings in a fix to the `@npm//foo:foo_files` targets for https://github.com/angular/angular/pull/33927 so the a rules_nodejs patch can be removed.
* It also brings a protractor_web_test fix that resolves the need for a work-around in /modules/playground/e2e_test/sourcemap/BUILD.bazel.

PR Close #34073
2019-12-02 11:02:38 -08:00
Pawel Kozlowski df6d6e0b1d perf: add js-web-frameworks benchmark (#34034)
PR Close #34034
2019-12-02 10:51:44 -08:00
Greg Magolan 005c4a1cc5 build: set default ts_devserver serving_path to /app_bundle.js to match g3 (#33996)
PR Close #33996
2019-11-26 16:09:32 -08:00
Greg Magolan c4335e2817 build: update to nodejs rules 0.41.0 (#33996)
This bring is changes to the @nodejs repository required for https://github.com/angular/angular/pull/33927. See release notes for more details: https://github.com/bazelbuild/rules_nodejs/releases/tag/0.41.0.

rules_nodejs is approaching 1.0 and breaking changes for that release are being made more frequently. In this release, the ts_devserver API changed and it no longer injects html script tags into a provided index.html file. The diff on this commit is large as this breaking change affects quite a few tests.

Also note that we don’t update @angular/bazel schematics and integration/bazel as 0.41.0 is not a recommended update for angular users yet due to the breaking changes in ts_devserver & web_package (now named pkg_web). When a suitable plain npm package that is in progress is finished then it will be possible to easily replace the html injection functionality removed from ts_devserver & pkg_web.

PR Close #33996
2019-11-26 16:09:32 -08:00
Igor Minar 955423c79b fix(bazel): ng_module should not emit shim files under bazel and Ivy (#33765)
Under bazel and Ivy we don't need the shim files to be emmited by default.

We still need to the shims for blaze however because google3 code imports them.

This improves build latency by 1-2 seconds per ng_module target.

PR Close #33765
2019-11-22 16:52:08 -05:00
Joey Perrott e6045ee0b7 build: fixes for cross-platform RBE (#33708)
The earlier update to nodejs rules 0.40.0 fixes the cross-platform RBE issues with nodejs_binary. This commit adds a work-around for rules_webtesting cross-platform RBE issues.

PR Close #33708
2019-11-15 10:49:55 -08:00
Pawel Kozlowski e8d43d8fde perf: report cold and minimal times when profiling in a browser (#33653)
PR Close #33653
2019-11-07 20:30:59 +00:00
Pawel Kozlowski 1aa3053b12 perf(ivy): allign (browser, benchpress, G3) the depth param for the tree benchmark (#33629)
PR Close #33629
2019-11-07 20:02:27 +00:00
JiaLiPassion 8c6fb17d29 build: reference zone.js from source directly instead of npm. (#33046)
Close #32482

PR Close #33046
2019-11-06 00:48:34 +00:00
Pawel Kozlowski 7e135f6d3a perf(ivy): class bindings benchmark (#33470)
PR Close #33470
2019-10-30 10:41:06 -07:00
crisbeto 9d54679e66 test: clean up explicit dynamic query usages (#33015)
Cleans up all the places where we explicitly set `static: false` on queries.

PR Close #33015
2019-10-17 16:10:10 -04:00
Kara Erickson fc93dafab1 refactor(core): rename ngModuleDef to ɵmod (#33142)
Module defs are not considered public API, so the property
that contains them should be prefixed with Angular's marker
for "private" ('ɵ') to discourage apps from relying on def
APIs directly.

This commit adds the prefix and shortens the name from
ngModuleDef to mod. This is because property names
cannot be minified by Uglify without turning on property
mangling (which most apps have turned off) and are thus
size-sensitive.

PR Close #33142
2019-10-14 23:08:10 +00:00
Kara Erickson 0de2a5e408 refactor(core): rename ngFactoryDef to ɵfac (#33116)
Factory defs are not considered public API, so the property
that contains them should be prefixed with Angular's marker
for "private" ('ɵ') to discourage apps from relying on def
APIs directly.

This commit adds the prefix and shortens the name from
ngFactoryDef to fac. This is because property names
cannot be minified by Uglify without turning on property
mangling (which most apps have turned off) and are thus
size-sensitive.

Note that the other "defs" (ngPipeDef, etc) will be
prefixed and shortened in follow-up PRs, in an attempt to
limit how large and conflict-y this change is.

PR Close #33116
2019-10-14 20:27:25 +00:00
Kara Erickson 64fd0d6db9 refactor(core): rename ngComponentDef to ɵcmp (#33088)
Component defs are not considered public API, so the property
that contains them should be prefixed with Angular's marker
for "private" ('ɵ') to discourage apps from relying on def
APIs directly.

This commit adds the prefix and shortens the name from
`ngComponentDef` to `cmp`. This is because property names
cannot be minified by Uglify without turning on property
mangling (which most apps have turned off) and are thus
size-sensitive.

Note that the other "defs" (ngDirectiveDef, etc) will be
prefixed and shortened in follow-up PRs, in an attempt to
limit how large and conflict-y this change is.

PR Close #33088
2019-10-11 15:45:22 -07:00
crisbeto d5b87d32b0 perf(ivy): move attributes array into component def (#32798)
Currently Ivy stores the element attributes into an array above the component def and passes it into the relevant instructions, however the problem is that upon minification the array will get a unique name which won't compress very well. These changes move the attributes array into the component def and pass in the index into the instructions instead.

Before:
```
const _c0 = ['foo', 'bar'];

SomeComp.ngComponentDef = defineComponent({
  template: function() {
    element(0, 'div', _c0);
  }
});
```

After:
```
SomeComp.ngComponentDef = defineComponent({
  consts: [['foo', 'bar']],
  template: function() {
    element(0, 'div', 0);
  }
});
```

A couple of cases that this PR doesn't handle:
* Template references are still in a separate array.
* i18n attributes are still in a separate array.

PR Close #32798
2019-10-09 13:16:55 -07:00
Alex Eagle f783244ad1 build: update to rules_nodejs 0.38 (#32889)
PR Close #32889
2019-10-08 09:27:11 -07:00
crisbeto 2265cb5938 refactor(core): remove deprecated Renderer (#33019)
Removes the `Renderer` and related symbols which have been deprecated since version 4.

BREAKING CHANGES:
* `Renderer` has been removed. Use `Renderer2` instead.
* `RenderComponentType` has been removed. Use `RendererType2` instead.
* `RootRenderer` has been removed. Use `RendererFactory2` instead.

PR Close #33019
2019-10-08 09:23:00 -07:00
Pawel Kozlowski 3ace25f4a1 perf(ivy): run the expandng rows benchmark with es2015 (#32716)
PR Close #32716
2019-09-17 15:58:05 -07:00
Joey Perrott d9054803e3 ci: add assets to ng_module in playground todo (#32678)
PR Close #32678
2019-09-16 15:35:37 -07:00
Joey Perrott 4ff9c942c0 ci: use remote strategy for AngularTemplateCompile and TypeScriptCompile (#32678)
PR Close #32678
2019-09-16 15:35:37 -07:00
Matias Niemelä 4f41473048 refactor(ivy): remove styling state storage and introduce direct style writing (#32591)
This patch is a final major refactor in styling Angular.

This PR includes three main fixes:

All temporary state taht is persisted between template style/class application
and style/class application in host bindings is now removed.
Removes the styling() and stylingApply() instructions.
Introduces a "direct apply" mode that is used apply prop-based
style/class in the event that there are no map-based bindings as
well as property collisions.

PR Close #32259

PR Close #32591
2019-09-16 14:12:48 -07:00
Pete Bacon Darwin 2bf5606bbe feat(ivy): i18n - reorganize entry-points for better reuse (#32488)
This is a refactoring that moves the source code around to provide a better
platform for adding the compile-time inlining.

1. Move the global side-effect import from the primary entry-point to a
   secondary entry-point @angular/localize/init.

   This has two benefits: first it allows the top level entry-point to
   contain tree-shakable shareable code; second it gives the side-effect
   import more of an "action" oriented name, which indicates that importing
   it does something tangible

2. Move all the source code into the top src folder, and import the localize
   related functions into the localize/init/index.ts entry-point.

   This allows the different parts of the package to share code without
   a proliferation of secondary entry-points (i.e. localize/utils).

3. Avoid publicly exporting any utilities at this time - the only public
   API at this point are the global `$localize` function and the two runtime
   helpers `loadTranslations()` and `clearTranslations()`.
   This does not mean that we will not expose additional helpers for 3rd
   party tooling in the future, but it avoid us preemptively exposing
   something that we might want to change in the near future.

Notes:

It is not possible to have the `$localize` code in the same Bazel package
as the rest of the code. If we did this, then the bundled `@angular/localize/init`
entry-point code contains all of the helper code, even though most of it is not used.

Equally it is not possible to have the `$localize` types (i.e. `LocalizeFn`
and `TranslateFn`) defined in the `@angular/localize/init` entry-point because
these types are needed for the runtime code, which is inside the primary
entry-point. Importing them from `@angular/localize/init` would run the
side-effect.

The solution is to have a Bazel sub-package at `//packages/localize/src/localize`
which contains these types and the `$localize` function implementation.
The primary `//packages/localize` entry-point imports the types without
any side-effect.
The secondary `//packages/localize/init` entry-point imports the `$localize`
function and attaches it to the global scope as a side-effect, without
bringing with it all the other utility functions.

BREAKING CHANGES:

The entry-points have changed:

* To attach the `$localize` function to the global scope import from
`@angular/localize/init`. Previously it was `@angular/localize`.

* To access the `loadTranslations()` and `clearTranslations()` functions,
import from `@angular/localize`. Previously it was `@angular/localize/run_time`.

PR Close #32488
2019-09-12 15:35:34 -07:00
Matias Niemelä 53dbff66d7 revert: refactor(ivy): remove styling state storage and introduce direct style writing (#32259)
This reverts commit 15aeab1620.
2019-09-11 15:24:10 -07:00
Matias Niemelä 15aeab1620 refactor(ivy): remove styling state storage and introduce direct style writing (#32259) (#32596)
This patch is a final major refactor in styling Angular.

This PR includes three main fixes:

All temporary state taht is persisted between template style/class application
and style/class application in host bindings is now removed.
Removes the styling() and stylingApply() instructions.
Introduces a "direct apply" mode that is used apply prop-based
style/class in the event that there are no map-based bindings as
well as property collisions.

PR Close #32259

PR Close #32596
2019-09-11 16:27:10 -04:00
Matias Niemelä c84c27f7f4 revert: refactor(ivy): remove styling state storage and introduce direct style writing (#32259) 2019-09-10 18:08:05 -04:00
Keen Yee Liau a813ae07e2 test: make expanding_rows test work in g3 (#32568)
This PR modifies the `expanding_rows` test so that it works in g3.

1. `index,ts` must be named `index_aot.ts`
2. Scripts should be loaded via `ts_devserver` and not as an explicit
script tag in the HTML.

PR Close #32568
2019-09-10 17:55:06 -04:00