Commit graph

29561 commits

Author SHA1 Message Date
JoostK
cf0c53aa1c fix(compiler): avoid errors for inputs with Object-builtin names (#47220)
Using raw objects as a lookup structure will inadvertently find methods defined on
`Object`, where strings are expected. This causes errors downstream when string
operations are applied on functions.

This commit switches over to use `Map`s in the DOM element schema registry to fix
this category of issues.

Fixes #46936

PR Close #47220
2022-09-06 11:55:13 -07:00
JoostK
4a53b7f36b refactor(compiler): show meaningful diagnostic when reporting a template error fails (#44001)
When the Angular compiler emits a diagnostic in a template file, it
forces TypeScript to parse that template. Templates are not TypeScript,
so this parse finds a bunch of parsing errors, which Angular then
ignores and we show the diagnostic anyways because we have more context.
This can lead to strange behavior in TypeScript because templates are so
weird that it can break the parser and crash the whole compiler.

For example, certain Angular templates can encounter failures fixed by
microsoft/TypeScript#45987, which are not easily debuggable and require
a TS upgrade to fix.

This commit introduces logic to handle the error gracefully, by falling
back to report the template error on the component class itself. The
diagnostic is extended to still reference the template location and
includes the failure's stack trace, to allow the parsing failure to be
reported to TypeScript (as parsing should in theory not cause a crash).

Closes #43970

PR Close #44001
2022-09-06 11:52:35 -07:00
Alan Agius
16f96eeabf refactor(compiler-cli): remove enableIvy options (#47346)
This option has no longer any effect as Ivy is the only rendering engine.

BREAKING CHANGE: Angular compiler option `enableIvy` has been removed as Ivy is the only rendering engine.

PR Close #47346
2022-09-06 11:33:48 -07:00
Bob Watson
1edb8e5c45 docs: add new words to vocabulary (#47344)
docs: add VMWare to spell check dictionary
docs: add rebase, rebases, rebased to spell check dictionary
docs: add repos to spell check dictionary
docs: change repeated string regex

PR Close #47344
2022-09-06 11:33:14 -07:00
Joe Martin (Crowdstaffing)
e810402ffc docs: Update markdown and formatting in image-directive topic. (#47259)
PR Close #47259
2022-09-06 11:30:50 -07:00
Angular Robot
ab936dd407 build: update cross-repo angular dependencies to f2a04c8 (#47231)
See associated pull request for more information.

PR Close #47231
2022-09-06 11:29:47 -07:00
George Kalpakas
e1bb638e0b fix(service-worker): include headers in requests for assets (#47260)
Previously, when requesting non-cached asset resources from the network,
the ServiceWorker would strip off all request metadata (including
headers). This was done in order to avoid issues with opaque responses,
but it turned out to be overly aggressive, breaking/worsening legit
usecases (such as requesting compressed data).

This commit fixes this by preserving the headers of such requests.

For reference, Workbox passes the original request as is. (See for
example the [NetworkFirst][1] strategy).

> **Note**
> Data requests (i.e. requests for URLs that belong to a data-group) are
  not affected by this. They already use the original resource as is.

[1]: 95f97a207f/packages/workbox-strategies/src/NetworkFirst.ts (L90)

Fixes #24227

PR Close #47260
2022-09-06 10:03:12 -07:00
George Kalpakas
d63fe2fa46 test(service-worker): simplify how redirects are defined in MockServerState (#47260)
Previously, the `MockServerStateBuilder#withRedirect()` method did two
things: (a) define a redirect from one path to another and (b) specify
the contents of the redirect destination. This was confusing, because it
deviated from the regular way of specifying file contents, which is via
a `MockFileSystem` instance.

This commit slightly simplifies the process of defining redirects by
having the `withRedirect()` method only define the redirect and let the
contents of the redirect destination be specified as usual via
`MockFileSystem`. This makes `MockFileSystem` the single source of truth
for file contents used with `MockServerState`.

PR Close #47260
2022-09-06 10:03:12 -07:00
George Kalpakas
e842fd75ac test(service-worker): fix default value of Request#credentials (omit --> same-origin) (#47260)
Previously, the default value of `MockRequest#credentials` (used in
testing) was set to `omit`. This was different than the default value
used in browsers, which is `same-origin` (see [Request docs on MDN][1])
and could lead to incorrect test results.

This commit changes the default value for `credentials` to `same-origin`
to match what would happen in the browser.

[1]: https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials

PR Close #47260
2022-09-06 10:03:12 -07:00
George Kalpakas
a0c3326485 fix(service-worker): only consider GET requests as navigation requests (#47263)
Previously, the criteria for determining if a request was a
[navigation request][1] did not account for the request method. This
incorrectly identified HTML form submit POST requests as navigation
requests and served `index.html` instead of passing them through to the
server, thus breaking the form submission.

This commit fixes this by ensuring that only GET requests are considered
navigation requests.

> **Note**
> HTML forms with their method set to `GET` will still be affected by
> the issue. This is not a big concern, because using `GET` for form
> submission is quite uncommon and generally discouraged (due to
> limitations and security considerations).

[1]: https://angular.io/guide/service-worker-config#handling-navigation-requests

Fixes #36368

PR Close #47263
2022-09-06 10:02:10 -07:00
Angular Robot
b9f80d277d build: update io_bazel_rules_sass digest to f3874ae (#47292)
See associated pull request for more information.

PR Close #47292
2022-09-06 09:59:21 -07:00
Jeremy Elbourn
35f93bd409 refactor(router): remove unnecesary null (#47238)
These null values are unused and unecessary. I suspect it's a remnant from when the codebase was transpiled to Dart.

PR Close #47238
2022-09-06 09:57:37 -07:00
Jeremy Elbourn
0e147cf6cb refactor(common): remove unnecesary null (#47238)
These null values are unused and unecessary. I suspect it's a remnant from when the codebase was transpiled to Dart.

PR Close #47238
2022-09-06 09:57:37 -07:00
Jeremy Elbourn
834927d0e7 refactor(animations): remove unnecesary null (#47238)
These null values are unused and unecessary. I suspect it's a remnant from when the codebase was transpiled to Dart.

PR Close #47238
2022-09-06 09:57:37 -07:00
Jeremy Elbourn
aa14662562 refactor(forms): remove unnecesary null (#47238)
These null values are unused and unecessary. I suspect it's a remnant from when the codebase was transpiled to Dart.

PR Close #47238
2022-09-06 09:57:37 -07:00
Alan Agius
d36fd3d9e4 refactor(localize): remove deprecated canParse method from TranslationParsers (#47275)
This change removed the deprecated `canParse` method from all the TranslationParsers.

BREAKING CHANGE:

- `canParse` method has been removed from all translation parsers in `@angular/localize/tools`. `analyze` should be used instead.
-  the `hint` parameter in the`parse` methods is now mandatory.

PR Close #47275
2022-09-06 09:57:02 -07:00
jaybell
93d7d9101e fix(common): use DOCUMENT token to query for preconnect links (#47353)
`PreconnectLinkChecker` checks to see if preconnect links have been added to the `<head>` element but uses `document` directly which does not exist when rendering in Angular Universal. This PR switches the `PreconnectLinkChecker` to use the `DOCUMENT` token instead so that the query works when SSR'ing

PR Close #47353
2022-09-06 09:56:26 -07:00
Kara Erickson
220d1203e6 fix(common): improve formatting of image warnings (#47299)
This is a tiny fix to add paragraph breaks in
image distortion warnings to make them a bit
easier to read. With this change, the intrinsic
and rendered image sizes are printed on their
own lines instead of mid-paragraph.

PR Close #47299
2022-09-06 09:55:57 -07:00
Angular Robot
4cafd08866 build: update all non-major dependencies (#47225)
See associated pull request for more information.

PR Close #47225
2022-09-06 09:53:29 -07:00
Angular Robot
1f23fdb03c build: update github/codeql-action action to v2.1.22 (#47223)
See associated pull request for more information.

PR Close #47223
2022-09-06 09:51:56 -07:00
George Kalpakas
dba71a1873 build(docs-infra): upgrade cli command docs sources to 4a6e62d46 (#47305)
Updating [angular#main](https://github.com/angular/angular/tree/main) from
[cli-builds#main](https://github.com/angular/cli-builds/tree/main).

##
Relevant changes in
[commit range](14d4d528c...4a6e62d46):

**Modified**
- help/generate.json

PR Close #47305
2022-09-06 09:51:15 -07:00
JiaLiPassion
9fbf810744 build: add zone.js to bug-report template for github (#47213)
Add `zone.js` to the `packages options` of the bug report template for
Github.

PR Close #47213
2022-09-06 09:49:55 -07:00
Sabareesh Kappagantu
94ea8700d7 docs: fix linting errors in component overview guide (#47352)
PR Close #47352
2022-09-06 09:41:12 -07:00
Sabareesh Kappagantu
385471d0c0 docs: add substitution entry for camel case (#47351)
PR Close #47351
2022-09-06 09:40:39 -07:00
Sabareesh Kappagantu
81e41717a3 docs: fix linting errors in class binding guide (#47351)
PR Close #47351
2022-09-06 09:40:39 -07:00
Bingo's Code
99c12c92a8 docs: apply suggestions from code review (#47350)
Co-authored-by: Bob Watson <104218420+bob-watson@users.noreply.github.com>
PR Close #47350
2022-09-06 09:38:31 -07:00
Sabareesh Kappagantu
a053c63f05 docs: fix linting errors in architecture components guide (#47350)
PR Close #47350
2022-09-06 09:38:31 -07:00
Sonu Sindhu
e4f6eed653 docs: formatting issue (#47349)
There were some formatting issue and I just updated * to & in migration-undecorated-classes.md
PR Close #47349
2022-09-06 09:37:48 -07:00
Sabareesh Kappagantu
99be607055 docs: update angular-package-format guide (#47342)
PR Close #47342
2022-09-06 09:35:38 -07:00
Bingo's Code
ce5fc87458 docs: update aio/content/guide/angular-package-format.md with suggestion (#47342)
Co-authored-by: Bob Watson <104218420+bob-watson@users.noreply.github.com>

PR Close #47342
2022-09-06 09:35:38 -07:00
Bingo's Code
ed0c9b6975 docs: apply suggestions from code review (#47342)
adding suggestions from Bob.

Co-authored-by: Bob Watson <104218420+bob-watson@users.noreply.github.com>

PR Close #47342
2022-09-06 09:35:38 -07:00
Sabareesh Kappagantu
ddc2c3db2e docs: fix linting errors in angular package format guide (#47342)
PR Close #47342
2022-09-06 09:35:37 -07:00
Asaf M
ff5ec02904 docs: fix grammar (#47333)
there aren't many forms here, the object model belongs to the form, hence the apostroph is needed before the letter s
PR Close #47333
2022-09-06 09:33:15 -07:00
abergquist
9efe24af40 docs: fixed a "grammatical opportunity" (#47328)
Since "application design" is being used as an adjective in the following sentence:

Angular is an application design framework and development platform for creating efficient and sophisticated single-page apps.

I recommend replacing it with "application-design" (cf. https://en.wikipedia.org/wiki/Compound_modifier).
PR Close #47328
2022-09-06 09:32:25 -07:00
Sabareesh Kappagantu
d3c2ca13ce docs: fix linting errors in change detection guide (#47324)
PR Close #47324
2022-09-06 09:31:21 -07:00
Simona Cotin
67bb2b348d docs: update cloudinary url (#47320)
PR Close #47320
2022-09-06 09:30:49 -07:00
Aristeidis Bampakos
a46886500f docs: fix typo in image directive guide (#47313)
PR Close #47313
2022-09-06 09:30:14 -07:00
Yann Provoost
329fed78f3 docs: fix doc linter warnings in app-shell.md (#47282)
PR Close #47282
2022-09-06 09:24:04 -07:00
Yann Provoost
7d45ef702f docs: fix doc linter warning and error in accessibility.md (#47282)
PR Close #47282
2022-09-06 09:24:03 -07:00
Yann Provoost
374b63d3c9 docs: fix doc linter warnings in angular-compiler-options.md (#47282)
PR Close #47282
2022-09-06 09:24:03 -07:00
George Kalpakas
d077d58139 docs(service-worker): add note regarding assets and CORS (#47262)
Fixes #41931

PR Close #47262
2022-09-06 09:23:28 -07:00
vyom1611
33bb34b64e refactor(service-worker): refactored code to remove useless code (#47255)
- Removes useless code in `generator.ts` and `module.ts` in service-workers
- Uses inline variables to return values from functions

PR Close #47255
2022-09-06 09:15:06 -07:00
vyom1611
0d13cc7848 docs: fixing typos and grammatical errors in several documentation files (#47254)
- Fixes grammar issues in various markdown files, like the `DEBUG.md` or `DEVELOPER.md`

PR Close #47254
2022-09-06 09:14:25 -07:00
George Kalpakas
b8fd0da47f docs(docs-infra): improve docs on updating angular.io and docs examples apps (#47250)
Add a new doc, `aio/UPDATING.md`, with instructions on updating the
angular.io app to align with the latest Angular CLI/framework/Material.
Also, update the instructions on updating the docs examples apps.

PR Close #47250
2022-09-06 09:13:53 -07:00
George Kalpakas
eb8e95f5cf docs(docs-infra): add instructions on using Let's Encrypt for preview server certificates (#47250)
Add a new doc with instructions on how to use TLS certificates issues by
[Let's Encrypt][1] in the PR preview server.

[1]: https://letsencrypt.org/

PR Close #47250
2022-09-06 09:13:52 -07:00
George Kalpakas
8fa33edc30 docs(docs-infra): minor improvements in preview server docs (#47250)
PR Close #47250
2022-09-06 09:13:52 -07:00
Jobayer Hossain
28f277e037 docs: typo (#47246)
It appears that the indefinite pronoun either does not agree with the verb occur in your sentence. Consider changing the form of the verb.
PR Close #47246
2022-09-06 09:13:21 -07:00
Maina Wycliffe
17d66d9302 docs: compress the bios image (#47244)
PR Close #47244
2022-09-06 09:12:38 -07:00
Maina Wycliffe
49b871dc33 docs: add Maina Wycliffe to GDE resources (#47244)
PR Close #47244
2022-09-06 09:12:38 -07:00
George Kalpakas
c905da12e2 docs(service-worker): improve docs related to SwUpdate APIs (#46960)
This commit improves documentation related to recently improved or
deprecated `SwUpdate` APIs in the following ways:

- Update [check-for-update.service.ts][1] to make use of the return
  value of [SwUpdate#checkForUpdate()][2].
- Update [prompt-update.service.ts][3] to not call
  [SwUpdate#activateUpdate()][4] and just reload the page.
- Update the [SwUpdate#activateUpdate()][4] API docs to explain that it
  is only useful if you want to update a client without reloading and
  that it can easily lead to version skew.
- Update [a code-snippet][5] to no longer be [hard-coded][6].

[1]: 9d9d05911d/aio/content/examples/service-worker-getting-started/src/app/check-for-update.service.ts (L16)
[2]: https://angular.io/api/service-worker/SwUpdate#checkForUpdate
[3]: 9d9d05911d/aio/content/examples/service-worker-getting-started/src/app/prompt-update.service.ts (L15)
[4]: https://angular.io/api/service-worker/SwUpdate#activateUpdate
[5]: 96c6139c9a/packages/service-worker/src/update.ts (L44-L54)
[6]: https://angular.io/guide/docs-style-guide#hard-coded-snippets

Fixes #43665

PR Close #46960
2022-09-06 09:11:57 -07:00