Commit Graph

18809 Commits

Author SHA1 Message Date
Dwayne Hinterlang 0a7a5e3aff docs: Remove confusion between do/avoid templates (#38647)
PR Close #38647
2020-08-31 10:25:16 -07:00
Juan José Arboleda d5fabc303d refactor(forms): remove extra space in error message (#38637)
Remove extra whitespace at package/forms/model.ts error messages

PR Close #38637
2020-08-31 09:31:55 -07:00
Paul Gschwendtner ebc0e46501 refactor(dev-infra): improve error message for unexpected version branches (#38622)
Currently the merge script default branch configuration throws an error
if an unexpected version branch is discovered. The error right now
assumes to much knowledge of the logic and the document outlining
the release trains conceptually.

We change it to something more easy to understand that doesn't require
full understanding of the versioning/labeling/branching document that
has been created for the Angular organization.

PR Close #38622
2020-08-31 09:29:58 -07:00
Joey Perrott 3487b549fd feat(dev-infra): write outputs of command runs to ng-dev log file (#38599)
Creates infrastructure to write outputs of command runs to ng-dev log file.
Additionally, on commands which fail with an exit code greater than 1, an
error log file is created with the posix timestamp of the commands run time
as an identifier.

PR Close #38599
2020-08-31 08:47:15 -07:00
Akash 52c7a4bfc6 docs: ng generate module command doc change (#38480)
PR Close #38480
2020-08-31 08:43:19 -07:00
GavinMK 827ba05914 docs: remove first person and space in CircleCI in the testing guide. (#38631)
PR Close #38631
2020-08-31 08:42:04 -07:00
narmit b2857b4e3a docs: remove double space in start-data. (#38642)
PR Close #38642
2020-08-31 08:41:30 -07:00
Da-Woon Chung 5d5caf21b8 docs: fix broken markdown in start/start-data (#38644)
PR Close #38644
2020-08-31 08:40:57 -07:00
Juan José Arboleda c1bc070b40 refactor(dev-infra): remove `style` type from commit style guide (#38639)
The `style` commit type is not part of the commit parser config,
it should be removed from the documentation.

PR Close #38639
2020-08-31 08:40:14 -07:00
Joey Perrott 930eeaf177 fix(bazel): fix integration test for bazel building (#38629)
Update the API used to request a timestamp.  The previous API we relied on for this
test application, worldclockapi.com no longer serves times and simply 403s on all
requests.  This caused our test to timeout as the HTTP request did not handle a failure
case.  By moving to a new api, the HTTP request responds as expected and timeouts
are corrected as there is not longer a pending microtask in the queue.

PR Close #38629
2020-08-28 11:16:40 -07:00
Joey Perrott 2dd29fbae7 build: update ng-dev merge config to reflect new label updates (#38620)
Update the ng-dev merge configuration to reflect the new label updates

PR Close #38620
2020-08-28 08:03:21 -07:00
Joey Perrott 9613660fee ci: update angular robot to be based on new label updates (#38620)
Update the angular robot configuration to reflect the new label updates

PR Close #38620
2020-08-28 08:03:19 -07:00
Andrew Kushnir c0523fc3b4 docs(forms): exclude internal-only methods and properties from docs (#38583)
Prior to this commit, a lot of internal-only class properties and methods (such as `ngOnChanges`)
of the Forms package directives were exposed on angular.io website. These fields are not expected
to be called externally (they are used/invoked by framework only), since they are part of internal
implementations of the following interfaces:

* Angular lifecycle hook interfaces
* ControlValueAccessor interface
* Validator interface

Having these internal-only fields in docs creates unnecessary noise on directive detail pages.
This commit adds the `@nodoc` annotation to these properties and methods to keep fields in the
golden files, but hide them in docs.

PR Close #38583
2020-08-27 16:39:38 -07:00
Joey Perrott de1cffb23b build: update the package.json to 10.2.0-next.0
When the rc was cut for 10.1.0-rc.0, the package.json for master should be updated
to to the following next version, in this case 10.2.0-next.0.
2020-08-27 15:59:52 -07:00
Paul Gschwendtner 31f4557621 ci: update github robot to reflect new target labels (#38428)
Updates the Github robot to reflect the updated target
labels that are used as part of the canonical versioning
and labeling for the Angular organization.

PR Close #38428
2020-08-27 14:52:44 -07:00
Paul Gschwendtner 7723bfd9ba build: use new labeling and branching in merge script (#38428)
We introduced a new shared configuration for merge script
labels that follow the proposal of:
https://docs.google.com/document/d/197kVillDwx-RZtSVOBtPb4BBIAw0E9RT3q3v6DZkykU

These label semantics and the branching are set up for the Angular
framework with this commit. The goal is that labeling and merging
is consistent between all Angular projects and that clear rules
are defined for branching. This was previously not the case.

PR Close #38428
2020-08-27 14:52:42 -07:00
Joey Perrott e8ea839df8 docs: update docs to reflect new PR targeting methods for release trains (#38401)
As part of the migration to a common strategy/method for branching and releasing across
the main angular repositories, updates need to be made to the documentation. These changes
reflect the updates made and is based on the following document which describes the
merging label expectations: https://docs.google.com/document/d/197kVillDwx-RZtSVOBtPb4BBIAw0E9RT3q3v6DZkykU

PR Close #38401
2020-08-27 14:52:04 -07:00
Joey Perrott 90cec40cce build: bump to lastest sha of angular/dev-infra's lock-closed action (#38615)
Update to the latest lock-closed action to fix the link which is used.

PR Close #38615
2020-08-27 10:58:29 -07:00
Keen Yee Liau 4036281007 docs: Update contributor info for kyliau (#38125)
Added twitter handle, website, and a short bio.

PR Close #38125
2020-08-27 10:39:30 -07:00
Sonu Kapoor 164cd274a4 test(docs-infra): add commands to run the unit tests (#34537)
This commit adds the necessary custom commands to run the tests in a
node environment.

PR Close #34537
2020-08-27 09:05:59 -07:00
Sonu Kapoor fedcfec346 test(docs-infra): add missing tests for obserables and promises (#34537)
This commit adds missing tests for obserables and promises which
are both stand-alone mini-apps.

PR Close #34537
2020-08-27 09:05:56 -07:00
Sam Vloeberghs 618cb32407 docs: add Sam Vloeberghs to GDE list (#37970)
PR Close #37970
2020-08-26 12:52:56 -07:00
George Kalpakas 4aee0087ea docs: remove outdated CircleCI link from `DEVELOPER.md` (#38554)
CircleCI updated their UI and now the URLs are different (and cannot be
constructed based on the build number alone). This commit removes a
reference of the obsolete URL pattern to avoid confusion.

Example old URL:
https://circleci.com/gh/angular/angular/<build-number>#artifacts

Example new URL:
https://app.circleci.com/pipelines/github/angular/angular/<build-number>/workflows/<workflow-id>/jobs/<job-id>/artifacts

PR Close #38554
2020-08-26 12:52:26 -07:00
Sonu Kapoor 0681a20d28 fix(docs-infra): add guard to not render anchor link for private api (#38589)
This commit adds a guard that prevents rendering anchor links for
private api's.

Closes #38564

PR Close #38589
2020-08-26 12:51:04 -07:00
Misko Hevery fb06903237 release: cut the v10.1.0-rc.0 release 2020-08-26 11:57:57 -07:00
Misko Hevery ecc6fd0d28 docs: release notes for the v10.0.14 release 2020-08-26 11:51:32 -07:00
Aristeidis Bampakos 80cab26023 docs: Minor fixes in NgModules section (#36177)
Apply minor fixes to various guides of the NgModules section

PR Close #36177
2020-08-25 15:24:02 -07:00
Aristeidis Bampakos 841dfa68f9 docs: typo fixes in the component testing scenarios guide (#38574)
Fixed some typos and removed a warning about limitation of the `fakeAsync` that is already mentioned in a helpful alert

PR Close #38574
2020-08-25 15:16:53 -07:00
Pete Bacon Darwin f0af387f6c fix(localize): ensure required XLIFF parameters are serialized (#38575)
When extracting i18n messages from source code, the XLIFF
serializers were missing some required attributes on the `<file>`
element.

This commit re-introduces the `original` property to each of XLIFF 1.2
and 2.0 serializers. Also it adds in the required `id` property for the
XLIFF 2.0 seralizer.

Fixes #38570

PR Close #38575
2020-08-25 15:14:19 -07:00
Pete Bacon Darwin 14e90bef58 fix(localize): render text of extracted placeholders (#38536)
Formats like XLIFF allow the text of the original source to
be included as metadata. This commit fixes the message
extractor to also render this text when available.

PR Close #38536
2020-08-25 15:13:23 -07:00
Pete Bacon Darwin db3a21b382 refactor(localize): add placeholder locations in extracted messages (#38536)
Some translation file formats would like to be able to render the
text of placeholders taken from the original source files. This commit
adds this information to the extracted messages so that it can be
used in translation file serializers.

PR Close #38536
2020-08-25 15:13:20 -07:00
Pete Bacon Darwin b8351f3b10 refactor(localize): ensure that translate plugin exceptions are not swallowed (#38536)
Previously, exceptions that were not `BabelParseError`s were just ignored.
Such exceptions are most likely programming errors in the package.
They are now re-thrown to ensure that the error is not hidden.

PR Close #38536
2020-08-25 15:13:17 -07:00
Pete Bacon Darwin 81053d3160 refactor(localize): run the translate plugin tests in mock FileSystems (#38536)
This commit is a tidy up of the translate plugin unit tests, but also ensures
that the tests are run in the context of a mock FileSystem. This ensures
that the tests are resilient to future refactors of the plugins that will
require a FileSystem to be initialized.

PR Close #38536
2020-08-25 15:13:15 -07:00
Pete Bacon Darwin bdba1a062d refactor(localize): include text in original location of extracted messages (#38536)
When extracting messages, source-mapping information is used to find
the original location of the message being extracted. This commit will
now include the text from the original source in the message location
so that it can be serialized into the translation file.

PR Close #38536
2020-08-25 15:13:12 -07:00
Pete Bacon Darwin 23f855b300 refactor(localize): allow ParsedMessage to hold additional location data (#38536)
In preparation for supporting `equiv-text` placeholder information in
extracted translation files, this commit adds these optional properties
to the `ParsedMessage` interface and updates `parseMessage()` to
be able to store them.

PR Close #38536
2020-08-25 15:13:09 -07:00
Aristeidis Bampakos 94a3e0e81d docs: add correct path for karma.conf.js file (#38571)
In the latest Angular CLI versions, the `karma.conf.js` file resides in the root folder of the Angular CLI project.

PR Close #38571
2020-08-25 09:56:32 -07:00
Aristeidis Bampakos 9cbde86534 docs: fix typo in the testing component basics guide (#38573)
The guide ends with a sentence that implies there are more tests following the end of the guide.

PR Close #38573
2020-08-25 09:55:59 -07:00
Dmitrii Kanatnikov 18e474f522 fix(zone.js): zone.js toString patch should check typeof Promise is function (#38350)
Close #38361

zone.js monkey patch toString, and check the instance is `Promise` or not by using `instanceof Promise`,
sometimes when Promise is not available, the `instanceof` operation fails
and throw `TypeError: Right-hand side of 'instanceof' is not an object`
this PR check `typeof Promise` equals to function or not to prevent the error.

PR Close #38350
2020-08-25 09:51:50 -07:00
Misko Hevery cb3db0d31b release: clean up changelog 2020-08-24 15:53:55 -07:00
Misko Hevery d36828a7a1 release: cut the v10.1.0-next.8 release 2020-08-24 15:38:13 -07:00
Misko Hevery f18e2d5898 docs: release notes for the v10.0.12 release 2020-08-24 15:31:03 -07:00
Alan Agius 375f0a6f67 build: update tslint to 6.1.3 (#38076)
This version supports TypeScript 4.0

PR Close #38076
2020-08-24 13:07:05 -07:00
Alan Agius 281b647f15 refactor(compiler-cli): remove usage of `ts.updateIdentifier` (#38076)
With Typescript 4, `ts.updateIdentifier` is no longer available.
Calling `ts.updateIdentifier` used to return the same node when
`typeArguments` was `undefined` because `node.typeArguments`
was also `undefined`.

Relevant TS code:
```js
function updateIdentifier(node, typeArguments) {
  return node.typeArguments !== typeArguments
      ? updateNode(createIdentifier(ts.idText(node), typeArguments), node)
      : node;
}
```

PR Close #38076
2020-08-24 13:07:02 -07:00
Alan Agius 0fc44e0436 feat(compiler-cli): add support for TypeScript 4.0 (#38076)
With this change we add support for TypeScript 4.0

PR Close #38076
2020-08-24 13:06:59 -07:00
Sonu Kapoor 201a546af8 perf(forms): use internal `ngDevMode` flag to tree-shake error messages in prod builds (#37821)
This commit adds a guard before throwing any forms errors. This will tree-shake
error messages which cannot be minified. It should also help to reduce the
bundle size of the `forms` package in production by ~20%.

Closes #37697

PR Close #37821
2020-08-24 09:26:28 -07:00
windmichael 6e643d9874 docs(localize): fix angular.json syntax (#38553)
In chapter internationalization (i18n) at section "Deploy multiple locales" the syntax for angular.json is wrong.
This commit fixes the angular.json, when specifying the translation file and the baseHref for a locale.

PR Close #38553
2020-08-24 09:25:35 -07:00
Keen Yee Liau 4985267211 test(language-service): [Ivy] return cursor position in overwritten template (#38552)
In many testing scenarios, there is a common pattern:

1. Overwrite template (inline or external)
2. Find cursor position
3. Call one of language service APIs
4. Inspect spans in result

In order to faciliate this pattern, this commit refactors
`MockHost.overwrite()` and `MockHost.overwriteInlineTemplate()` to
allow a faux cursor symbol `¦` to be injected into the template, and
the methods will automatically remove it before updating the script snapshot.
Both methods will return the cursor position and the new text without
the cursor symbol.

This makes testing very convenient. Here's a typical example:

```ts
const {position, text} = mockHost.overwrite('template.html', `{{ ti¦tle }}`);
const quickInfo = ngLS.getQuickInfoAtPosition('template.html', position);
const {start, length} = quickInfo!.textSpan;
expect(text.substring(start, start + length)).toBe('title');
```

PR Close #38552
2020-08-24 09:25:04 -07:00
Keen Yee Liau b48cc6ead5 feat(language-service): introduce hybrid visitor to locate AST node (#38540)
This commit introduces two visitors, one for Template AST and the other
for Expression AST to allow us to easily find the node that most closely
corresponds to a given cursor position.

This is crucial because many language service APIs take in a `position`
parameter, and the information returned depends on how well we can find
a good candidate node.

In View Engine implementation of language service, the search for the node
and the processing of information to return the result are strongly coupled.
This makes the code hard to understand and hard to debug because the stack
trace is often littered with layers of visitor calls.

With this new feature, we could test the "searching" part separately and
colocate all the logic (aka hacks) that's required to retrieve an accurate
span for a given node.

Right now, only the most "narrow" node is returned by the main exported
function `findNodeAtPosition`. If needed, we could expose the entire AST
path, or expose other methods to provide more context for a node.

Note that due to limitations in the template AST interface, there are
a few known cases where microsyntax spans are not recorded properly.
This will be dealt with in a follow-up PR.

PR Close #38540
2020-08-24 09:24:18 -07:00
JoostK 874792dc43 feat(compiler): support unary operators for more accurate type checking (#37918)
Prior to this change, the unary + and - operators would be parsed as `x - 0`
and `0 - x` respectively. The runtime semantics of these expressions are
equivalent, however they may introduce inaccurate template type checking
errors as the literal type is lost, for example:

```ts
@Component({
  template: `<button [disabled]="isAdjacent(-1)"></button>`
})
export class Example {
  isAdjacent(direction: -1 | 1): boolean { return false; }
}
```

would incorrectly report a type-check error:

> error TS2345: Argument of type 'number' is not assignable to parameter
  of type '-1 | 1'.

Additionally, the translated expression for the unary + operator would be
considered as arithmetic expression with an incompatible left-hand side:

> error TS2362: The left-hand side of an arithmetic operation must be of
  type 'any', 'number', 'bigint' or an enum type.

To resolve this issues, the implicit transformation should be avoided.
This commit adds a new unary AST node to represent these expressions,
allowing for more accurate type-checking.

Fixes #20845
Fixes #36178

PR Close #37918
2020-08-21 12:25:53 -07:00
crisbeto e7da4040d6 fix(compiler-cli): adding references to const enums in runtime code (#38542)
We had a couple of places where we were assuming that if a particular
symbol has a value, then it will exist at runtime. This is true in most cases,
but it breaks down for `const` enums.

Fixes #38513.

PR Close #38542
2020-08-21 12:23:21 -07:00