Commit graph

29561 commits

Author SHA1 Message Date
shlasouski
6e924313c3 fix(service-worker): NPE if onActionClick is undefined (#43210)
Previously, it leads to fail if notification.data.onActionClick is undefined

PR Close #43210
2021-08-23 13:29:59 -07:00
Andrew Scott
b10d90bef6 feat(language-service): Add method for retrieving the component template at the cursor location (#43208)
This method is the @angular/language-service side of the implementation
for https://github.com/angular/vscode-ng-language-service/issues/1485

Given a location in a file, if the location is inside a component,
`getTemplateLocationForComponent` will return the `DocumentSpan` of the
inline `template` or the `DocumentSpan` for the file that the
`templateUrl` points to.

PR Close #43208
2021-08-23 13:29:38 -07:00
renovate[bot]
e2ecca45ac build(devtools): update angular-framework to 1985e48 (rangle/angular-devtools#909)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-23 09:43:54 -07:00
Andrew Scott
ccb09b4558 fix(router): null/undefined routerLink should disable navigation (#43087)
The current behavior of `routerLink` for `null` and `undefined` inputs is to treat
the input the same as `[]`. This creates several unresolvable issues with
correctly disabling the links because `commands = []` does _not_ behave the same
as disabling a link. Instead, it navigates to the current page, but will also
clear any fragment and/or query params.

The new behavior of the `routerLink` input will be to completely disable navigation
for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean
removing the `href` attribute.

Fixes #21457
Fixes #13980
Fixes #31154

BREAKING CHANGE:
Previously `null` and `undefined` inputs for `routerLink` were
equaivalent to empty string and there was no way to disable the link's
navigation.
In addition, the `href` is changed from a property `HostBinding()` to an
attribute binding (`HostBinding('attr.href')`). The effect of this
change is that `DebugElement.properties['href']` will now return the
`href` value returned by the native element which will be the full URL
rather than the internal value of the `RouterLink` `href` property.

PR Close #43087
2021-08-20 12:51:09 -07:00
renovate[bot]
9b2634cced build(devtools): update angular-framework to 26f9407 (rangle/angular-devtools#908)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-20 10:41:43 -07:00
Daniel Trevino
c389052bab test(language-service): add extended diagnostics test (#43107)
Add a test in the langauge-service to make sure the extended template
diagnostics are being correctly generated.

Refs #42966

PR Close #43107
2021-08-19 11:55:27 -07:00
Daniel Trevino
4d42a3ab10 test(compiler-cli): add extended template diagnostics end-to-end tests (#43107)
This commit adds extended template diagnostics end-to-end tests, to make
sure the diagnostics are generated correctly. Template checks are
already tested with unit tests.

Refs #42966

PR Close #43107
2021-08-19 11:55:27 -07:00
Daniel Trevino
ff858ac9d8 refactor(compiler-cli): add extendedTemplateCheck phase to compiler (#43107)
This commit integrates extended template checks with the compiler, by
adding another phase of diagnostics generation. This integration is
under the `_extendedTemplateDiagnostics` flag.

Refs #42966

PR Close #43107
2021-08-19 11:55:27 -07:00
Daniel Trevino
cb654d1c53 refactor(compiler-cli): export ExtendedTemplateCheckerImpl and template checks (#43107)
This commit exports the implementation of `ExtendedTemplateChecker` to
generate extended template diagnostics and all the template checks.

Refs #42966

PR Close #43107
2021-08-19 11:55:27 -07:00
Daniel Trevino
3932480ddb refactor(compiler-cli): add ExtendedTemplateChecker (#43107)
Change the current way to run template checks to the
`ExtendedTemplateChecker` instead of just the
`getExtendedTemplateDiagnosticsForComponent` function. Refactored the
tests that used the previous function to use the new class.

Refs #42966

PR Close #43107
2021-08-19 11:55:27 -07:00
Paul Gschwendtner
bed121c34f feat(compiler-cli): inline resources when generating class metadata calls (#43178)
Previously with View Engine output, the `enableResourceInlining` option
could be set to inline external templates and styles (also for the
resulting `.metadata.json` files). We want to do the same for the Ivy
compilation pipeline (regardless of the compilation mode). The full
compilation definitions, and partial declarations currently already
inline resources in a way that no external requests need to be made.

Although there is one exception currently. These are the calls for
setting class metadata (for testbed overrides). This commit updates
the set class metadata calls (for both partial and full compilation)
to always inline resources. This means that libraries do not need
to start shipping external styles/templates just for the
`setClassMetadata` calls.

Note: Only doing this for partial compilation has been considered, but
it seems like it would be simpler implementation-wise to do this for
full compilation as well. Given the external resources are already
inlined (through their `ecmp` definitions), it seems acceptable (or
even more aligned) to do the same for the set class metadata calls.

PR Close #43178
2021-08-19 11:27:15 -07:00
Andrew Scott
e57691c9c5 feat(core): Add migration to update empty routerLinks in templates (#43176)
The previous behavior of `RouterLink` for `null` and `undefined` inputs was to treat
the input the same as `[]` or `''`. This creates several unresolvable issues with
correctly disabling the links because `commands = []` does not behave the same
as disabling a link. Instead, it navigates to the current page, but will also
clear any fragment and/or query params.

The new behavior of the `routerLink` input will be to completely disable navigation
for `null` and `undefined` inputs. For HTML Anchor elements, this will also mean
removing the `href` attribute.

Migration for change in #43087

PR Close #43176
2021-08-19 11:24:12 -07:00
dario-piotrowicz
47cca522f8 refactor(docs-infra): use tslint in aio's tools-lint script (#43010)
Instead of the deprecated tslint use eslint in the aio's tools-lint
script

PR Close #43010
2021-08-19 11:20:06 -07:00
renovate[bot]
3f01d9f928 build(devtools): update angular-framework to e357b38 (rangle/angular-devtools#907)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-19 09:13:28 -07:00
Joey Perrott
e3b6e26565
release: cut the v13.0.0-next.2 release (#43200) 2021-08-18 14:38:39 -07:00
Erik Slack
3e756f06ee docs: fix typo (#43190)
Fix typo in description of ngxp and link for angular community meetup

PR Close #43190
2021-08-18 10:52:19 -07:00
Dylan Hunn
edde058e5e
docs: release notes for the v12.2.2 release (#43196) 2021-08-18 10:48:41 -07:00
renovate[bot]
0056051f52 build(devtools): update angular-framework to 7cc7528 (rangle/angular-devtools#906)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-18 10:37:30 -07:00
Kirk Larkin
c366d1c8a0 docs: tidy up description of NgComponentOutlet (#43159)
PR Close #43159
2021-08-18 09:17:43 -07:00
Joe Martin (Crowdstaffing)
3db35b360a docs: update links and formatting (#43066)
Update links and formatting prior to creating sub-topics.

Update links to reference links for consistency.  Update formatting for code sections.  Updated list alignment for consistent formatting.

PR Close #43066
2021-08-17 20:00:58 -07:00
Renovate Bot
d7de6d6725 build: update bazel to v4.0.0-rc.0 (#43138)
PR Close #43138
2021-08-17 20:00:37 -07:00
Paul Gschwendtner
59f0796398 build: update rules_nodejs version for bazel integration test (#43138)
To keep our integration tests aligned with the setup we use
for the Angular repo and Components repo, we should also update
the `rules_nodejs` version for our `bazel` integration test.

PR Close #43138
2021-08-17 20:00:36 -07:00
renovate[bot]
f5135a21d6 build(devtools): update angular-framework to 0cf5f52 (rangle/angular-devtools#905)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-17 09:43:49 -07:00
Pete Bacon Darwin
e9dd078e77 docs(upgrade): add @extensible to the UpgradeComponent class (#42807)
This class is designed to be used as a base class. Therefore it should not be
marked as `final` in the API docs.

PR Close #42807
2021-08-17 09:23:09 -07:00
Pete Bacon Darwin
e4e98edf20 build(docs-infra): add sealed markers to classes in API pages (#42807)
This change will mark classes as `sealed` unless they have been annotated
with an `@extensible` jsdoc tag.

Fixes #42802

PR Close #42807
2021-08-17 09:23:09 -07:00
Renovate Bot
ec4dcdfbd7 build: lock file maintenance (#43015)
PR Close #43015
2021-08-17 09:22:34 -07:00
Kristiyan Kostadinov
7e71370fe6 perf(platform-browser): avoid intermediate arrays in server transition (#43145)
The server transition initializer looks for some `style` tags and clears them based on their `ng-transition` ID. The way we currently have the logic creates a couple of intermediate arrays just so we can call `forEach` at the end.

These changes use a regular `for` loop with an `if` statement instead. This isn't a _massive_ performance improvement, but the logic does run during app initialization which is performance-sensitive and it's an easy change to make on our end.

PR Close #43145
2021-08-17 09:22:05 -07:00
Charles Lyding
3cb1f18f97 fix(animations): add pure annotations to static property initializers (#43064)
Class static properties with initializers that cause code execution (for example, call expressions or new expressions) have the potential to cause side effects at module evaluation. This is similar in effect to module level code. As a result, optimizers can not safely remove a class with such a static property as the potential side effects may have meaningful effects on the state of the application execution. To allow classes with these type of static properties to be optimized and removed if unused, the initializer expressions for the static properties can be annotated as pure. This annotation provides a signal to an optimizer that the expression does not have any potential side effects and is useful in cases where static analysis can not currently prove that there are, in fact, no side effects caused by the initializer.

PR Close #43064
2021-08-16 17:20:21 -07:00
Charles Lyding
27a89a9298 fix(core): add pure annotations to static property initializers (#43064)
Class static properties with initializers that cause code execution (for example, call expressions or new expressions) have the potential to cause side effects at module evaluation. This is similar in effect to module level code. As a result, optimizers can not safely remove a class with such a static property as the potential side effects may have meaningful effects on the state of the application execution. To allow classes with these type of static properties to be optimized and removed if unused, the initializer expressions for the static properties can be annotated as pure. This annotation provides a signal to an optimizer that the expression does not have any potential side effects and is useful in cases where static analysis can not currently prove that there are, in fact, no side effects caused by the initializer.

PR Close #43064
2021-08-16 17:20:20 -07:00
dario-piotrowicz
cf338493bf refactor(compiler-cli): remove unused closureCompilerEnabled from NgtscProgram (#43148)
remove the NgtscProgram's private field closureCompilerEnabled as that
is not being used in the class itself

PR Close #43148
2021-08-16 17:19:53 -07:00
George Kalpakas
b9fd76e257 docs(router): use the correct live-example name in routing-overview.md (#43180)
The previously used code (`<live-example stackblitz="router">`) would
try to target the `router.stackblitz.json` file inside the
(non-existent) `routing-overview` example (same as the guide's name).

This commit fixes the code to correctly express the original intention
of targeting the default `stackblitz.json` file of the `router` example
with `<live-example name="router">`.

Fixes #43167

PR Close #43180
2021-08-16 17:18:28 -07:00
Pete Bacon Darwin
66f1962fa6 test(compiler): add a test for parsing multiline expressions in attributes (#43129)
This tests a scenario that was failing in an internal project.

PR Close #43129
2021-08-16 13:07:23 -07:00
Pete Bacon Darwin
a6fab37789 test(compiler): check that the parser supports prematurely terminated interpolations (#43129)
Such interpolations turned up during internal testing at Google, so this
commit adds a test to prevent regressions.

PR Close #43129
2021-08-16 13:07:23 -07:00
Pete Bacon Darwin
0f56b036b4 refactor(compiler): use === rather than == in the ml_parser (#43129)
This is a simple tidy up commit to move to the more specific `===`
comparison operator in the HTML lexer/parser.

PR Close #43129
2021-08-16 13:07:23 -07:00
Pete Bacon Darwin
0d71bc6061 refactor(compiler): share isQuote() via chars.ts (#43129)
This function is general purpose and by moving it into the
`chars.ts` file along with similar helpers, it can be reused
in the lexer, for instance.

PR Close #43129
2021-08-16 13:07:23 -07:00
Pete Bacon Darwin
c32bfe5860 refactor(compiler): remove cyclic dependencies (#43129)
This commit removes 9 cycles in the dependency graph of the compiler code.

PR Close #43129
2021-08-16 13:07:23 -07:00
Pete Bacon Darwin
9e18b65e9a test(compiler-cli): clarify source-map expectations in compliance tests (#43129)
The compliance tests can check source-map segments against expectations
encoded into the expectation files. Previously, the encoding of the expected
segment was only delimited by whitespace, but this made it difficult to identify
segments that started or ended with whitespace.

Now these segment expectations are wrapped in double-quotes which makes
it easier to read and understand the expectation files.

PR Close #43129
2021-08-16 13:07:23 -07:00
Pete Bacon Darwin
c5250aebae refactor(ngcc): remove unused import (#43129)
This import is not used in the file, so can be removed.

PR Close #43129
2021-08-16 13:07:22 -07:00
Joey Perrott
564ad0622a build: uipdate to latest @angular/dev-infra-private-builds (#43179)
Update to the latest @angular/dev-infra as it includes the fix to no longer include
husky installs in the published package.json

PR Close #43179
2021-08-16 13:06:30 -07:00
Alan Agius
40ef4e0101 ci: configure renovate to manage GitHub workflow updates (#43146)
Update renovate config to allow GitHub workflow updates

PR Close #43146
2021-08-16 11:37:20 -07:00
Joey Perrott
c91cecddaa ci: update circle cache key (#43177)
Update the prefix used for the circle cache key to use new cache base.

PR Close #43177
2021-08-16 11:06:01 -07:00
TIffany Davis
6d9cac4f1a docs: add tmdavis to contributors (#43135)
PR Close #43135
2021-08-16 10:47:08 -07:00
Renovate Bot
6004afccdf build: update dependency entities to v3 (#43095)
PR Close #43095
2021-08-16 10:46:27 -07:00
Renovate Bot
d743dd9900 build: update dependency http-server to v13 (#43096)
PR Close #43096
2021-08-16 10:46:03 -07:00
Edoardo Dusi
85c345b011 refactor(common): change encoding function in httpparams for better performances and coding standards (#42998)
HttpParams uses custom encoding function "standardEncoding" to encode query string preserving specific charachters. This refactoring aims to improve performances and code quality of that function by using a RegExp and a Map object instead of a chain of replace functions.

PR Close #42998
2021-08-16 10:44:52 -07:00
Joey Perrott
19977b1bf1 build: add mainBranchName to github configuration (#43061)
Update the ng-dev config for Github to include the main branch name.

PR Close #43061
2021-08-16 10:44:27 -07:00
Joey Perrott
81e4257761 build: remove dev-infra directory and migrate to relying on @angular/dev-infra-private-builds (#43061)
Remove the dev-infra directory and complete the migration to using the code generated by the
angular/dev-infra repository.

PR Close #43061
2021-08-16 10:44:27 -07:00
Aristeidis Bampakos
30bf472597 docs: update Aristeidis bio in GDE list (#43164)
PR Close #43164
2021-08-16 09:39:06 -07:00
Andrew Scott
286b2807de fix(router): eagerly update internal state on browser-triggered navigations (#43102)
The management of `browserUrlTree` currently has several problems with
correctly tracking the actual state of the browser.

This change makes the Router eagerly update the `browserUrlTree` when
handling navigations triggered by browser events (i.e., not 'imperative'). This
is because with those types of navigations, the browser URL bar is
_already_ updated. If we do not update the internal tracking of the
`browserUrlTree`, we will be out of sync with the real URL if the
navigation is rejected.

It would be best if we could remove `browserUrlTree` completely, but doing that
would require a lot more investigation and is blocked by #27059 because
the SpyLocation used in tests does not emulate real browser behavior.

fixes #43101

PR Close #43102
2021-08-16 09:33:23 -07:00
ali
b3bb6ec161 docs: add example for template local variable (#43137)
PR Close #43137
2021-08-16 09:24:12 -07:00