26526 Commits

Author SHA1 Message Date
George Kalpakas
ab47f417d6 test(core): fix Function#name shim used in IE11 (#41439)
Since IE11 does not support `Function#name`, we use a shim in tests that
parses the stringified function to extract the name. Previously, that
shim would cache the computed name on the function to speed up future
invocations. However, this resulted in incorrect values for functions
that "extended" other functions (such as the code generated by
TypeScript when downleveling ES2015 classes that extended other
classes).

To avoid issues such as #41416 (see also [internal discussion][1]), this
commit removes the caching of names. This is not expected to noticeably
affect performance, since (a) it is only used in tests, (b) it is only
used on browsers that do not natively support `Function#name` (i.e.
IE11) and (c) accessing function names is rare and inexpensive compared
to other operations that happen during testing.

[1]: https://angular-team.slack.com/archives/CB4UC1932/p1617285258058000

PR Close #41439
2021-04-05 08:56:17 -07:00
YuCheng Hu
03cab937c1 合并修改 2021-04-05 11:48:32 -04:00
Philipp_Lypniakov
fcd190aa9c docs: fix grammar mistake in glossary.md ("can exported" --> "can be exported") (#41440)
PR Close #41440
2021-04-05 08:17:26 -07:00
YuCheng Hu
774a2e6f9c 合并修改 2021-04-05 10:22:10 -04:00
YuCheng Hu
025a45cd06 Rename doc-shredder/test to doc-shredder/_test to avoid harp compile issues
# Conflicts:
#	public/doc-shredder/_test/.gitignore
#	public/doc-shredder/_test/test_source/app.js
#	public/doc-shredder/_test/test_source/app.ts
#	public/doc-shredder/_test/test_source/app2.ts
#	public/doc-shredder/_test/test_source/do-not-read.js
#	public/doc-shredder/_test/test_source/first.html
#	public/doc-shredder/_test/test_source/gettingstarted/js/index.html
#	public/doc-shredder/_test/test_source/gettingstarted/js/main.js
#	public/doc-shredder/_test/test_source/gettingstarted/protractor-spec.js
#	public/doc-shredder/_test/test_source/gettingstarted/ts/index.html
#	public/doc-shredder/_test/test_source/gettingstarted/ts/main.js
#	public/doc-shredder/_test/test_source/gettingstarted/ts/main.js.map
#	public/doc-shredder/_test/test_source/gettingstarted/ts/main.ts
#	public/doc-shredder/_test/test_source/sub1/foo/script.js
#	public/doc-shredder/_test/test_source/sub1/script.2.js
#	public/doc-shredder/_test/test_source/sub1/script.js
#	public/doc-shredder/_test/test_source/sub1/script.ts
#	public/doc-shredder/_test/test_source/sub1/second.html
#	public/doc-shredder/test/test_source/app.ts
#	public/doc-shredder/test/test_source/app2.ts
#	public/doc-shredder/test/test_source/do-not-read.js
#	public/doc-shredder/test/test_source/gettingstarted/js/index.html
#	public/doc-shredder/test/test_source/gettingstarted/js/main.js
#	public/doc-shredder/test/test_source/gettingstarted/protractor-spec.js
#	public/doc-shredder/test/test_source/gettingstarted/ts/index.html
#	public/doc-shredder/test/test_source/gettingstarted/ts/main.js
#	public/doc-shredder/test/test_source/gettingstarted/ts/main.js.map
#	public/doc-shredder/test/test_source/gettingstarted/ts/main.ts
#	public/doc-shredder/test/test_source/sub1/foo/script.js
#	tools/doc-shredder/_test/test_source/no-multiregion/app.ts
#	tools/doc-shredder/_test/test_source/no-multiregion/app2.ts
#	tools/doc-shredder/_test/test_source/no-multiregion/do-not-read.js
#	tools/doc-shredder/_test/test_source/no-multiregion/gettingstarted/js/index.html
#	tools/doc-shredder/_test/test_source/no-multiregion/gettingstarted/js/main.js
#	tools/doc-shredder/_test/test_source/no-multiregion/gettingstarted/protractor-spec.js
#	tools/doc-shredder/_test/test_source/no-multiregion/gettingstarted/ts/index.html
#	tools/doc-shredder/_test/test_source/no-multiregion/gettingstarted/ts/main.js
#	tools/doc-shredder/_test/test_source/no-multiregion/gettingstarted/ts/main.js.map
#	tools/doc-shredder/_test/test_source/no-multiregion/gettingstarted/ts/main.ts
#	tools/doc-shredder/_test/test_source/no-multiregion/nestedFolder/script.js
2021-04-05 09:57:24 -04:00
Jay Traband
4bc13ad1a6 Fix to handle extra #enddocregion tags 2021-04-05 09:52:59 -04:00
Marcel Good
7349fad338 Karma configuration and sample test 2021-04-05 09:52:52 -04:00
Ward Bell
6fd005bcf9 Added 'app.ts' test file to doc-shredder tests 2021-04-05 09:52:00 -04:00
Jay Traband
d67f728b20 clean up regionExtractor to hoist nullLine pattern,
add examplesDir to xref info
2021-04-05 09:51:19 -04:00
Jay Traband
f43477263f First pass at build-shred-map complete 2021-04-05 09:51:11 -04:00
Jay Traband
c85d482b18 Fix for triply or greater nested fragments and trailing nullLine markers 2021-04-05 09:50:09 -04:00
Jay Traband
49f8b32e6c Building shredMap tooling 2021-04-05 09:49:39 -04:00
Jay Traband
d8ad38137b added make-example 2021-04-05 09:49:10 -04:00
Jay Traband
24948fde50 added browser-sync, modified shred-single-dir in doc-shredder to return a promise, updated readme. 2021-04-05 09:48:41 -04:00
Victor Berchet
ac2bfed40d Set the minimum typescript version to 1.5.0
fixes #172

^1.5.0-beta means >= 1.5.0 and < 2.0.0 and is technically valid. however
it's probably nicer not to refer to beta versions in the doc.
2021-04-05 09:48:08 -04:00
Jay Traband
e38fc6b3a9 shred and watch build tooling - v2 ( dgeni, gulp, jade) 2021-04-05 09:47:30 -04:00
Jay Traband
1d4c56d7f8 shred and watch build tooling ( dgeni, gulp, jade) 2021-04-05 09:46:35 -04:00
YuCheng Hu
2ef750d8cf shred and watch build tooling ( dgeni, gulp, jade)
# Conflicts:
#	gulpfile.js
#	package.json
2021-04-05 09:42:38 -04:00
YuCheng Hu
3ac61dbc20 提交构建测试文件 2021-04-04 11:03:27 -04:00
YuCheng Hu
c3645af932 更新组件 2021-04-04 10:45:50 -04:00
YuCheng Hu
e8ea7d562c 尝试更新使用代码跟踪和修改中文标题 2021-04-03 10:30:14 -04:00
YuCheng Hu
895f2fe818 针对新的版本提交没有提交的代码 2021-04-03 09:52:53 -04:00
YuCheng Hu
3d12ab7d35 提交 2021-04-03 09:50:33 -04:00
Charles Lyding
1de04b124e feat(compiler-cli): support transforming component style resources (#41307)
This change introduces a new hook on the `ResourceHost` interface named `transformResource`.
Resource transformation allows both external and inline resources to be transformed prior to
compilation by the AOT compiler. This provides support for tooling integrations to enable
features such as preprocessor support for inline styles.
Only style resources are currently supported. However, the infrastructure is in place to add
template support in the future.

PR Close #41307
2021-04-02 15:48:45 -07:00
Alan Agius
dc655262be refactor(compiler): remove TypeScript 4.0 program reuse check (#41406)
We no longer support TS 4.0, hence this check is redundant.

PR Close #41406
2021-04-02 15:47:54 -07:00
Alan Agius
64b979e12b fix(dev-infra): exclude node_modules from circular dependency checks (#41407)
With this change we exclude node_modules from circular dependency checks.

PR Close #41407
2021-04-02 15:47:33 -07:00
Alan Agius
cd2961a3d8 ci: add renovate (#41407)
With this change we add renovate to update dependencies in the following locations
- WORKSPACE
- integration/bazel/WORKSPACE
- package.json
- packages/**/package.json
- tools/ts-api-guardian/package.json
- aio/package.json

We also enable yarn workspaces so that dependencies in these packages are hoisting to the root and renovate doesn't created nested lock files.

Enabling auto updates is important, because quite often dependencies get out of date especially in the compiler-cli which depends on a number of external dependencies.

PR Close #41407
2021-04-02 15:47:33 -07:00
Gabrielle Crevecoeur
03a46afc91 docs: Including Visual Studio (#41414)
Uploading how to use the Angular Language Service in Visual Studio
PR Close #41414
2021-04-02 10:53:37 -07:00
YuCheng Hu
73f42e8a9d 更新错误 2021-04-02 13:52:29 -04:00
mgechev
520ff69854 perf(core): add private hooks around user code executed by the runtime (#41255)
Introduces an **internal**, **experimental** `profiler` function, which
the runtime invokes around user code, including before and after:
- Running the template function of a component
- Executing a lifecycle hook
- Evaluating an output handler

The `profiler` function invokes a callback set with the global
`ng.ɵsetProfiler`. This API is **private** and **experimental** and
could be removed or changed at any time.

This implementation is cheap and available in production. It's cheap
because the `profiler` function is simple, which allows the JiT compiler
to inline it in the callsites. It also doesn't add up much to the
production bundle.

To listen for profiler events:

```ts
ng.ɵsetProfiler((event, ...args) => {
  // monitor user code execution
});
```

PR Close #41255
2021-04-02 10:34:23 -07:00
Joey Perrott
a43f36babd fix(dev-infra): require npm login for all publishes via wombat proxy (#41422)
Due to an issue with wombat proxy returning the login state of the generated tokens,
we will need to require a login for all `ng-dev release publish` runs to ensure npm
login has occured.

PR Close #41422
2021-04-02 10:30:18 -07:00
GChuf
46a97b985e build: Bump minimum required node version to 10.19.0 (#41390)
Critical security vulnerability fixed in node v 10.19.0
Other performance and security updates since node 10.9.0

PR Close #41390
2021-04-02 10:29:24 -07:00
Alan Agius
c5e9944c42 fix(dev-infra): allow npm like scopes as commit message scopes (#41430)
In the CLI and Universal, we use the package name as commit message scope. The recent changes that introduced `conventional-commits-parser` in https://github.com/angular/angular/pull/41286 breaks the parsing of such commit scopes and caused commit validations to fail.

Example: https://app.circleci.com/pipelines/github/angular/angular-cli/14420/workflows/85feb5c9-184f-4088-b924-6b9e6c91f062/jobs/238446/parallel-runs/0/steps/0-102

PR Close #41430
2021-04-02 10:28:08 -07:00
Alex Rickabaugh
4ce743dfb8 release: cut the v12.0.0-next.7 release (#41423)
PR Close #41423
2021-04-01 16:56:42 -07:00
Pete Bacon Darwin
ed77bfea26 test(core): fix JIT factory declaration test for IE11 (#41416)
This commit removes a check for the name of the generated factory
function, which is unimportant to test the behaviour of the code.

The name of these functions is generated from the name of the class
being instantiated. In IE11, there is no `function.name` property available
and so there is a shim for it in `third_party/shims_for_IE.js`, which patches
the `Function.property.name` property.

For performance reasons this shim writes the result of the computation
to the prototype of the function. Unfortunately, this means that any class
that extends the patched class will have the same value for `name`.

PR Close #41416
2021-04-01 12:21:00 -07:00
George Kalpakas
18abd3ce01 build(docs-infra): upgrade cli command docs sources to e240e5b7c (#41411)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](b6effecae...e240e5b7c):

**Modified**
- help/extract-i18n.json
- help/generate.json

##
Relevant changes in
[commit range](935b1fdee...e240e5b7c) since PR #41394:

**Modified**
- help/generate.json

##
Closes #41394

PR Close #41411
2021-04-01 12:07:45 -07:00
Pete Bacon Darwin
c4af49335c docs(forms): fix the short description for DefaultValueAccessor (#41409)
The position of the `{@searchKeywords}` inline tag was causing the short-description to be empty.

PR Close #41409
2021-04-01 12:07:03 -07:00
Zach Arend
3c586fa4e0 ci: add Zach Arend to pullapprove (#41386)
add Zach Arend to .pullapprove.yml

PR Close #41386
2021-04-01 12:06:17 -07:00
Pete Bacon Darwin
fccffc647b refactor(docs-infra): include more info in search index data (#41368)
The AIO search index is built in a WebWorker on the browser from a set
of page information that is downloaded as a JSON file (`search-data.json`).
We want to keep this file as small as possible while providing enough
data to generate a useful index to query against.

Previously, we only included one copy of each (non-ignored) term from each
doc but this prevents more subtle ranking of query results, since the number
of occurences of a term in a doc is lost.

This commit changes the generated file in the following ways:

- All non-ignored terms are now included in the order in which they appear
  in the doc.
- The terms are indexed into a dictonary to avoid the text of the term being
  repeated in every doc that contains the term.
- Each term is pre-"stemmed" using the same Porter Stemming algorith that the
  Lunr search engine uses.

The web-worker has been updated to decode the new format of the file.
Now that all terms are included, it may enable some level of phrase based
matching in the future.

The size of the generated file is considerably larger than previously, but
on production HTTP servers the data is sent compressed, which reduces the
size dramatically.

PR Close #41368
2021-04-01 12:02:37 -07:00
Pete Bacon Darwin
55f7f1d446 feat(docs-infra): improve search query processing (#41368)
This commit tries to improve the search results by processing
the query and attempting progressively less restrictive searches
until a non-zero set of pages is matched.

The new procesing includes:

* stripping off quote marks, which were causing searches to fail
* first attempting to match pages where ALL the query terms exist
* second attempting to match pages where ANY of the query terms exist
* third attempting to match pages where the title contains partial word matches

The first query attempt approximates, quite well, the idea of searching
for multi-word phrases. This is given the technical nature of the terms
and the fairly small size of the corpus.

PR Close #41368
2021-04-01 12:02:37 -07:00
pavlenko
a5a3752859 docs: fix misspelled word in VSCode Remote Development guide (#41376)
There is a plural word after indefinite article in readme file.

PR Close #41376
2021-04-01 12:02:02 -07:00
Adem Simsek
c6d9a193d6 fix(dev-infra): Correctly place comments in dockerfile (#41374)
The doc in https://docs.docker.com/engine/reference/builder/#format says that
"Docker treats lines that begin with # as a comment, unless the line is a valid parser directive. A # marker anywhere else in a line is treated as an argument."

Fixes #41361

PR Close #41374
2021-04-01 11:55:53 -07:00
JoostK
ff9470b0a0 fix(compiler): include used components during JIT compilation of partial component declaration (#41353)
In #41104 the list of used directives was split into two arrays of used
directives and components, but the JIT side was not updated. This commit
fixes the JIT integration by including the list of used components.

Fixes #41318

PR Close #41353
2021-04-01 11:39:41 -07:00
Andrew Scott
0226a11c18 fix(language-service): Only provide Angular property completions in templates (#41278)
When possible, the @angular/language-service should only provide
information related to Angular. When there is an embedded language, like
inline templates, editor extensions should have the ability to create
virtual documents and forward the requests to the relevant providers for
that language type (see https://github.com/angular/vscode-ng-language-service/pull/1212).

This commit removes all dom schema completions in both inline and
external templates and provides only the Angular syntax for property completions
on elements.

PR Close #41278
2021-04-01 11:37:30 -07:00
George Kalpakas
3470ea17d5 fix(docs-infra): increase the max width of the file-not-found page (#41275)
Previously, the max width of the `file-not-found` page was limited to
50rem (800px by default). This allowed little space for showing
potentially helpful search results, which are shown in columns).

This commit increases the max width of the `file-not-found` page to
84rem (1344px by default) to allow search results to be visible without
requiring scrolling. This will not negatively affect UX, because the
page uses a multi-column layout and therefore there will rarely be long
lines of text to scan.

PR Close #41275
2021-04-01 11:36:44 -07:00
George Kalpakas
3cda3e6a32 fix(docs-infra): correctly show search results on narrow screens (#41275)
Previously, some part of the search results would be hidden and
inaccessible on narrow screens. This was caused by an issue with the
flexbox layout. See [here][1] for more info on the issue and the
available solutions.
NOTE: This issue affected both the search results shown when using the
search box (on the top right of the page) as well as the search results
shown in the `file-not-found` page.

This commit changes how the layout of search results is achieved to
ensure they are always accessible via scrolling on all screen sizes
(while keeping the same layout on larger screens).

Before: ![search results at 768px before][2]
After: ![search results at 768px after][3]

[1]: https://stackoverflow.com/questions/33454533/cant-scroll-to-top-of-flex-item-that-is-overflowing-container#33455342
[2]: https://user-images.githubusercontent.com/8604205/111772790-efe2ac00-88b5-11eb-925d-a80faeaa5369.png
[3]: https://user-images.githubusercontent.com/8604205/111772810-f5d88d00-88b5-11eb-8b2a-60bdc3736ea3.png

PR Close #41275
2021-04-01 11:36:44 -07:00
Joey Perrott
db55f8e671 ci: update commit-message verification range parameters (#41341)
Update parameters used for commit message checks in pull requests.

PR Close #41341
2021-04-01 11:30:26 -07:00
Joey Perrott
381ea9d7d4 refactor(dev-infra): set up new method for checking range of commits (#41341)
Check a range of commits by retrieving the log files to be parsed with the expected
format for the parser.

This change is in part of a larger set of changes making the process for obtaining
and parsing commits for release note creation and message validation consistent.
This consistency will make it easier to debug as well as ease the design of tooling
which is built on top of these processes.

PR Close #41341
2021-04-01 11:30:26 -07:00
Pete Bacon Darwin
18bc9ffb51 ci: do not try to publish directories that are not packages (#41393)
We now include `misc/angular-in-memory-web-api` in the packages that
are build in the `dist/packages-dist` directory. But this package should
not be published as an artifact.

This commit prevents attempting to publishing the `misc` directory by
first checking whether the directory contains a `package.json` file.

PR Close #41393
2021-04-01 11:26:11 -07:00
Pete Bacon Darwin
7dfa446c4a fix(common): temporarily re-export and deprecate XhrFactory (#41393)
The moved `XhrFactory` still needs to be available from `@angular/common/http`
for some libraries that were built prior to 12.0.0, otherwise they cannot be
used in applications built post-12.0.0.

This commit adds back the re-export of `XhrFactory` and deprecates it.

PR Close #41393
2021-04-01 11:26:11 -07:00