Commit Graph

15240 Commits

Author SHA1 Message Date
Paul Gschwendtner 3af99a7b4a refactor(core): wire up missing-injectable migration for ng-update (#32349)
Initially the `missing-injectable` migration was only being used
in google3. Wiring the migration up in the CLI migrations was
planned to be done in a follow-up.

PR Close #32349
2019-08-29 12:34:43 -07:00
Paul Gschwendtner b4d3468088 build: update ibazel to version that supports windows (#32390)
The `bazel-watcher` (also known as `ibazel`) currently does not work on windows. This
is because all versions before `v0.10.0` did not have official windows support. This
commit updates `ibazel` to the latest version which also comes with windows support.

PR Close #32390
2019-08-29 12:34:09 -07:00
Keen Yee Liau 266c267b62 test: export TableModule in benchmarks (#32404)
This fixes the error in g3:

```
error TS100: Cannot determine the module for class LargeTableComponent in
modules/benchmarks/src/largetable/render3/table.ts!
Add LargeTableComponent to the NgModule to fix it.
```

PR Close #32404
2019-08-29 12:33:42 -07:00
Pete Bacon Darwin d5101dff3b fix(ivy): ngcc - improve the "ngcc version changed" error message (#32396)
If a project has nested projects that contain node_modules folders
that get processed by ngcc, it can be confusing when the ngcc
version changes since the error message is very generic:

```
The ngcc compiler has changed since the last ngcc build.
Please completely remove `node_modules` and try again.
```

This commit augments the error message with the path of
the entry-point that failed so that it is more obvious which
node_modules folder to remove.

BREAKING CHANGE:

This commit removes the public export of `hasBeenProcessed()`.

This was exported to be availble to the CLI integration but was never
used. The change to the function signature is a breaking change in itself
so we remove the function altogether to simplify and lower the public
API surface going forward.

PR Close #32396
2019-08-29 12:32:54 -07:00
Paul Gschwendtner 63dff9c888 ci: temporarily disable chrome mobile tests on android (#32403)
Temporarily disables saucelabs tests for Chrome Mobile on
android devices. This is because the browsers constantly do not
capture in Karma due to some connectivity issue where the
browsers are not able to load the karma page.

PR Close #32403
2019-08-29 12:29:53 -07:00
Kara Erickson 7742a99cee ci: update size benchmarks for core with 9.0.0-next.4 (#32255)
PR Close #32255
2019-08-28 21:39:24 -07:00
Pawel Kozlowski 5635505f2e refactor(ivy): remove unused ɵɵtextBinding instruction (#32345)
PR Close #32345
2019-08-28 21:37:15 -07:00
George Kalpakas cc288aec3d docs(platform-browser): remove redundant JSDoc tag from `BROWSER_SANITIZATION_PROVIDERS__POST_R3__` (#32314)
The JSDoc tag was introduced in #31934 and was not intentional according
to [this discussion on Slack][1].

[1]: https://angular-team.slack.com/archives/CHB51S90D/p1566322373094100?thread_ts=1566292123.093500&cid=CHB51S90D

PR Close #32314
2019-08-28 21:34:42 -07:00
Keen Yee Liau 2d96576a10 test: make largetable test work in g3 (#32275)
This PR modifies the `largetable` render3 (ivy) 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 #32275
2019-08-28 21:33:55 -07:00
Keen Yee Liau a9864471a4 test: make tree test work in g3 (#32274)
This PR modifies the tree render3 (ivy) test so that it works in g3.
Namely, the index.ts must be named index_aot.ts and scripts should be
loaded via ts_devserver and not as an explicit script tag in the HTML.

PR Close #32274
2019-08-28 21:32:59 -07:00
ayazhafiz 47a4edb817 refactor(language-service): rename `host` to `tsLsHost` (#32346)
Disambiguate the name of the Language Service Host used in constructing
a TypeScript Language Service Host by renaming the `host` property to
`tsLsHost`.

PR Close #32346
2019-08-28 21:27:15 -07:00
Carlos Ortiz García 3aba7ebe6a feat(core): Introduce TestBed.inject to replace TestBed.get (#32200)
TestBed.get is not type safe, fixing it would be a massive breaking
change. The Angular team has proposed replacing it with TestBed.inject
and deprecate TestBed.get.

Deprecation from TestBed.get will come as a separate commit.

Issue #26491
Fixes #29905

BREAKING CHANGE: Injector.get now accepts abstract classes to return
type-safe values. Previous implementation returned `any` through the
deprecated implementation.

PR Close #32200
2019-08-28 21:26:46 -07:00
Keen Yee Liau 2b28b91fd9 ci: Add ANGULAR_PACKAGE to snapshot builds (#31900)
Ivy snapshots no longer contain metadata.json which breaks the detection logic for
Angular Package Format (APF) in npm/yarn install.
This PR adds ANGULAR_PACAKGE as a magic file to denote APF.
See https://github.com/bazelbuild/rules_nodejs/issues/927

PR Close #31900
2019-08-28 21:25:56 -07:00
Keen Yee Liau 18ce58c2bc refactor(language-service): cleanup tests for Hover (#32378)
Move generic test methods to `MockTypescriptHost` so they could be
shared across all tests.

This is in preparation for adding more tests to Hover when new features
get added.

PR Close #32378
2019-08-28 17:25:07 -07:00
Keen Yee Liau 852afb312a fix(language-service): Create DirectiveKind enum (#32376)
Hovering over a selector, the QuickInfo display string is something
like:
```
(component) AppComponent
```
where `component` is the symbol kind.
Prior to this, there was no types to indicate the possible values of a
symbol. This PR creates an enum to represent that.

PR Close #32376
2019-08-28 17:23:53 -07:00
Pawel Kozlowski d4703d9316 refactor(ivy): remove global state access from inputs-related functions (#32370)
PR Close #32370
2019-08-28 17:23:23 -07:00
Pawel Kozlowski 1bb9ce5d8c refactor(ivy): remove superflous argument to the createTNodeAtIndex function (#32370)
PR Close #32370
2019-08-28 17:23:23 -07:00
Keen Yee Liau 97fc45f32a fix(language-service): Invalidate Reflector caches when program changes (#32357)
This commit fixes a bug introduced in the recent refactoring whereby
caches become stale when the program changes.
This is because StaticReflector keeps its own caches that are not
clearable. The previous refactoring tried to reuse the same instance,
leading to out-of-sync program state.

Clearing out the *entire* cache is very inefficient. Instead, we could
just invalidate the symbols in the files that have changed. This
requires changes to the API of StaticReflector, but put this on hold
until the refactoring of language service for Ivy commences.

PR closes https://github.com/angular/angular/issues/32301

PR Close #32357
2019-08-28 17:22:50 -07:00
Joey Perrott 4b1251106e build: bump yarn requirement to 1.17.3 (#32344)
PR Close #32344
2019-08-28 17:13:05 -07:00
Pawel Kozlowski a1e91b00d2 perf(ivy): remove renderStringify calls for text nodes creation (#32342)
Values passed to the `ɵɵtext` instruction are strings (or undefined)
in the generated code so no need to stringify those again.

PR Close #32342
2019-08-28 17:12:38 -07:00
Pawel Kozlowski fac066ea9f perf(ivy): run registerPostOrderHooks in the first template pass only (#32342)
PR Close #32342
2019-08-28 17:12:38 -07:00
Pawel Kozlowski 85864ed9f7 perf(ivy): add element and text creation benchmark (#32342)
PR Close #32342
2019-08-28 17:12:38 -07:00
Pawel Kozlowski 581b837e88 perf(ivy): remove repeated memory read / write in addComponentLogic (#32339)
PR Close #32339
2019-08-28 17:12:02 -07:00
Paul Gschwendtner 60a056d5dc refactor(core): undecorated classes migration should not decorate classes if not needed (#32319)
Currently the undecorated classes migration decorates base classes if no
explicit constructor is defined on all classes in the inheritance chain.

We only want to decorate base classes which define a constructor that is
inherited. Additionally for best practice, all classes in between the class
that inherits the constructor and the one that defines it are also decorated.

PR Close #32319
2019-08-28 17:11:36 -07:00
Paul Gschwendtner 543631f2b3 refactor(core): undecorated-classes migration should properly construct object literal from metadata (#32319)
The `undecorated-classes-with-di` migration currently creates invalid object literals from parsed
NGC metadata files if there are object literal properties with keys that contain special characters.

e.g. consider a decorated base class with a host binding using `[class.X]`. Currently the migration
parses and converts the metadata to TypeScript code but incorrectly uses `[class.X]` unquoted as
identifier.

PR Close #32319
2019-08-28 17:11:36 -07:00
Paul Gschwendtner d0f3539e6e test(core): cleanup bazel target names for schematic tests (#32318)
Apparently the names of the bazel test targets in the schematics are
incorrect. This commit updates the target names to match their bazel
package name.

PR Close #32318
2019-08-28 17:11:04 -07:00
Paul Gschwendtner e5636a322c refactor(core): undecorated-classes-with-di migration should never use ngtsc (#32318)
ec4381dd40 enabled Ivy by default. This is
problematic as migrations like `undecorated-classes-with-di` depend on the
`AngularCompilerProgram` (NGC) in order to perform the migration from
version 8 to version 9. In order to ensure that the migration always runs
with NGC (and doesn't get the `NgtscProgram`), we need to explicitly disable
ivy when creating the `@angular/compiler-cli` program for the migration.

PR Close #32318
2019-08-28 17:11:04 -07:00
Kara Erickson b094936d72 refactor(core): remove more misc unused utilities from DomAdapters (#32291)
PR Close #32291
2019-08-28 17:10:30 -07:00
Kara Erickson f3e4cb491e refactor(core): remove testing-only event utilities from DomAdapters (#32291)
PR Close #32291
2019-08-28 17:10:30 -07:00
Kara Erickson cb5701f8d9 refactor(core): remove testing-only node getters and invoke() from DomAdapters (#32291)
PR Close #32291
2019-08-28 17:10:30 -07:00
Kara Erickson c0680602f9 refactor(core): remove testing-only childNodes() and firstChild() fns from DomAdapters (#32291)
PR Close #32291
2019-08-28 17:10:30 -07:00
Kara Erickson 30dabdf8fc refactor(core): remove testing-only DOM manipulation utils from DomAdapters (#32291)
PR Close #32291
2019-08-28 17:10:30 -07:00
Kara Erickson ede5786d1e refactor(core): remove testing-only style utils from DomAdapters (#32291)
PR Close #32291
2019-08-28 17:10:29 -07:00
ayazhafiz 46caf88b2c feat(language-service): add definitions for templateUrl (#32238)
Adds support for `getDefinitionAt` when called on a templateUrl
property assignment.

The currrent architecture for getting definitions is designed to be
called on templates, so we have to introduce a new
`getTsDefinitionAndBoundSpan` method to get Angular-specific definitions
in TypeScript files and pass a `readTemplate` closure that will read the
contents of a template using `TypeScriptServiceHost#getTemplates`. We
can probably go in and make this nicer in a future PR, though I'm not
sure what the best architecture should be yet.

Part of angular/vscode-ng-language-service#111

PR Close #32238
2019-08-28 17:09:46 -07:00
atscott 98420c27de release: cut the v9.0.0-next.4 release 2019-08-28 12:06:45 -07:00
Andrew Scott a8131365c5 docs: release notes for the v8.2.4 release 2019-08-28 12:00:17 -07:00
George Kalpakas 3e52e32dce build(docs-infra): add empty `codeGenApi` JSDoc tag definition (#32207)
This avoids warning such as the following ([example][1]):

```
warn: Invalid tags found -
  doc "platform-browser/ɵBROWSER_SANITIZATION_PROVIDERS__POST_R3__" (const)
  from file "platform-browser/src/browser.ts"
```

[1]: https://circleci.com/gh/angular/angular/427064

PR Close #32207
2019-08-28 09:41:21 -07:00
Amadou Sall 0a09fb1432 docs: fix a minor typo in the HTTP guide (#32359)
"of typed" should be "of type"
PR Close #32359
2019-08-28 09:40:09 -07:00
Judy Bogart 2f6062f632 docs: fix callout header (#32325)
PR Close #32325
2019-08-28 09:06:07 -07:00
George Kalpakas 066b281979 docs(docs-infra): add note about setting up examples on Windows (#32355)
Closes #32321

PR Close #32355
2019-08-28 09:04:39 -07:00
George Kalpakas 125ef0a0ec build(docs-infra): upgrade cli command docs sources to 0d56c1f5f (#32367)
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](59722208a...0d56c1f5f):

**Modified**
- help/update.json

##

PR Close #32367
2019-08-28 09:04:02 -07:00
George Kalpakas 65aaffcfe4 docs(service-worker): add example app for `SwPush` API docs (#32139)
Previously, the `SwPush` API docs were using hard-coded code snippets.

This commit switches to using code snippets from an actual example app,
which ensures that the code shown in the docs will at least continue to
compile successfully.

PR Close #32139
2019-08-27 16:18:53 -07:00
Judy Bogart ac11a0be15 docs: add push notification usage to api doc (#32139)
PR Close #32139
2019-08-27 16:18:53 -07:00
Judy Bogart e3f42818e9 docs: add detail to router event doc (#32140)
PR Close #32140
2019-08-27 16:17:06 -07:00
Judy Bogart ef2047555a docs: clean up formats in template syntax guide (#32197)
PR Close #32197
2019-08-27 16:14:24 -07:00
Jordan Nelson d953c1cee3 docs: update marketing resources.json with ExtAngular (#32126)
PR Close #32126
2019-08-27 16:12:31 -07:00
Ankit Prajapati 7c7fcd7ab8 docs: change lite-server baseDir path to output folder (#32164)
In lite-server baseDir, path should be the output folder path, So need to change `baseDir="dist"` to `baseDir="dist/project-name"`

PR Close #32164
2019-08-27 15:53:37 -07:00
Kristiyan Kostadinov c885178d5f refactor(ivy): move directive, component and pipe factories to ngFactoryFn (#31953)
Reworks the compiler to output the factories for directives, components and pipes under a new static field called `ngFactoryFn`, instead of the usual `factory` property in their respective defs. This should eventually allow us to inject any kind of decorated class (e.g. a pipe).

**Note:** these changes are the first part of the refactor and they don't include injectables. I decided to leave injectables for a follow-up PR, because there's some more cases we need to handle when it comes to their factories. Furthermore, directives, components and pipes make up most of the compiler output tests that need to be refactored and it'll make follow-up PRs easier to review if the tests are cleaned up now.

This is part of the larger refactor for FW-1468.

PR Close #31953
2019-08-27 13:57:00 -07:00
Andrew Scott 14feb56139 fix(ivy): debug node names should match user declaration (#32328)
PR Close #32328
2019-08-27 13:55:59 -07:00
ayazhafiz f209aacbfa docs(language-service): update integration test information (#32269)
The documentation for the langauge service plugin integration test
appears to be stale. Remove section about new versions of TypeScript,
which appear not to be tested, and update the information about
generating and updating goldens to reflect the new way of doing so.
Add information about install deps in the repo root, this directory, and
building Angular before testing.

Also remove trailing whitespace on one line.

PR Close #32269
2019-08-27 09:08:41 -07:00