Compare commits
309 Commits
zone.js-0.
...
8.0.2
Author | SHA1 | Date | |
---|---|---|---|
a73b8a62c8 | |||
2fe8f2b1e0 | |||
f1c08c6918 | |||
bf9de8ca53 | |||
df37c47ac5 | |||
788d19c036 | |||
8492499fe7 | |||
48174010a1 | |||
1460e46ba1 | |||
a7ff7d8d27 | |||
eb970b4626 | |||
18d301258a | |||
6a01fa532c | |||
e190a7e9de | |||
53c6425954 | |||
c198dc6c19 | |||
d1b26dd3a1 | |||
ce7131f3fb | |||
934702892e | |||
8a830a72e2 | |||
2abb54c4a1 | |||
44632bb700 | |||
e33b382ab4 | |||
c4da400db4 | |||
c40e6b2edc | |||
978fc27314 | |||
b9f2bbb7d1 | |||
9654d646ae | |||
7f214499e8 | |||
a3d55a9d27 | |||
e222b8761e | |||
1435c0b3a9 | |||
0a7aebbcf5 | |||
bd7f91feac | |||
3bbc89b958 | |||
52d98e563d | |||
b279f8bd62 | |||
954e34cc91 | |||
e1f6d15387 | |||
cbb3794931 | |||
77a5790a9d | |||
4ca401c394 | |||
3dcd5ebdbc | |||
49307f0595 | |||
762fc28fee | |||
338e58c278 | |||
7e2ed89208 | |||
56a3dcf44c | |||
501bacdcf6 | |||
c5f2979a87 | |||
fe02462b5f | |||
3000d19ad1 | |||
dcf9f05c9a | |||
ba56f3c15b | |||
865ad56e9a | |||
5cda2a041b | |||
6a484853a9 | |||
e6ac289518 | |||
4e8614bb92 | |||
9ace748d3a | |||
08c38a1f99 | |||
9aeef0afdb | |||
8aef446373 | |||
f7ee91a17c | |||
8ae0afd3f8 | |||
be82270493 | |||
4cef2c1236 | |||
26e3615e19 | |||
65f20107fe | |||
5a7bcd1862 | |||
152ea36c80 | |||
ea2adb104b | |||
19caace2ab | |||
ccc1c27461 | |||
97268b95f7 | |||
7c41abe64a | |||
991e138650 | |||
d00b421402 | |||
06ffed5141 | |||
5a15126520 | |||
9e4b2f1a4f | |||
393529d3b5 | |||
81b75590d7 | |||
151f0f4b2c | |||
f88f941008 | |||
0e17958640 | |||
e82b45c8a7 | |||
8422ef2a93 | |||
cdf586d0d2 | |||
3828c89792 | |||
0f352b6350 | |||
06bdecffb9 | |||
99ddec152b | |||
31aba96fcb | |||
facce2c9fd | |||
edaf058548 | |||
4bff2d0c8c | |||
cfc608aaf3 | |||
6d9f5fcddb | |||
b19a05c25a | |||
bd75b3b7b3 | |||
1c67b9063b | |||
9a9ae60e0e | |||
ae6fa9260a | |||
f8fa2f2a6c | |||
f3ee9a6144 | |||
d076c51455 | |||
38a7e2a775 | |||
c61c14a127 | |||
652b0959a8 | |||
002fbddcf1 | |||
4761d40a41 | |||
608e0f0d67 | |||
45718b3b21 | |||
b5756bcc39 | |||
60f0462049 | |||
9fd22959d3 | |||
d5dd907396 | |||
5a6bf7de0e | |||
d135bb5e6e | |||
8b9a3e49f2 | |||
44e55fe2e4 | |||
063cc308b6 | |||
c567135dd5 | |||
361f181c8c | |||
b40844523b | |||
c8af830ec8 | |||
e2c9ddb33e | |||
04196ec2d0 | |||
7323072c5c | |||
f0c5400cab | |||
3f2f937c9f | |||
256fe2421a | |||
e6f27bcb0c | |||
8abcf04a5e | |||
bf38df4eb9 | |||
79a025306a | |||
62c936aa49 | |||
77e1b34d91 | |||
26cb128b3c | |||
fdbe07982a | |||
c0e3209915 | |||
70880f0cea | |||
221a5ba634 | |||
68b08cf782 | |||
10560a0872 | |||
561e01ddfd | |||
d1345c78f0 | |||
276f9067c8 | |||
0e90a4263b | |||
e4cc1398aa | |||
8d1f993ceb | |||
df1ab49893 | |||
df03fec8a6 | |||
c01cae22e1 | |||
5a46f94987 | |||
5716605d52 | |||
8043e3131c | |||
54f7245081 | |||
5de24b6dfe | |||
4dc4d7f30a | |||
fcea1a3c22 | |||
8bc4da8665 | |||
a5a2d525ae | |||
4690dcecac | |||
722b2fa6ed | |||
124d1abf19 | |||
736d3ef820 | |||
9b0ad347e1 | |||
d2598ace0a | |||
4a25e4cf95 | |||
3f67bf208d | |||
d85476fd8c | |||
9763edf829 | |||
b6ae54c547 | |||
3de26a84ff | |||
8022d3691b | |||
581336a918 | |||
effc58086c | |||
766615c8a1 | |||
ede4246663 | |||
bb8a6abbf2 | |||
32daa930d0 | |||
b6aa99d3a7 | |||
e10b213784 | |||
a67cf99b0c | |||
04d04fd147 | |||
17361d2b2c | |||
9b88920aa9 | |||
b12e76d1d3 | |||
af001a8cbd | |||
db64b014f8 | |||
7e34975bb0 | |||
0fa48e8c00 | |||
fde3f467e2 | |||
7b378a6920 | |||
3136d9ff2e | |||
325e6cf557 | |||
381d7c4e44 | |||
1b6f3c1ead | |||
c38349127c | |||
a4817729a2 | |||
61c343e3eb | |||
24e6c1e80d | |||
42fc5c9b33 | |||
33e7b285ca | |||
74afdc37da | |||
3c1ffba0ad | |||
14c0017db8 | |||
4878f4890b | |||
b7edef0cd3 | |||
39fa937ab9 | |||
2977829c67 | |||
dbe845e048 | |||
e562acc884 | |||
e295c6a0ae | |||
10b43355f8 | |||
d4e7587bd8 | |||
cabe03cf6d | |||
0cefa9e342 | |||
e073daa48e | |||
994d48a96e | |||
806f8118c8 | |||
dd299f9eb2 | |||
49ec3f312c | |||
71eba450e6 | |||
192f108b0f | |||
dd8651db73 | |||
5bbbe3f684 | |||
a71d8a837b | |||
e8ceae14e1 | |||
c3246e6f16 | |||
685753361e | |||
6b07711f96 | |||
12fb639b7d | |||
644925fd0c | |||
bcc72b0924 | |||
e1091b2ba8 | |||
08841e31d9 | |||
d1fcc2bc13 | |||
fac00442d2 | |||
b8cbcbcf49 | |||
1ed45bd783 | |||
82fd1920b1 | |||
f6d7271ec7 | |||
c1f3faf1df | |||
97202278f9 | |||
132f01c5ca | |||
6a987f1b9c | |||
548b003ed3 | |||
48dc41de01 | |||
817c2b49bc | |||
fed07c735c | |||
390cac6874 | |||
8eb0b8bd40 | |||
d7283c6085 | |||
3fe3a84a4b | |||
28e4187bd6 | |||
7cbc69c890 | |||
1dc134bc6b | |||
6a61d37f95 | |||
8d2e92bcfe | |||
5038f5c909 | |||
6eeca70043 | |||
9f68c35fa9 | |||
21418ea109 | |||
02d8b4ed3c | |||
6748392edc | |||
d9fd301157 | |||
71c5d80ce7 | |||
9798229fde | |||
4b2fcfd5dc | |||
b4d291aa7a | |||
b0ecafdc2f | |||
6816bb62d7 | |||
4b05b8cea0 | |||
a0728aedf7 | |||
ea96f6112a | |||
b706800ea8 | |||
c6f95b1d70 | |||
d896126604 | |||
a20da5ddcc | |||
18878600ba | |||
d7e10f3f7e | |||
4d044ea5b2 | |||
e2d1e0cd98 | |||
4e056580bb | |||
e4c2e6a904 | |||
a50989832d | |||
525307b6a3 | |||
a3ab76b216 | |||
f2265d4b46 | |||
d3ac709b99 | |||
908d43a5bb | |||
71cdb0a08e | |||
c7fbbdfa99 | |||
10e4ab7712 | |||
5114c23c21 | |||
c3e585d7eb | |||
0776daec88 | |||
615e1a58b2 | |||
606758357e | |||
ba2a3595c6 | |||
a50bfe5054 | |||
c8983bc367 | |||
8d6d2c6704 | |||
6711f22e62 | |||
8dd9192fe3 | |||
870e0dab48 |
13
.bazelrc
13
.bazelrc
@ -142,6 +142,10 @@ build:remote --remote_instance_name=projects/internal-200822/instances/default_i
|
||||
# We need to understand the security risks of using prior build artifacts.
|
||||
build:remote --remote_accept_cached=false
|
||||
|
||||
# Load any settings specific to the current user. Needs to be last statement in this
|
||||
# config, as the user configuration should be able to overwrite flags from this file.
|
||||
try-import .bazelrc.user
|
||||
|
||||
###############################
|
||||
# NodeJS rules settings
|
||||
# These settings are required for rules_nodejs
|
||||
@ -150,12 +154,3 @@ build:remote --remote_accept_cached=false
|
||||
# Turn on managed directories feature in Bazel
|
||||
# This allows us to avoid installing a second copy of node_modules
|
||||
common --experimental_allow_incremental_repository_updates
|
||||
|
||||
####################################################
|
||||
# User bazel configuration
|
||||
# NOTE: This needs to be the *last* entry in the config.
|
||||
####################################################
|
||||
|
||||
# Load any settings which are specific to the current user. Needs to be *last* statement
|
||||
# in this config, as the user configuration should be able to overwrite flags from this file.
|
||||
try-import .bazelrc.user
|
||||
|
42
.buildkite/Dockerfile
Normal file
42
.buildkite/Dockerfile
Normal file
@ -0,0 +1,42 @@
|
||||
# Heavily based on https://github.com/StefanScherer/dockerfiles-windows/ images.
|
||||
# Combines the node windowsservercore image with the Bazel Prerequisites (https://docs.bazel.build/versions/master/install-windows.html).
|
||||
# msys install taken from https://github.com/StefanScherer/dockerfiles-windows/issues/30
|
||||
# VS redist install taken from https://github.com/StefanScherer/dockerfiles-windows/blob/master/apache/Dockerfile
|
||||
# The nanoserver image won't work because MSYS2 does not run in it https://github.com/Alexpux/MSYS2-packages/issues/1493
|
||||
|
||||
# Before building this image, you must locally build node-windows:10.13.0-windowsservercore-1803.
|
||||
# Clone https://github.com/StefanScherer/dockerfiles-windows/commit/4ce7101a766b9b880ac262479dd9126b64d656cf and build using
|
||||
# docker build -t node-windows:10.13.0-windowsservercore-1803 --build-arg core=microsoft/windowsservercore:1803 --build-arg target=microsoft/windowsservercore:1803 .
|
||||
FROM node-windows:10.13.0-windowsservercore-1803
|
||||
|
||||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
|
||||
|
||||
# Install 7zip to extract msys2
|
||||
RUN Invoke-WebRequest -UseBasicParsing 'https://www.7-zip.org/a/7z1805-x64.exe' -OutFile 7z.exe
|
||||
# For some reason the last letter in the destination directory is lost. So '/D=C:\\7zip0' will extract to '/D=C:\\7zip'.
|
||||
RUN Start-Process -FilePath 'C:\\7z.exe' -ArgumentList '/S', '/D=C:\\7zip0' -NoNewWindow -Wait
|
||||
|
||||
# Extract msys2
|
||||
RUN Invoke-WebRequest -UseBasicParsing 'http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20180531.tar.xz' -OutFile msys2.tar.xz
|
||||
RUN Start-Process -FilePath 'C:\\7zip\\7z' -ArgumentList 'e', 'msys2.tar.xz' -Wait
|
||||
RUN Start-Process -FilePath 'C:\\7zip\\7z' -ArgumentList 'x', 'msys2.tar', '-oC:\\' -Wait
|
||||
RUN Remove-Item msys2.tar.xz
|
||||
RUN Remove-Item msys2.tar
|
||||
RUN Remove-Item 7z.exe
|
||||
RUN Remove-Item -Recurse 7zip
|
||||
|
||||
# Add MSYS2 to PATH, and set BAZEL_SH
|
||||
RUN [Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\msys64\usr\bin', [System.EnvironmentVariableTarget]::Machine)
|
||||
RUN [Environment]::SetEnvironmentVariable('BAZEL_SH', 'C:\msys64\usr\bin\bash.exe', [System.EnvironmentVariableTarget]::Machine)
|
||||
|
||||
# Install Microsoft Visual C++ Redistributable for Visual Studio 2015
|
||||
RUN Invoke-WebRequest -UseBasicParsing 'https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe' -OutFile vc_redist.x64.exe
|
||||
RUN Start-Process 'c:\\vc_redist.x64.exe' -ArgumentList '/Install', '/Passive', '/NoRestart' -NoNewWindow -Wait
|
||||
RUN Remove-Item vc_redist.x64.exe
|
||||
|
||||
# Add a fix for https://github.com/docker/for-win/issues/2920 as entry point to the container.
|
||||
SHELL ["cmd", "/c"]
|
||||
COPY "fix-msys64.cmd" "C:\\fix-msys64.cmd"
|
||||
ENTRYPOINT cmd /C C:\\fix-msys64.cmd && cmd /c
|
||||
|
||||
CMD ["cmd.exe"]
|
96
.buildkite/README.md
Normal file
96
.buildkite/README.md
Normal file
@ -0,0 +1,96 @@
|
||||
# BuildKite configuration
|
||||
|
||||
This folder contains configuration for the [BuildKite](https://buildkite.com) based CI checks for
|
||||
this repository.
|
||||
|
||||
BuildKite is a CI provider that provides build coordination and reports while we provide the
|
||||
infrastructure.
|
||||
|
||||
CI runs are triggered by new PRs and will show up on the GitHub checks interface, along with the
|
||||
other current CI solutions.
|
||||
|
||||
Currently it is only used for tests on Windows platforms.
|
||||
|
||||
|
||||
## The build pipeline
|
||||
|
||||
BuildKite uses a pipeline for each repository. The `pipeline.yml` file defines pipeline
|
||||
[build steps](https://buildkite.com/docs/pipelines/defining-steps) for this repository.
|
||||
|
||||
Run results can be seen in the GitHub checks interface and in the
|
||||
[pipeline dashboard](https://buildkite.com/angular/angular).
|
||||
|
||||
Although most configuration is done via `pipeline.yml`, some options are only available
|
||||
in the online [pipeline settings](https://buildkite.com/angular/angular/settings).
|
||||
|
||||
|
||||
## Infrastructure
|
||||
|
||||
BuildKite does not provide the host machines where the builds runs, providing instead the
|
||||
[BuildKite Agent](https://buildkite.com/docs/agent/v3) that should be run our own infrastructure.
|
||||
|
||||
|
||||
### Agents
|
||||
|
||||
This agent polls the BuildKite API for builds, runs them, and reports back the results.
|
||||
Agents are the unit of concurrency: each agent can run one build at any given time.
|
||||
Adding agents allows more builds to be ran at the same time.
|
||||
|
||||
Individual agents can have tags, and pipeline steps can target only agents with certain tags via the
|
||||
`agents` field in `pipeline.yml`.
|
||||
For example: agents on Windows machines are tagged as `windows`, and the Windows specific build
|
||||
steps list `windows: true` in their `agents` field.
|
||||
|
||||
You can see the current agent pool, along with their tags, in the
|
||||
[agents list](https://buildkite.com/organizations/angular/agents).
|
||||
|
||||
|
||||
### Our host machines
|
||||
|
||||
We use [Google Cloud](https://cloud.google.com/) as our cloud provider, under the
|
||||
[Angular project](https://console.cloud.google.com/home/dashboard?project=internal-200822).
|
||||
To access this project you need need to be logged in with a Google account that's a member of
|
||||
team@angular.io.
|
||||
For googlers this may be your google.com account, for others it is an angular.io account.
|
||||
|
||||
In this project we have a number of Windows VMs running, each of them with several agents.
|
||||
The `provision-windows-buildkite.ps1` file contains instructions on how to create new host VMs that
|
||||
are fully configured to run the BuildKite agents as services.
|
||||
|
||||
Our pipeline uses [docker-buildkite-plugin](https://github.com/buildkite-plugins/docker-buildkite-plugin)
|
||||
to run build steps inside docker containers.
|
||||
This way we achieve isolation and hermeticity.
|
||||
|
||||
The `Dockerfile` file describes a custom Docker image that includes NodeJs, Yarn, and the Bazel
|
||||
pre-requisites on Windows.
|
||||
|
||||
To upload a new version of the docker image, follow any build instructions in `Dockerfile` and then
|
||||
run `docker build -t angular/node-bazel-windows:NEW_VERSION`, followed by
|
||||
`docker push angular/node-bazel-windows:NEW_VERSION`.
|
||||
After being pushed it should be available online, and you can use the new version in `pipeline.yml`.
|
||||
|
||||
|
||||
## Caretaker
|
||||
|
||||
BuildKite status can be found at https://www.buildkitestatus.com/.
|
||||
|
||||
Issues related to the BuildKite setup should be escalated to the Tools Team via the current
|
||||
caretaker, followed by Alex Eagle and Filipe Silva.
|
||||
|
||||
Support requests should be submitted via email to support@buildkite.com and cc Igor, Misko, Alex,
|
||||
Jeremy and Manu
|
||||
|
||||
|
||||
## Rollout strategy
|
||||
|
||||
At the moment our BuildKite CI uses 1 host VM running 4 agents, thus being capable of 4 concurrent
|
||||
builds.
|
||||
The only test running is `bazel test //tools/ts-api-guardian:all`, and the PR check is not
|
||||
mandatory.
|
||||
|
||||
In the future we should add cache support to speed up the initial `yarn` install, and also Bazel
|
||||
remote caching to speed up Bazel builds.
|
||||
|
||||
After the current setup is verified as stable and reliable the GitHub PR check can become mandatory.
|
||||
|
||||
The tests ran should also be expanded to cover most, if not all, of the Bazel tests.
|
6
.buildkite/fix-msys64.cmd
Normal file
6
.buildkite/fix-msys64.cmd
Normal file
@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
REM Fix for https://github.com/docker/for-win/issues/2920
|
||||
REM echo "Fixing msys64 folder..."
|
||||
REM Touch all .dll files inside C:\msys64\
|
||||
forfiles /p C:\msys64\ /s /m *.dll /c "cmd /c Copy /B @path+,, >NUL"
|
||||
REM echo "Fixed msys64 folder."
|
10
.buildkite/pipeline.yml
Normal file
10
.buildkite/pipeline.yml
Normal file
@ -0,0 +1,10 @@
|
||||
steps:
|
||||
- label: windows-test
|
||||
commands:
|
||||
- "yarn install --frozen-lockfile --non-interactive --network-timeout 100000"
|
||||
- "yarn bazel test //tools/ts-api-guardian:all --noshow_progress"
|
||||
plugins:
|
||||
- docker#v2.1.0:
|
||||
image: "filipesilva/node-bazel-windows:0.0.2"
|
||||
agents:
|
||||
windows: true
|
94
.buildkite/provision-windows-buildkite.ps1
Normal file
94
.buildkite/provision-windows-buildkite.ps1
Normal file
@ -0,0 +1,94 @@
|
||||
# PowerShell script to provision a Windows Server with BuildKite
|
||||
# This script follows https://buildkite.com/docs/agent/v3/windows.
|
||||
|
||||
# Instructions
|
||||
|
||||
# VM creation:
|
||||
# In Google Cloud Platform, create a Compute Engine instance.
|
||||
# We recommend machine type n1-standard-16 (16 vCPUs, 60 GB memory).
|
||||
# Use a recent windows boot disk with container support such as
|
||||
# "Windows Server version 1803 Datacenter Core for Containers", and add a 128GB SSD disk.
|
||||
# Give it a name, then click "Create".
|
||||
|
||||
# VM setup:
|
||||
# In the Compute Engine menu, select "VM Instances". Click on the VM name you chose before.
|
||||
# Click "Set Windows Password" to choose a username and password.
|
||||
# Click RDP to open a remote desktop via browser, using the username and password.
|
||||
# In the Windows command prompt start an elevated powershell by inputing
|
||||
# "powershell -Command "Start-Process PowerShell -Verb RunAs" followed by Enter.
|
||||
# Download and execute this script from GitHub, passing the token (mandatory), tags (optional)
|
||||
# and number of agents (optional) as args:
|
||||
# ```
|
||||
# Invoke-WebRequest -Uri https://raw.githubusercontent.com/angular/angular/master/.buildkite/provision-windows-buildkite.ps1 -OutFile provision.ps1
|
||||
# .\provision.ps1 -token "MY_TOKEN" -tags "windows=true,another_tag=true" -agents 4
|
||||
# ```
|
||||
# The VM should restart and be fully configured.
|
||||
|
||||
# Creating extra VMs
|
||||
# You can create an image of the current VM by following the instructions below.
|
||||
# https://cloud.google.com/compute/docs/instances/windows/creating-windows-os-image
|
||||
# Then create a new VM and choose "Custom images".
|
||||
|
||||
|
||||
# Script proper.
|
||||
|
||||
# Get the token and tags from arguments.
|
||||
param (
|
||||
[Parameter(Mandatory=$true)][string]$token,
|
||||
[string]$tags = "",
|
||||
[Int]$agents = 1
|
||||
)
|
||||
|
||||
# Allow HTTPS
|
||||
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
|
||||
|
||||
# Helper to add to PATH.
|
||||
# Will take current PATH so avoid running it after anything to modifies only the powershell session path.
|
||||
function Add-Path ([string]$newPathItem) {
|
||||
$Env:Path+= ";" + $newPathItem + ";"
|
||||
[Environment]::SetEnvironmentVariable("Path",$env:Path, [System.EnvironmentVariableTarget]::Machine)
|
||||
}
|
||||
|
||||
# Install Git for Windows
|
||||
Write-Host "Installing Git for Windows."
|
||||
Invoke-WebRequest -Uri https://github.com/git-for-windows/git/releases/download/v2.19.1.windows.1/Git-2.19.1-64-bit.exe -OutFile git.exe
|
||||
.\git.exe /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS="icons,ext\reg\shellhere,assoc,assoc_sh" /DIR="C:\git"
|
||||
Add-Path "C:\git\bin"
|
||||
# Sleep for 15s while git is installed. Trying to remove the git.exe before it finishes install causes an error.
|
||||
Start-Sleep -s 15
|
||||
Remove-Item git.exe
|
||||
|
||||
# Download NSSM (https://nssm.cc/) to run the BuildKite agent as a service.
|
||||
Write-Host "Downloading NSSM."
|
||||
Invoke-WebRequest -Uri https://nssm.cc/ci/nssm-2.24-101-g897c7ad.zip -OutFile nssm.zip
|
||||
Expand-Archive -Path nssm.zip -DestinationPath C:\nssm
|
||||
Add-Path "C:\nssm\nssm-2.24-101-g897c7ad\win64"
|
||||
Remove-Item nssm.zip
|
||||
|
||||
# Run the BuildKite agent install script
|
||||
Write-Host "Installing BuildKite agent."
|
||||
$env:buildkiteAgentToken = $token
|
||||
$env:buildkiteAgentTags = $tags
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/buildkite/agent/master/install.ps1'))
|
||||
|
||||
# Configure the BuildKite agent clone and timestamp behavior
|
||||
Add-Content C:\buildkite-agent\buildkite-agent.cfg "`ngit-clone-flags=--config core.autocrlf=input --config core.eol=lf --config core.longpaths=true --config core.symlinks=true`n"
|
||||
Add-Content C:\buildkite-agent\buildkite-agent.cfg "`ntimestamp-lines=true`n"
|
||||
|
||||
# Register the BuildKite agent service using NSSM, so that it persists through restarts and is
|
||||
# restarted if the process dies.
|
||||
for ($i=1; $i -le $agents; $i++)
|
||||
{
|
||||
$agentName = "buildkite-agent-$i"
|
||||
Write-Host "Registering $agentName as a service."
|
||||
nssm.exe install $agentName "C:\buildkite-agent\bin\buildkite-agent.exe" "start"
|
||||
nssm.exe set $agentName AppStdout "C:\buildkite-agent\$agentName.log"
|
||||
nssm.exe set $agentName AppStderr "C:\buildkite-agent\$agentName.log"
|
||||
nssm.exe status $agentName
|
||||
nssm.exe start $agentName
|
||||
nssm.exe status $agentName
|
||||
}
|
||||
|
||||
# Restart the machine.
|
||||
Restart-Computer
|
@ -175,13 +175,6 @@ jobs:
|
||||
# Setup remote execution and run RBE-compatible tests.
|
||||
- *setup_bazel_remote_execution
|
||||
- run: yarn bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only
|
||||
- run: mkdir ~/testlogs
|
||||
- run: cp -Lr dist/testlogs/* ~/testlogs
|
||||
- store_test_results:
|
||||
# Bazel always writes test.xml files under this directory
|
||||
path: ~/testlogs
|
||||
- store_artifacts:
|
||||
path: ~/testlogs
|
||||
|
||||
# Temporary job to test what will happen when we flip the Ivy flag to true
|
||||
test_ivy_aot:
|
||||
@ -300,7 +293,8 @@ jobs:
|
||||
# Run PWA-score tests
|
||||
- run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
|
||||
# Check the bundle sizes.
|
||||
- run: yarn --cwd aio payload-size aio-local
|
||||
# Temporary disabled due to a problem with patch branch (8.0.x)
|
||||
# - run: yarn --cwd aio payload-size aio-local
|
||||
|
||||
test_aio_local_ivy:
|
||||
<<: *job_defaults
|
||||
@ -319,7 +313,8 @@ jobs:
|
||||
# Run PWA-score tests
|
||||
- run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
|
||||
# Check the bundle sizes.
|
||||
- run: yarn --cwd aio payload-size aio-local-ivy
|
||||
# Temporary disabled due to a problem with patch branch (8.0.x)
|
||||
# - run: yarn --cwd aio payload-size aio-local-ivy
|
||||
|
||||
test_aio_tools:
|
||||
<<: *job_defaults
|
||||
@ -374,7 +369,7 @@ jobs:
|
||||
# Run examples tests with ivy. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
|
||||
# Since the parallelism is set to "3", there will be three parallel CircleCI containers
|
||||
# with either "0", "1" or "2" as node index. This can be passed to the "--shard" argument.
|
||||
- run: yarn --cwd aio example-e2e --setup --local --ivy --cliSpecsConcurrency=5 --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL}
|
||||
- run: yarn --cwd aio example-e2e --setup --local --ivy --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL}
|
||||
|
||||
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
|
||||
aio_preview:
|
||||
@ -641,17 +636,6 @@ jobs:
|
||||
name: "Running Material unit tests"
|
||||
command: ./scripts/ci/run_angular_material_unit_tests.sh
|
||||
|
||||
test_zonejs:
|
||||
<<: *job_defaults
|
||||
steps:
|
||||
- *attach_workspace
|
||||
- *init_environment
|
||||
# Install
|
||||
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
|
||||
# Run zone.js tools tests
|
||||
- run: yarn --cwd packages/zone.js promisetest
|
||||
- run: yarn --cwd packages/zone.js promisefinallytest
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
default_workflow:
|
||||
@ -736,9 +720,6 @@ workflows:
|
||||
- material-unit-tests:
|
||||
requires:
|
||||
- build-ivy-npm-packages
|
||||
- test_zonejs:
|
||||
requires:
|
||||
- setup
|
||||
|
||||
saucelabs_tests:
|
||||
jobs:
|
||||
|
@ -1,5 +1,3 @@
|
||||
# escape=`
|
||||
|
||||
ARG core=mcr.microsoft.com/windows/servercore:1809
|
||||
ARG target=mcr.microsoft.com/powershell:windowsservercore-1809
|
||||
|
||||
@ -12,57 +10,57 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref
|
||||
|
||||
ENV GPG_VERSION 2.3.4
|
||||
|
||||
RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; `
|
||||
RUN Invoke-WebRequest $('https://files.gpg4win.org/gpg4win-vanilla-{0}.exe' -f $env:GPG_VERSION) -OutFile 'gpg4win.exe' -UseBasicParsing ; \
|
||||
Start-Process .\gpg4win.exe -ArgumentList '/S' -NoNewWindow -Wait
|
||||
|
||||
RUN @( `
|
||||
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', `
|
||||
'FD3A5288F042B6850C66B31F09FE44734EB7990E', `
|
||||
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', `
|
||||
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', `
|
||||
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', `
|
||||
'B9AE9905FFD7803F25714661B63B535A4C206CA9', `
|
||||
'77984A986EBC2AA786BC0F66B01FBB92821C587A', `
|
||||
'8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600', `
|
||||
'4ED778F539E3634C779C87C6D7062848A1AB005C', `
|
||||
'A48C2BEE680E841632CD4E44F07496B3EB3C1762', `
|
||||
'B9E2F5981AA6E0CD28160D9FF13993A75599653C' `
|
||||
) | foreach { `
|
||||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; `
|
||||
RUN @( \
|
||||
'94AE36675C464D64BAFA68DD7434390BDBE9B9C5', \
|
||||
'FD3A5288F042B6850C66B31F09FE44734EB7990E', \
|
||||
'71DCFD284A79C3B38668286BC97EC7A07EDE3FC1', \
|
||||
'DD8F2338BAE7501E3DD5AC78C273792F7D83545D', \
|
||||
'C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8', \
|
||||
'B9AE9905FFD7803F25714661B63B535A4C206CA9', \
|
||||
'77984A986EBC2AA786BC0F66B01FBB92821C587A', \
|
||||
'8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600', \
|
||||
'4ED778F539E3634C779C87C6D7062848A1AB005C', \
|
||||
'A48C2BEE680E841632CD4E44F07496B3EB3C1762', \
|
||||
'B9E2F5981AA6E0CD28160D9FF13993A75599653C' \
|
||||
) | foreach { \
|
||||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys $_ ; \
|
||||
}
|
||||
|
||||
ENV NODE_VERSION=$node_version
|
||||
|
||||
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; `
|
||||
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/SHASUMS256.txt.asc' -f $env:NODE_VERSION) -OutFile 'SHASUMS256.txt.asc' -UseBasicParsing ; \
|
||||
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc
|
||||
|
||||
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; `
|
||||
$sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; `
|
||||
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; `
|
||||
Expand-Archive node.zip -DestinationPath C:\ ; `
|
||||
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; \
|
||||
$sum = $(cat SHASUMS256.txt.asc | sls $(' node-v{0}-win-x64.zip' -f $env:NODE_VERSION)) -Split ' ' ; \
|
||||
if ((Get-FileHash node.zip -Algorithm sha256).Hash -ne $sum[0]) { Write-Error 'SHA256 mismatch' } ; \
|
||||
Expand-Archive node.zip -DestinationPath C:\ ; \
|
||||
Rename-Item -Path $('C:\node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:\nodejs'
|
||||
|
||||
ENV YARN_VERSION=$yarn_version
|
||||
|
||||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
|
||||
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; `
|
||||
$sig = Get-AuthenticodeSignature yarn.msi ; `
|
||||
if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; `
|
||||
Write-Output $sig.SignerCertificate.Thumbprint ; `
|
||||
if (@( `
|
||||
'7E253367F8A102A91D04829E37F3410F14B68A5F', `
|
||||
'AF764E1EA56C762617BDC757C8B0F3780A0CF5F9' `
|
||||
) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; `
|
||||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
|
||||
Invoke-WebRequest $('https://yarnpkg.com/downloads/{0}/yarn-{0}.msi' -f $env:YARN_VERSION) -OutFile yarn.msi -UseBasicParsing ; \
|
||||
$sig = Get-AuthenticodeSignature yarn.msi ; \
|
||||
if ($sig.Status -ne 'Valid') { Write-Error 'Authenticode signature is not valid' } ; \
|
||||
Write-Output $sig.SignerCertificate.Thumbprint ; \
|
||||
if (@( \
|
||||
'7E253367F8A102A91D04829E37F3410F14B68A5F', \
|
||||
'AF764E1EA56C762617BDC757C8B0F3780A0CF5F9' \
|
||||
) -notcontains $sig.SignerCertificate.Thumbprint) { Write-Error 'Unknown signer certificate' } ; \
|
||||
Start-Process msiexec.exe -ArgumentList '/i', 'yarn.msi', '/quiet', '/norestart' -NoNewWindow -Wait
|
||||
|
||||
ENV GIT_VERSION 2.20.1
|
||||
ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/MinGit-${GIT_VERSION}-busybox-64-bit.zip
|
||||
ENV GIT_SHA256 9817ab455d9cbd0b09d8664b4afbe4bbf78d18b556b3541d09238501a749486c
|
||||
|
||||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
|
||||
Invoke-WebRequest -UseBasicParsing $env:GIT_DOWNLOAD_URL -OutFile git.zip; `
|
||||
if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_SHA256) {exit 1} ; `
|
||||
Expand-Archive git.zip -DestinationPath C:\git; `
|
||||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
|
||||
Invoke-WebRequest -UseBasicParsing $env:GIT_DOWNLOAD_URL -OutFile git.zip; \
|
||||
if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_SHA256) {exit 1} ; \
|
||||
Expand-Archive git.zip -DestinationPath C:\git; \
|
||||
Remove-Item git.zip
|
||||
|
||||
FROM $target as baseimage
|
||||
@ -76,45 +74,30 @@ COPY --from=download /git /git
|
||||
ARG SETX=/M
|
||||
RUN setx %SETX% PATH "%PATH%;C:\nodejs;C:\yarn\bin;C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin"
|
||||
|
||||
CMD [ "node.exe" ]
|
||||
CMD [ "node.exe" ]
|
||||
|
||||
FROM baseimage
|
||||
|
||||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
|
||||
|
||||
RUN Invoke-WebRequest -UseBasicParsing 'https://www.7-zip.org/a/7z1805-x64.exe' -OutFile 7z.exe; `
|
||||
Start-Process -FilePath 'C:\\7z.exe' -ArgumentList '/S', '/D=C:\\7zip0' -NoNewWindow -Wait; `
|
||||
Invoke-WebRequest -UseBasicParsing 'http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20180531.tar.xz' -OutFile msys2.tar.xz; `
|
||||
Start-Process -FilePath 'C:\\7zip\\7z' -ArgumentList 'e', 'msys2.tar.xz' -Wait; `
|
||||
Start-Process -FilePath 'C:\\7zip\\7z' -ArgumentList 'x', 'msys2.tar', '-oC:\\' -Wait; `
|
||||
Remove-Item msys2.tar.xz; `
|
||||
Remove-Item msys2.tar; `
|
||||
Remove-Item 7z.exe; `
|
||||
Remove-Item -Recurse 7zip; `
|
||||
[Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\msys64\usr\bin', [System.EnvironmentVariableTarget]::Machine); `
|
||||
[Environment]::SetEnvironmentVariable('BAZEL_SH', 'C:\msys64\usr\bin\bash.exe', [System.EnvironmentVariableTarget]::Machine)
|
||||
RUN Invoke-WebRequest -UseBasicParsing 'https://www.7-zip.org/a/7z1805-x64.exe' -OutFile 7z.exe; \
|
||||
Start-Process -FilePath 'C:\\7z.exe' -ArgumentList '/S', '/D=C:\\7zip0' -NoNewWindow -Wait; \
|
||||
Invoke-WebRequest -UseBasicParsing 'http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20180531.tar.xz' -OutFile msys2.tar.xz; \
|
||||
Start-Process -FilePath 'C:\\7zip\\7z' -ArgumentList 'e', 'msys2.tar.xz' -Wait; \
|
||||
Start-Process -FilePath 'C:\\7zip\\7z' -ArgumentList 'x', 'msys2.tar', '-oC:\\' -Wait; \
|
||||
Remove-Item msys2.tar.xz; \
|
||||
Remove-Item msys2.tar; \
|
||||
Remove-Item 7z.exe; \
|
||||
Remove-Item -Recurse 7zip; \
|
||||
[Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\msys64\usr\bin', [System.EnvironmentVariableTarget]::Machine); \
|
||||
[Environment]::SetEnvironmentVariable('BAZEL_SH', 'C:\msys64\usr\bin\bash.exe', [System.EnvironmentVariableTarget]::Machine); \
|
||||
Invoke-WebRequest -UseBasicParsing 'https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe' -OutFile vc_redist.x64.exe; \
|
||||
Start-Process 'c:\\vc_redist.x64.exe' -ArgumentList '/Install', '/Passive', '/NoRestart' -NoNewWindow -Wait; \
|
||||
Remove-Item vc_redist.x64.exe
|
||||
|
||||
# Install VS Build Tools
|
||||
RUN Invoke-WebRequest -UseBasicParsing https://download.visualstudio.microsoft.com/download/pr/df649173-11e9-4af2-8eb7-0eb02ba8958a/cadb5bdac41e55bb8f6a6b7c45273370/vs_buildtools.exe -OutFile vs_BuildTools.exe; `
|
||||
# Installer won't detect DOTNET_SKIP_FIRST_TIME_EXPERIENCE if ENV is used, must use setx /M
|
||||
setx /M DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1; `
|
||||
Start-Process vs_BuildTools.exe `
|
||||
-ArgumentList `
|
||||
'--add', 'Microsoft.VisualStudio.Workload.VCTools', `
|
||||
'--add', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', `
|
||||
'--add', 'Microsoft.Component.VC.Runtime.UCRTSDK', `
|
||||
'--add', 'Microsoft.VisualStudio.Component.Windows10SDK.17763', `
|
||||
'--quiet', '--norestart', '--nocache' `
|
||||
-NoNewWindow -Wait; `
|
||||
Remove-Item -Force vs_buildtools.exe; `
|
||||
Remove-Item -Force -Recurse \"${Env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\"; `
|
||||
Remove-Item -Force -Recurse ${Env:TEMP}\*; `
|
||||
Remove-Item -Force -Recurse \"${Env:ProgramData}\Package Cache\"; `
|
||||
[Environment]::SetEnvironmentVariable('BAZEL_VC', \"${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\BuildTools\VC\", [System.EnvironmentVariableTarget]::Machine)
|
||||
# Add a fix for https://github.com/docker/for-win/issues/2920 as entry point to the container.
|
||||
SHELL ["cmd", "/c"]
|
||||
COPY "fix-msys64.cmd" "C:\\fix-msys64.cmd"
|
||||
ENTRYPOINT cmd /C C:\\fix-msys64.cmd && cmd /c
|
||||
|
||||
# Install Python
|
||||
RUN Invoke-WebRequest -UseBasicParsing https://www.python.org/ftp/python/3.5.1/python-3.5.1.exe -OutFile python-3.5.1.exe; `
|
||||
Start-Process python-3.5.1.exe -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1' -Wait; `
|
||||
Remove-Item -Force python-3.5.1.exe
|
||||
|
||||
CMD ["cmd.exe"]
|
||||
CMD ["cmd.exe"]
|
@ -2,17 +2,11 @@
|
||||
# We do this by copying this file to /etc/bazel.bazelrc at the start of the build.
|
||||
# See documentation in /docs/BAZEL.md
|
||||
|
||||
# Save built files and downloaded repositories in a location that can be cached by CodeFresh and
|
||||
# shared between builds. This helps speed up the analysis time significantly with Bazel managed node
|
||||
# dependencies on the CI.
|
||||
# Save downloaded repositories in a location that can be cached by CodeFresh and shared between
|
||||
# builds. This helps speed up the analysis time significantly with Bazel managed node dependencies
|
||||
# on the CI.
|
||||
# https://codefresh.io/docs/docs/configure-ci-cd-pipeline/introduction-to-codefresh-pipelines/#caching-the-artifacts-of-your-build-system
|
||||
build --repository_cache=C:/codefresh/volume/bazel_repository_cache
|
||||
# Setting the output_base to a Docker volume is currently broken because of a Docker bug on Windows:
|
||||
# https://github.com/moby/moby/issues/37024
|
||||
# This affects Bazel because bazel_output_base\external\bazel_tools is an absolute path junction.
|
||||
# When its fixed we can uncomment this line, and use a different output_base for Ivy tests (they
|
||||
# use a separate compiler and destructively replace the cache).
|
||||
# startup --output_base=C:/codefresh/volume/bazel_output_base
|
||||
|
||||
# Don't be spammy in the logs
|
||||
# TODO(gmagolan): Hide progress again once build performance improves
|
||||
@ -29,10 +23,20 @@ build --announce_rc
|
||||
# Bazel doesn't calculate the memory ceiling correctly when running under Docker.
|
||||
# Limit Bazel to consuming resources that fit in CodeFresh VMs
|
||||
# TODO(filipesilva): determine the correct memory limit
|
||||
build --local_resources=10240,8.0,1.0
|
||||
build --local_resources=8000,8.0,1.0
|
||||
|
||||
# Retry in the event of flakes, eg. https://circleci.com/gh/angular/angular/31309
|
||||
test --flaky_test_attempts=2
|
||||
|
||||
# More details on failures
|
||||
build --verbose_failures=true
|
||||
|
||||
# Include PATH in Windows build/tests
|
||||
# https://github.com/bazelbuild/rules_typescript/pull/356
|
||||
build --action_env=PATH
|
||||
test --action_env=PATH --test_env=PATH
|
||||
|
||||
# Exclude tests known to not work on Windows.
|
||||
|
||||
# Chrome web tests are currently broken.
|
||||
test --test_tag_filters=-browser:chromium-local
|
||||
|
@ -2,7 +2,6 @@ version: '1.0'
|
||||
|
||||
steps:
|
||||
BuildImage:
|
||||
title: Build Docker image
|
||||
type: build
|
||||
image_name: node-bazel-windows
|
||||
working_directory: ./.codefresh
|
||||
@ -13,7 +12,7 @@ steps:
|
||||
dockerfile: ./Dockerfile.win-1809
|
||||
|
||||
RunTests:
|
||||
title: Run Bazel tests
|
||||
title: Run Example
|
||||
image: ${{BuildImage}}
|
||||
commands:
|
||||
# Install dependencies
|
||||
@ -21,8 +20,7 @@ steps:
|
||||
# Add Bazel CI config
|
||||
- copy .codefresh\bazel.rc %ProgramData%\bazel.bazelrc
|
||||
# Run tests
|
||||
# At the moment 'browser:chromium-local' are broken in CI while locally they work
|
||||
# VE
|
||||
- yarn bazel test --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only,-browser:chromium-local //...
|
||||
# Ivy
|
||||
- yarn bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local //...
|
||||
- yarn bazel test //tools/ts-api-guardian:all //packages/language-service/test //packages/compiler/test //packages/compiler-cli/test:ngc //packages/compiler-cli/test/ngtsc:ngtsc
|
||||
- yarn test-ivy-aot //packages/animations/test //packages/common/test //packages/forms/test //packages/http/test //packages/platform-browser/test //packages/platform-browser-dynamic/test //packages/router/test
|
||||
- yarn bazel test //tools/public_api_guard/...
|
||||
- yarn bazel test //packages/compiler-cli/integrationtest:integrationtest //packages/compiler-cli/test/compliance:compliance
|
||||
|
6
.codefresh/fix-msys64.cmd
Normal file
6
.codefresh/fix-msys64.cmd
Normal file
@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
REM Fix for https://github.com/docker/for-win/issues/2920
|
||||
REM echo "Fixing msys64 folder..."
|
||||
REM Touch all .dll files inside C:\msys64\
|
||||
forfiles /p C:\msys64\ /s /m *.dll /c "cmd /c Copy /B @path+,, >NUL"
|
||||
REM echo "Fixed msys64 folder."
|
@ -74,7 +74,6 @@ karma_web_test(
|
||||
"//packages/core/test:test_lib",
|
||||
"//packages/forms/test:test_lib",
|
||||
"//packages/http/test:test_lib",
|
||||
"//packages/zone.js/test:karma_jasmine_test_ci",
|
||||
# "//packages/router/test:test_lib",
|
||||
# //packages/router/test:test_lib fails with:
|
||||
# IE 11.0.0 (Windows 8.1.0.0) bootstrap should restore the scrolling position FAILED
|
||||
|
244
CHANGELOG.md
244
CHANGELOG.md
@ -1,15 +1,3 @@
|
||||
<a name="8.1.0-next.3"></a>
|
||||
# [8.1.0-next.3](https://github.com/angular/angular/compare/8.1.0-next.2...8.1.0-next.3) (2019-06-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bazel:** builder workspace should use nodejs v10.16.0 ([#31088](https://github.com/angular/angular/issues/31088)) ([a1fc4de](https://github.com/angular/angular/commit/a1fc4de))
|
||||
* **core:** temporarily remove [@deprecated](https://github.com/deprecated) jsdoc tag for a TextBedStatic.get overload ([#30714](https://github.com/angular/angular/issues/30714)) ([6bc9c78](https://github.com/angular/angular/commit/6bc9c78)), closes [#30514](https://github.com/angular/angular/issues/30514)
|
||||
* **language-service:** Remove 'any' in getQuickInfoAtPosition ([#31014](https://github.com/angular/angular/issues/31014)) ([a4601ec](https://github.com/angular/angular/commit/a4601ec))
|
||||
|
||||
|
||||
|
||||
<a name="8.0.2"></a>
|
||||
## [8.0.2](https://github.com/angular/angular/compare/8.0.1...8.0.2) (2019-06-19)
|
||||
|
||||
@ -22,20 +10,6 @@
|
||||
|
||||
|
||||
|
||||
<a name="8.1.0-next.2"></a>
|
||||
# [8.1.0-next.2](https://github.com/angular/angular/compare/8.1.0-next.1...8.1.0-next.2) (2019-06-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bazel:** do not modify tsconfig.json ([#30877](https://github.com/angular/angular/issues/30877)) ([b086676](https://github.com/angular/angular/commit/b086676))
|
||||
* **bazel:** exclude components schematics from build ([#30825](https://github.com/angular/angular/issues/30825)) ([05a43ca](https://github.com/angular/angular/commit/05a43ca))
|
||||
* **bazel:** Load global stylesheet in dev and prod ([#30879](https://github.com/angular/angular/issues/30879)) ([17bfedd](https://github.com/angular/angular/commit/17bfedd))
|
||||
* **common:** expose the `HttpUploadProgressEvent` interface as public API ([#30852](https://github.com/angular/angular/issues/30852)) ([5c18f23](https://github.com/angular/angular/commit/5c18f23)), closes [#30814](https://github.com/angular/angular/issues/30814)
|
||||
* **service-worker:** avoid uncaught rejection warning when registration fails ([#30876](https://github.com/angular/angular/issues/30876)) ([81c2a94](https://github.com/angular/angular/commit/81c2a94))
|
||||
|
||||
|
||||
|
||||
<a name="8.0.1"></a>
|
||||
## [8.0.1](https://github.com/angular/angular/compare/8.0.0...8.0.1) (2019-06-13)
|
||||
|
||||
@ -50,83 +24,24 @@
|
||||
|
||||
|
||||
|
||||
<a name="8.1.0-next.1"></a>
|
||||
# [8.1.0-next.1](https://github.com/angular/angular/compare/8.1.0-beta.0...8.1.0-next.1) (2019-06-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **core:** TypeScript related migrations should cater for BOM ([#30719](https://github.com/angular/angular/issues/30719)) ([80394ce](https://github.com/angular/angular/commit/80394ce)), closes [/github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/src/tree/recorder.ts#L72](https://github.com//github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/src/tree/recorder.ts/issues/L72) [#30713](https://github.com/angular/angular/issues/30713)
|
||||
|
||||
|
||||
|
||||
<a name="8.1.0-beta.0"></a>
|
||||
# [8.1.0-beta.0](https://github.com/angular/angular/compare/8.0.0...8.1.0-beta.0) (2019-05-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bazel:** allow ts_library interop with list-typed inputs ([#30600](https://github.com/angular/angular/issues/30600)) ([3125376](https://github.com/angular/angular/commit/3125376))
|
||||
* **bazel:** Bump ibazel to 0.10.1 for windows fixes ([#30196](https://github.com/angular/angular/issues/30196)) ([1353bf0](https://github.com/angular/angular/commit/1353bf0))
|
||||
* **bazel:** Directly spawn native Bazel binary ([#30306](https://github.com/angular/angular/issues/30306)) ([2a0f497](https://github.com/angular/angular/commit/2a0f497))
|
||||
* **bazel:** Disable sandbox on Mac OS ([#30460](https://github.com/angular/angular/issues/30460)) ([b6b1aec](https://github.com/angular/angular/commit/b6b1aec))
|
||||
* **bazel:** Exclude common/upgrade* in metadata.tsconfig.json ([#30133](https://github.com/angular/angular/issues/30133)) ([1f4c380](https://github.com/angular/angular/commit/1f4c380))
|
||||
* **bazel:** ng test should run specific ts_web_test_suite ([#30526](https://github.com/angular/angular/issues/30526)) ([e688e02](https://github.com/angular/angular/commit/e688e02))
|
||||
* **bazel:** pass correct arguments to http_server in Windows ([#30346](https://github.com/angular/angular/issues/30346)) ([3aff79c](https://github.com/angular/angular/commit/3aff79c)), closes [#29785](https://github.com/angular/angular/issues/29785)
|
||||
* **bazel:** update peerDep ranges ([#30155](https://github.com/angular/angular/issues/30155)) ([4ae0ee8](https://github.com/angular/angular/commit/4ae0ee8))
|
||||
* **bazel:** Use existing npm/yarn lock files ([#30438](https://github.com/angular/angular/issues/30438)) ([ff29ccc](https://github.com/angular/angular/commit/ff29ccc))
|
||||
* **compiler-cli:** log ngcc skipping messages as debug instead of info ([#30232](https://github.com/angular/angular/issues/30232)) ([60a8888](https://github.com/angular/angular/commit/60a8888))
|
||||
* **core:** consistently use ng:/// for sourcemap URLs ([#29826](https://github.com/angular/angular/issues/29826)) ([392473e](https://github.com/angular/angular/commit/392473e))
|
||||
* **core:** CSS sanitizer now allows parens in file names ([#30322](https://github.com/angular/angular/issues/30322)) ([728db88](https://github.com/angular/angular/commit/728db88))
|
||||
* **core:** fix interpolate identifier in AOT ([#30243](https://github.com/angular/angular/issues/30243)) ([30d1f29](https://github.com/angular/angular/commit/30d1f29))
|
||||
* **core:** migrations not always migrating all files ([#30269](https://github.com/angular/angular/issues/30269)) ([349935a](https://github.com/angular/angular/commit/349935a))
|
||||
* **core:** remove deprecated `TestBed.deprecatedOverrideProvider` API ([#30576](https://github.com/angular/angular/issues/30576)) ([a96976e](https://github.com/angular/angular/commit/a96976e))
|
||||
* **core:** require 'static' flag on queries in typings ([#30639](https://github.com/angular/angular/issues/30639)) ([84dd267](https://github.com/angular/angular/commit/84dd267))
|
||||
* **core:** static-query migration errors not printed properly ([#30458](https://github.com/angular/angular/issues/30458)) ([6ceb903](https://github.com/angular/angular/commit/6ceb903))
|
||||
* **core:** static-query migration fails with default parameter values ([#30269](https://github.com/angular/angular/issues/30269)) ([6357d4a](https://github.com/angular/angular/commit/6357d4a))
|
||||
* **core:** static-query migration should gracefully exit if AOT compiler throws ([#30269](https://github.com/angular/angular/issues/30269)) ([509352f](https://github.com/angular/angular/commit/509352f))
|
||||
* **core:** static-query migration should handle queries on accessors ([#30327](https://github.com/angular/angular/issues/30327)) ([0ffdb48](https://github.com/angular/angular/commit/0ffdb48))
|
||||
* **core:** static-query migration should not fallback to test strategy ([#30458](https://github.com/angular/angular/issues/30458)) ([0cdf598](https://github.com/angular/angular/commit/0cdf598))
|
||||
* **core:** static-query migration should not prompt if no queries are used ([#30254](https://github.com/angular/angular/issues/30254)) ([4c12d74](https://github.com/angular/angular/commit/4c12d74))
|
||||
* **core:** static-query usage migration strategy should detect ambiguous query usage ([#30215](https://github.com/angular/angular/issues/30215)) ([8d3365e](https://github.com/angular/angular/commit/8d3365e))
|
||||
* **core:** temporarily remove [@deprecated](https://github.com/deprecated) jsdoc tag for a TextBed.get overload ([#30514](https://github.com/angular/angular/issues/30514)) ([f6bf892](https://github.com/angular/angular/commit/f6bf892)), closes [#29290](https://github.com/angular/angular/issues/29290) [#29905](https://github.com/angular/angular/issues/29905)
|
||||
* **language-service:** Remove tsserverlibrary from rollup globals ([#30123](https://github.com/angular/angular/issues/30123)) ([124e497](https://github.com/angular/angular/commit/124e497))
|
||||
* **router:** ensure `history.state` is set in `eager` update mode ([#30154](https://github.com/angular/angular/issues/30154)) ([b40f6f3](https://github.com/angular/angular/commit/b40f6f3))
|
||||
* **router:** ensure navigations start with the current URL value incase redirect is skipped ([#30344](https://github.com/angular/angular/issues/30344)) ([0fd9d08](https://github.com/angular/angular/commit/0fd9d08)), closes [#30340](https://github.com/angular/angular/issues/30340) [#30160](https://github.com/angular/angular/issues/30160)
|
||||
* **router:** fix a problem with router not responding to back button ([#30160](https://github.com/angular/angular/issues/30160)) ([3327bd8](https://github.com/angular/angular/commit/3327bd8))
|
||||
* **router:** IE 11 bug can break URL unification when comparing objects ([#30393](https://github.com/angular/angular/issues/30393)) ([197584d](https://github.com/angular/angular/commit/197584d))
|
||||
* **router:** type cast correctly for IE 11 bug breaking URL Unification when comparing objects ([#30464](https://github.com/angular/angular/issues/30464)) ([53f3564](https://github.com/angular/angular/commit/53f3564))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **bazel:** use `rbe_autoconfig()` and new container. ([#29336](https://github.com/angular/angular/issues/29336)) ([9abf114](https://github.com/angular/angular/commit/9abf114))
|
||||
* **common:** add ability to watch for AngularJS URL updates through `onUrlChange` hook ([#30466](https://github.com/angular/angular/issues/30466)) ([1aff524](https://github.com/angular/angular/commit/1aff524))
|
||||
* **common:** stricter types for `SlicePipe` ([#30156](https://github.com/angular/angular/issues/30156)) ([95830ee](https://github.com/angular/angular/commit/95830ee))
|
||||
* **core:** deprecate integration with the Web Tracing Framework (WTF) ([#30642](https://github.com/angular/angular/issues/30642)) ([f310a59](https://github.com/angular/angular/commit/f310a59))
|
||||
* **language-service:** Implement `definitionAndBoundSpan` ([#30125](https://github.com/angular/angular/issues/30125)) ([f491673](https://github.com/angular/angular/commit/f491673))
|
||||
* **platform-webworker:** deprecate platform-webworker ([#30642](https://github.com/angular/angular/issues/30642)) ([ccc76f7](https://github.com/angular/angular/commit/ccc76f7))
|
||||
|
||||
|
||||
|
||||
<a name="8.0.0"></a>
|
||||
# [8.0.0](https://github.com/angular/angular/compare/8.0.0-rc.5...8.0.0) (2019-05-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for TypeScript 3.4 (and drop older versions) ([#29372](https://github.com/angular/angular/issues/29372)) ([ef85336](https://github.com/angular/angular/commit/ef85336))
|
||||
* add support for TypeScript 3.3 (and drop older versions) ([#29004](https://github.com/angular/angular/issues/29004)) ([75748d6](https://github.com/angular/angular/commit/75748d6))
|
||||
* **common:** add ability to watch for AngularJS URL updates through `onUrlChange` hook ([#30466](https://github.com/angular/angular/issues/30466)) ([8022d36](https://github.com/angular/angular/commit/8022d36))
|
||||
* **common:** stricter types for `SlicePipe` ([#30156](https://github.com/angular/angular/issues/30156)) ([722b2fa](https://github.com/angular/angular/commit/722b2fa))
|
||||
* **bazel:** use `rbe_autoconfig()` and new container ([#29336](https://github.com/angular/angular/issues/29336)) ([e562acc](https://github.com/angular/angular/commit/e562acc))
|
||||
* **common:** add @angular/common/upgrade package for `$location`-related APIs ([#30055](https://github.com/angular/angular/issues/30055)) ([152d99e](https://github.com/angular/angular/commit/152d99e))
|
||||
* **common:** add ability to retrieve the state from `Location` service ([#30055](https://github.com/angular/angular/issues/30055)) ([b44b143](https://github.com/angular/angular/commit/b44b143))
|
||||
* **common:** stricter types for SlicePipe ([#30156](https://github.com/angular/angular/issues/30156)) ([722b2fa](https://github.com/angular/angular/commit/722b2fa))
|
||||
* **bazel:** use rbe_autoconfig() and new container. ([#29336](https://github.com/angular/angular/issues/29336)) ([e562acc](https://github.com/angular/angular/commit/e562acc))
|
||||
* **common:** add [@angular](https://github.com/angular)/common/upgrade package for $location-related APIs ([#30055](https://github.com/angular/angular/issues/30055)) ([152d99e](https://github.com/angular/angular/commit/152d99e))
|
||||
* **common:** add ability to retrieve the state from Location service ([#30055](https://github.com/angular/angular/issues/30055)) ([b44b143](https://github.com/angular/angular/commit/b44b143))
|
||||
* **common:** add ability to track all location changes ([#30055](https://github.com/angular/angular/issues/30055)) ([3a9cf3f](https://github.com/angular/angular/commit/3a9cf3f))
|
||||
* **common:** add APIs to read component pieces of URL ([#30055](https://github.com/angular/angular/issues/30055)) ([b635fe8](https://github.com/angular/angular/commit/b635fe8))
|
||||
* **common:** add `MockPlatformLocation` to enable more robust testing of `Location` services ([#30055](https://github.com/angular/angular/issues/30055)) ([d0672c2](https://github.com/angular/angular/commit/d0672c2))
|
||||
* **common:** add `UrlCodec` type for use with upgrade applications ([#30055](https://github.com/angular/angular/issues/30055)) ([ec455e1](https://github.com/angular/angular/commit/ec455e1))
|
||||
* **common:** add MockPlatformLocation to enable more robust testing of Location services ([#30055](https://github.com/angular/angular/issues/30055)) ([d0672c2](https://github.com/angular/angular/commit/d0672c2))
|
||||
* **common:** add UrlCodec type for use with upgrade applications ([#30055](https://github.com/angular/angular/issues/30055)) ([ec455e1](https://github.com/angular/angular/commit/ec455e1))
|
||||
* **common:** provide replacement for AngularJS $location service ([#30055](https://github.com/angular/angular/issues/30055)) ([4277600](https://github.com/angular/angular/commit/4277600))
|
||||
* remove deprecated `DOCUMENT` token from platform-browser ([#28117](https://github.com/angular/angular/issues/28117)) ([3a9d247](https://github.com/angular/angular/commit/3a9d247))
|
||||
* remove deprecated DOCUMENT token from platform-browser ([#28117](https://github.com/angular/angular/issues/28117)) ([3a9d247](https://github.com/angular/angular/commit/3a9d247))
|
||||
* **compiler:** support skipping leading trivia in template source-maps ([#30095](https://github.com/angular/angular/issues/30095)) ([304a12f](https://github.com/angular/angular/commit/304a12f))
|
||||
* **core:** add missing ARIA attributes to html sanitizer ([#29685](https://github.com/angular/angular/issues/29685)) ([909557d](https://github.com/angular/angular/commit/909557d)), closes [#26815](https://github.com/angular/angular/issues/26815)
|
||||
* **router:** deprecate loadChildren:string ([#30073](https://github.com/angular/angular/issues/30073)) ([c61df39](https://github.com/angular/angular/commit/c61df39))
|
||||
@ -135,28 +50,28 @@
|
||||
* **service-worker:** support bypassing SW with specific header/query param ([#30010](https://github.com/angular/angular/issues/30010)) ([6200732](https://github.com/angular/angular/commit/6200732)), closes [#21191](https://github.com/angular/angular/issues/21191)
|
||||
* **compiler-cli:** export tooling definitions ([#29929](https://github.com/angular/angular/issues/29929)) ([e1f51ea](https://github.com/angular/angular/commit/e1f51ea))
|
||||
* **compiler-cli:** lower some exported expressions ([#30038](https://github.com/angular/angular/issues/30038)) ([8e73f9b](https://github.com/angular/angular/commit/8e73f9b))
|
||||
* **core:** add schematics to move deprecated `DOCUMENT` import ([#29950](https://github.com/angular/angular/issues/29950)) ([645e305](https://github.com/angular/angular/commit/645e305))
|
||||
* **core:** add schematics to move deprecated DOCUMENT import ([#29950](https://github.com/angular/angular/issues/29950)) ([645e305](https://github.com/angular/angular/commit/645e305))
|
||||
* **bazel:** update the build to use the new architect api ([#29720](https://github.com/angular/angular/issues/29720)) ([902a53a](https://github.com/angular/angular/commit/902a53a))
|
||||
* remove @angular/http dependency from @angular/platform-server ([#29408](https://github.com/angular/angular/issues/29408)) ([9745f55](https://github.com/angular/angular/commit/9745f55))
|
||||
* remove [@angular](https://github.com/angular)/http dependency from [@angular](https://github.com/angular)/platform-server ([#29408](https://github.com/angular/angular/issues/29408)) ([9745f55](https://github.com/angular/angular/commit/9745f55))
|
||||
* **compiler-cli:** ngcc - make logging more configurable ([#29591](https://github.com/angular/angular/issues/29591)) ([8d3d75e](https://github.com/angular/angular/commit/8d3d75e))
|
||||
* **core:** Add `AbstractType<T>` interface ([#29295](https://github.com/angular/angular/issues/29295)) ([afd4a4e](https://github.com/angular/angular/commit/afd4a4e)), closes [#26491](https://github.com/angular/angular/issues/26491)
|
||||
* **core:** Add "AbstractType<T>" interface ([#29295](https://github.com/angular/angular/issues/29295)) ([afd4a4e](https://github.com/angular/angular/commit/afd4a4e)), closes [#26491](https://github.com/angular/angular/issues/26491)
|
||||
* **core:** template-var-assignment update schematic ([#29608](https://github.com/angular/angular/issues/29608)) ([7c8f4e3](https://github.com/angular/angular/commit/7c8f4e3))
|
||||
* **bazel:** Upgrade rules_nodejs and rules_sass ([#29388](https://github.com/angular/angular/issues/29388)) ([d6d081e](https://github.com/angular/angular/commit/d6d081e))
|
||||
* **service-worker:** support multiple apps on different subpaths of a domain ([#27080](https://github.com/angular/angular/issues/27080)) ([e721c08](https://github.com/angular/angular/commit/e721c08)), closes [#21388](https://github.com/angular/angular/issues/21388)
|
||||
* **bazel:** Eject Bazel ([#29167](https://github.com/angular/angular/issues/29167)) ([36a1550](https://github.com/angular/angular/commit/36a1550))
|
||||
* **bazel:** Hide Bazel files in Bazel builder ([#29110](https://github.com/angular/angular/issues/29110)) ([7060d90](https://github.com/angular/angular/commit/7060d90))
|
||||
* **forms:** clear (remove all) components from a FormArray ([#28918](https://github.com/angular/angular/issues/28918)) ([a68b1a1](https://github.com/angular/angular/commit/a68b1a1)), closes [#18531](https://github.com/angular/angular/issues/18531)
|
||||
* **platform-server:** wait on returned `BEFORE_APP_SERIALIZED` promises ([#29120](https://github.com/angular/angular/issues/29120)) ([7102ea8](https://github.com/angular/angular/commit/7102ea8))
|
||||
* **platform-server:** wait on returned BEFORE_APP_SERIALIZED promises ([#29120](https://github.com/angular/angular/issues/29120)) ([7102ea8](https://github.com/angular/angular/commit/7102ea8))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bazel:** allow `ts_library` interop with list-typed inputs ([#30600](https://github.com/angular/angular/issues/30600)) ([bf38df4](https://github.com/angular/angular/commit/bf38df4))
|
||||
* **bazel:** allow ts_library interop with list-typed inputs ([#30600](https://github.com/angular/angular/issues/30600)) ([bf38df4](https://github.com/angular/angular/commit/bf38df4))
|
||||
* **bazel:** Disable sandbox on Mac OS ([#30460](https://github.com/angular/angular/issues/30460)) ([3de26a8](https://github.com/angular/angular/commit/3de26a8))
|
||||
* **bazel:** ng test should run specific ts_web_test_suite ([#30526](https://github.com/angular/angular/issues/30526)) ([8bc4da8](https://github.com/angular/angular/commit/8bc4da8))
|
||||
* **core:** remove deprecated `TestBed.deprecatedOverrideProvider` API ([#30576](https://github.com/angular/angular/issues/30576)) ([5a46f94](https://github.com/angular/angular/commit/5a46f94))
|
||||
* **core:** require 'static' flag on queries in typings ([#30641](https://github.com/angular/angular/issues/30641)) ([c8af830](https://github.com/angular/angular/commit/c8af830))
|
||||
* **core:** temporarily remove [@deprecated](https://github.com/deprecated) jsdoc tag for a `TextBed.get` overload ([#30514](https://github.com/angular/angular/issues/30514)) ([561e01d](https://github.com/angular/angular/commit/561e01d)), closes [#29290](https://github.com/angular/angular/issues/29290) [#29905](https://github.com/angular/angular/issues/29905)
|
||||
* **core:** temporarily remove [@deprecated](https://github.com/deprecated) jsdoc tag for a TextBed.get overload ([#30514](https://github.com/angular/angular/issues/30514)) ([561e01d](https://github.com/angular/angular/commit/561e01d)), closes [#29290](https://github.com/angular/angular/issues/29290) [#29905](https://github.com/angular/angular/issues/29905)
|
||||
* **router:** type cast correctly for IE 11 bug breaking URL Unification when comparing objects ([#30464](https://github.com/angular/angular/issues/30464)) ([32daa93](https://github.com/angular/angular/commit/32daa93))
|
||||
* **bazel:** Directly spawn native Bazel binary ([#30306](https://github.com/angular/angular/issues/30306)) ([d1fcc2b](https://github.com/angular/angular/commit/d1fcc2b))
|
||||
* **bazel:** pass correct arguments to http_server in Windows ([#30346](https://github.com/angular/angular/issues/30346)) ([71eba45](https://github.com/angular/angular/commit/71eba45)), closes [#29785](https://github.com/angular/angular/issues/29785)
|
||||
@ -172,7 +87,7 @@
|
||||
* **core:** static-query usage migration strategy should detect ambiguous query usage ([#30215](https://github.com/angular/angular/issues/30215)) ([e295c6a](https://github.com/angular/angular/commit/e295c6a))
|
||||
* **router:** ensure navigations start with the current URL value incase redirect is skipped ([#30344](https://github.com/angular/angular/issues/30344)) ([9b88920](https://github.com/angular/angular/commit/9b88920)), closes [#30340](https://github.com/angular/angular/issues/30340) [#30160](https://github.com/angular/angular/issues/30160)
|
||||
* **router:** IE 11 bug can break URL unification when comparing objects ([#30393](https://github.com/angular/angular/issues/30393)) ([c383491](https://github.com/angular/angular/commit/c383491))
|
||||
* **bazel:** Bump ibazel to 0.10.1 for Windows fixes ([#30196](https://github.com/angular/angular/issues/30196)) ([9f68c35](https://github.com/angular/angular/commit/9f68c35))
|
||||
* **bazel:** Bump ibazel to 0.10.1 for windows fixes ([#30196](https://github.com/angular/angular/issues/30196)) ([9f68c35](https://github.com/angular/angular/commit/9f68c35))
|
||||
* **compiler-cli:** log ngcc skipping messages as debug instead of info ([#30232](https://github.com/angular/angular/issues/30232)) ([548b003](https://github.com/angular/angular/commit/548b003))
|
||||
* **core:** fix interpolate identifier in AOT ([#30243](https://github.com/angular/angular/issues/30243)) ([3fe3a84](https://github.com/angular/angular/commit/3fe3a84))
|
||||
* **router:** ensure `history.state` is set in `eager` update mode ([#30154](https://github.com/angular/angular/issues/30154)) ([9720227](https://github.com/angular/angular/commit/9720227))
|
||||
@ -182,54 +97,57 @@
|
||||
* **bazel:** Exclude common/upgrade* in metadata.tsconfig.json ([#30133](https://github.com/angular/angular/issues/30133)) ([6711f22](https://github.com/angular/angular/commit/6711f22))
|
||||
* **bazel:** update peerDep ranges ([#30155](https://github.com/angular/angular/issues/30155)) ([6067583](https://github.com/angular/angular/commit/6067583))
|
||||
* **bazel:** make name param in ng add optional ([#30074](https://github.com/angular/angular/issues/30074)) ([0b5f480](https://github.com/angular/angular/commit/0b5f480))
|
||||
* **bazel:** Make sure only single copy of @angular/bazel is installed ([#30072](https://github.com/angular/angular/issues/30072)) ([2905bf5](https://github.com/angular/angular/commit/2905bf5))
|
||||
* **bazel:** Make sure only single copy of `[@angular](https://github.com/angular)/bazel` is installed ([#30072](https://github.com/angular/angular/issues/30072)) ([2905bf5](https://github.com/angular/angular/commit/2905bf5))
|
||||
* **bazel:** transitive npm deps in ng_module ([#30065](https://github.com/angular/angular/issues/30065)) ([61365a9](https://github.com/angular/angular/commit/61365a9))
|
||||
* **common:** add upgrade sub-package to `ng_package` rule for @angular/common ([#30117](https://github.com/angular/angular/issues/30117)) ([6de4cbd](https://github.com/angular/angular/commit/6de4cbd)), closes [#30055](https://github.com/angular/angular/issues/30055) [#30116](https://github.com/angular/angular/issues/30116)
|
||||
* **common:** adjust `MockPlatformLocation` to set state to new object ([#30055](https://github.com/angular/angular/issues/30055)) ([825efa8](https://github.com/angular/angular/commit/825efa8))
|
||||
* **common:** add upgrade sub-package to ng_package rule for [@angular](https://github.com/angular)/common ([#30117](https://github.com/angular/angular/issues/30117)) ([6de4cbd](https://github.com/angular/angular/commit/6de4cbd)), closes [#30055](https://github.com/angular/angular/issues/30055) [#30116](https://github.com/angular/angular/issues/30116)
|
||||
* **common:** adjust MockPlatformLocation to set state to new object ([#30055](https://github.com/angular/angular/issues/30055)) ([825efa8](https://github.com/angular/angular/commit/825efa8))
|
||||
* **compiler:** Fix compiler crash due to isSkipSelf of null ([#30075](https://github.com/angular/angular/issues/30075)) ([28fd5ab](https://github.com/angular/angular/commit/28fd5ab))
|
||||
* **upgrade:** do not break if `onMicrotaskEmpty` emits while a `$digest` is in progress ([#29794](https://github.com/angular/angular/issues/29794)) ([0ddf2e7](https://github.com/angular/angular/commit/0ddf2e7)), closes [#24680](https://github.com/angular/angular/issues/24680) [/github.com/angular/angular/blob/78146c189/packages/core/src/util/ng_dev_mode.ts#L12](https://github.com//github.com/angular/angular/blob/78146c189/packages/core/src/util/ng_dev_mode.ts/issues/L12) [#24680](https://github.com/angular/angular/issues/24680)
|
||||
* **bazel:** do not typecheck core schematic files ([#29876](https://github.com/angular/angular/issues/29876)) ([2ba799d](https://github.com/angular/angular/commit/2ba799d))
|
||||
* **bazel:** restore `ng build --prod` ([#30005](https://github.com/angular/angular/issues/30005)) ([96a8289](https://github.com/angular/angular/commit/96a8289))
|
||||
* **common:** prevent repeated application of `HttpParams` mutations ([#29045](https://github.com/angular/angular/issues/29045)) ([8e8e89a](https://github.com/angular/angular/commit/8e8e89a)), closes [#20430](https://github.com/angular/angular/issues/20430)
|
||||
* **common:** async pipe will properly check when it receives an NaN value from an observable ([#22305](https://github.com/angular/angular/issues/22305)) ([3f6bf6d](https://github.com/angular/angular/commit/3f6bf6d)), closes [#15721](https://github.com/angular/angular/issues/15721)
|
||||
* **core:** don't include a local `EventListener` in typings ([#29809](https://github.com/angular/angular/issues/29809)) ([4bde40f](https://github.com/angular/angular/commit/4bde40f)), closes [#29806](https://github.com/angular/angular/issues/29806)
|
||||
* **core:** use shakeable global definitions ([#29929](https://github.com/angular/angular/issues/29929)) ([e5905bb](https://github.com/angular/angular/commit/e5905bb))
|
||||
* **bazel:** restore ng build --prod ([#30005](https://github.com/angular/angular/issues/30005)) ([96a8289](https://github.com/angular/angular/commit/96a8289))
|
||||
* **common:** prevent repeated application of HttpParams mutations ([#29045](https://github.com/angular/angular/issues/29045)) ([8e8e89a](https://github.com/angular/angular/commit/8e8e89a)), closes [#20430](https://github.com/angular/angular/issues/20430)
|
||||
* **common:** async pipe will properly check when it recieves an NaN value from an observable ([#22305](https://github.com/angular/angular/issues/22305)) ([3f6bf6d](https://github.com/angular/angular/commit/3f6bf6d)), closes [#15721](https://github.com/angular/angular/issues/15721)
|
||||
* **core:** don't include a local `EventListener` in typings ([#29809](https://github.com/angular/angular/issues/29809)) ([4bde40f](https://github.com/angular/angular/commit/4bde40f)), closes [/github.com/angular/angular/blob/303eae918d997070a36b523ddc97e018f622c258/packages/core/src/debug/debug_node.ts#L32](https://github.com//github.com/angular/angular/blob/303eae918d997070a36b523ddc97e018f622c258/packages/core/src/debug/debug_node.ts/issues/L32) [#29806](https://github.com/angular/angular/issues/29806)
|
||||
* **core:** use shakeable global definitions ([#29929](https://github.com/angular/angular/issues/29929)) ([e5905bb](https://github.com/angular/angular/commit/e5905bb)), closes [/github.com/angular/angular-cli/blob/5fc1f2499cbe57f9a95e4b0dfced130eb3a8046d/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts#L279-L282](https://github.com//github.com/angular/angular-cli/blob/5fc1f2499cbe57f9a95e4b0dfced130eb3a8046d/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts/issues/L279-L282)
|
||||
* **language-service:** Use proper types instead of any ([#29942](https://github.com/angular/angular/issues/29942)) ([1a56cd5](https://github.com/angular/angular/commit/1a56cd5))
|
||||
* **bazel:** Install packages after `ng add` when invoked independently ([#29852](https://github.com/angular/angular/issues/29852)) ([bd2ce9c](https://github.com/angular/angular/commit/bd2ce9c))
|
||||
* **compiler-cli:** pass config path to `ts.parseJsonConfigFileContent` ([#29872](https://github.com/angular/angular/issues/29872)) ([86a3f90](https://github.com/angular/angular/commit/86a3f90))
|
||||
* **compiler-cli:** pass config path to ts.parseJsonConfigFileContent ([#29872](https://github.com/angular/angular/issues/29872)) ([86a3f90](https://github.com/angular/angular/commit/86a3f90)), closes [/github.com/Microsoft/TypeScript/blob/025d82633915b67003ea38ba40b9239a19721c13/src/compiler/emitter.ts#L56-L57](https://github.com//github.com/Microsoft/TypeScript/blob/025d82633915b67003ea38ba40b9239a19721c13/src/compiler/emitter.ts/issues/L56-L57)
|
||||
* **router:** support non-NgFactory promise in loadChildren typings ([#29832](https://github.com/angular/angular/issues/29832)) ([2bfb6a0](https://github.com/angular/angular/commit/2bfb6a0))
|
||||
* **bazel:** add `configuration_env_vars = ["compile"]` to generated `@npm//@angular/bazel/bin:ngc-wrapped` `nodejs_binary` ([#29694](https://github.com/angular/angular/issues/29694)) ([2e66ddf](https://github.com/angular/angular/commit/2e66ddf))
|
||||
* **bazel:** add configuration_env_vars = ["compile"] to generated [@npm](https://github.com/npm)//[@angular](https://github.com/angular)/bazel/bin:ngc-wrapped nodejs_binary ([#29694](https://github.com/angular/angular/issues/29694)) ([2e66ddf](https://github.com/angular/angular/commit/2e66ddf))
|
||||
* **bazel:** docs formatting ([#29817](https://github.com/angular/angular/issues/29817)) ([cc2e4b6](https://github.com/angular/angular/commit/cc2e4b6))
|
||||
* **bazel:** remove karma-jasmine from `ts_web_test_suite` ([#29695](https://github.com/angular/angular/issues/29695)) ([2bd9214](https://github.com/angular/angular/commit/2bd9214))
|
||||
* **bazel:** remove karma-jasmine from ts_web_test_suite ([#29695](https://github.com/angular/angular/issues/29695)) ([2bd9214](https://github.com/angular/angular/commit/2bd9214))
|
||||
* **bazel:** support running ng-add on minimal applications ([#29681](https://github.com/angular/angular/issues/29681)) ([9810c6c](https://github.com/angular/angular/commit/9810c6c)), closes [#29680](https://github.com/angular/angular/issues/29680)
|
||||
* **common:** add `@Injectable()` to common pipes ([#29834](https://github.com/angular/angular/issues/29834)) ([387fbb8](https://github.com/angular/angular/commit/387fbb8))
|
||||
* **compiler-cli:** ensure `LogicalProjectPaths` always start with a slash ([#29627](https://github.com/angular/angular/issues/29627)) ([e02684e](https://github.com/angular/angular/commit/e02684e))
|
||||
* **compiler-cli:** ensure LogicalProjectPaths always start with a slash ([#29627](https://github.com/angular/angular/issues/29627)) ([e02684e](https://github.com/angular/angular/commit/e02684e))
|
||||
* **core:** add missing migration to npm package ([#29705](https://github.com/angular/angular/issues/29705)) ([96b76dc](https://github.com/angular/angular/commit/96b76dc))
|
||||
* **core:** call `ngOnDestroy` for tree-shakeable providers ([#28943](https://github.com/angular/angular/issues/28943)) ([30b0442](https://github.com/angular/angular/commit/30b0442)), closes [#28927](https://github.com/angular/angular/issues/28927)
|
||||
* **core:** Deprecate `TestBed.get(...):any` ([#29290](https://github.com/angular/angular/issues/29290)) ([609024f](https://github.com/angular/angular/commit/609024f)), closes [#13785](https://github.com/angular/angular/issues/13785) [#26491](https://github.com/angular/angular/issues/26491)
|
||||
* **core:** call ngOnDestroy for tree-shakeable providers ([#28943](https://github.com/angular/angular/issues/28943)) ([30b0442](https://github.com/angular/angular/commit/30b0442)), closes [#28927](https://github.com/angular/angular/issues/28927)
|
||||
* **core:** Deprecate TestBed.get(...):any ([#29290](https://github.com/angular/angular/issues/29290)) ([609024f](https://github.com/angular/angular/commit/609024f)), closes [#13785](https://github.com/angular/angular/issues/13785) [#26491](https://github.com/angular/angular/issues/26491)
|
||||
* **core:** resolve ts compile issues due to lenient tsconfig ([#29843](https://github.com/angular/angular/issues/29843)) ([54058ba](https://github.com/angular/angular/commit/54058ba))
|
||||
* **platform-browser:** insert `APP_ID` in styles, contentAttr and hostAttr ([#17745](https://github.com/angular/angular/issues/17745)) ([712d60e](https://github.com/angular/angular/commit/712d60e))
|
||||
* **platform-browser:** insert APP_ID in styles, contentAttr and hostAttr ([#17745](https://github.com/angular/angular/issues/17745)) ([712d60e](https://github.com/angular/angular/commit/712d60e))
|
||||
* **bazel:** use //:tsconfig.json as the default for ng_module ([#29670](https://github.com/angular/angular/issues/29670)) ([#29711](https://github.com/angular/angular/issues/29711)) ([9e33dc3](https://github.com/angular/angular/commit/9e33dc3))
|
||||
* **platform-browser:** insert APP_ID in styles, contentAttr and hostAttr ([#17745](https://github.com/angular/angular/issues/17745)) ([ca14509](https://github.com/angular/angular/commit/ca14509))
|
||||
* **bazel:** Update schematics to support routing ([#29548](https://github.com/angular/angular/issues/29548)) ([401b8ee](https://github.com/angular/angular/commit/401b8ee))
|
||||
* **bazel:** use `//:tsconfig.json` as the default for `ng_module` ([#29670](https://github.com/angular/angular/issues/29670)) ([b14537a](https://github.com/angular/angular/commit/b14537a))
|
||||
* **bazel:** use //:tsconfig.json as the default for ng_module ([#29670](https://github.com/angular/angular/issues/29670)) ([b14537a](https://github.com/angular/angular/commit/b14537a))
|
||||
* **compiler-cli:** ngcc - cope with processing entry-points multiple times ([#29657](https://github.com/angular/angular/issues/29657)) ([6b39c9c](https://github.com/angular/angular/commit/6b39c9c))
|
||||
* **core:** static-query schematic should detect static queries in getters. ([#29609](https://github.com/angular/angular/issues/29609)) ([33016b8](https://github.com/angular/angular/commit/33016b8))
|
||||
* **common:** escape query selector used when anchor scrolling ([#29577](https://github.com/angular/angular/issues/29577)) ([7671c73](https://github.com/angular/angular/commit/7671c73)), closes [#28193](https://github.com/angular/angular/issues/28193)
|
||||
* **router:** adjust setting navigationTransition when a new navigation cancels an existing one ([#29636](https://github.com/angular/angular/issues/29636)) ([e884c0c](https://github.com/angular/angular/commit/e884c0c)), closes [#29389](https://github.com/angular/angular/issues/29389) [#29590](https://github.com/angular/angular/issues/29590)
|
||||
* **bazel:** allow `ng_module` users to set `createExternalSymbolFactoryReexports` ([#29459](https://github.com/angular/angular/issues/29459)) ([21be0fb](https://github.com/angular/angular/commit/21be0fb))
|
||||
* **bazel:** allow ng_module users to set createExternalSymbolFactoryReexports ([#29459](https://github.com/angular/angular/issues/29459)) ([21be0fb](https://github.com/angular/angular/commit/21be0fb))
|
||||
* **bazel:** workaround problem reading summary files from node_modules ([#29459](https://github.com/angular/angular/issues/29459)) ([769d960](https://github.com/angular/angular/commit/769d960))
|
||||
* **compiler:** inherit param types when class has a constructor which takes no declared parameters and delegates up ([#29232](https://github.com/angular/angular/issues/29232)) ([0007564](https://github.com/angular/angular/commit/0007564))
|
||||
* **core:** parse incorrect ML open tag as text ([#29328](https://github.com/angular/angular/issues/29328)) ([dafbbf8](https://github.com/angular/angular/commit/dafbbf8)), closes [#29231](https://github.com/angular/angular/issues/29231)
|
||||
* **core:** static-query schematic should detect queries in `ngDoCheck` and `ngOnChanges` ([#29492](https://github.com/angular/angular/issues/29492)) ([09fab58](https://github.com/angular/angular/commit/09fab58))
|
||||
* **router:** support `NgFactory` promise in loadChildren typings ([#29392](https://github.com/angular/angular/issues/29392)) ([26a8c59](https://github.com/angular/angular/commit/26a8c59))
|
||||
* **core:** static-query schematic should detect queries in "ngDoCheck" and "ngOnChanges" ([#29492](https://github.com/angular/angular/issues/29492)) ([09fab58](https://github.com/angular/angular/commit/09fab58))
|
||||
* **router:** support NgFactory promise in loadChildren typings ([#29392](https://github.com/angular/angular/issues/29392)) ([26a8c59](https://github.com/angular/angular/commit/26a8c59))
|
||||
* **bazel:** correct regexp test for self-references in metadata ([#29346](https://github.com/angular/angular/issues/29346)) ([9d090cb](https://github.com/angular/angular/commit/9d090cb))
|
||||
* **bazel:** don't produce self-references in metadata ([#29317](https://github.com/angular/angular/issues/29317)) ([3facdeb](https://github.com/angular/angular/commit/3facdeb)), closes [#29315](https://github.com/angular/angular/issues/29315)
|
||||
* **bazel:** fix strict null checks compile error in `packages/bazel/src/schematics/ng-add/index.ts` ([#29282](https://github.com/angular/angular/issues/29282)) ([9a7f560](https://github.com/angular/angular/commit/9a7f560))
|
||||
* **bazel:** Remove @angular/upgrade from dev dependencies ([#29319](https://github.com/angular/angular/issues/29319)) ([1db8bf3](https://github.com/angular/angular/commit/1db8bf3))
|
||||
* **bazel:** fix strict null checks compile error in packages/bazel/src/schematics/ng-add/index.ts ([#29282](https://github.com/angular/angular/issues/29282)) ([9a7f560](https://github.com/angular/angular/commit/9a7f560))
|
||||
* **bazel:** Remove [@angular](https://github.com/angular)/upgrade from dev dependencies ([#29319](https://github.com/angular/angular/issues/29319)) ([1db8bf3](https://github.com/angular/angular/commit/1db8bf3))
|
||||
* **bazel:** Support new e2e project layout ([#29318](https://github.com/angular/angular/issues/29318)) ([8ef690c](https://github.com/angular/angular/commit/8ef690c))
|
||||
* **bazel:** turn off pure call tree shaking for ng_package ([#29210](https://github.com/angular/angular/issues/29210)) ([4990b93](https://github.com/angular/angular/commit/4990b93))
|
||||
* **compiler-cli:** incorrect metadata bundle for multiple unnamed re-exports ([#29360](https://github.com/angular/angular/issues/29360)) ([105cfaf](https://github.com/angular/angular/commit/105cfaf))
|
||||
* **compiler-cli:** incorrect metadata bundle for multiple unnamed re-exports ([#29360](https://github.com/angular/angular/issues/29360)) ([105cfaf](https://github.com/angular/angular/commit/105cfaf)), closes [/github.com/angular/material2/blob/master/tools/package-tools/build-release.ts#L78-L85](https://github.com//github.com/angular/material2/blob/master/tools/package-tools/build-release.ts/issues/L78-L85)
|
||||
* **core:** don't wrap `<tr>` and `<col>` elements into a required parent ([#29219](https://github.com/angular/angular/issues/29219)) ([f2dc32e](https://github.com/angular/angular/commit/f2dc32e))
|
||||
* **core:** parse incorrect ML open tag as text ([#29328](https://github.com/angular/angular/issues/29328)) ([4605df8](https://github.com/angular/angular/commit/4605df8)), closes [#29231](https://github.com/angular/angular/issues/29231)
|
||||
* **compiler-cli:** incorrect metadata bundle for multiple unnamed re-exports ([#29360](https://github.com/angular/angular/issues/29360)) ([cf8d934](https://github.com/angular/angular/commit/cf8d934)), closes [github.com/angular/material2/blob/master/tools/package-tools/build-release.ts#L78-L85](https://github.com/angular/material2/blob/master/tools/package-tools/build-release.ts#L78-L85)
|
||||
* **bazel:** add missing binary path for api-extractor ([#29202](https://github.com/angular/angular/issues/29202)) ([df354d1](https://github.com/angular/angular/commit/df354d1))
|
||||
* **bazel:** ng build should produce prod bundle ([#29136](https://github.com/angular/angular/issues/29136)) ([14ce8a9](https://github.com/angular/angular/commit/14ce8a9))
|
||||
* **compiler:** ensure template is updated if an output is transformed ([#29041](https://github.com/angular/angular/issues/29041)) ([c7e4931](https://github.com/angular/angular/commit/c7e4931))
|
||||
@ -243,16 +161,16 @@
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **bazel:** @bazel/typescript is now a peerDependency of @angular/bazel so users of @angular/bazel must add @bazel/typescript to their package.json
|
||||
* **bazel:** `ng_module` now depends on a minimum of build_bazel_rules_nodejs 0.27.12
|
||||
* **core:** In Angular version 8, it's required that all `@ViewChild` and `@ContentChild`
|
||||
queries have a `'static'` flag specifying whether the query is 'static' or
|
||||
* **bazel:** @bazel/typescript is now a peerDependency of @angular/bazel so user's of @angular/bazel must add @bazel/typescript to their package.json
|
||||
* **bazel:** ng_module now depends on a minimum of build_bazel_rules_nodejs 0.27.12
|
||||
* **core:** In Angular version 8, it's required that all @ViewChild and @ContentChild
|
||||
queries have a 'static' flag specifying whether the query is 'static' or
|
||||
'dynamic'. The compiler previously sorted queries automatically, but in
|
||||
8.0 developers are required to explicitly specify which behavior is wanted.
|
||||
This is a temporary requirement as part of a migration; see
|
||||
[static query migration guide](https://v8.angular.io/guide/static-query-migration) for more details.
|
||||
https://v8.angular.io/guide/static-query-migration for more details.
|
||||
|
||||
`@ViewChildren` and `@ContentChildren` queries are always dynamic, and so are
|
||||
@ViewChildren and @ContentChildren queries are always dynamic, and so are
|
||||
unaffected.
|
||||
|
||||
* `TestBed.get()` has two signatures, one which is typed and another which accepts and returns `any`. The signature for `any` is deprecated; all usage of `TestBed.get()` should go through the typed API. This mainly affects string tokens
|
||||
@ -286,8 +204,8 @@ This is a temporary requirement as part of a migration; see
|
||||
- `<tr>` would be wrapped in `<tbody>` if not inside `<tbody>`, `<tfoot>` or `<thead>`;
|
||||
- `<col>` would be wrapped in `<colgroup>` if not inside `<colgroup>`.
|
||||
|
||||
This mechanism of automatic wrapping / auto-correcting was problematic for several reasons:
|
||||
- it is non-obvious and arbitrary (ex. there are more HTML elements that have rules for parent type);
|
||||
This meachanism of automatic wrapping / auto-correcting was problematic for several reasons:
|
||||
- it is non-obvious and arbitrary (ex. there are more HTML elements that has rules for parent type);
|
||||
- it is incorrect for cases where `<tr>` / `<col>` are at the root of a component's content, ex.:
|
||||
|
||||
```html
|
||||
@ -299,13 +217,10 @@ This is a temporary requirement as part of a migration; see
|
||||
In the above example the `<projecting-tr-inside-tbody>` component could be "surprised" to see additional
|
||||
`<tbody>` elements inserted by Angular HTML parser.
|
||||
|
||||
* **http:** The deprecated @angular/http package has been removed, the @angular/common/http package should be used instead.
|
||||
For details on how to migrate, please refer to [the deprecations guide](https://angular.io/guide/deprecations#angularhttp).
|
||||
|
||||
|
||||
* TypeScript 3.1 and 3.2 are no longer supported.
|
||||
|
||||
Please update your TypeScript version to 3.4, as version 3.3 is also not supported.
|
||||
Please update your TypeScript version to 3.3
|
||||
|
||||
|
||||
<a name="8.0.0-rc.5"></a>
|
||||
@ -391,17 +306,6 @@ unaffected.
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="7.2.15"></a>
|
||||
## [7.2.15](https://github.com/angular/angular/compare/7.2.14...7.2.15) (2019-05-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **upgrade:** do not break if `onMicrotaskEmpty` emits while a `$digest` is in progress ([#29794](https://github.com/angular/angular/issues/29794)) ([#30107](https://github.com/angular/angular/issues/30107)) ([1084c19](https://github.com/angular/angular/commit/1084c19)), closes [#24680](https://github.com/angular/angular/issues/24680) [/github.com/angular/angular/blob/78146c189/packages/core/src/util/ng_dev_mode.ts#L12](https://github.com//github.com/angular/angular/blob/78146c189/packages/core/src/util/ng_dev_mode.ts/issues/L12) [#24680](https://github.com/angular/angular/issues/24680)
|
||||
|
||||
|
||||
|
||||
<a name="8.0.0-rc.2"></a>
|
||||
# [8.0.0-rc.2](https://github.com/angular/angular/compare/8.0.0-rc.1...8.0.0-rc.2) (2019-04-29)
|
||||
|
||||
@ -431,9 +335,9 @@ unaffected.
|
||||
### Bug Fixes
|
||||
|
||||
* **bazel:** make name param in ng add optional ([#30074](https://github.com/angular/angular/issues/30074)) ([0b5f480](https://github.com/angular/angular/commit/0b5f480))
|
||||
* **bazel:** Make sure only single copy of `@angular/bazel` is installed ([#30072](https://github.com/angular/angular/issues/30072)) ([2905bf5](https://github.com/angular/angular/commit/2905bf5))
|
||||
* **bazel:** Make sure only single copy of `[@angular](https://github.com/angular)/bazel` is installed ([#30072](https://github.com/angular/angular/issues/30072)) ([2905bf5](https://github.com/angular/angular/commit/2905bf5))
|
||||
* **bazel:** transitive npm deps in ng_module ([#30065](https://github.com/angular/angular/issues/30065)) ([61365a9](https://github.com/angular/angular/commit/61365a9))
|
||||
* **common:** add upgrade sub-package to ng_package rule for @angular/common ([#30117](https://github.com/angular/angular/issues/30117)) ([6de4cbd](https://github.com/angular/angular/commit/6de4cbd)), closes [#30055](https://github.com/angular/angular/issues/30055) [#30116](https://github.com/angular/angular/issues/30116)
|
||||
* **common:** add upgrade sub-package to ng_package rule for [@angular](https://github.com/angular)/common ([#30117](https://github.com/angular/angular/issues/30117)) ([6de4cbd](https://github.com/angular/angular/commit/6de4cbd)), closes [#30055](https://github.com/angular/angular/issues/30055) [#30116](https://github.com/angular/angular/issues/30116)
|
||||
* **common:** adjust MockPlatformLocation to set state to new object ([#30055](https://github.com/angular/angular/issues/30055)) ([825efa8](https://github.com/angular/angular/commit/825efa8))
|
||||
* **compiler:** Fix compiler crash due to isSkipSelf of null ([#30075](https://github.com/angular/angular/issues/30075)) ([28fd5ab](https://github.com/angular/angular/commit/28fd5ab))
|
||||
* **upgrade:** do not break if `onMicrotaskEmpty` emits while a `$digest` is in progress ([#29794](https://github.com/angular/angular/issues/29794)) ([0ddf2e7](https://github.com/angular/angular/commit/0ddf2e7)), closes [#24680](https://github.com/angular/angular/issues/24680) [/github.com/angular/angular/blob/78146c189/packages/core/src/util/ng_dev_mode.ts#L12](https://github.com//github.com/angular/angular/blob/78146c189/packages/core/src/util/ng_dev_mode.ts/issues/L12) [#24680](https://github.com/angular/angular/issues/24680)
|
||||
@ -441,7 +345,7 @@ unaffected.
|
||||
|
||||
### Features
|
||||
|
||||
* **common:** add @angular/common/upgrade package for $location-related APIs ([#30055](https://github.com/angular/angular/issues/30055)) ([152d99e](https://github.com/angular/angular/commit/152d99e))
|
||||
* **common:** add [@angular](https://github.com/angular)/common/upgrade package for $location-related APIs ([#30055](https://github.com/angular/angular/issues/30055)) ([152d99e](https://github.com/angular/angular/commit/152d99e))
|
||||
* **common:** add ability to retrieve the state from Location service ([#30055](https://github.com/angular/angular/issues/30055)) ([b44b143](https://github.com/angular/angular/commit/b44b143))
|
||||
* **common:** add ability to track all location changes ([#30055](https://github.com/angular/angular/issues/30055)) ([3a9cf3f](https://github.com/angular/angular/commit/3a9cf3f))
|
||||
* **common:** add APIs to read component pieces of URL ([#30055](https://github.com/angular/angular/issues/30055)) ([b635fe8](https://github.com/angular/angular/commit/b635fe8))
|
||||
@ -504,7 +408,7 @@ unaffected.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bazel:** add configuration_env_vars = ["compile"] to generated [@npm](https://github.com/npm)//@angular/bazel/bin:ngc-wrapped nodejs_binary ([#29694](https://github.com/angular/angular/issues/29694)) ([2e66ddf](https://github.com/angular/angular/commit/2e66ddf))
|
||||
* **bazel:** add configuration_env_vars = ["compile"] to generated [@npm](https://github.com/npm)//[@angular](https://github.com/angular)/bazel/bin:ngc-wrapped nodejs_binary ([#29694](https://github.com/angular/angular/issues/29694)) ([2e66ddf](https://github.com/angular/angular/commit/2e66ddf))
|
||||
* **bazel:** docs formatting ([#29817](https://github.com/angular/angular/issues/29817)) ([cc2e4b6](https://github.com/angular/angular/commit/cc2e4b6))
|
||||
* **bazel:** remove karma-jasmine from ts_web_test_suite ([#29695](https://github.com/angular/angular/issues/29695)) ([2bd9214](https://github.com/angular/angular/commit/2bd9214))
|
||||
* **bazel:** support running ng-add on minimal applications ([#29681](https://github.com/angular/angular/issues/29681)) ([9810c6c](https://github.com/angular/angular/commit/9810c6c)), closes [#29680](https://github.com/angular/angular/issues/29680)
|
||||
@ -579,7 +483,7 @@ let service = TestBed.get(SERVICE_TOKEN); // type Service
|
||||
|
||||
### Features
|
||||
|
||||
* remove @angular/http dependency from @angular/platform-server ([#29408](https://github.com/angular/angular/issues/29408)) ([9745f55](https://github.com/angular/angular/commit/9745f55))
|
||||
* remove [@angular](https://github.com/angular)/http dependency from [@angular](https://github.com/angular)/platform-server ([#29408](https://github.com/angular/angular/issues/29408)) ([9745f55](https://github.com/angular/angular/commit/9745f55))
|
||||
* **compiler-cli:** ngcc - make logging more configurable ([#29591](https://github.com/angular/angular/issues/29591)) ([8d3d75e](https://github.com/angular/angular/commit/8d3d75e))
|
||||
* **core:** Add "AbstractType<T>" interface ([#29295](https://github.com/angular/angular/issues/29295)) ([afd4a4e](https://github.com/angular/angular/commit/afd4a4e)), closes [#26491](https://github.com/angular/angular/issues/26491)
|
||||
* **core:** template-var-assignment update schematic ([#29608](https://github.com/angular/angular/issues/29608)) ([7c8f4e3](https://github.com/angular/angular/commit/7c8f4e3))
|
||||
@ -639,7 +543,7 @@ This release contains various API docs improvements.
|
||||
* **bazel:** correct regexp test for self-references in metadata ([#29346](https://github.com/angular/angular/issues/29346)) ([9d090cb](https://github.com/angular/angular/commit/9d090cb))
|
||||
* **bazel:** don't produce self-references in metadata ([#29317](https://github.com/angular/angular/issues/29317)) ([3facdeb](https://github.com/angular/angular/commit/3facdeb)), closes [#29315](https://github.com/angular/angular/issues/29315)
|
||||
* **bazel:** fix strict null checks compile error in packages/bazel/src/schematics/ng-add/index.ts ([#29282](https://github.com/angular/angular/issues/29282)) ([9a7f560](https://github.com/angular/angular/commit/9a7f560))
|
||||
* **bazel:** Remove @angular/upgrade from dev dependencies ([#29319](https://github.com/angular/angular/issues/29319)) ([1db8bf3](https://github.com/angular/angular/commit/1db8bf3))
|
||||
* **bazel:** Remove [@angular](https://github.com/angular)/upgrade from dev dependencies ([#29319](https://github.com/angular/angular/issues/29319)) ([1db8bf3](https://github.com/angular/angular/commit/1db8bf3))
|
||||
* **bazel:** Support new e2e project layout ([#29318](https://github.com/angular/angular/issues/29318)) ([8ef690c](https://github.com/angular/angular/commit/8ef690c))
|
||||
* **bazel:** turn off pure call tree shaking for ng_package ([#29210](https://github.com/angular/angular/issues/29210)) ([4990b93](https://github.com/angular/angular/commit/4990b93))
|
||||
* **compiler-cli:** incorrect metadata bundle for multiple unnamed re-exports ([#29360](https://github.com/angular/angular/issues/29360)) ([105cfaf](https://github.com/angular/angular/commit/105cfaf)), closes [/github.com/angular/material2/blob/master/tools/package-tools/build-release.ts#L78-L85](https://github.com//github.com/angular/material2/blob/master/tools/package-tools/build-release.ts/issues/L78-L85)
|
||||
@ -660,8 +564,8 @@ This release contains various API docs improvements.
|
||||
- `<tr>` would be wrapped in `<tbody>` if not inside `<tbody>`, `<tfoot>` or `<thead>`;
|
||||
- `<col>` would be wrapped in `<colgroup>` if not inside `<colgroup>`.
|
||||
|
||||
This mechanism of automatic wrapping / auto-correcting was problematic for several reasons:
|
||||
- it is non-obvious and arbitrary (ex. there are more HTML elements that have rules for parent type);
|
||||
This meachanism of automatic wrapping / auto-correcting was problematic for several reasons:
|
||||
- it is non-obvious and arbitrary (ex. there are more HTML elements that has rules for parent type);
|
||||
- it is incorrect for cases where `<tr>` / `<col>` are at the root of a component's content, ex.:
|
||||
|
||||
```html
|
||||
@ -1062,7 +966,7 @@ This release contains various API docs improvements.
|
||||
* **bazel:** unable to launch protractor test on windows ([#27850](https://github.com/angular/angular/issues/27850)) ([1e6c9be](https://github.com/angular/angular/commit/1e6c9be))
|
||||
* **bazel:** devserver entry_module should have underscore name ([#27719](https://github.com/angular/angular/issues/27719)) ([f57916c](https://github.com/angular/angular/commit/f57916c))
|
||||
* **bazel:** emit full node stack traces when Angular compilation crashes ([#27678](https://github.com/angular/angular/issues/27678)) ([522919a](https://github.com/angular/angular/commit/522919a))
|
||||
* **bazel:** fix major/minor semver check between @angular/bazel npm packager version and angular bazel repo version ([#27635](https://github.com/angular/angular/issues/27635)) ([1cc08b4](https://github.com/angular/angular/commit/1cc08b4))
|
||||
* **bazel:** fix major/minor semver check between [@angular](https://github.com/angular)/bazel npm packager version and angular bazel repo version ([#27635](https://github.com/angular/angular/issues/27635)) ([1cc08b4](https://github.com/angular/angular/commit/1cc08b4))
|
||||
* **bazel:** Load http_archive and rules_nodejs dependencies ([#27609](https://github.com/angular/angular/issues/27609)) ([8313ffc](https://github.com/angular/angular/commit/8313ffc))
|
||||
* **bazel:** ng_package writes unrelevant definitions to bazel out ([#27519](https://github.com/angular/angular/issues/27519)) ([44dfa60](https://github.com/angular/angular/commit/44dfa60)), closes [/github.com/angular/angular/blob/4f9374951d67c75f67a31c110bd61ab72563db7d/packages/bazel/src/ng_package/packager.ts#L105-L124](https://github.com//github.com/angular/angular/blob/4f9374951d67c75f67a31c110bd61ab72563db7d/packages/bazel/src/ng_package/packager.ts/issues/L105-L124)
|
||||
* **bazel:** Set module_name and enable ng test ([#27715](https://github.com/angular/angular/issues/27715)) ([85866de](https://github.com/angular/angular/commit/85866de))
|
||||
@ -1082,7 +986,7 @@ This release contains various API docs improvements.
|
||||
* **core:** export a value for InjectFlags ([#27279](https://github.com/angular/angular/issues/27279)) ([23b06af](https://github.com/angular/angular/commit/23b06af)), closes [#27251](https://github.com/angular/angular/issues/27251)
|
||||
* **core:** More precise return type for `InjectableDecorator` ([#27360](https://github.com/angular/angular/issues/27360)) ([4b9948c](https://github.com/angular/angular/commit/4b9948c)), closes [#26942](https://github.com/angular/angular/issues/26942)
|
||||
* **forms:** typed argument for FormBuilder group ([#26985](https://github.com/angular/angular/issues/26985)) ([b0c7561](https://github.com/angular/angular/commit/b0c7561))
|
||||
* **platform-server:** add @angular/http to the list of peerDependencies ([#27307](https://github.com/angular/angular/issues/27307)) ([32c5be9](https://github.com/angular/angular/commit/32c5be9)), closes [#26154](https://github.com/angular/angular/issues/26154)
|
||||
* **platform-server:** add [@angular](https://github.com/angular)/http to the list of peerDependencies ([#27307](https://github.com/angular/angular/issues/27307)) ([32c5be9](https://github.com/angular/angular/commit/32c5be9)), closes [#26154](https://github.com/angular/angular/issues/26154)
|
||||
* **router:** ensure URL is updated after second redirect with UrlUpdateStrategy="eager" ([#27523](https://github.com/angular/angular/issues/27523)) ([ad26cd6](https://github.com/angular/angular/commit/ad26cd6)), closes [#27116](https://github.com/angular/angular/issues/27116)
|
||||
* **router:** update URL after redirects when urlHandlingStrategy='eager' ([#27356](https://github.com/angular/angular/issues/27356)) ([11a8bd8](https://github.com/angular/angular/commit/11a8bd8)), closes [#27076](https://github.com/angular/angular/issues/27076)
|
||||
* **upgrade:** allow nesting components from different downgraded modules ([#27217](https://github.com/angular/angular/issues/27217)) ([bc0ee01](https://github.com/angular/angular/commit/bc0ee01))
|
||||
@ -1102,7 +1006,7 @@ This release contains various API docs improvements.
|
||||
* **animations:** mark actual descendant node as disabled ([#26180](https://github.com/angular/angular/issues/26180)) ([453589f](https://github.com/angular/angular/commit/453589f))
|
||||
* **bazel:** devserver entry_module should have underscore name ([#27719](https://github.com/angular/angular/issues/27719)) ([b108e9a](https://github.com/angular/angular/commit/b108e9a))
|
||||
* **bazel:** emit full node stack traces when Angular compilation crashes ([#27678](https://github.com/angular/angular/issues/27678)) ([0d8528b](https://github.com/angular/angular/commit/0d8528b))
|
||||
* **bazel:** fix major/minor semver check between @angular/bazel npm packager version and angular bazel repo version ([#27635](https://github.com/angular/angular/issues/27635)) ([3ed1e84](https://github.com/angular/angular/commit/3ed1e84))
|
||||
* **bazel:** fix major/minor semver check between [@angular](https://github.com/angular)/bazel npm packager version and angular bazel repo version ([#27635](https://github.com/angular/angular/issues/27635)) ([3ed1e84](https://github.com/angular/angular/commit/3ed1e84))
|
||||
* **bazel:** Load http_archive and rules_nodejs dependencies ([#27609](https://github.com/angular/angular/issues/27609)) ([89ace1a](https://github.com/angular/angular/commit/89ace1a))
|
||||
* **bazel:** ng_package writes unrelevant definitions to bazel out ([#27519](https://github.com/angular/angular/issues/27519)) ([ef056c5](https://github.com/angular/angular/commit/ef056c5)), closes [/github.com/angular/angular/blob/4f9374951d67c75f67a31c110bd61ab72563db7d/packages/bazel/src/ng_package/packager.ts#L105-L124](https://github.com//github.com/angular/angular/blob/4f9374951d67c75f67a31c110bd61ab72563db7d/packages/bazel/src/ng_package/packager.ts/issues/L105-L124)
|
||||
* **bazel:** Read latest versions from latest-versions.ts & use semver check ([#27591](https://github.com/angular/angular/issues/27591)) ([93078e3](https://github.com/angular/angular/commit/93078e3))
|
||||
@ -1134,7 +1038,7 @@ This release contains various API docs improvements.
|
||||
* **bazel:** ng_package should correctly map to source maps in secondary entry-points ([#27313](https://github.com/angular/angular/issues/27313)) ([fc2c23e](https://github.com/angular/angular/commit/fc2c23e)), closes [#25510](https://github.com/angular/angular/issues/25510)
|
||||
* **compiler-cli:** flatModuleIndex files not generated on windows with multiple input files ([#27200](https://github.com/angular/angular/issues/27200)) ([8087b6b](https://github.com/angular/angular/commit/8087b6b))
|
||||
* **compiler-cli:** ngtsc shim files not being generated on case-insensitive platforms ([#27466](https://github.com/angular/angular/issues/27466)) ([84f2928](https://github.com/angular/angular/commit/84f2928)), closes [/github.com/Microsoft/TypeScript/blob/3e4c5c95abd515eb9713b881d27ab3a93cc00461/src/compiler/sys.ts#L681-L682](https://github.com//github.com/Microsoft/TypeScript/blob/3e4c5c95abd515eb9713b881d27ab3a93cc00461/src/compiler/sys.ts/issues/L681-L682)
|
||||
* **platform-server:** add @angular/http to the list of peerDependencies ([#27307](https://github.com/angular/angular/issues/27307)) ([236ac06](https://github.com/angular/angular/commit/236ac06)), closes [#26154](https://github.com/angular/angular/issues/26154)
|
||||
* **platform-server:** add [@angular](https://github.com/angular)/http to the list of peerDependencies ([#27307](https://github.com/angular/angular/issues/27307)) ([236ac06](https://github.com/angular/angular/commit/236ac06)), closes [#26154](https://github.com/angular/angular/issues/26154)
|
||||
|
||||
|
||||
|
||||
@ -1161,7 +1065,7 @@ This release contains various API docs improvements.
|
||||
* **compiler:** generate inputs with aliases properly ([#26774](https://github.com/angular/angular/issues/26774)) ([19fcfc3](https://github.com/angular/angular/commit/19fcfc3))
|
||||
* **compiler:** generate relative paths only in summary file errors ([#26759](https://github.com/angular/angular/issues/26759)) ([56f44be](https://github.com/angular/angular/commit/56f44be))
|
||||
* **core:** ignore comment nodes under unsafe elements ([#25879](https://github.com/angular/angular/issues/25879)) ([d5cbcef](https://github.com/angular/angular/commit/d5cbcef))
|
||||
* **core:** Remove static dependency from @angular/core to @angular/compiler ([#26734](https://github.com/angular/angular/issues/26734)) ([d042c4a](https://github.com/angular/angular/commit/d042c4a))
|
||||
* **core:** Remove static dependency from [@angular](https://github.com/angular)/core to [@angular](https://github.com/angular)/compiler ([#26734](https://github.com/angular/angular/issues/26734)) ([d042c4a](https://github.com/angular/angular/commit/d042c4a))
|
||||
* **core:** support computed base class in metadata inheritance ([#24014](https://github.com/angular/angular/issues/24014)) ([95743e3](https://github.com/angular/angular/commit/95743e3))
|
||||
* **bazel:** unknown replay compiler error in windows ([#26711](https://github.com/angular/angular/issues/26711)) ([aed95fd](https://github.com/angular/angular/commit/aed95fd))
|
||||
* **core:** ensure that `ɵdefineNgModule` is available in flat-file formats ([#26403](https://github.com/angular/angular/issues/26403)) ([a64859b](https://github.com/angular/angular/commit/a64859b))
|
||||
@ -1268,7 +1172,7 @@ This release contains various API docs improvements.
|
||||
* **compiler:** generate inputs with aliases properly ([#26774](https://github.com/angular/angular/issues/26774)) ([19fcfc3](https://github.com/angular/angular/commit/19fcfc3))
|
||||
* **compiler:** generate relative paths only in summary file errors ([#26759](https://github.com/angular/angular/issues/26759)) ([56f44be](https://github.com/angular/angular/commit/56f44be))
|
||||
* **core:** ignore comment nodes under unsafe elements ([#25879](https://github.com/angular/angular/issues/25879)) ([d5cbcef](https://github.com/angular/angular/commit/d5cbcef))
|
||||
* **core:** Remove static dependency from @angular/core to @angular/compiler ([#26734](https://github.com/angular/angular/issues/26734)) ([d042c4a](https://github.com/angular/angular/commit/d042c4a))
|
||||
* **core:** Remove static dependency from [@angular](https://github.com/angular)/core to [@angular](https://github.com/angular)/compiler ([#26734](https://github.com/angular/angular/issues/26734)) ([d042c4a](https://github.com/angular/angular/commit/d042c4a))
|
||||
* **core:** support computed base class in metadata inheritance ([#24014](https://github.com/angular/angular/issues/24014)) ([95743e3](https://github.com/angular/angular/commit/95743e3))
|
||||
|
||||
|
||||
@ -1280,7 +1184,7 @@ This release contains various API docs improvements.
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** generate relative paths only in summary file errors ([#26759](https://github.com/angular/angular/issues/26759)) ([c01f340](https://github.com/angular/angular/commit/c01f340))
|
||||
* **core:** Remove static dependency from @angular/core to @angular/compiler ([#26734](https://github.com/angular/angular/issues/26734)) ([#26879](https://github.com/angular/angular/issues/26879)) ([257ac83](https://github.com/angular/angular/commit/257ac83))
|
||||
* **core:** Remove static dependency from [@angular](https://github.com/angular)/core to [@angular](https://github.com/angular)/compiler ([#26734](https://github.com/angular/angular/issues/26734)) ([#26879](https://github.com/angular/angular/issues/26879)) ([257ac83](https://github.com/angular/angular/commit/257ac83))
|
||||
* **core:** support computed base class in metadata inheritance ([#24014](https://github.com/angular/angular/issues/24014)) ([b3c6409](https://github.com/angular/angular/commit/b3c6409))
|
||||
|
||||
|
||||
@ -1357,7 +1261,7 @@ To learn about the release highlights and our new CLI-powered update workflow fo
|
||||
* **compiler:** update compiler to flatten nested template fns ([#24943](https://github.com/angular/angular/issues/24943)) ([fe14f18](https://github.com/angular/angular/commit/fe14f18))
|
||||
* **compiler:** update compiler to generate new slot allocations ([#25607](https://github.com/angular/angular/issues/25607)) ([27e2039](https://github.com/angular/angular/commit/27e2039))
|
||||
* **core:** In Testability.whenStable update callback, pass more complete ([#25010](https://github.com/angular/angular/issues/25010)) ([16c03c0](https://github.com/angular/angular/commit/16c03c0))
|
||||
* **core:** add missing `peerDependency ` to `@angular/compiler` ([#26033](https://github.com/angular/angular/issues/26033)) ([549de1e](https://github.com/angular/angular/commit/549de1e)), closes [/github.com/angular/angular/commit/919f42fea1df4b9e38b7d688aef5f2de668e9d3e#diff-58563046c4439699f2e6a89187099a54](https://github.com//github.com/angular/angular/commit/919f42fea1df4b9e38b7d688aef5f2de668e9d3e/issues/diff-58563046c4439699f2e6a89187099a54)
|
||||
* **core:** add missing `peerDependency ` to `[@angular](https://github.com/angular)/compiler` ([#26033](https://github.com/angular/angular/issues/26033)) ([549de1e](https://github.com/angular/angular/commit/549de1e)), closes [/github.com/angular/angular/commit/919f42fea1df4b9e38b7d688aef5f2de668e9d3e#diff-58563046c4439699f2e6a89187099a54](https://github.com//github.com/angular/angular/commit/919f42fea1df4b9e38b7d688aef5f2de668e9d3e/issues/diff-58563046c4439699f2e6a89187099a54)
|
||||
* **core:** allow null value for renderer setElement(…) ([#17065](https://github.com/angular/angular/issues/17065)) ([ff15043](https://github.com/angular/angular/commit/ff15043)), closes [#13686](https://github.com/angular/angular/issues/13686)
|
||||
* **core:** do not clear element content when using shadow dom ([#24861](https://github.com/angular/angular/issues/24861)) ([6e828bb](https://github.com/angular/angular/commit/6e828bb))
|
||||
* **core:** size regression with closure compiler ([#25531](https://github.com/angular/angular/issues/25531)) ([1f59f2f](https://github.com/angular/angular/commit/1f59f2f))
|
||||
@ -1803,7 +1707,7 @@ To learn about the release highlights and our new CLI-powered update workflow fo
|
||||
* **upgrade:** propagate return value of resumeBootstrap ([#22754](https://github.com/angular/angular/issues/22754)) ([a2330ff](https://github.com/angular/angular/commit/a2330ff)), closes [#22723](https://github.com/angular/angular/issues/22723)
|
||||
* **upgrade:** two-way binding and listening for event ([#22772](https://github.com/angular/angular/issues/22772)) ([2b3de63](https://github.com/angular/angular/commit/2b3de63)), closes [#22734](https://github.com/angular/angular/issues/22734)
|
||||
* **upgrade:** correctly destroy nested downgraded component ([#22400](https://github.com/angular/angular/issues/22400)) ([8a85888](https://github.com/angular/angular/commit/8a85888)), closes [#22392](https://github.com/angular/angular/issues/22392)
|
||||
* **upgrade:** correctly handle `=` bindings in `@angular/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([f089bf5](https://github.com/angular/angular/commit/f089bf5))
|
||||
* **upgrade:** correctly handle `=` bindings in `[@angular](https://github.com/angular)/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([f089bf5](https://github.com/angular/angular/commit/f089bf5))
|
||||
* **upgrade:** fix empty transclusion content with AngularJS@>=1.5.8 ([#22167](https://github.com/angular/angular/issues/22167)) ([13ab91e](https://github.com/angular/angular/commit/13ab91e)), closes [#22175](https://github.com/angular/angular/issues/22175)
|
||||
|
||||
|
||||
@ -1938,7 +1842,7 @@ To learn about the release highlights and our new CLI-powered update workflow fo
|
||||
* **router:** don't mutate route configs ([#22358](https://github.com/angular/angular/issues/22358)) ([8f0a064](https://github.com/angular/angular/commit/8f0a064)), closes [#22203](https://github.com/angular/angular/issues/22203)
|
||||
* **router:** fix URL serialization so special characters are only encoded where needed ([#22337](https://github.com/angular/angular/issues/22337)) ([789a47e](https://github.com/angular/angular/commit/789a47e)), closes [#10280](https://github.com/angular/angular/issues/10280)
|
||||
* **upgrade:** correctly destroy nested downgraded component ([#22400](https://github.com/angular/angular/issues/22400)) ([4aef9de](https://github.com/angular/angular/commit/4aef9de)), closes [#22392](https://github.com/angular/angular/issues/22392)
|
||||
* **upgrade:** correctly handle `=` bindings in `@angular/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([6638390](https://github.com/angular/angular/commit/6638390))
|
||||
* **upgrade:** correctly handle `=` bindings in `[@angular](https://github.com/angular)/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([6638390](https://github.com/angular/angular/commit/6638390))
|
||||
* **upgrade:** fix empty transclusion content with AngularJS@>=1.5.8 ([#22167](https://github.com/angular/angular/issues/22167)) ([a9a0e27](https://github.com/angular/angular/commit/a9a0e27)), closes [#22175](https://github.com/angular/angular/issues/22175)
|
||||
|
||||
|
||||
@ -1952,7 +1856,7 @@ To learn about the release highlights and our new CLI-powered update workflow fo
|
||||
* **platform-server:** generate correct stylings for camel case names ([#22263](https://github.com/angular/angular/issues/22263)) ([de02a7a](https://github.com/angular/angular/commit/de02a7a)), closes [#19235](https://github.com/angular/angular/issues/19235)
|
||||
* **router:** don't mutate route configs ([#22358](https://github.com/angular/angular/issues/22358)) ([8f0a064](https://github.com/angular/angular/commit/8f0a064)), closes [#22203](https://github.com/angular/angular/issues/22203)
|
||||
* **upgrade:** correctly destroy nested downgraded component ([#22400](https://github.com/angular/angular/issues/22400)) ([4aef9de](https://github.com/angular/angular/commit/4aef9de)), closes [#22392](https://github.com/angular/angular/issues/22392)
|
||||
* **upgrade:** correctly handle `=` bindings in `@angular/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([6638390](https://github.com/angular/angular/commit/6638390))
|
||||
* **upgrade:** correctly handle `=` bindings in `[@angular](https://github.com/angular)/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([6638390](https://github.com/angular/angular/commit/6638390))
|
||||
* **upgrade:** fix empty transclusion content with AngularJS@>=1.5.8 ([#22167](https://github.com/angular/angular/issues/22167)) ([a9a0e27](https://github.com/angular/angular/commit/a9a0e27)), closes [#22175](https://github.com/angular/angular/issues/22175)
|
||||
|
||||
|
||||
@ -2399,7 +2303,7 @@ Note: Due to an animation fix back in 5.1.1 ([c2b3792](https://github.com/angula
|
||||
* **platform-server:** provide a way to hook into renderModule* ([#19023](https://github.com/angular/angular/issues/19023)) ([8dfc3c3](https://github.com/angular/angular/commit/8dfc3c3))
|
||||
* **router:** add ActivationStart/End events ([8f79150](https://github.com/angular/angular/commit/8f79150))
|
||||
* **router:** add events tracking activation of individual routes ([49cd851](https://github.com/angular/angular/commit/49cd851))
|
||||
* **service-worker:** introduce the @angular/service-worker package ([#19274](https://github.com/angular/angular/issues/19274)) ([d442b68](https://github.com/angular/angular/commit/d442b68))
|
||||
* **service-worker:** introduce the [@angular](https://github.com/angular)/service-worker package ([#19274](https://github.com/angular/angular/issues/19274)) ([d442b68](https://github.com/angular/angular/commit/d442b68))
|
||||
* **upgrade:** propagate touched state of NgModelController ([59c23c7](https://github.com/angular/angular/commit/59c23c7))
|
||||
* **upgrade:** support lazy-loading Angular module into AngularJS app ([30e76fc](https://github.com/angular/angular/commit/30e76fc))
|
||||
* update angular to support TypeScript 2.4 ([ca5aeba](https://github.com/angular/angular/commit/ca5aeba))
|
||||
@ -2623,7 +2527,7 @@ Because of multiple bugs and browser inconsistencies, we have dropped the intl a
|
||||
### Bug Fixes
|
||||
|
||||
* **animations:** do not leak DOM nodes/styling for host triggered animations ([#18853](https://github.com/angular/angular/issues/18853)) ([1cc3fe2](https://github.com/angular/angular/commit/1cc3fe2)), closes [#18606](https://github.com/angular/angular/issues/18606)
|
||||
* **common:** fix improper packaging for @angular/common/http ([#18613](https://github.com/angular/angular/issues/18613)) ([a203a95](https://github.com/angular/angular/commit/a203a95))
|
||||
* **common:** fix improper packaging for [@angular](https://github.com/angular)/common/http ([#18613](https://github.com/angular/angular/issues/18613)) ([a203a95](https://github.com/angular/angular/commit/a203a95))
|
||||
* **common:** fix XSSI prefix stripping by using JSON.parse always ([#18466](https://github.com/angular/angular/issues/18466)) ([8821723](https://github.com/angular/angular/commit/8821723)), closes [#18396](https://github.com/angular/angular/issues/18396) [#18453](https://github.com/angular/angular/issues/18453)
|
||||
* **compiler:** normalize the locale name ([#18963](https://github.com/angular/angular/issues/18963)) ([497e017](https://github.com/angular/angular/commit/497e017))
|
||||
* **core:** complete EventEmitter in QueryList on component destroy ([#18902](https://github.com/angular/angular/issues/18902)) ([7d137d7](https://github.com/angular/angular/commit/7d137d7)), closes [#18741](https://github.com/angular/angular/issues/18741)
|
||||
@ -2964,7 +2868,7 @@ Note: the 4.4.0 release on npm accidentally glitched-out midway, so we cut 4.4.1
|
||||
* **compiler-cli:** allow '==' to compare nullable types ([#16731](https://github.com/angular/angular/issues/16731)) ([d761059](https://github.com/angular/angular/commit/d761059))
|
||||
* **core:** detach projected views when a parent view is destroyed ([#16592](https://github.com/angular/angular/issues/16592)) ([f0f6544](https://github.com/angular/angular/commit/f0f6544)), closes [#15578](https://github.com/angular/angular/issues/15578)
|
||||
* **core:** projected views should be dirty checked when the declaring component is dirty checked. ([#16592](https://github.com/angular/angular/issues/16592)) ([fcc91d8](https://github.com/angular/angular/commit/fcc91d8)), closes [#14321](https://github.com/angular/angular/issues/14321)
|
||||
* **http:** flatten metadata for @angular/http/testing ([9da6340](https://github.com/angular/angular/commit/9da6340)), closes [#15521](https://github.com/angular/angular/issues/15521)
|
||||
* **http:** flatten metadata for [@angular](https://github.com/angular)/http/testing ([9da6340](https://github.com/angular/angular/commit/9da6340)), closes [#15521](https://github.com/angular/angular/issues/15521)
|
||||
* **http:** honor RequestArgs.search and RequestArgs.params map type ([aef5245](https://github.com/angular/angular/commit/aef5245)), closes [#15761](https://github.com/angular/angular/issues/15761) [#16392](https://github.com/angular/angular/issues/16392)
|
||||
* **http:** introduce encodingHint for text() for better ArrayBuffer support ([7ae7a84](https://github.com/angular/angular/commit/7ae7a84)), closes [#15932](https://github.com/angular/angular/issues/15932) [#16420](https://github.com/angular/angular/issues/16420)
|
||||
* **router:** fix redirect to a URL with a param having multiple values ([#16376](https://github.com/angular/angular/issues/16376)) ([5d4b36f](https://github.com/angular/angular/commit/5d4b36f)), closes [#16310](https://github.com/angular/angular/issues/16310)
|
||||
@ -3020,7 +2924,7 @@ Note: the 4.4.0 release on npm accidentally glitched-out midway, so we cut 4.4.1
|
||||
* **compiler:** avoid a `...null` spread in extraction ([#16547](https://github.com/angular/angular/issues/16547)) ([d0e1688](https://github.com/angular/angular/commit/d0e1688))
|
||||
* **core:** detach projected views when a parent view is destroyed ([#16592](https://github.com/angular/angular/issues/16592)) ([ee6705a](https://github.com/angular/angular/commit/ee6705a)), closes [#15578](https://github.com/angular/angular/issues/15578)
|
||||
* **core:** projected views should be dirty checked when the declaring component is dirty checked. ([#16592](https://github.com/angular/angular/issues/16592)) ([9218812](https://github.com/angular/angular/commit/9218812)), closes [#14321](https://github.com/angular/angular/issues/14321)
|
||||
* **http:** flatten metadata for @angular/http/testing ([9c70a3c](https://github.com/angular/angular/commit/9c70a3c)), closes [#15521](https://github.com/angular/angular/issues/15521)
|
||||
* **http:** flatten metadata for [@angular](https://github.com/angular)/http/testing ([9c70a3c](https://github.com/angular/angular/commit/9c70a3c)), closes [#15521](https://github.com/angular/angular/issues/15521)
|
||||
* **http:** honor RequestArgs.search and RequestArgs.params map type ([63066f7](https://github.com/angular/angular/commit/63066f7)), closes [#15761](https://github.com/angular/angular/issues/15761) [#16392](https://github.com/angular/angular/issues/16392)
|
||||
* **http:** introduce encodingHint for text() for better ArrayBuffer support ([ec3b6e9](https://github.com/angular/angular/commit/ec3b6e9)), closes [#15932](https://github.com/angular/angular/issues/15932) [#16420](https://github.com/angular/angular/issues/16420)
|
||||
* **router:** fix redirect to a URL with a param having multiple values ([#16376](https://github.com/angular/angular/issues/16376)) ([915eae5](https://github.com/angular/angular/commit/915eae5)), closes [#16310](https://github.com/angular/angular/issues/16310)
|
||||
@ -3650,7 +3554,7 @@ Note: the 4.0.0-rc.0 release on npm accidentally omitted one bug fix, so we cut
|
||||
* **core:** add isStable Observable property to ApplicationRef to indicate when it's stable and unstable ([#14337](https://github.com/angular/angular/issues/14337)) ([c481798](https://github.com/angular/angular/commit/c481798))
|
||||
* **platform-server:** add API to render Module and ModuleFactory to string ([#14381](https://github.com/angular/angular/issues/14381)) ([b4d444a](https://github.com/angular/angular/commit/b4d444a))
|
||||
* **platform-server:** Implement PlatformLocation for platformServer() ([#14405](https://github.com/angular/angular/issues/14405)) ([9e28568](https://github.com/angular/angular/commit/9e28568))
|
||||
* **platform-server:** support @angular/http from @angular/platform-server ([9559d3e](https://github.com/angular/angular/commit/9559d3e))
|
||||
* **platform-server:** support [@angular](https://github.com/angular)/http from [@angular](https://github.com/angular)/platform-server ([9559d3e](https://github.com/angular/angular/commit/9559d3e))
|
||||
* **tsc-wrapped:** add an option to `ngc` to bundle metadata ([#14509](https://github.com/angular/angular/issues/14509)) ([3b89670](https://github.com/angular/angular/commit/3b89670))
|
||||
|
||||
|
||||
@ -4611,7 +4515,7 @@ Note: The 2.2.0-beta.0 release also contains all the changes present in the 2.1.
|
||||
* **compiler:** properly shim `:host:before` and `:host(:before)` ([#12171](https://github.com/angular/angular/issues/12171)) ([aa92512](https://github.com/angular/angular/commit/aa92512)), closes [#12165](https://github.com/angular/angular/issues/12165)
|
||||
* **compiler:** validate `@HostBinding` name ([#12139](https://github.com/angular/angular/issues/12139)) ([13ecc14](https://github.com/angular/angular/commit/13ecc14))
|
||||
* **compiler-cli:** don't clone static symbols when simplifying annotation metadata ([#12158](https://github.com/angular/angular/issues/12158)) ([8c477b2](https://github.com/angular/angular/commit/8c477b2))
|
||||
* **compiler-cli:** remove peerDependency on @angular/platform-server ([#12122](https://github.com/angular/angular/issues/12122)) ([71b7654](https://github.com/angular/angular/commit/71b7654))
|
||||
* **compiler-cli:** remove peerDependency on [@angular](https://github.com/angular)/platform-server ([#12122](https://github.com/angular/angular/issues/12122)) ([71b7654](https://github.com/angular/angular/commit/71b7654))
|
||||
* **compiler-cli:** remove unused parse5 dependency from package.json ([eaaec69](https://github.com/angular/angular/commit/eaaec69))
|
||||
* **forms:** allow optional fields with pattern and minlength validators ([#12147](https://github.com/angular/angular/issues/12147)) ([d22eeb7](https://github.com/angular/angular/commit/d22eeb7))
|
||||
* **forms:** properly validate blank strings with minlength ([#12091](https://github.com/angular/angular/issues/12091)) ([f50c1da](https://github.com/angular/angular/commit/f50c1da))
|
||||
|
@ -48,7 +48,7 @@ Angular supports most recent browsers. This includes the following specific vers
|
||||
2 most recent major versions
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr>
|
||||
<td>
|
||||
IE
|
||||
</td>
|
||||
@ -57,7 +57,7 @@ Angular supports most recent browsers. This includes the following specific vers
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr>
|
||||
<tr>
|
||||
<td>
|
||||
IE Mobile
|
||||
</td>
|
||||
@ -82,7 +82,7 @@ Angular supports most recent browsers. This includes the following specific vers
|
||||
<td>
|
||||
2 most recent major versions
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Android
|
||||
@ -91,7 +91,7 @@ Angular supports most recent browsers. This includes the following specific vers
|
||||
<td>
|
||||
Nougat (7.0)<br>Marshmallow (6.0)<br>Lollipop (5.0, 5.1)<br>KitKat (4.4)
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
@ -103,10 +103,12 @@ using <a href="https://saucelabs.com/">SauceLabs</a> and
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
## Polyfills
|
||||
|
||||
Angular is built on the latest standards of the web platform.
|
||||
Targeting such a wide range of browsers is challenging because they do not support all features of modern browsers.
|
||||
|
||||
You compensate by loading polyfill scripts ("polyfills") for the browsers that you must support.
|
||||
The [table below](#polyfill-libs) identifies most of the polyfills you might need.
|
||||
|
||||
@ -118,15 +120,6 @@ Note that polyfills cannot magically transform an old, slow browser into a moder
|
||||
|
||||
</div>
|
||||
|
||||
In Angular CLI version 8 and higher, applications are built using *differential loading*, a strategy where the CLI builds two separate bundles as part of your deployed application.
|
||||
|
||||
* The first bundle contains modern ES1015 syntax, takes advantage of built-in support in modern browsers, ships less polyfills, and results in a smaller bundle size.
|
||||
|
||||
* The second bundle contains code in the old ES5 syntax, along with all necessary polyfills. This results in a larger bundle size, but supports older browsers.
|
||||
|
||||
This strategy allows you to continue to build your web application to support multiple browsers, but only load the necessary code that the browser needs.
|
||||
For more information about how this works, see [Differential Loading](guide/deployment#differential-loading) in the [Deployment guide](guide/deployment).
|
||||
|
||||
## Enabling polyfills
|
||||
|
||||
[Angular CLI](cli) users enable polyfills through the `src/polyfills.ts` file that
|
||||
@ -309,14 +302,14 @@ Here are the features which may require additional polyfills:
|
||||
<td>
|
||||
|
||||
If you use the following deprecated i18n pipes:
|
||||
|
||||
|
||||
|
||||
[date](api/common/DeprecatedDatePipe),
|
||||
|
||||
[date](api/common/DeprecatedDatePipe),
|
||||
|
||||
[currency](api/common/DeprecatedCurrencyPipe),
|
||||
|
||||
[decimal](api/common/DeprecatedDecimalPipe),
|
||||
|
||||
|
||||
[decimal](api/common/DeprecatedDecimalPipe),
|
||||
|
||||
[percent](api/common/DeprecatedPercentPipe)
|
||||
|
||||
</td>
|
||||
@ -337,8 +330,8 @@ Here are the features which may require additional polyfills:
|
||||
|
||||
<td>
|
||||
|
||||
[NgClass](api/common/NgClass)
|
||||
|
||||
[NgClass](api/common/NgClass)
|
||||
|
||||
on SVG elements
|
||||
</td>
|
||||
|
||||
@ -358,8 +351,8 @@ Here are the features which may require additional polyfills:
|
||||
|
||||
<td>
|
||||
|
||||
[Http](guide/http)
|
||||
|
||||
[Http](guide/http)
|
||||
|
||||
when sending and receiving binary data
|
||||
</td>
|
||||
|
||||
@ -383,8 +376,8 @@ Here are the features which may require additional polyfills:
|
||||
|
||||
<td>
|
||||
|
||||
[Router](guide/router)
|
||||
|
||||
[Router](guide/router)
|
||||
|
||||
when using [hash-based routing](guide/router#appendix-locationstrategy-and-browser-url-styles)
|
||||
</td>
|
||||
|
||||
|
@ -30,9 +30,7 @@ You will need two terminals to get the live-reload experience.
|
||||
* On the first terminal, run the [`ng build` command](cli/build) in *watch* mode to compile the application to the `dist` folder.
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
|
||||
ng build --watch
|
||||
|
||||
</code-example>
|
||||
|
||||
Like the `ng serve` command, this regenerates output files when source files change.
|
||||
@ -40,9 +38,7 @@ You will need two terminals to get the live-reload experience.
|
||||
* On the second terminal, install a web server (such as [lite-server](https://github.com/johnpapa/lite-server)), and run it against the output folder. For example:
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
|
||||
lite-server --baseDir="dist"
|
||||
|
||||
</code-example>
|
||||
|
||||
The server will automatically reload your browser when new files are output.
|
||||
@ -60,9 +56,7 @@ For the simplest deployment, create a production build and copy the output direc
|
||||
1. Start with the production build:
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
|
||||
ng build --prod
|
||||
|
||||
</code-example>
|
||||
|
||||
|
||||
@ -84,10 +78,8 @@ Make a note of the user name and project name in GitHub.
|
||||
|
||||
1. Build your project using Github project name, with the Angular CLI command [`ng build`](cli/build) and the options shown here:
|
||||
<code-example language="none" class="code-shell">
|
||||
|
||||
ng build --prod --output-path docs --base-href /<project_name>/
|
||||
|
||||
</code-example>
|
||||
ng build --prod --output-path docs --base-href /<project_name>/
|
||||
</code-example>
|
||||
|
||||
1. When the build is complete, make a copy of `docs/index.html` and name it `docs/404.html`.
|
||||
|
||||
@ -152,7 +144,6 @@ The list is by no means exhaustive, but should provide you with a good starting
|
||||
(https://ngmilk.rocks/2015/03/09/angularjs-html5-mode-or-pretty-urls-on-apache-using-htaccess/):
|
||||
|
||||
<code-example format=".">
|
||||
|
||||
RewriteEngine On
|
||||
# If an existing asset or directory is requested go to it as it is
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
|
||||
@ -161,7 +152,6 @@ The list is by no means exhaustive, but should provide you with a good starting
|
||||
|
||||
# If the requested resource doesn't exist, use index.html
|
||||
RewriteRule ^ /index.html
|
||||
|
||||
</code-example>
|
||||
|
||||
|
||||
@ -170,17 +160,14 @@ The list is by no means exhaustive, but should provide you with a good starting
|
||||
modified to serve `index.html`:
|
||||
|
||||
<code-example format=".">
|
||||
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
</code-example>
|
||||
|
||||
|
||||
* [IIS](https://www.iis.net/): add a rewrite rule to `web.config`, similar to the one shown
|
||||
[here](http://stackoverflow.com/a/26152011/2116927):
|
||||
|
||||
<code-example format='.' linenums="false">
|
||||
|
||||
<code-example format='.'>
|
||||
<system.webServer>
|
||||
<rewrite>
|
||||
<rules>
|
||||
@ -214,7 +201,6 @@ and to
|
||||
[rewrite rule](https://firebase.google.com/docs/hosting/url-redirects-rewrites#section-rewrites).
|
||||
|
||||
<code-example format=".">
|
||||
|
||||
"rewrites": [ {
|
||||
"source": "**",
|
||||
"destination": "/index.html"
|
||||
@ -262,9 +248,7 @@ See [`ng build`](cli/build) for more about CLI build options and what they do.
|
||||
In addition to build optimizations, Angular also has a runtime production mode. Angular apps run in development mode by default, as you can see by the following message on the browser console:
|
||||
|
||||
<code-example format="nocode">
|
||||
|
||||
Angular is running in the development mode. Call enableProdMode() to enable the production mode.
|
||||
|
||||
</code-example>
|
||||
|
||||
Switching to _production mode_ makes it run faster by disabling development specific checks such as the dual change detection cycles.
|
||||
@ -283,9 +267,9 @@ Configure the Angular Router to defer loading of all other modules (and their as
|
||||
or by [_lazy loading_](guide/router#asynchronous-routing "Lazy loading")
|
||||
them on demand.
|
||||
|
||||
<div class="callout is-helpful>
|
||||
<div class="alert is-helpful>
|
||||
|
||||
<header>Don't eagerly import something from a lazy-loaded module</header>
|
||||
#### Don't eagerly import something from a lazy-loaded module
|
||||
|
||||
If you mean to lazy-load a module, be careful not import it
|
||||
in a file that's eagerly loaded when the app starts (such as the root `AppModule`).
|
||||
@ -329,34 +313,26 @@ tool is a great way to inspect the generated JavaScript bundles after a producti
|
||||
Install `source-map-explorer`:
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
|
||||
npm install source-map-explorer --save-dev
|
||||
|
||||
</code-example>
|
||||
|
||||
Build your app for production _including the source maps_
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
|
||||
ng build --prod --source-map
|
||||
|
||||
</code-example>
|
||||
|
||||
List the generated bundles in the `dist/` folder.
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
|
||||
ls dist/*.bundle.js
|
||||
|
||||
</code-example>
|
||||
|
||||
Run the explorer to generate a graphical representation of one of the bundles.
|
||||
The following example displays the graph for the _main_ bundle.
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
|
||||
node_modules/.bin/source-map-explorer dist/main.*.bundle.js
|
||||
|
||||
</code-example>
|
||||
|
||||
The `source-map-explorer` analyzes the source map generated with the bundle and draws a map of all dependencies,
|
||||
@ -394,58 +370,34 @@ the subfolder is `my/app/` and you should add `<base href="/my/app/">` to the se
|
||||
When the `base` tag is mis-configured, the app fails to load and the browser console displays `404 - Not Found` errors
|
||||
for the missing files. Look at where it _tried_ to find those files and adjust the base tag appropriately.
|
||||
|
||||
{@a differential-loading}
|
||||
|
||||
## Differential Loading
|
||||
|
||||
When building web applications, making sure your application is compatible with the majority of browsers is a goal.
|
||||
Even as JavaScript continues to evolve, with new features being introduced, not all browsers are updated with support for these new features at the same pace.
|
||||
When building web applications, making sure your application is compatible with the majority of browsers is a goal. Even as JavaScript continues to evolve, with new features being introduced, not all browsers are updated with support for these new features at the same pace. This is where compilation and [polyfills](guide/browser-support#polyfills) come in. The code you write in development using TypeScript is compiled and bundled into a format that is compatible with most browsers, commonly known as ES5. Polyfills are used bridge the gap, providing functionality that simply doesn't exist in some legacy browsers.
|
||||
|
||||
The code you write in development using TypeScript is compiled and bundled into ES2015, the JavaScript syntax that is compatible with most browsers.
|
||||
All modern browsers support ES2015 and beyond, but in most cases, you still have to account for users accessing your application from a browser that doesn't.
|
||||
When targeting older browsers, [polyfills](guide/browser-support#polyfills) can bridge the gap by providing functionality that doesn't exist in the older versions of JavaScript supported by those browsers.
|
||||
There is a cost to ensure this browser compatibility, and it comes in the form of larger bundle size. All modern browsers support ES2015 and beyond, but in most cases, you still have to account for users accessing your application from a browser that doesn't. To maximize compatibility, you ship a single bundle that includes all your compiled code, plus any polyfills that may be needed. Users with modern browsers shouldn't pay the price of increased bundle size when used in a modern browser that supports many of the latest features in JavaScript. This is where differential loading comes into play.
|
||||
|
||||
To maximize compatibility, you could ship a single bundle that includes all your compiled code, plus any polyfills that may be needed.
|
||||
Users with modern browsers, however, shouldn't have to pay the price of increased bundle size that comes with polyfills they don't need.
|
||||
Differential loading, which is supported by default in Angular CLI version 8 and higher, solves this problem.
|
||||
|
||||
Differential loading is a strategy where the CLI builds two separate bundles as part of your deployed application.
|
||||
|
||||
* The first bundle contains modern ES1015 syntax, takes advantage of built-in support in modern browsers, ships less polyfills, and results in a smaller bundle size.
|
||||
|
||||
* The second bundle contains code in the old ES5 syntax, along with all necessary polyfills. This results in a larger bundle size, but supports older browsers.
|
||||
|
||||
This strategy allows you to continue to build your web application to support multiple browsers, but only load the necessary code that the browser needs.
|
||||
Differential loading is a strategy where the CLI builds two separate bundles as part of your deployed application. The modern bundle contains modern syntax, takes advantage of built-in support in modern browsers, ships less polyfills, and results in a smaller bundle size. The second bundle, includes the additional compiled code, all necessary polyfills, and results in a larger bundle size. This strategy allows you to continue to build your web application to support multiple browsers, but only load the necessary code that the browser needs.
|
||||
|
||||
### Differential builds
|
||||
|
||||
The Angular CLI handles differential loading for you as part of the _build_ process for deployment.
|
||||
The `ng build` command produces the necessary bundles used for differential loading, based on your browser support requirements and compilation target.
|
||||
The Angular CLI handles differential loading for you as part of the _build_ process for deployment. The Angular CLI will produce the necessary bundles used for differential loading, based on your browser support requirements and compilation target.
|
||||
|
||||
The Angular CLI uses two configurations for differential loading:
|
||||
|
||||
* Browsers list
|
||||
The `browserslist` configuration file is included in your application [project structure](guide/file-structure#application-configuration-files) and provides the minimum browsers your application supports. See the [Browserslist spec](https://github.com/browserslist/browserslist) for complete configuration options.
|
||||
|
||||
* TypeScript configuration
|
||||
In the TypeScript configuration file, `tsconfig.json`, the `target` in the `compilerOptions` section determines the ECMAScript target version that the code is compiled to.
|
||||
Modern browsers support ES2015 natively, while ES5 is more commonly used to support legacy browsers.
|
||||
- Browserslist - The `browserslist` configuration file is included in your application [project structure](guide/file-structure#application-configuration-files) and provides the minimum browsers your application supports. See the [Browserslist spec](https://github.com/browserslist/browserslist) for complete configuration options.
|
||||
- tsconfig.json - The `target` in the TypeScript `compilerOptions` determines the ECMAScript target version that the code is compiled to. Modern browsers support ES2015 natively, while ES5 is more commonly used to support legacy browsers.
|
||||
|
||||
<div class="alert is-helpful">
|
||||
|
||||
Differential loading is currently only supported when using `es2015` as a compilation `target`. When used with targets higher than `es2015`, a warning is emitted during build time.
|
||||
**Note:** Differential loading is currently only supported when using `es2015` as a compilation `target`. When used with targets higher than `es2015`, a warning is emitted during build time.
|
||||
|
||||
</div>
|
||||
|
||||
The CLI queries the Browserslist configuration, and checks the `target` to determine if support for legacy browsers is required.
|
||||
The combination of these two configurations determines whether multiple bundles are produced when you create a _build_.
|
||||
When you create a development build using [`ng build`](cli/build) and differential loading is enabled, the output produced is simpler and easier to debug, allowing you to rely less on sourcemaps of compiled code.
|
||||
When you create a production build using [`ng build --prod`](cli/build), the CLI uses the defined configurations above to determine the bundles to build for deployment of your application.
|
||||
The CLI queries the Browserslist configuration, and checks the `target` to determine if support for legacy browsers is required. The combination of these two configurations determines whether multiple bundles are produced when you create a _build_. When you create a development build using [`ng build`](cli/build) and differential loading is enabled, the output produced is simpler and easier to debug, allowing you to rely less on sourcemaps of compiled code. When you create a production build using [`ng build --prod`](cli/build), the CLI uses the defined configurations above to determine the bundles to build for deployment of your application.
|
||||
|
||||
The `index.html` file is also modified during the build process to include script tags that enable differential loading. See the sample output below from the `index.html` file produced during a build using `ng build`.
|
||||
|
||||
<code-example language="html" format="." linenums="false">
|
||||
|
||||
```html
|
||||
<!-- ... -->
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
@ -461,14 +413,13 @@ The `index.html` file is also modified during the build process to include scrip
|
||||
<script src="main-es5.js" nomodule></script>
|
||||
</body>
|
||||
<!-- ... -->
|
||||
```
|
||||
|
||||
</code-example>
|
||||
|
||||
Each script tag has a `type="module"` or `nomodule` attribute. Browsers with native support for ES modules only load the scripts with the `module` type attribute and ignore scripts with the `nomodule` attribute. Legacy browsers only load the scripts with the `nomodule` attribute, and ignore the script tags with the `module` type that load ES modules.
|
||||
Each script tag has a `type="module"` or `nomodule` attribute. Browsers with native support for ES modules only load the scripts with the `module` type attribute and ignore scripts with the `nomodule` attribute. Legacy browsers only load the scripts with the `nomodule` attribute, and ignore the script tags with the `module` type that load ES modules.
|
||||
|
||||
<div class="alert is-helpful">
|
||||
|
||||
Some legacy browsers still download both bundles, but only execute the appropriate scripts based on the attributes mentioned above. You can read more on the issue [here](https://github.com/philipwalton/webpack-esnext-boilerplate/issues/1).
|
||||
**Note:** Some legacy browsers still download both bundles, but only execute the appropriate scripts based on the attributes mentioned above. You can read more on the issue [here](https://github.com/philipwalton/webpack-esnext-boilerplate/issues/1).
|
||||
|
||||
</div>
|
||||
|
||||
@ -476,10 +427,11 @@ See the [configuration table](#configuration-table) below for the configurations
|
||||
|
||||
### Configuring differential loading
|
||||
|
||||
Differential loading is supported by default with version 8 and later of the Angular CLI.
|
||||
For each application project in your workspace, you can configure how builds are produced based on the `browserslist` and `tsconfig.json` files in your application project.
|
||||
Differential loading for creating builds is already supported with version 8 and later of the Angular CLI. For each application project in your workspace, you can configure how builds are produced based on the mentioned `browserslist` and `tsconfig.json` files in your application project.
|
||||
|
||||
For a newly created Angular application, the default `browserslist` looks like this:
|
||||
Look at the default configuration for a newly created Angular application:
|
||||
|
||||
The `browserslist` looks like this:
|
||||
|
||||
```
|
||||
> 0.5%
|
||||
@ -491,8 +443,8 @@ not IE 9-11 # For IE 9-11 support, remove 'not'.
|
||||
|
||||
The `tsconfig.json` looks like this:
|
||||
|
||||
<code-example language="json" format="." linenums="false">
|
||||
|
||||
```
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
@ -515,14 +467,13 @@ The `tsconfig.json` looks like this:
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</code-example>
|
||||
|
||||
By default, legacy browsers such as IE 9-11 are ignored, and the compilation target is ES2015. As a result, this produces two builds, and differential loading is enabled. If you ignore browsers without ES2015 support, a single build is produced. To see the build result for differential loading based on different configurations, refer to the table below.
|
||||
By default, legacy browsers such as IE 9-11 are ignored, and the compilation target is ES2015. As a result, this produces two builds, and differential loading is enabled. If you ignore browsers without ES2015 support, a single build is produced. To see the build result for differential loading based on different configurations, refer to the table below.
|
||||
|
||||
<div class="alert is-important">
|
||||
|
||||
To see which browsers are supported with the above configuration, see which settings meet to your browser support requirements, see the [Browserslist compatibility page](https://browserl.ist/?q=%3E+0.5%25%2C+last+2+versions%2C+Firefox+ESR%2C+Chrome+41%2C+not+dead%2C+not+IE+9-11).
|
||||
**Note:** To see which browsers are supported with the above configuration, see which settings meet to your browser support requirements, see the [Browserslist compatibility page](https://browserl.ist/?q=%3E+0.5%25%2C+last+2+versions%2C+Firefox+ESR%2C+Chrome+41%2C+not+dead%2C+not+IE+9-11).
|
||||
|
||||
</div>
|
||||
|
||||
@ -539,151 +490,9 @@ When the ES5 Browserslist result is `disabled`, then ES5 browser support is not
|
||||
|
||||
### Opting out of differential loading
|
||||
|
||||
Differential loading can be explicitly disabled if it causes unexpected issues or you need to target ES5 specifically for legacy browser support.
|
||||
Differential loading can be explicitly disabled if it causes unexpected issues or you need to target ES5 specifically for legacy browser support.
|
||||
|
||||
To explicitly disable differential loading:
|
||||
|
||||
- Enable the `dead` or `IE` browsers in the `browserslist` config file by removing the `not` keyword in front of them.
|
||||
- Set the `target` in the `compilerOptions` to `es5`.
|
||||
|
||||
{@a test-and-serve}
|
||||
|
||||
## Local development in older browsers
|
||||
|
||||
In Angular CLI version 8 and higher, differential loading is enabled by default for the `ng build` command.
|
||||
The `ng serve`, `ng test`, and `ng e2e` commands, however, generate a single ES2015 build which cannot run in older browsers that don't support the modules, such as IE 11.
|
||||
|
||||
If you want to run ES5 code during development, you could disable differential loading completely.
|
||||
To maintain the benefits of differential loading, however, a better option is to define multiple configurations for `ng serve`, `ng e2e`, and `ng test`.
|
||||
|
||||
{@a differential-serve}
|
||||
|
||||
### Configuring serve for ES5
|
||||
|
||||
To do this for `ng serve`, create a new file, `tsconfig-es5.app.json` next to `tsconfig.app.json` with the following content.
|
||||
|
||||
<code-example language="json" format="." linenums="false">
|
||||
|
||||
{
|
||||
"extends": "./tsconfig.app.json",
|
||||
"compilerOptions": {
|
||||
"target": "es5"
|
||||
}
|
||||
}
|
||||
|
||||
</code-example>
|
||||
|
||||
In `angular.json` add two new configuration sections under the `build` and `serve` targets to point to the new TypeScript configuration.
|
||||
|
||||
<code-example language="json" format="." linenums="false">
|
||||
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
...
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
...
|
||||
},
|
||||
"es5": {
|
||||
"tsConfig": "./tsconfig-es5.app.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
...
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
...
|
||||
},
|
||||
"es5": {
|
||||
"browserTarget": "app:build:es5"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
</code-example>
|
||||
|
||||
You can then run the serve with this configuration.
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
|
||||
ng serve --configuration es5
|
||||
|
||||
</code-example>
|
||||
|
||||
{@a differential-test}
|
||||
|
||||
### Configuring the test command
|
||||
|
||||
Create a new file, `tsconfig-es5.spec.json` next to `tsconfig.spec.json` with the following content.
|
||||
|
||||
<code-example language="json" format="." linenums="false">
|
||||
|
||||
{
|
||||
"extends": "./tsconfig.spec.json",
|
||||
"compilerOptions": {
|
||||
"target": "es5"
|
||||
}
|
||||
}
|
||||
|
||||
</code-example>
|
||||
|
||||
<code-example language="json" format="." linenums="false">
|
||||
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
...
|
||||
},
|
||||
"configurations": {
|
||||
"es5": {
|
||||
"tsConfig": "./tsconfig-es5.spec.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
</code-example>
|
||||
|
||||
You can then run the tests with this configuration
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
|
||||
ng test --configuration es5
|
||||
|
||||
</code-example>
|
||||
|
||||
### Configuring the e2e command
|
||||
|
||||
Create an ES5 serve configuration as explained above (link to the above serve section), and configuration an ES5 configuration for the E2E target.
|
||||
|
||||
<code-example language="json" format="." linenums="false">
|
||||
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
...
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
...
|
||||
},
|
||||
"es5": {
|
||||
"devServerTarget": "app:serve:es5"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
</code-example>
|
||||
|
||||
You can then run the e2e's with this configuration
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
|
||||
ng e2e --configuration es5
|
||||
|
||||
</code-example>
|
||||
|
@ -19,7 +19,7 @@
|
||||
"build-local": "yarn ~~build",
|
||||
"prebuild-with-ivy": "yarn setup-local && node scripts/switch-to-ivy",
|
||||
"build-with-ivy": "yarn ~~build",
|
||||
"extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js ab6f36229",
|
||||
"extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js 7da10691d",
|
||||
"lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint && yarn tools-lint",
|
||||
"test": "yarn check-env && ng test",
|
||||
"pree2e": "yarn check-env && yarn update-webdriver",
|
||||
@ -93,8 +93,8 @@
|
||||
"zone.js": "^0.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "0.801.0-beta.2",
|
||||
"@angular/cli": "8.1.0-beta.2",
|
||||
"@angular-devkit/build-angular": "0.800.2",
|
||||
"@angular/cli": "8.0.2",
|
||||
"@angular/compiler": "^8.1.0-next.1",
|
||||
"@angular/compiler-cli": "^8.1.0-next.1",
|
||||
"@angular/language-service": "^8.1.0-next.1",
|
||||
|
@ -2,36 +2,36 @@
|
||||
"aio": {
|
||||
"master": {
|
||||
"uncompressed": {
|
||||
"runtime-es5": 3042,
|
||||
"runtime-es2015": 3048,
|
||||
"main-es5": 511036,
|
||||
"main-es2015": 450486,
|
||||
"polyfills-es5": 130136,
|
||||
"polyfills-es2015": 52931
|
||||
"runtime-es5": 3005,
|
||||
"runtime-es2015": 3011,
|
||||
"main-es5": 511054,
|
||||
"main-es2015": 450560,
|
||||
"polyfills-es5": 129161,
|
||||
"polyfills-es2015": 53295
|
||||
}
|
||||
}
|
||||
},
|
||||
"aio-local": {
|
||||
"master": {
|
||||
"uncompressed": {
|
||||
"runtime-es5": 3042,
|
||||
"runtime-es2015": 3048,
|
||||
"main-es5": 511036,
|
||||
"main-es2015": 450486,
|
||||
"polyfills-es5": 130136,
|
||||
"polyfills-es2015": 52931
|
||||
"runtime-es5": 3005,
|
||||
"runtime-es2015": 3011,
|
||||
"main-es5": 511054,
|
||||
"main-es2015": 450560,
|
||||
"polyfills-es5": 129161,
|
||||
"polyfills-es2015": 53295
|
||||
}
|
||||
}
|
||||
},
|
||||
"aio-local-ivy": {
|
||||
"master": {
|
||||
"uncompressed": {
|
||||
"runtime-es5": 2932,
|
||||
"runtime-es2015": 2938,
|
||||
"main-es5": 565073,
|
||||
"main-es2015": 583108,
|
||||
"polyfills-es5": 130136,
|
||||
"polyfills-es2015": 52931
|
||||
"runtime-es5": 2895,
|
||||
"runtime-es2015": 2901,
|
||||
"main-es5": 564586,
|
||||
"main-es2015": 582731,
|
||||
"polyfills-es5": 129161,
|
||||
"polyfills-es2015": 53295
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,10 +36,9 @@ module.exports = new Package('angular-base', [
|
||||
.factory('packageInfo', function() { return require(path.resolve(PROJECT_ROOT, 'package.json')); })
|
||||
.factory(require('./readers/json'))
|
||||
.factory(require('./services/copyFolder'))
|
||||
.factory(require('./services/filterPipes'))
|
||||
.factory(require('./services/filterAmbiguousDirectiveAliases'))
|
||||
.factory(require('./services/getImageDimensions'))
|
||||
.factory(require('./services/auto-link-filters/filterPipes'))
|
||||
.factory(require('./services/auto-link-filters/filterAmbiguousDirectiveAliases'))
|
||||
.factory(require('./services/auto-link-filters/ignoreHttpInUrls'))
|
||||
|
||||
.factory(require('./post-processors/add-image-dimensions'))
|
||||
.factory(require('./post-processors/auto-link-code'))
|
||||
@ -129,9 +128,9 @@ module.exports = new Package('angular-base', [
|
||||
})
|
||||
|
||||
|
||||
.config(function(postProcessHtml, addImageDimensions, autoLinkCode, filterPipes, filterAmbiguousDirectiveAliases, ignoreHttpInUrls) {
|
||||
.config(function(postProcessHtml, addImageDimensions, autoLinkCode, filterPipes, filterAmbiguousDirectiveAliases) {
|
||||
addImageDimensions.basePath = path.resolve(AIO_PATH, 'src');
|
||||
autoLinkCode.customFilters = [ignoreHttpInUrls, filterPipes, filterAmbiguousDirectiveAliases];
|
||||
autoLinkCode.customFilters = [filterPipes, filterAmbiguousDirectiveAliases];
|
||||
postProcessHtml.plugins = [
|
||||
require('./post-processors/autolink-headings'),
|
||||
addImageDimensions,
|
||||
|
@ -38,7 +38,7 @@ module.exports = function autoLinkCode(getDocFromAlias) {
|
||||
// Only interested in text nodes that are not inside links
|
||||
if (ancestors.every(ancestor => !is(ancestor, 'a'))) {
|
||||
|
||||
const parent = ancestors[ancestors.length - 1];
|
||||
const parent = ancestors[ancestors.length-1];
|
||||
const index = parent.children.indexOf(node);
|
||||
|
||||
// Can we convert the whole text node into a doc link?
|
||||
@ -66,7 +66,6 @@ module.exports = function autoLinkCode(getDocFromAlias) {
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function foundValidDoc(docs) {
|
||||
return docs.length === 1 &&
|
||||
!docs[0].internal &&
|
||||
|
@ -1,12 +0,0 @@
|
||||
|
||||
/**
|
||||
* This service is used by the autoLinkCode post-processor to ignore the `http(s)` part in URLs
|
||||
* (i.e. `http://...` or `https://...`).
|
||||
*/
|
||||
module.exports = function ignoreHttpInUrls() {
|
||||
const ignoredSchemes = ['http', 'https'];
|
||||
return (docs, words, index) => {
|
||||
const httpInUrl = ignoredSchemes.includes(words[index]) && (words[index + 1] === '://');
|
||||
return httpInUrl ? [] : docs;
|
||||
};
|
||||
};
|
@ -1,49 +0,0 @@
|
||||
const ignoreHttpInUrls = require('./ignoreHttpInUrls')();
|
||||
|
||||
describe('ignoreHttpInUrls', () => {
|
||||
it('should ignore all docs when matching `http` in `http://...`', () => {
|
||||
const docs = [{ docType: 'package', name: 'http' }, { docType: 'class', name: 'Foo' }];
|
||||
|
||||
const words1 = ['http', '://', 'example', '.', 'com', '/'];
|
||||
expect(ignoreHttpInUrls(docs, words1, 0)).toEqual([]);
|
||||
|
||||
const words2 = ['URL', ': ', 'http', '://', 'example', '.', 'com', '/'];
|
||||
expect(ignoreHttpInUrls(docs, words2, 2)).toEqual([]);
|
||||
});
|
||||
|
||||
it('should ignore all docs when matching `https` in `https://...`', () => {
|
||||
const docs = [{ docType: 'package', name: 'https' }, { docType: 'class', name: 'Foo' }];
|
||||
|
||||
const words1 = ['https', '://', 'example', '.', 'com', '/'];
|
||||
expect(ignoreHttpInUrls(docs, words1, 0)).toEqual([]);
|
||||
|
||||
const words2 = ['URL', ': ', 'https', '://', 'example', '.', 'com', '/'];
|
||||
expect(ignoreHttpInUrls(docs, words2, 2)).toEqual([]);
|
||||
});
|
||||
|
||||
it('should keep all docs when not matching `http(s)`', () => {
|
||||
const docs = [{ docType: 'package', name: 'http' }, { docType: 'class', name: 'Foo' }];
|
||||
|
||||
const words1 = ['http', '://', 'example', '.', 'com', '/'];
|
||||
expect(ignoreHttpInUrls(docs, words1, 2)).toEqual(docs);
|
||||
|
||||
const words2 = ['URL', ': ', 'https', '://', 'example', '.', 'com', '/'];
|
||||
expect(ignoreHttpInUrls(docs, words2, 0)).toEqual(docs);
|
||||
|
||||
const words3 = ['file', '://', 'example', '.', 'com', '/'];
|
||||
expect(ignoreHttpInUrls(docs, words3, 0)).toEqual(docs);
|
||||
});
|
||||
|
||||
it('should keep all docs when not matching `http(s)` at the beginning of a URL', () => {
|
||||
const docs = [{ docType: 'package', name: 'http' }, { docType: 'class', name: 'Foo' }];
|
||||
|
||||
const words1 = ['http', ' ', 'is', ' ', 'cool'];
|
||||
expect(ignoreHttpInUrls(docs, words1, 0)).toEqual(docs);
|
||||
|
||||
const words2 = ['https', ' ', 'is', ' ', 'cooler'];
|
||||
expect(ignoreHttpInUrls(docs, words2, 0)).toEqual(docs);
|
||||
|
||||
const words3 = ['http', '://', 'http', '.', 'com'];
|
||||
expect(ignoreHttpInUrls(docs, words3, 2)).toEqual(docs);
|
||||
});
|
||||
});
|
@ -1,6 +1,6 @@
|
||||
|
||||
/**
|
||||
* This service is used by the autoLinkCode post-processor to filter out pipe docs
|
||||
* This service is used by the autoLinkCode post-processors to filter out pipe docs
|
||||
* where the matching word is the pipe name and is not preceded by a pipe
|
||||
*/
|
||||
module.exports = function filterPipes() {
|
764
aio/yarn.lock
764
aio/yarn.lock
File diff suppressed because it is too large
Load Diff
@ -81,9 +81,6 @@ See also: [`//.bazelrc`](https://github.com/angular/angular/blob/master/.bazelrc
|
||||
|
||||
The process should automatically connect to the debugger. For additional info and testing options, see the [nodejs_test documentation](https://bazelbuild.github.io/rules_nodejs/node/node.html#nodejs_test).
|
||||
|
||||
- Click on "Resume script execution" to let the code run until the first `debugger` statement or a previously set breakpoint.
|
||||
- If you're debugging an ivy test and you want to inspect the generated template instructions, find the template of your component in the call stack and click on `(source mapped from [CompName].js)` at the bottom of the code. You can also disable sourcemaps in the options or go to sources and look into ng:// namespace to see all the generated code.
|
||||
|
||||
### Debugging a Node Test in VSCode
|
||||
|
||||
First time setup:
|
||||
|
@ -37,7 +37,7 @@ We explicitly don't consider the following to be our public API surface:
|
||||
|
||||
- any file/import paths within our package except for the `/`, `/testing` and `/bundles/*` and other documented package entry-points.
|
||||
- constructors of injectable classes (services and directives) - please use DI to obtain instances of these classes
|
||||
- any class members or symbols marked as `private`, or prefixed with underscore (`_`), [barred latin o](https://en.wikipedia.org/wiki/%C6%9F) (`ɵ`), and double barred latin o (`ɵɵ`).
|
||||
- any class members or symbols marked as `private`, or prefixed with underscore (`_`), [barred latin o](https://en.wikipedia.org/wiki/%C6%9F) (`ɵ`), and double barred latin o, aka "frog eyes" (`ɵɵ`).
|
||||
- extending any of our classes unless the support for this is specifically documented in the API docs
|
||||
- the contents and API surface of the code generated by Angular's compiler (with one notable exception: the existence and name of `NgModuleFactory` instances exported from generated code is guaranteed)
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
"master": {
|
||||
"uncompressed": {
|
||||
"runtime": 1440,
|
||||
"main": 14664,
|
||||
"main": 14487,
|
||||
"polyfills": 43567
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,7 @@
|
||||
"master": {
|
||||
"uncompressed": {
|
||||
"runtime": 1440,
|
||||
"main": 149248,
|
||||
"main": 149205,
|
||||
"polyfills": 43567
|
||||
}
|
||||
}
|
||||
@ -34,4 +34,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -24,8 +24,6 @@
|
||||
"node_modules/@angular/compiler-cli/**",
|
||||
"node_modules/@angular/**/testing/**",
|
||||
"node_modules/@angular/common/upgrade*",
|
||||
"node_modules/@angular/router/upgrade*",
|
||||
"node_modules/@angular/cdk/schematics*",
|
||||
"node_modules/@angular/material/schematics*"
|
||||
"node_modules/@angular/router/upgrade*"
|
||||
]
|
||||
}
|
||||
|
@ -1,32 +0,0 @@
|
||||
{
|
||||
"seq": 0,
|
||||
"type": "response",
|
||||
"command": "definitionAndBoundSpan",
|
||||
"request_seq": 2,
|
||||
"success": true,
|
||||
"body": {
|
||||
"definitions": [
|
||||
{
|
||||
"file": "${PWD}/project/app/app.component.ts",
|
||||
"start": {
|
||||
"line": 7,
|
||||
"offset": 30
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"offset": 47
|
||||
}
|
||||
}
|
||||
],
|
||||
"textSpan": {
|
||||
"start": {
|
||||
"line": 7,
|
||||
"offset": 30
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"offset": 47
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"seq": 0,
|
||||
"type": "response",
|
||||
"command": "quickinfo",
|
||||
"request_seq": 4,
|
||||
"success": true,
|
||||
"body": {
|
||||
"kind": "const",
|
||||
"kindModifiers": "declare",
|
||||
"start": {
|
||||
"line": 1,
|
||||
"offset": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"offset": 21
|
||||
},
|
||||
"displayString": "const name: never",
|
||||
"documentation": "",
|
||||
"tags": []
|
||||
}
|
||||
}
|
@ -2,6 +2,6 @@ import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
template: `<h1>Hello {{name}}</h1><my-widget></my-widget>`,
|
||||
template: `<h1>Hello {{name}}</h1>`,
|
||||
})
|
||||
export class AppComponent { name = 'Angular'; }
|
||||
|
@ -2,11 +2,10 @@ import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { WidgetComponent } from './widget.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [ BrowserModule ],
|
||||
declarations: [ AppComponent, WidgetComponent ],
|
||||
declarations: [ AppComponent ],
|
||||
bootstrap: [ AppComponent ]
|
||||
})
|
||||
export class AppModule { }
|
||||
|
@ -1 +0,0 @@
|
||||
<h1>This is a {{name}} widget!</h1>
|
@ -1,7 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'my-widget',
|
||||
templateUrl: './widget.component.html',
|
||||
})
|
||||
export class WidgetComponent { name = 'Angular'; }
|
@ -8,9 +8,6 @@
|
||||
"experimentalDecorators": true,
|
||||
"lib": [ "es2015", "dom" ],
|
||||
"noImplicitAny": true,
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
"plugins": [
|
||||
{"name": "@angular/language-service"}
|
||||
]
|
||||
"suppressImplicitAnyIndexErrors": true
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ describe('Angular Language Service', () => {
|
||||
beforeEach(() => {
|
||||
jasmine.addMatchers(goldenMatcher);
|
||||
server = fork(SERVER_PATH, [
|
||||
'--globalPlugins', '@angular/language-service',
|
||||
'--logVerbosity', 'verbose',
|
||||
'--logFile', join(PWD, 'tsserver.log'),
|
||||
], {
|
||||
@ -117,17 +118,6 @@ describe('Angular Language Service', () => {
|
||||
offset: 28,
|
||||
});
|
||||
expect(resp2).toMatchGolden('quickinfo.json');
|
||||
|
||||
client.sendRequest('open', {
|
||||
file: `${PWD}/project/app/widget.component.html`,
|
||||
});
|
||||
|
||||
const resp3 = await client.sendRequest('quickinfo', {
|
||||
file: `${PWD}/project/app/widget.component.html`,
|
||||
line: 1,
|
||||
offset: 19,
|
||||
});
|
||||
expect(resp3).toMatchGolden('quickinfo_externalTemplate.json');
|
||||
});
|
||||
|
||||
it('should perform definition', async () => {
|
||||
@ -149,25 +139,4 @@ describe('Angular Language Service', () => {
|
||||
});
|
||||
expect(resp2).toMatchGolden('definition.json');
|
||||
});
|
||||
|
||||
it('should perform definitionAndBoundSpan', async () => {
|
||||
client.sendRequest('open', {
|
||||
file: `${PWD}/project/app/app.component.ts`,
|
||||
});
|
||||
|
||||
const resp1 = await client.sendRequest('reload', {
|
||||
file: `${PWD}/project/app/app.component.ts`,
|
||||
tmpFile: `${PWD}/project/app/app.component.ts`,
|
||||
}) as any;
|
||||
expect(resp1.command).toBe('reload');
|
||||
expect(resp1.success).toBe(true);
|
||||
|
||||
const resp2 = await client.sendRequest('definitionAndBoundSpan', {
|
||||
file: `${PWD}/project/app/app.component.ts`,
|
||||
line: 5,
|
||||
offset: 28,
|
||||
});
|
||||
expect(resp2).toMatchGolden('definitionAndBoundSpan.json');
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -3,12 +3,12 @@
|
||||
|
||||
|
||||
"@angular/core@file:../../dist/packages-dist/core":
|
||||
version "8.0.0-beta.13"
|
||||
version "7.2.0"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/language-service@file:../../dist/packages-dist/language-service":
|
||||
version "8.0.0-beta.13"
|
||||
version "7.2.0"
|
||||
|
||||
"@types/node@file:../../node_modules/@types/node":
|
||||
version "10.9.4"
|
||||
@ -61,16 +61,16 @@ inherits@2:
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
||||
|
||||
jasmine-core@~3.3.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.3.0.tgz#dea1cdc634bc93c7e0d4ad27185df30fa971b10e"
|
||||
integrity sha512-3/xSmG/d35hf80BEN66Y6g9Ca5l/Isdeg/j6zvbTYlTzeKinzmaTM4p9am5kYqOmE05D7s1t8FGjzdSnbUbceA==
|
||||
jasmine-core@~3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.1.0.tgz#a4785e135d5df65024dfc9224953df585bd2766c"
|
||||
integrity sha1-pHheE11d9lAk38kiSVPfWFvSdmw=
|
||||
|
||||
"jasmine@file:../../node_modules/jasmine":
|
||||
version "3.3.1"
|
||||
version "3.1.0"
|
||||
dependencies:
|
||||
glob "^7.0.6"
|
||||
jasmine-core "~3.3.0"
|
||||
jasmine-core "~3.1.0"
|
||||
|
||||
minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
@ -97,7 +97,7 @@ tslib@^1.9.0:
|
||||
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
|
||||
|
||||
"typescript@file:../../node_modules/typescript":
|
||||
version "3.4.2"
|
||||
version "3.2.2"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
|
@ -4,13 +4,13 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@angular/animations": "file:../../dist/packages-dist/animations",
|
||||
"@angular/cdk": "^8.0.0",
|
||||
"@angular/cdk": "^7.0.0-rc.1",
|
||||
"@angular/common": "file:../../dist/packages-dist/common",
|
||||
"@angular/compiler": "file:../../dist/packages-dist/compiler",
|
||||
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
|
||||
"@angular/core": "file:../../dist/packages-dist/core",
|
||||
"@angular/forms": "file:../../dist/packages-dist/forms",
|
||||
"@angular/material": "8.0.0",
|
||||
"@angular/material": "7.0.0-rc.1",
|
||||
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
|
||||
"@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic",
|
||||
"@angular/router": "file:../../dist/packages-dist/router",
|
||||
|
@ -61,12 +61,6 @@ if [[ $? != 0 ]]; then exit 1; fi
|
||||
grep "const ɵMatTable_BaseFactory = ɵngcc0.ɵɵgetInheritedFactory(MatTable);" node_modules/@angular/material/esm5/table.es5.js
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
|
||||
# Did it generate a base definition for undecorated classes with inputs and view queries?
|
||||
grep "_MatMenuBase.ngBaseDef = ɵngcc0.ɵɵdefineBase({ inputs: {" node_modules/@angular/material/esm2015/menu.js
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
grep "_MatMenuBase.ngBaseDef = ɵngcc0.ɵɵdefineBase({ inputs: {" node_modules/@angular/material/esm5/menu.es5.js
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
|
||||
# Can it be safely run again (as a noop)?
|
||||
# And check that it logged skipping compilation as expected
|
||||
ivy-ngcc -l debug | grep 'Skipping'
|
||||
|
@ -3,26 +3,26 @@
|
||||
|
||||
|
||||
"@angular/animations@file:../../dist/packages-dist/animations":
|
||||
version "8.1.0-beta.0"
|
||||
version "8.0.0-beta.10"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/cdk@^8.0.0":
|
||||
version "8.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-8.0.0.tgz#34ca95e71d71780b29b5ba07318c88c4577bdc25"
|
||||
integrity sha512-2vsRWEHNARe0iRmqgzvM67gwfRy+aKvdef4Qu9L+ndSsTrrZT3tSgG8SMn1v9SfBHnx5G8mo4d1AMquXG69AuQ==
|
||||
"@angular/cdk@^7.0.0-rc.1":
|
||||
version "7.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-7.0.2.tgz#35081cd27a8f5214568b6ad1acf8cb3b3c315f99"
|
||||
integrity sha512-MAugJsjQ3ye2RX7vNjd9IN1c7enAxJaCz9UZBFuzfo/pNxvjaEObFmF2NUKyU1DctknqjyOzZYYg0e+bBxrBbQ==
|
||||
dependencies:
|
||||
tslib "^1.7.1"
|
||||
optionalDependencies:
|
||||
parse5 "^5.0.0"
|
||||
|
||||
"@angular/common@file:../../dist/packages-dist/common":
|
||||
version "8.1.0-beta.0"
|
||||
version "8.0.0-beta.10"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/compiler-cli@file:../../dist/packages-dist/compiler-cli":
|
||||
version "8.1.0-beta.0"
|
||||
version "8.0.0-beta.10"
|
||||
dependencies:
|
||||
canonical-path "1.0.0"
|
||||
chokidar "^2.1.1"
|
||||
@ -34,42 +34,44 @@
|
||||
shelljs "^0.8.1"
|
||||
source-map "^0.6.1"
|
||||
tslib "^1.9.0"
|
||||
yargs "13.1.0"
|
||||
yargs "9.0.1"
|
||||
|
||||
"@angular/compiler@file:../../dist/packages-dist/compiler":
|
||||
version "8.1.0-beta.0"
|
||||
version "8.0.0-beta.10"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/core@file:../../dist/packages-dist/core":
|
||||
version "8.1.0-beta.0"
|
||||
version "8.0.0-beta.10"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/forms@file:../../dist/packages-dist/forms":
|
||||
version "8.1.0-beta.0"
|
||||
version "8.0.0-beta.10"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/material@8.0.0":
|
||||
version "8.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/material/-/material-8.0.0.tgz#21dd15c318d1e29eb4d1a2dd888ddb027897eb49"
|
||||
integrity sha512-c7O7GhZd46xF2WB6T/YPam5lJkTgQLdIS53IqwZIFhL427+SEfPvejVzRnVfZCI3NdrKiWt/5VsvtQZwWzlGvw==
|
||||
"@angular/material@7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/material/-/material-7.0.0-rc.1.tgz#e9a88c8b6f6b48b87ed3d1da3037d14a0e3e8290"
|
||||
integrity sha512-4LC3y5ZorNjdF1lEkVN/3zwOEnBwjfWLCY92tA06Kdvs1yENZdu0fGTRwcu9Hz4y+t84sL/KEKC9VjKN3Z7PSg==
|
||||
dependencies:
|
||||
tslib "^1.7.1"
|
||||
optionalDependencies:
|
||||
parse5 "^5.0.0"
|
||||
|
||||
"@angular/platform-browser-dynamic@file:../../dist/packages-dist/platform-browser-dynamic":
|
||||
version "8.1.0-beta.0"
|
||||
version "8.0.0-beta.10"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/platform-browser@file:../../dist/packages-dist/platform-browser":
|
||||
version "8.1.0-beta.0"
|
||||
version "8.0.0-beta.10"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/router@file:../../dist/packages-dist/router":
|
||||
version "8.1.0-beta.0"
|
||||
version "8.0.0-beta.10"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
@ -148,11 +150,6 @@ ansi-regex@^3.0.0:
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
|
||||
integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
|
||||
|
||||
ansi-regex@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
|
||||
integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
|
||||
|
||||
ansi-styles@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de"
|
||||
@ -520,10 +517,10 @@ camelcase@^3.0.0:
|
||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"
|
||||
integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo=
|
||||
|
||||
camelcase@^5.0.0:
|
||||
version "5.3.1"
|
||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
|
||||
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
|
||||
camelcase@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd"
|
||||
integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=
|
||||
|
||||
canonical-path@1.0.0:
|
||||
version "1.0.0"
|
||||
@ -620,15 +617,6 @@ cliui@^3.2.0:
|
||||
strip-ansi "^3.0.1"
|
||||
wrap-ansi "^2.0.0"
|
||||
|
||||
cliui@^4.0.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49"
|
||||
integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==
|
||||
dependencies:
|
||||
string-width "^2.1.1"
|
||||
strip-ansi "^4.0.0"
|
||||
wrap-ansi "^2.0.0"
|
||||
|
||||
co@^4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
|
||||
@ -747,14 +735,12 @@ core-util-is@1.0.2, core-util-is@~1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
|
||||
|
||||
cross-spawn@^6.0.0:
|
||||
version "6.0.5"
|
||||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
|
||||
integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
|
||||
cross-spawn@^5.0.1:
|
||||
version "5.1.0"
|
||||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
|
||||
integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=
|
||||
dependencies:
|
||||
nice-try "^1.0.4"
|
||||
path-key "^2.0.1"
|
||||
semver "^5.5.0"
|
||||
lru-cache "^4.0.1"
|
||||
shebang-command "^1.2.0"
|
||||
which "^1.2.9"
|
||||
|
||||
@ -791,7 +777,7 @@ debug@^3.1.0:
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
decamelize@^1.1.1, decamelize@^1.2.0:
|
||||
decamelize@^1.1.1:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
|
||||
@ -903,23 +889,11 @@ ee-first@1.1.1:
|
||||
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
|
||||
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
|
||||
|
||||
emoji-regex@^7.0.1:
|
||||
version "7.0.3"
|
||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
|
||||
integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==
|
||||
|
||||
encodeurl@~1.0.1, encodeurl@~1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
|
||||
integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=
|
||||
|
||||
end-of-stream@^1.1.0:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
|
||||
integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==
|
||||
dependencies:
|
||||
once "^1.4.0"
|
||||
|
||||
engine.io-client@~3.2.0:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36"
|
||||
@ -999,13 +973,13 @@ eventemitter3@1.x.x:
|
||||
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.2.0.tgz#1c86991d816ad1e504750e73874224ecf3bec508"
|
||||
integrity sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg=
|
||||
|
||||
execa@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
|
||||
integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==
|
||||
execa@^0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777"
|
||||
integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=
|
||||
dependencies:
|
||||
cross-spawn "^6.0.0"
|
||||
get-stream "^4.0.0"
|
||||
cross-spawn "^5.0.1"
|
||||
get-stream "^3.0.0"
|
||||
is-stream "^1.1.0"
|
||||
npm-run-path "^2.0.0"
|
||||
p-finally "^1.0.0"
|
||||
@ -1152,12 +1126,12 @@ find-up@^1.0.0:
|
||||
path-exists "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
find-up@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
|
||||
integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==
|
||||
find-up@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
|
||||
integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c=
|
||||
dependencies:
|
||||
locate-path "^3.0.0"
|
||||
locate-path "^2.0.0"
|
||||
|
||||
follow-redirects@^1.2.5:
|
||||
version "1.5.9"
|
||||
@ -1260,17 +1234,10 @@ get-caller-file@^1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
|
||||
integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==
|
||||
|
||||
get-caller-file@^2.0.1:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
||||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
||||
|
||||
get-stream@^4.0.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
|
||||
integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==
|
||||
dependencies:
|
||||
pump "^3.0.0"
|
||||
get-stream@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
|
||||
integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=
|
||||
|
||||
get-value@^2.0.3, get-value@^2.0.6:
|
||||
version "2.0.6"
|
||||
@ -1520,11 +1487,6 @@ invert-kv@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
|
||||
integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY=
|
||||
|
||||
invert-kv@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02"
|
||||
integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==
|
||||
|
||||
is-accessor-descriptor@^0.1.6:
|
||||
version "0.1.6"
|
||||
resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
|
||||
@ -1878,13 +1840,6 @@ lcid@^1.0.0:
|
||||
dependencies:
|
||||
invert-kv "^1.0.0"
|
||||
|
||||
lcid@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf"
|
||||
integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==
|
||||
dependencies:
|
||||
invert-kv "^2.0.0"
|
||||
|
||||
lie@~3.3.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a"
|
||||
@ -1919,6 +1874,16 @@ load-json-file@^1.0.0:
|
||||
pinkie-promise "^2.0.0"
|
||||
strip-bom "^2.0.0"
|
||||
|
||||
load-json-file@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8"
|
||||
integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=
|
||||
dependencies:
|
||||
graceful-fs "^4.1.2"
|
||||
parse-json "^2.2.0"
|
||||
pify "^2.0.0"
|
||||
strip-bom "^3.0.0"
|
||||
|
||||
localtunnel@1.9.1:
|
||||
version "1.9.1"
|
||||
resolved "https://registry.yarnpkg.com/localtunnel/-/localtunnel-1.9.1.tgz#1d1737eab658add5a40266d8e43f389b646ee3b1"
|
||||
@ -1929,12 +1894,12 @@ localtunnel@1.9.1:
|
||||
openurl "1.1.1"
|
||||
yargs "6.6.0"
|
||||
|
||||
locate-path@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
|
||||
integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==
|
||||
locate-path@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
|
||||
integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=
|
||||
dependencies:
|
||||
p-locate "^3.0.0"
|
||||
p-locate "^2.0.0"
|
||||
path-exists "^3.0.0"
|
||||
|
||||
lodash.debounce@^4.0.8:
|
||||
@ -1952,6 +1917,14 @@ lodash@^4.11.1, lodash@^4.17.10, lodash@^4.5.1:
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
|
||||
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
|
||||
|
||||
lru-cache@^4.0.1:
|
||||
version "4.1.3"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c"
|
||||
integrity sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==
|
||||
dependencies:
|
||||
pseudomap "^1.0.2"
|
||||
yallist "^2.1.2"
|
||||
|
||||
magic-string@^0.25.0:
|
||||
version "0.25.1"
|
||||
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.1.tgz#b1c248b399cd7485da0fe7385c2fc7011843266e"
|
||||
@ -1959,13 +1932,6 @@ magic-string@^0.25.0:
|
||||
dependencies:
|
||||
sourcemap-codec "^1.4.1"
|
||||
|
||||
map-age-cleaner@^0.1.1:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a"
|
||||
integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==
|
||||
dependencies:
|
||||
p-defer "^1.0.0"
|
||||
|
||||
map-cache@^0.2.2:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf"
|
||||
@ -1983,14 +1949,12 @@ math-random@^1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac"
|
||||
integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w=
|
||||
|
||||
mem@^4.0.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178"
|
||||
integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==
|
||||
mem@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76"
|
||||
integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=
|
||||
dependencies:
|
||||
map-age-cleaner "^0.1.1"
|
||||
mimic-fn "^2.0.0"
|
||||
p-is-promise "^2.0.0"
|
||||
mimic-fn "^1.0.0"
|
||||
|
||||
micromatch@2.3.11:
|
||||
version "2.3.11"
|
||||
@ -2047,10 +2011,10 @@ mime@1.4.1:
|
||||
resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
|
||||
integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==
|
||||
|
||||
mimic-fn@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
|
||||
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
|
||||
mimic-fn@^1.0.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
|
||||
integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==
|
||||
|
||||
minimatch@^3.0.2, minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
@ -2160,11 +2124,6 @@ negotiator@0.6.1:
|
||||
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
|
||||
integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=
|
||||
|
||||
nice-try@^1.0.4:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
|
||||
integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==
|
||||
|
||||
node-pre-gyp@^0.10.0:
|
||||
version "0.10.3"
|
||||
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc"
|
||||
@ -2304,7 +2263,7 @@ on-finished@~2.3.0:
|
||||
dependencies:
|
||||
ee-first "1.1.1"
|
||||
|
||||
once@^1.3.0, once@^1.3.1, once@^1.4.0:
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
|
||||
@ -2343,14 +2302,14 @@ os-locale@^1.4.0:
|
||||
dependencies:
|
||||
lcid "^1.0.0"
|
||||
|
||||
os-locale@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a"
|
||||
integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==
|
||||
os-locale@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2"
|
||||
integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==
|
||||
dependencies:
|
||||
execa "^1.0.0"
|
||||
lcid "^2.0.0"
|
||||
mem "^4.0.0"
|
||||
execa "^0.7.0"
|
||||
lcid "^1.0.0"
|
||||
mem "^1.1.0"
|
||||
|
||||
os-tmpdir@^1.0.0, os-tmpdir@~1.0.1:
|
||||
version "1.0.2"
|
||||
@ -2365,39 +2324,29 @@ osenv@^0.1.4:
|
||||
os-homedir "^1.0.0"
|
||||
os-tmpdir "^1.0.0"
|
||||
|
||||
p-defer@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c"
|
||||
integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=
|
||||
|
||||
p-finally@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
|
||||
integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=
|
||||
|
||||
p-is-promise@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e"
|
||||
integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==
|
||||
|
||||
p-limit@^2.0.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2"
|
||||
integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==
|
||||
p-limit@^1.1.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
|
||||
integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==
|
||||
dependencies:
|
||||
p-try "^2.0.0"
|
||||
p-try "^1.0.0"
|
||||
|
||||
p-locate@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4"
|
||||
integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==
|
||||
p-locate@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
|
||||
integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=
|
||||
dependencies:
|
||||
p-limit "^2.0.0"
|
||||
p-limit "^1.1.0"
|
||||
|
||||
p-try@^2.0.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
|
||||
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
|
||||
p-try@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
|
||||
integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=
|
||||
|
||||
pako@~1.0.2:
|
||||
version "1.0.10"
|
||||
@ -2477,7 +2426,7 @@ path-is-inside@^1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
|
||||
integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=
|
||||
|
||||
path-key@^2.0.0, path-key@^2.0.1:
|
||||
path-key@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
|
||||
integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
|
||||
@ -2496,6 +2445,13 @@ path-type@^1.0.0:
|
||||
pify "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
path-type@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
|
||||
integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=
|
||||
dependencies:
|
||||
pify "^2.0.0"
|
||||
|
||||
performance-now@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
||||
@ -2560,19 +2516,16 @@ process-nextick-args@~2.0.0:
|
||||
webdriver-js-extender "2.1.0"
|
||||
webdriver-manager "^12.0.6"
|
||||
|
||||
pseudomap@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
|
||||
integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM=
|
||||
|
||||
psl@^1.1.24:
|
||||
version "1.1.29"
|
||||
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67"
|
||||
integrity sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==
|
||||
|
||||
pump@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
|
||||
integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
|
||||
dependencies:
|
||||
end-of-stream "^1.1.0"
|
||||
once "^1.3.1"
|
||||
|
||||
punycode@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
|
||||
@ -2640,6 +2593,14 @@ read-pkg-up@^1.0.1:
|
||||
find-up "^1.0.0"
|
||||
read-pkg "^1.0.0"
|
||||
|
||||
read-pkg-up@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be"
|
||||
integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=
|
||||
dependencies:
|
||||
find-up "^2.0.0"
|
||||
read-pkg "^2.0.0"
|
||||
|
||||
read-pkg@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28"
|
||||
@ -2649,6 +2610,15 @@ read-pkg@^1.0.0:
|
||||
normalize-package-data "^2.3.2"
|
||||
path-type "^1.0.0"
|
||||
|
||||
read-pkg@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8"
|
||||
integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=
|
||||
dependencies:
|
||||
load-json-file "^2.0.0"
|
||||
normalize-package-data "^2.3.2"
|
||||
path-type "^2.0.0"
|
||||
|
||||
readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@~2.3.6:
|
||||
version "2.3.6"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
|
||||
@ -2749,11 +2719,6 @@ require-main-filename@^1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
|
||||
integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=
|
||||
|
||||
require-main-filename@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
|
||||
integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
|
||||
|
||||
requires-port@1.x.x:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
|
||||
@ -2857,11 +2822,6 @@ selenium-webdriver@3.6.0, selenium-webdriver@^3.0.1:
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
|
||||
integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==
|
||||
|
||||
semver@^5.5.0:
|
||||
version "5.7.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
|
||||
integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==
|
||||
|
||||
send@0.16.2:
|
||||
version "0.16.2"
|
||||
resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1"
|
||||
@ -3177,7 +3137,7 @@ string-width@^1.0.1, string-width@^1.0.2:
|
||||
is-fullwidth-code-point "^1.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
|
||||
"string-width@^1.0.2 || 2", string-width@^2.1.1:
|
||||
"string-width@^1.0.2 || 2", string-width@^2.0.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
|
||||
integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
|
||||
@ -3185,15 +3145,6 @@ string-width@^1.0.1, string-width@^1.0.2:
|
||||
is-fullwidth-code-point "^2.0.0"
|
||||
strip-ansi "^4.0.0"
|
||||
|
||||
string-width@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
|
||||
integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==
|
||||
dependencies:
|
||||
emoji-regex "^7.0.1"
|
||||
is-fullwidth-code-point "^2.0.0"
|
||||
strip-ansi "^5.1.0"
|
||||
|
||||
string_decoder@~1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
|
||||
@ -3222,13 +3173,6 @@ strip-ansi@^4.0.0:
|
||||
dependencies:
|
||||
ansi-regex "^3.0.0"
|
||||
|
||||
strip-ansi@^5.1.0:
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
|
||||
integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==
|
||||
dependencies:
|
||||
ansi-regex "^4.1.0"
|
||||
|
||||
strip-bom@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
|
||||
@ -3236,6 +3180,11 @@ strip-bom@^2.0.0:
|
||||
dependencies:
|
||||
is-utf8 "^0.2.0"
|
||||
|
||||
strip-bom@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
|
||||
integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=
|
||||
|
||||
strip-eof@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
|
||||
@ -3357,7 +3306,7 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
|
||||
|
||||
"typescript@file:../../node_modules/typescript":
|
||||
version "3.4.2"
|
||||
version "3.3.3333"
|
||||
|
||||
ua-parser-js@0.7.17:
|
||||
version "0.7.17"
|
||||
@ -3553,24 +3502,16 @@ y18n@^3.2.1:
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"
|
||||
integrity sha1-bRX7qITAhnnA136I53WegR4H+kE=
|
||||
|
||||
y18n@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
|
||||
integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
|
||||
yallist@^2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
|
||||
integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=
|
||||
|
||||
yallist@^3.0.0, yallist@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9"
|
||||
integrity sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=
|
||||
|
||||
yargs-parser@^13.0.0:
|
||||
version "13.1.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.0.tgz#7016b6dd03e28e1418a510e258be4bff5a31138f"
|
||||
integrity sha512-Yq+32PrijHRri0vVKQEm+ys8mbqWjLiwQkMFNXEENutzLPP0bE4Lcd4iA3OQY5HF+GD3xXxf0MEHb8E4/SA3AA==
|
||||
dependencies:
|
||||
camelcase "^5.0.0"
|
||||
decamelize "^1.2.0"
|
||||
|
||||
yargs-parser@^4.1.0, yargs-parser@^4.2.0:
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c"
|
||||
@ -3578,22 +3519,12 @@ yargs-parser@^4.1.0, yargs-parser@^4.2.0:
|
||||
dependencies:
|
||||
camelcase "^3.0.0"
|
||||
|
||||
yargs@13.1.0:
|
||||
version "13.1.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.1.0.tgz#b2729ce4bfc0c584939719514099d8a916ad2301"
|
||||
integrity sha512-1UhJbXfzHiPqkfXNHYhiz79qM/kZqjTE8yGlEjZa85Q+3+OwcV6NRkV7XOV1W2Eom2bzILeUn55pQYffjVOLAg==
|
||||
yargs-parser@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9"
|
||||
integrity sha1-jQrELxbqVd69MyyvTEA4s+P139k=
|
||||
dependencies:
|
||||
cliui "^4.0.0"
|
||||
find-up "^3.0.0"
|
||||
get-caller-file "^2.0.1"
|
||||
os-locale "^3.1.0"
|
||||
require-directory "^2.1.1"
|
||||
require-main-filename "^2.0.0"
|
||||
set-blocking "^2.0.0"
|
||||
string-width "^3.0.0"
|
||||
which-module "^2.0.0"
|
||||
y18n "^4.0.0"
|
||||
yargs-parser "^13.0.0"
|
||||
camelcase "^4.1.0"
|
||||
|
||||
yargs@6.4.0:
|
||||
version "6.4.0"
|
||||
@ -3634,10 +3565,29 @@ yargs@6.6.0:
|
||||
y18n "^3.2.1"
|
||||
yargs-parser "^4.2.0"
|
||||
|
||||
yargs@9.0.1:
|
||||
version "9.0.1"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-9.0.1.tgz#52acc23feecac34042078ee78c0c007f5085db4c"
|
||||
integrity sha1-UqzCP+7Kw0BCB47njAwAf1CF20w=
|
||||
dependencies:
|
||||
camelcase "^4.1.0"
|
||||
cliui "^3.2.0"
|
||||
decamelize "^1.1.1"
|
||||
get-caller-file "^1.0.1"
|
||||
os-locale "^2.0.0"
|
||||
read-pkg-up "^2.0.0"
|
||||
require-directory "^2.1.1"
|
||||
require-main-filename "^1.0.1"
|
||||
set-blocking "^2.0.0"
|
||||
string-width "^2.0.0"
|
||||
which-module "^2.0.0"
|
||||
y18n "^3.2.1"
|
||||
yargs-parser "^7.0.0"
|
||||
|
||||
yeast@0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"
|
||||
integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk=
|
||||
|
||||
"zone.js@file:../../node_modules/zone.js":
|
||||
version "0.9.1"
|
||||
version "0.9.0"
|
||||
|
@ -1,3 +1,147 @@
|
||||
import "rxjs";
|
||||
import { Subject, Subscription } from "rxjs";
|
||||
|
||||
import "rxjs/operators";
|
||||
|
||||
function getGlobal() {
|
||||
const __globalThis = "undefined" !== typeof globalThis && globalThis;
|
||||
const __window = "undefined" !== typeof window && window;
|
||||
const __self = "undefined" !== typeof self && "undefined" !== typeof WorkerGlobalScope && self instanceof WorkerGlobalScope && self;
|
||||
const __global = "undefined" !== typeof global && global;
|
||||
return __globalThis || __global || __window || __self;
|
||||
}
|
||||
|
||||
const _global = getGlobal();
|
||||
|
||||
let _symbolIterator = null;
|
||||
|
||||
function getSymbolIterator() {
|
||||
if (!_symbolIterator) {
|
||||
const Symbol = _global["Symbol"];
|
||||
if (Symbol && Symbol.iterator) _symbolIterator = Symbol.iterator; else {
|
||||
const keys = Object.getOwnPropertyNames(Map.prototype);
|
||||
for (let i = 0; i < keys.length; ++i) {
|
||||
const key = keys[i];
|
||||
if ("entries" !== key && "size" !== key && Map.prototype[key] === Map.prototype["entries"]) _symbolIterator = key;
|
||||
}
|
||||
}
|
||||
}
|
||||
return _symbolIterator;
|
||||
}
|
||||
|
||||
if ("undefined" === typeof ngI18nClosureMode) _global["ngI18nClosureMode"] = "undefined" !== typeof goog && "function" === typeof goog.getMsg;
|
||||
|
||||
function flatten(list, dst) {
|
||||
if (void 0 === dst) dst = list;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let item = list[i];
|
||||
if (Array.isArray(item)) {
|
||||
if (dst === list) dst = list.slice(0, i);
|
||||
flatten(item, dst);
|
||||
} else if (dst !== list) dst.push(item);
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
class EventEmitter extends Subject {
|
||||
constructor(isAsync = false) {
|
||||
super();
|
||||
this.__isAsync = isAsync;
|
||||
}
|
||||
emit(value) {
|
||||
super.next(value);
|
||||
}
|
||||
subscribe(generatorOrNext, error, complete) {
|
||||
let schedulerFn;
|
||||
let errorFn = err => null;
|
||||
let completeFn = () => null;
|
||||
if (generatorOrNext && "object" === typeof generatorOrNext) {
|
||||
schedulerFn = this.__isAsync ? value => {
|
||||
setTimeout(() => generatorOrNext.next(value));
|
||||
} : value => {
|
||||
generatorOrNext.next(value);
|
||||
};
|
||||
if (generatorOrNext.error) errorFn = this.__isAsync ? err => {
|
||||
setTimeout(() => generatorOrNext.error(err));
|
||||
} : err => {
|
||||
generatorOrNext.error(err);
|
||||
};
|
||||
if (generatorOrNext.complete) completeFn = this.__isAsync ? () => {
|
||||
setTimeout(() => generatorOrNext.complete());
|
||||
} : () => {
|
||||
generatorOrNext.complete();
|
||||
};
|
||||
} else {
|
||||
schedulerFn = this.__isAsync ? value => {
|
||||
setTimeout(() => generatorOrNext(value));
|
||||
} : value => {
|
||||
generatorOrNext(value);
|
||||
};
|
||||
if (error) errorFn = this.__isAsync ? err => {
|
||||
setTimeout(() => error(err));
|
||||
} : err => {
|
||||
error(err);
|
||||
};
|
||||
if (complete) completeFn = this.__isAsync ? () => {
|
||||
setTimeout(() => complete());
|
||||
} : () => {
|
||||
complete();
|
||||
};
|
||||
}
|
||||
const sink = super.subscribe(schedulerFn, errorFn, completeFn);
|
||||
if (generatorOrNext instanceof Subscription) generatorOrNext.add(sink);
|
||||
return sink;
|
||||
}
|
||||
}
|
||||
|
||||
class QueryList {
|
||||
constructor() {
|
||||
this.dirty = true;
|
||||
this._results = [];
|
||||
this.changes = new EventEmitter();
|
||||
this.length = 0;
|
||||
}
|
||||
map(fn) {
|
||||
return this._results.map(fn);
|
||||
}
|
||||
filter(fn) {
|
||||
return this._results.filter(fn);
|
||||
}
|
||||
find(fn) {
|
||||
return this._results.find(fn);
|
||||
}
|
||||
reduce(fn, init) {
|
||||
return this._results.reduce(fn, init);
|
||||
}
|
||||
forEach(fn) {
|
||||
this._results.forEach(fn);
|
||||
}
|
||||
some(fn) {
|
||||
return this._results.some(fn);
|
||||
}
|
||||
toArray() {
|
||||
return this._results.slice();
|
||||
}
|
||||
[getSymbolIterator()]() {
|
||||
return this._results[getSymbolIterator()]();
|
||||
}
|
||||
toString() {
|
||||
return this._results.toString();
|
||||
}
|
||||
reset(resultsTree) {
|
||||
this._results = flatten(resultsTree);
|
||||
this.dirty = false;
|
||||
this.length = this._results.length;
|
||||
this.last = this._results[this.length - 1];
|
||||
this.first = this._results[0];
|
||||
}
|
||||
notifyOnChanges() {
|
||||
this.changes.emit(this);
|
||||
}
|
||||
setDirty() {
|
||||
this.dirty = true;
|
||||
}
|
||||
destroy() {
|
||||
this.changes.complete();
|
||||
this.changes.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
@ -3,3 +3,15 @@ import "tslib";
|
||||
import "rxjs";
|
||||
|
||||
import "rxjs/operators";
|
||||
|
||||
function getGlobal() {
|
||||
var __globalThis = "undefined" !== typeof globalThis && globalThis;
|
||||
var __window = "undefined" !== typeof window && window;
|
||||
var __self = "undefined" !== typeof self && "undefined" !== typeof WorkerGlobalScope && self instanceof WorkerGlobalScope && self;
|
||||
var __global = "undefined" !== typeof global && global;
|
||||
return __globalThis || __global || __window || __self;
|
||||
}
|
||||
|
||||
var _global = getGlobal();
|
||||
|
||||
if ("undefined" === typeof ngI18nClosureMode) _global["ngI18nClosureMode"] = "undefined" !== typeof goog && "function" === typeof goog.getMsg;
|
||||
|
@ -1,73 +0,0 @@
|
||||
package(default_visibility = ["//modules/benchmarks:__subpackages__"])
|
||||
|
||||
load("//tools:defaults.bzl", "ng_module", "ng_rollup_bundle", "ts_library")
|
||||
load("@npm_bazel_typescript//:index.bzl", "ts_devserver")
|
||||
load("//modules/benchmarks:benchmark_test.bzl", "benchmark_test")
|
||||
|
||||
ng_module(
|
||||
name = "application_lib",
|
||||
srcs = glob(
|
||||
["**/*.ts"],
|
||||
exclude = ["**/*.spec.ts"],
|
||||
),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/common",
|
||||
"//packages/core",
|
||||
"//packages/platform-browser",
|
||||
"@npm//rxjs",
|
||||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
name = "perf_lib",
|
||||
testonly = 1,
|
||||
srcs = ["benchmark_perf.spec.ts"],
|
||||
deps = [
|
||||
"//modules/e2e_util",
|
||||
"@npm//protractor",
|
||||
],
|
||||
)
|
||||
|
||||
ng_rollup_bundle(
|
||||
name = "bundle",
|
||||
entry_point = ":index.ts",
|
||||
deps = [
|
||||
":application_lib",
|
||||
"@npm//rxjs",
|
||||
],
|
||||
)
|
||||
|
||||
ts_devserver(
|
||||
name = "prodserver",
|
||||
static_files = [
|
||||
":bundle.min_debug.js",
|
||||
":bundle.min.js",
|
||||
"@npm//node_modules/zone.js:dist/zone.js",
|
||||
"index.html",
|
||||
],
|
||||
)
|
||||
|
||||
ts_devserver(
|
||||
name = "devserver",
|
||||
entry_module = "angular/modules/benchmarks/src/expanding_rows/index",
|
||||
index_html = "index.html",
|
||||
scripts = [
|
||||
"@npm//node_modules/tslib:tslib.js",
|
||||
"//tools/rxjs:rxjs_umd_modules",
|
||||
],
|
||||
serving_path = "/index.js",
|
||||
static_files = [
|
||||
"@npm//node_modules/zone.js:dist/zone.js",
|
||||
"index.html",
|
||||
],
|
||||
deps = [":application_lib"],
|
||||
)
|
||||
|
||||
benchmark_test(
|
||||
name = "perf",
|
||||
server = ":prodserver",
|
||||
deps = [
|
||||
":perf_lib",
|
||||
],
|
||||
)
|
@ -1,78 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {AfterViewInit, Component, NgModule, ViewChild, ViewEncapsulation} from '@angular/core';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
|
||||
import {BenchmarkModule} from './benchmark_module';
|
||||
import {BenchmarkableExpandingRow} from './benchmarkable_expanding_row';
|
||||
import {BenchmarkableExpandingRowModule} from './benchmarkable_expanding_row_module';
|
||||
|
||||
@Component({
|
||||
selector: 'benchmark-root',
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
template: `
|
||||
<h2>cfc-expanding-row initialization benchmark</h2>
|
||||
|
||||
<section>
|
||||
<button id="reset" (click)="reset()">Reset</button>
|
||||
<button id="init" (click)="init()">Init</button>
|
||||
<button id="run" (click)="runAll()">Run All</button>
|
||||
</section>
|
||||
|
||||
<benchmark-area>
|
||||
<benchmarkable-expanding-row></benchmarkable-expanding-row>
|
||||
</benchmark-area>`,
|
||||
})
|
||||
export class InitializationRoot implements AfterViewInit {
|
||||
@ViewChild(BenchmarkableExpandingRow, {static: true})
|
||||
expandingRow !: BenchmarkableExpandingRow;
|
||||
|
||||
ngAfterViewInit() {}
|
||||
|
||||
reset() { this.expandingRow.reset(); }
|
||||
|
||||
init() { this.expandingRow.init(); }
|
||||
|
||||
async runAll() {
|
||||
await execTimed('initialization_benchmark', async() => { await this.doInit(); });
|
||||
}
|
||||
|
||||
async handleInitClick() { await this.doInit(); }
|
||||
|
||||
private async doInit() {
|
||||
await execTimed('initial_load', async() => { this.expandingRow.init(); });
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [InitializationRoot],
|
||||
exports: [InitializationRoot],
|
||||
imports: [
|
||||
CommonModule,
|
||||
BenchmarkableExpandingRowModule,
|
||||
BenchmarkModule,
|
||||
BrowserModule,
|
||||
],
|
||||
bootstrap: [InitializationRoot],
|
||||
})
|
||||
// Component benchmarks must export a BenchmarkModule.
|
||||
export class ExpandingRowBenchmarkModule {
|
||||
}
|
||||
|
||||
export async function execTimed(description: string, func: () => Promise<void>) {
|
||||
console.time(description);
|
||||
await func();
|
||||
await nextTick(200);
|
||||
console.timeEnd(description);
|
||||
}
|
||||
|
||||
export async function nextTick(delay = 1) {
|
||||
return new Promise((res, rej) => { setTimeout(() => { res(); }, delay); });
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Component, ErrorHandler, Injectable, NgModule} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'benchmark-area',
|
||||
template: '<ng-content></ng-content>',
|
||||
styles: [`
|
||||
:host {
|
||||
padding: 1;
|
||||
margin: 1;
|
||||
background-color: white;
|
||||
width: 1000px;
|
||||
display: block;
|
||||
}`],
|
||||
host: {
|
||||
'class': 'cfc-ng2-region',
|
||||
}
|
||||
})
|
||||
export class BenchmarkArea {
|
||||
}
|
||||
|
||||
declare interface ExtendedWindow extends Window { benchmarkErrors?: string[]; }
|
||||
const extendedWindow = window as ExtendedWindow;
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
export class BenchmarkErrorHandler implements ErrorHandler {
|
||||
handleError(error: Error) {
|
||||
if (!extendedWindow.benchmarkErrors) {
|
||||
extendedWindow.benchmarkErrors = [];
|
||||
}
|
||||
extendedWindow.benchmarkErrors.push(error.message);
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [BenchmarkArea],
|
||||
exports: [BenchmarkArea],
|
||||
providers: [
|
||||
{provide: ErrorHandler, useClass: BenchmarkErrorHandler},
|
||||
]
|
||||
})
|
||||
export class BenchmarkModule {
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {$, browser} from 'protractor';
|
||||
import {runBenchmark} from '../../../e2e_util/perf_util';
|
||||
|
||||
describe('benchmarks', () => {
|
||||
|
||||
it('should work for create', done => {
|
||||
browser.rootEl = '#root';
|
||||
runBenchmark({
|
||||
id: 'create',
|
||||
url: '',
|
||||
ignoreBrowserSynchronization: true,
|
||||
params: [],
|
||||
prepare: () => $('#reset').click(),
|
||||
work: () => $('#init').click()
|
||||
}).then(done, done.fail);
|
||||
});
|
||||
|
||||
});
|
@ -1,73 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
export interface MlbTeam {
|
||||
name: string;
|
||||
id: number;
|
||||
division: string;
|
||||
stadium: string;
|
||||
projection: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'benchmarkable-expanding-row',
|
||||
template: `
|
||||
<cfc-expanding-row-host *ngIf="showExpandingRow">
|
||||
<cfc-expanding-row *ngFor="let team of teams" [rowId]="$any(team.id)">
|
||||
<cfc-expanding-row-summary>
|
||||
Team {{team.id}}
|
||||
</cfc-expanding-row-summary>
|
||||
<cfc-expanding-row-details-caption>
|
||||
{{team.name}}
|
||||
<a href="https://www.google.com" class="cfc-demo-expanding-row-caption-link">
|
||||
{{team.id}}
|
||||
</a>
|
||||
</cfc-expanding-row-details-caption>
|
||||
<cfc-expanding-row-details-content>
|
||||
<ul ace-list>
|
||||
<li>Division: {{team.division}}</li>
|
||||
<li>
|
||||
<a href="https://www.google.com">{{team.stadium}}</a>
|
||||
</li>
|
||||
<li>Projected Record: {{team.projection}}</li>
|
||||
</ul>
|
||||
</cfc-expanding-row-details-content>
|
||||
</cfc-expanding-row>
|
||||
</cfc-expanding-row-host>`,
|
||||
})
|
||||
export class BenchmarkableExpandingRow {
|
||||
// TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
|
||||
showExpandingRow !: boolean;
|
||||
|
||||
// TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
|
||||
teams !: MlbTeam[];
|
||||
// TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
|
||||
private fakeTeams !: MlbTeam[];
|
||||
|
||||
init(): void {
|
||||
this.teams = this.fakeTeams;
|
||||
this.showExpandingRow = true;
|
||||
}
|
||||
|
||||
reset(numItems = 5000): void {
|
||||
this.showExpandingRow = false;
|
||||
|
||||
this.fakeTeams = [];
|
||||
for (let i = 0; i < numItems; i++) {
|
||||
this.fakeTeams.push({
|
||||
name: `name ${i}`,
|
||||
id: i,
|
||||
division: `division ${i}`,
|
||||
stadium: `stadium ${i}`,
|
||||
projection: `projection ${i}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {NgModule} from '@angular/core';
|
||||
|
||||
import {BenchmarkableExpandingRow} from './benchmarkable_expanding_row';
|
||||
import {ExpandingRowModule} from './expanding_row_module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [BenchmarkableExpandingRow],
|
||||
exports: [BenchmarkableExpandingRow],
|
||||
imports: [
|
||||
CommonModule,
|
||||
ExpandingRowModule,
|
||||
],
|
||||
})
|
||||
export class BenchmarkableExpandingRowModule {
|
||||
}
|
@ -1,355 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, HostListener, Inject, InjectionToken, Input, Output, QueryList, ViewChild} from '@angular/core';
|
||||
|
||||
import {expanding_row_css} from './expanding_row_css';
|
||||
import {ExpandingRowSummary} from './expanding_row_summary';
|
||||
import {ExpandingRowToggleEvent} from './expanding_row_toggle_event';
|
||||
|
||||
|
||||
/**
|
||||
* Injection token to break cylic dependency between ExpandingRow and
|
||||
* ExpandingRowHost
|
||||
*/
|
||||
export const EXPANDING_ROW_HOST_INJECTION_TOKEN =
|
||||
new InjectionToken<ExpandingRowHostBase>('ExpandingRowHost');
|
||||
|
||||
/** The base class for ExpandingRowHost component to break cylic dependency. */
|
||||
export interface ExpandingRowHostBase {
|
||||
/**
|
||||
* A reference to all child cfc-expanding-row elements. We will need for
|
||||
* keyboard accessibility and scroll adjustments. For example, we need to know
|
||||
* which row is previous row when user presses "left arrow" on a focused row.
|
||||
*/
|
||||
contentRows: QueryList<ExpandingRow>;
|
||||
|
||||
/**
|
||||
* Keeps track of the last row that had focus before focus left the list
|
||||
* of expanding rows.
|
||||
*/
|
||||
lastFocusedRow?: ExpandingRow;
|
||||
|
||||
/**
|
||||
* Handles summary element click on a cfc-expanding-row component. Note
|
||||
* that summary element is visible only when the row is collapsed. So this
|
||||
* event will fired prior to expansion of a collapsed row. Scroll adjustment
|
||||
* below makes sure mouse stays on the caption element when the collapsed
|
||||
* row expands.
|
||||
*/
|
||||
handleRowSummaryClick(row: ExpandingRow): void;
|
||||
|
||||
/**
|
||||
* Check if element is blacklisted. Blacklisted elements will not collapse an
|
||||
* open row when clicked.
|
||||
*/
|
||||
isBlacklisted(element: HTMLElement|null): boolean;
|
||||
|
||||
/**
|
||||
* Handles caption element click on a cfc-expanding-row component. Note
|
||||
* that caption element is visible only when the row is expanded. So this
|
||||
* means we will collapse the expanded row. The scroll adjustment below
|
||||
* makes sure that the mouse stays under the summary of the expanded row
|
||||
* when the row collapses.
|
||||
*/
|
||||
handleRowCaptionClick(row: ExpandingRow): void;
|
||||
|
||||
/**
|
||||
* Handles expansion of a row. When a new row expands, we need to remove
|
||||
* previous expansion and collapse. We also need to save the currently
|
||||
* expanded row so that we can collapse this row once another row expands.
|
||||
*/
|
||||
handleRowExpand(row: ExpandingRow): void;
|
||||
|
||||
/**
|
||||
* Handles focus on a row. When a new row gets focus (note that this is
|
||||
* different from expansion), we need to remove previous focus and expansion.
|
||||
* We need to save the reference to this focused row so that we can unfocus
|
||||
* this row when another row is focused.
|
||||
*/
|
||||
handleRowFocus(row: ExpandingRow): void;
|
||||
|
||||
/**
|
||||
* Function that is called by expanding row summary to focus on the last
|
||||
* focusable element before the list of expanding rows.
|
||||
*/
|
||||
focusOnPreviousFocusableElement(): void;
|
||||
|
||||
/**
|
||||
* Function that is called by expanding row summary to focus on the next
|
||||
* focusable element after the list of expanding rows.
|
||||
*/
|
||||
focusOnNextFocusableElement(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This component is used to render a single expanding row. It should contain
|
||||
* cfc-expanding-row-summary, cfc-expanding-row-details-caption and
|
||||
* cfc-expanding-row-details-content components.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'cfc-expanding-row',
|
||||
styles: [expanding_row_css],
|
||||
template: `
|
||||
<div #expandingRowMainElement
|
||||
class="cfc-expanding-row"
|
||||
cdkMonitorSubtreeFocus
|
||||
[attr.tabindex]="isExpanded ? '0' : '-1'"
|
||||
[class.cfc-expanding-row-has-focus]="isFocused"
|
||||
[class.cfc-expanding-row-is-expanded]="isExpanded"
|
||||
ve="CfcExpandingRow">
|
||||
<ng-content></ng-content>
|
||||
</div>`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ExpandingRow {
|
||||
/**
|
||||
* The identifier for this node provided by the user code. We need this
|
||||
* while we are emitting onToggle event.
|
||||
*/
|
||||
@Input() rowId !: string;
|
||||
|
||||
/**
|
||||
* An ElementRef to the main element in this component. We need a reference
|
||||
* to this element to compute the height. The height of cfc-expanding-row
|
||||
* is used in [cfcExpandingRowHost] directive for scroll adjustments.
|
||||
*/
|
||||
@ViewChild('expandingRowMainElement', {static: true})
|
||||
expandingRowMainElement !: ElementRef;
|
||||
|
||||
/**
|
||||
* This @Output event emitter will be triggered when the user expands or
|
||||
* collapses this node.
|
||||
*/
|
||||
@Output() onToggle = new EventEmitter<ExpandingRowToggleEvent>();
|
||||
|
||||
/**
|
||||
* A boolean indicating if this node is expanded. This value is used to
|
||||
* hide/show summary, caption, and content of the expanding row. There should
|
||||
* only be one expanded row within [cfcExpandingRowHost] directive. And if
|
||||
* there is an expanded row, there shouldn't be any focused rows.
|
||||
*/
|
||||
set isExpanded(value: boolean) {
|
||||
const changed: boolean = this.isExpandedInternal !== value;
|
||||
this.isExpandedInternal = value;
|
||||
|
||||
if (changed) {
|
||||
this.isExpandedChange.emit();
|
||||
this.changeDetectorRef.markForCheck();
|
||||
}
|
||||
}
|
||||
|
||||
/** TS getter for isExpanded property. */
|
||||
get isExpanded(): boolean { return this.isExpandedInternal; }
|
||||
|
||||
/** Triggered when isExpanded property changes. */
|
||||
isExpandedChange = new EventEmitter<void>();
|
||||
|
||||
/** Triggered when index property changes. */
|
||||
indexChange = new EventEmitter<void>();
|
||||
|
||||
/**
|
||||
* A boolean indicating if this node is focused. This value is used to add
|
||||
* a CSS class that should render a blue border on the right. There should
|
||||
* only be one focused row in [cfcExpandingRowHost] directive.
|
||||
*/
|
||||
set isFocused(value: boolean) {
|
||||
this.isFocusedInternal = value;
|
||||
this.changeDetectorRef.markForCheck();
|
||||
}
|
||||
|
||||
/** TS getter for isFocused property. */
|
||||
get isFocused(): boolean { return this.isFocusedInternal; }
|
||||
|
||||
/** The index of the row in the context of the entire collection. */
|
||||
set index(value: number) {
|
||||
const changed: boolean = this.indexInternal !== value;
|
||||
this.indexInternal = value;
|
||||
|
||||
if (changed) {
|
||||
this.indexChange.emit();
|
||||
this.changeDetectorRef.markForCheck();
|
||||
}
|
||||
}
|
||||
|
||||
/** TS getter for index property. */
|
||||
get index(): number { return this.indexInternal; }
|
||||
|
||||
/**
|
||||
* We should probably rename this to summaryContentChild. Because technically
|
||||
* this is not a @ViewChild that is in a template. This will be transcluded.
|
||||
* Note that we are not using @ContentChild directive here. The @ContentChild
|
||||
* will cause cyclic reference if the class definition for ExpandingRowSummary
|
||||
* component is not in the same file as ExpandingRow.
|
||||
*/
|
||||
// TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
|
||||
summaryViewChild !: ExpandingRowSummary;
|
||||
|
||||
/**
|
||||
* We compute the collapsed height (which is just height of
|
||||
* cfc-expanding-row-summary component) in this component. This is used in
|
||||
* [cfcExpandingRowHost] for scroll adjustment calculation.
|
||||
*/
|
||||
collapsedHeight = -1;
|
||||
|
||||
/** Internal storage for isExpanded public property. */
|
||||
private isExpandedInternal = false;
|
||||
|
||||
/** Internal storage for isFocused public property. */
|
||||
private isFocusedInternal = false;
|
||||
|
||||
/** Internal storage for index public property. */
|
||||
// TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
|
||||
private indexInternal !: number;
|
||||
|
||||
/**
|
||||
* This holds a reference to [cfcExpandingRowHost] directive. We need
|
||||
* this reference to notify the host when this row expands/collapses or is
|
||||
* focused.
|
||||
*/
|
||||
constructor(
|
||||
public elementRef: ElementRef,
|
||||
@Inject(EXPANDING_ROW_HOST_INJECTION_TOKEN) public expandingRowHost: ExpandingRowHostBase,
|
||||
private readonly changeDetectorRef: ChangeDetectorRef) {}
|
||||
|
||||
/**
|
||||
* Handles click on cfc-expanding-row-summary component. This will expand
|
||||
* this row and collapse the previously expanded row. The collapse & blur
|
||||
* is handled in [cfcExpandingRowHost] directive.
|
||||
*/
|
||||
handleSummaryClick(): void {
|
||||
this.collapsedHeight =
|
||||
this.elementRef.nativeElement.querySelector('.cfc-expanding-row-summary').offsetHeight;
|
||||
this.expandingRowHost.handleRowSummaryClick(this);
|
||||
this.expand();
|
||||
}
|
||||
|
||||
/**
|
||||
* When user tabs into child cfc-expanding-row-summary component. This method
|
||||
* will make sure we focuse on this row, and blur on previously focused row.
|
||||
*/
|
||||
handleSummaryFocus(): void { this.focus(); }
|
||||
|
||||
/**
|
||||
* cfc-expanding-row-details-caption component will call this function to
|
||||
* notify click on its host element. Note that caption is only shown when
|
||||
* the row is expanded. Hence this will collapse this row and put the focus
|
||||
* on it.
|
||||
* If a blacklisted element exists in the caption, clicking that element will
|
||||
* not trigger the row collapse.
|
||||
*/
|
||||
handleCaptionClick(event: MouseEvent): void {
|
||||
if (this.expandingRowHost.isBlacklisted(event.target as {} as HTMLElement)) {
|
||||
return;
|
||||
}
|
||||
this.expandingRowHost.handleRowCaptionClick(this);
|
||||
this.collapse();
|
||||
this.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the height of this component. This height is used in parent
|
||||
* [cfcExpandingRowHost] directive to compute scroll adjustment.
|
||||
*/
|
||||
getHeight(): number { return this.expandingRowMainElement.nativeElement.offsetHeight; }
|
||||
|
||||
/**
|
||||
* Expands this row. This will notify the host so that it can collapse
|
||||
* previously expanded row. This function also emits onToggle @Output event
|
||||
* to the user code.
|
||||
*/
|
||||
expand(): void {
|
||||
this.isExpanded = true;
|
||||
this.expandingRowHost.handleRowExpand(this);
|
||||
|
||||
// setTimeout here makes sure we scroll this row into view after animation.
|
||||
setTimeout(() => { this.expandingRowMainElement.nativeElement.focus(); });
|
||||
|
||||
this.onToggle.emit({rowId: this.rowId, isExpand: true});
|
||||
}
|
||||
|
||||
/**
|
||||
* Collapses this row. Setting isExpanded to false will make sure we hide
|
||||
* the caption and details, and show cfc-expanding-row-summary component.
|
||||
* This also emits onToggle @Output event to the user code.
|
||||
*/
|
||||
collapse(): void {
|
||||
this.isExpanded = false;
|
||||
this.onToggle.emit({rowId: this.rowId, isExpand: false});
|
||||
}
|
||||
|
||||
/**
|
||||
* Blurs this row. This should remove the blue border on the left if there
|
||||
* is any. This function will remove DOM focus on the
|
||||
* cfc-expanding-row-summary
|
||||
* component.
|
||||
*/
|
||||
blur(): void {
|
||||
this.isFocused = false;
|
||||
this.summaryViewChild.blur();
|
||||
}
|
||||
|
||||
/**
|
||||
* Focuses this row. This should put blue border on the left. If there is
|
||||
* any previous focus/selection, those should be gone. Parent
|
||||
* [cfcExpandingRowHost] component takes care of that.
|
||||
*/
|
||||
focus(): void {
|
||||
this.isFocused = true;
|
||||
this.expandingRowHost.handleRowFocus(this);
|
||||
|
||||
// Summary child is not present currently. We need to NG2 to update the
|
||||
// template.
|
||||
setTimeout(() => { this.summaryViewChild.focus(); });
|
||||
}
|
||||
|
||||
/**
|
||||
* We listen for TAB press here to make sure we trap the focus on the
|
||||
* expanded
|
||||
* row. If the row is not expanded, we don't care about this event since focus
|
||||
* trap should work for expanded rows only.
|
||||
*/
|
||||
@HostListener('keydown', ['$event'])
|
||||
handleKeyDown(event: KeyboardEvent) {
|
||||
const charCode = event.which || event.keyCode;
|
||||
|
||||
switch (charCode) {
|
||||
case 9:
|
||||
if (!this.isExpanded) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.trapFocus(event);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When this row is expanded, this function traps the focus between focusable
|
||||
* elements contained in this row.
|
||||
*/
|
||||
private trapFocus(event: KeyboardEvent): void {
|
||||
const rowElement: HTMLElement = this.expandingRowMainElement.nativeElement;
|
||||
const focusableEls: HTMLElement[] = [];
|
||||
let lastFocusableEl: HTMLElement = rowElement;
|
||||
|
||||
if (focusableEls.length) {
|
||||
lastFocusableEl = focusableEls[focusableEls.length - 1];
|
||||
}
|
||||
|
||||
if (event.target === lastFocusableEl && !event.shiftKey) {
|
||||
rowElement.focus();
|
||||
event.preventDefault();
|
||||
} else if (event.target === rowElement && event.shiftKey) {
|
||||
lastFocusableEl.focus();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Directive} from '@angular/core';
|
||||
|
||||
|
||||
/**
|
||||
* This directive is used to flag an element to NOT trigger collapsing an
|
||||
* expanded row
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[cfcExpandingRowBlacklist]',
|
||||
})
|
||||
export class ExpandingRowBlacklist {
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export const expanding_row_css = `
|
||||
::ng-deep [cfcExpandingRowHost] {
|
||||
display: block;
|
||||
margin-bottom: 2;
|
||||
}
|
||||
|
||||
:host(cfc-expanding-row),
|
||||
:host(cfc-expanding-row-summary),
|
||||
:host(cfc-expanding-row-details-caption),
|
||||
:host(cfc-expanding-row-details-content) {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.cfc-expanding-row {
|
||||
background: white;
|
||||
border-top: 1 solid black;
|
||||
box-shadow: 0 1 1 gray;
|
||||
transition: margin 1 1;
|
||||
will-change: margin;
|
||||
}
|
||||
|
||||
.cfc-expanding-row.cfc-expanding-row-is-expanded {
|
||||
margin: 1 (-1);
|
||||
}
|
||||
|
||||
.cfc-expanding-row:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.cfc-expanding-row-summary {
|
||||
|
||||
display: flex;
|
||||
border-left: 6 solid transparent;
|
||||
cursor: pointer;
|
||||
padding: 6 2;
|
||||
|
||||
}
|
||||
|
||||
.cfc-expanding-row-summary:focus {
|
||||
outline: none;
|
||||
border-left-color: $cfc-color-active;
|
||||
}
|
||||
|
||||
// Adjust icons to be positioned correctly in the row.
|
||||
.cfc-expanding-row-summary::ng-deep cfc-icon {
|
||||
margin-top: 3;
|
||||
}
|
||||
|
||||
.cfc-expanding-row-details-caption {
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
padding: 4 2;
|
||||
|
||||
}
|
||||
|
||||
.cfc-expanding-row-details-caption::ng-deep a,
|
||||
.cfc-expanding-row-details-caption::ng-deep a:visited,
|
||||
.cfc-expanding-row-details-caption::ng-deep a .cfc-external-link-content {
|
||||
border-color: $cfc-color-text-primary-inverse;
|
||||
color: $cfc-color-text-primary-inverse;
|
||||
}
|
||||
|
||||
// Adjust icons to be positioned correctly in the row.
|
||||
::ng-deep cfc-icon {
|
||||
margin-top: 3;
|
||||
}
|
||||
|
||||
.cfc-expanding-row-details-content {
|
||||
padding: 2;
|
||||
}
|
||||
|
||||
.cfc-expanding-row-details-content::ng-deep .ace-kv-list.cfc-full-bleed {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
|
||||
.cfc-expanding-row-accessibility-text {
|
||||
display: none;
|
||||
}`;
|
@ -1,53 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
|
||||
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Host, Input, OnDestroy} from '@angular/core';
|
||||
import {Subject} from 'rxjs';
|
||||
import {takeUntil} from 'rxjs/operators';
|
||||
|
||||
import {ExpandingRow} from './expanding_row';
|
||||
import {expanding_row_css} from './expanding_row_css';
|
||||
|
||||
/**
|
||||
* This component should be within cfc-expanding-row component. The caption
|
||||
* is only visible when the row is expanded.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'cfc-expanding-row-details-caption',
|
||||
styles: [expanding_row_css],
|
||||
template: `
|
||||
<div *ngIf="expandingRow.isExpanded"
|
||||
(click)="expandingRow.handleCaptionClick($event)"
|
||||
[style.backgroundColor]="color"
|
||||
class="cfc-expanding-row-details-caption">
|
||||
<ng-content></ng-content>
|
||||
</div>`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ExpandingRowDetailsCaption implements OnDestroy {
|
||||
/** The background color of this component. */
|
||||
@Input() color: string = 'blue';
|
||||
|
||||
/** This is triggered when this component is destroyed. */
|
||||
private readonly onDestroy = new Subject();
|
||||
|
||||
/**
|
||||
* We need a reference to parent cfc-expanding-row component here to hide
|
||||
* this component when the row is collapsed. We also need to relay clicks
|
||||
* to the parent component.
|
||||
*/
|
||||
constructor(@Host() public expandingRow: ExpandingRow, changeDetectorRef: ChangeDetectorRef) {
|
||||
this.expandingRow.isExpandedChange.pipe(takeUntil(this.onDestroy)).subscribe(() => {
|
||||
changeDetectorRef.markForCheck();
|
||||
});
|
||||
}
|
||||
|
||||
/** When component is destroyed, unlisten to isExpanded. */
|
||||
ngOnDestroy(): void { this.onDestroy.next(); }
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Host, OnDestroy} from '@angular/core';
|
||||
import {Subscription} from 'rxjs';
|
||||
|
||||
import {ExpandingRow} from './expanding_row';
|
||||
import {expanding_row_css} from './expanding_row_css';
|
||||
|
||||
/**
|
||||
* This component should be within cfc-expanding-row component. Note that the
|
||||
* content is visible only when the row is expanded.
|
||||
*/
|
||||
@Component({
|
||||
styles: [expanding_row_css],
|
||||
selector: 'cfc-expanding-row-details-content',
|
||||
template: `
|
||||
<div class="cfc-expanding-row-details-content"
|
||||
*ngIf="expandingRow.isExpanded">
|
||||
<ng-content></ng-content>
|
||||
</div>`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ExpandingRowDetailsContent implements OnDestroy {
|
||||
/** Used for unsubscribing to changes in isExpanded parent property. */
|
||||
private isExpandedChangeSubscription: Subscription;
|
||||
|
||||
/**
|
||||
* We need a reference to parent cfc-expanding-row component to make sure we
|
||||
* hide this component if the row is collapsed.
|
||||
*/
|
||||
constructor(@Host() public expandingRow: ExpandingRow, changeDetectorRef: ChangeDetectorRef) {
|
||||
this.isExpandedChangeSubscription =
|
||||
this.expandingRow.isExpandedChange.subscribe(() => { changeDetectorRef.markForCheck(); });
|
||||
}
|
||||
|
||||
/** Unsubscribe from changes in parent isExpanded property. */
|
||||
ngOnDestroy(): void { this.isExpandedChangeSubscription.unsubscribe(); }
|
||||
}
|
@ -1,497 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {AfterContentInit, AfterViewInit, ChangeDetectionStrategy, Component, ContentChildren, ElementRef, EventEmitter, HostListener, Input, OnDestroy, Output, QueryList, ViewChild, forwardRef} from '@angular/core';
|
||||
import {Subscription} from 'rxjs';
|
||||
|
||||
import {EXPANDING_ROW_HOST_INJECTION_TOKEN, ExpandingRow, ExpandingRowHostBase} from './expanding_row';
|
||||
|
||||
|
||||
/**
|
||||
* We use this class in <cfc-expanding-row/> template to identify the row.
|
||||
* The [cfcExpandingRowHost] directive also uses this class to check if a given
|
||||
* HTMLElement is within an <cfc-expanding-row/>.
|
||||
*/
|
||||
const EXPANDING_ROW_CLASS_NAME = 'cfc-expanding-row';
|
||||
|
||||
/** Throttle duration in milliseconds for repeated key presses. */
|
||||
export const EXPANDING_ROW_KEYPRESS_THORTTLE_MS = 50;
|
||||
|
||||
/**
|
||||
* This type union is created to make arguments of handleUpOrDownPress*
|
||||
* methods in ExpandingRowHost class more readable.
|
||||
*/
|
||||
type UpOrDown = 'up' | 'down';
|
||||
|
||||
/**
|
||||
* This is the wrapper directive for the cfc-expanding-row components. Note that
|
||||
* we wanted to make this a directive instead of component because child
|
||||
* cfc-expanding-row components does not have to be a direct child.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'cfc-expanding-row-host',
|
||||
template: `
|
||||
<div #firstFocusable
|
||||
(focus)="focusOnLastFocusedRow()"
|
||||
tabindex="0">
|
||||
</div>
|
||||
<ng-content></ng-content>
|
||||
<div #lastFocusable
|
||||
(focus)="focusOnLastFocusedRow()"
|
||||
tabindex="0">
|
||||
</div>`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
providers: [{provide: EXPANDING_ROW_HOST_INJECTION_TOKEN, useExisting: ExpandingRowHost}],
|
||||
})
|
||||
export class ExpandingRowHost implements AfterViewInit,
|
||||
OnDestroy, ExpandingRowHostBase {
|
||||
/**
|
||||
* An HTML selector (e.g. "body") for the scroll element. We need this to
|
||||
* make some scroll adjustments.
|
||||
*/
|
||||
@Input() scrollElementSelector = '.cfc-panel-body-scrollable';
|
||||
|
||||
/**
|
||||
* An HTML selector (e.g. "body") for the click root. While the row is
|
||||
* expanded, and user clicks outside of the expanded row, we collapse this row
|
||||
* But to do this, we need to know the clickable area.
|
||||
*/
|
||||
@Input() clickRootElementSelector = 'cfc-panel-body';
|
||||
|
||||
/**
|
||||
* The @Output will be triggered when the user wants to focus on the
|
||||
* previously expanded row, and we are already at the first row. The logs team
|
||||
* will use this to prepend data on demand.
|
||||
*/
|
||||
@Output() onPrepend = new EventEmitter<void>();
|
||||
|
||||
/** A reference to the last focusable element in list of expanding rows. */
|
||||
@ViewChild('lastFocusable', {static: true}) lastFocusableElement !: ElementRef;
|
||||
|
||||
/** A reference to the first focusable element in list of expanding rows. */
|
||||
@ViewChild('firstFocusable', {static: true})
|
||||
firstFocusableElement !: ElementRef;
|
||||
|
||||
/**
|
||||
* A reference to all child cfc-expanding-row elements. We will need for
|
||||
* keyboard accessibility and scroll adjustments. For example, we need to know
|
||||
* which row is previous row when user presses "left arrow" on a focused row.
|
||||
*/
|
||||
@ContentChildren(forwardRef(() => ExpandingRow), {descendants: true})
|
||||
contentRows !: QueryList<ExpandingRow>;
|
||||
|
||||
/**
|
||||
* Keeps track of the last row that had focus before focus left the list
|
||||
* of expanding rows.
|
||||
*/
|
||||
lastFocusedRow?: ExpandingRow = undefined;
|
||||
|
||||
/**
|
||||
* Focused rows just show a blue left border. This node is not expanded. We
|
||||
* need to keep a reference to the focused row to unfocus when another row
|
||||
* is focused.
|
||||
*/
|
||||
private focusedRow?: ExpandingRow = undefined;
|
||||
|
||||
/**
|
||||
* This is the expanded row. If there is an expanded row there shouldn't be
|
||||
* any focused rows. We need a reference to this. For example we need to
|
||||
* collapse the currently expanded row, if another row is expanded.
|
||||
*/
|
||||
private expandedRow?: ExpandingRow = undefined;
|
||||
|
||||
/**
|
||||
* This is just handleRootMouseUp.bind(this). handleRootMouseUp handles
|
||||
* click events on root element (defined by clickRootElementSelector @Input)
|
||||
* Since we attach the click listener dynamically, we need to keep this
|
||||
* function around. This enables us to detach the click listener when
|
||||
* component is destroyed.
|
||||
*/
|
||||
private handleRootMouseUpBound: EventListenerObject = this.handleRootMouseUp.bind(this);
|
||||
|
||||
/**
|
||||
* 16px is the margin animation we have on cfc-expanding-row component.
|
||||
* We need this value to compute scroll adjustments.
|
||||
*/
|
||||
private static rowMargin = 16;
|
||||
|
||||
/** Subscription to changes in the expanding rows. */
|
||||
// TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
|
||||
private rowChangeSubscription !: Subscription;
|
||||
|
||||
/**
|
||||
* When component initializes we need to attach click listener to the root
|
||||
* element. This click listener will allows us to collapse the
|
||||
* currently expanded row when user clicks outside of it.
|
||||
*/
|
||||
ngAfterViewInit(): void {
|
||||
const clickRootElement: HTMLElement = this.getClickRootElement();
|
||||
|
||||
if (!clickRootElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
clickRootElement.addEventListener('mouseup', this.handleRootMouseUpBound);
|
||||
|
||||
this.rowChangeSubscription =
|
||||
this.contentRows.changes.subscribe(() => { this.recalcRowIndexes(); });
|
||||
this.recalcRowIndexes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Detaches the click listener on the root element. Note that we are attaching
|
||||
* this listener on ngAfterViewInit function.
|
||||
*/
|
||||
ngOnDestroy(): void {
|
||||
const clickRootElement: HTMLElement = this.getClickRootElement();
|
||||
|
||||
if (!clickRootElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
clickRootElement.removeEventListener('mouseup', this.handleRootMouseUpBound);
|
||||
|
||||
if (this.rowChangeSubscription) {
|
||||
this.rowChangeSubscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles caption element click on a cfc-expanding-row component. Note
|
||||
* that caption element is visible only when the row is expanded. So this
|
||||
* means we will collapse the expanded row. The scroll adjustment below
|
||||
* makes sure that the mouse stays under the summary of the expanded row
|
||||
* when the row collapses.
|
||||
*/
|
||||
handleRowCaptionClick(row: ExpandingRow): void {
|
||||
const scrollAdjustment: number = -ExpandingRowHost.rowMargin;
|
||||
const scrollElement: HTMLElement = this.getScrollElement() as HTMLElement;
|
||||
if (!scrollElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
scrollElement.scrollTop += scrollAdjustment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles summary element click on a cfc-expanding-row component. Note
|
||||
* that summary element is visible only when the row is collapsed. So this
|
||||
* event will fired prior to expansion of a collapsed row. Scroll adjustment
|
||||
* below makes sure mouse stays on the caption element when the collapsed
|
||||
* row expands.
|
||||
*/
|
||||
handleRowSummaryClick(row: ExpandingRow): void {
|
||||
const hadPreviousSelection: boolean = !!this.expandedRow;
|
||||
const previousSelectedRowIndex: number = this.getRowIndex(this.expandedRow as ExpandingRow);
|
||||
const newSelectedRowIndex: number = this.getRowIndex(row);
|
||||
const previousCollapsedHeight: number = this.getSelectedRowCollapsedHeight();
|
||||
const previousExpansionHeight = this.getSelectedRowExpandedHeight();
|
||||
|
||||
if (this.expandedRow) {
|
||||
return;
|
||||
}
|
||||
|
||||
let scrollAdjustment = 0;
|
||||
const scrollElement: HTMLElement = this.getScrollElement() as HTMLElement;
|
||||
if (!scrollElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (previousExpansionHeight > 0 && previousCollapsedHeight >= 0) {
|
||||
scrollAdjustment = previousExpansionHeight - previousCollapsedHeight;
|
||||
}
|
||||
|
||||
const newSelectionIsInfrontOfPrevious: boolean = newSelectedRowIndex > previousSelectedRowIndex;
|
||||
const multiplier = newSelectionIsInfrontOfPrevious ? -1 : 0;
|
||||
scrollAdjustment = scrollAdjustment * multiplier + ExpandingRowHost.rowMargin;
|
||||
|
||||
scrollElement.scrollTop += scrollAdjustment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles expansion of a row. When a new row expands, we need to remove
|
||||
* previous expansion and collapse. We also need to save the currently
|
||||
* expanded row so that we can collapse this row once another row expands.
|
||||
*/
|
||||
handleRowExpand(row: ExpandingRow): void {
|
||||
this.removePreviousFocus();
|
||||
this.removePreviousExpansion();
|
||||
this.expandedRow = row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles focus on a row. When a new row gets focus (note that this is
|
||||
* different from expansion), we need to remove previous focus and expansion.
|
||||
* We need to save the reference to this focused row so that we can unfocus
|
||||
* this row when another row is focused.
|
||||
*/
|
||||
handleRowFocus(row: ExpandingRow): void {
|
||||
// Do not blur then refocus the row if it's already selected.
|
||||
if (row === this.focusedRow) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.removePreviousFocus();
|
||||
this.removePreviousExpansion();
|
||||
this.focusedRow = row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when shift+tabbing from the first focusable element after the list
|
||||
* of expanding rows or tabbing from the last focusable element before.
|
||||
*/
|
||||
focusOnLastFocusedRow(): void {
|
||||
if (!this.lastFocusedRow) {
|
||||
this.lastFocusedRow = this.contentRows.toArray()[0];
|
||||
}
|
||||
this.lastFocusedRow.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that is called by expanding row summary to focus on the last
|
||||
* focusable element before the list of expanding rows.
|
||||
*/
|
||||
focusOnPreviousFocusableElement(): void { this.lastFocusedRow = this.focusedRow; }
|
||||
|
||||
/**
|
||||
* Function that is called by expanding row summary to focus on the next
|
||||
* focusable element after the list of expanding rows.
|
||||
*/
|
||||
focusOnNextFocusableElement(): void { this.lastFocusedRow = this.focusedRow; }
|
||||
|
||||
/**
|
||||
* Handles keydown event on the host. We are just concerned with up,
|
||||
* down arrow, ESC, and ENTER presses here. Note that Up/Down presses
|
||||
* can be repeated.
|
||||
*
|
||||
* - Up: Focuses on the row above.
|
||||
* - Down: Focuses on the row below.
|
||||
* - Escape: Collapses the expanded row.
|
||||
* - Enter: Expands the focused row.
|
||||
*/
|
||||
@HostListener('keydown', ['$event'])
|
||||
handleKeyDown(event: KeyboardEvent) {}
|
||||
|
||||
/**
|
||||
* Recursively returns true if target HTMLElement is within a
|
||||
* cfc-expanding-row component. It will return false otherwise.
|
||||
* We need this function in handleRootMouseUp to collapse the expanded row
|
||||
* when user clicks outside of all expanded rows.
|
||||
*/
|
||||
private isTargetInRow(target: HTMLElement): boolean {
|
||||
return target.classList.contains(EXPANDING_ROW_CLASS_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the click root element that is described by clickRootElementSelector
|
||||
* @Input value.
|
||||
*/
|
||||
private getClickRootElement(): HTMLElement {
|
||||
return document.querySelector(this.clickRootElementSelector) as HTMLElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles all of the mouseup events on the click root. When user clicks
|
||||
* outside of an expanded row, we need to collapse that row.
|
||||
* We trigger collapse by calling handleCaptionClick() on the expanded row.
|
||||
*/
|
||||
private handleRootMouseUp(event: MouseEvent): void {
|
||||
if (!this.expandedRow) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.isTargetInRow(event.target as {} as HTMLElement)) {
|
||||
this.expandedRow.handleCaptionClick(event);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if element is blacklisted. Blacklisted elements will not collapse an
|
||||
* open row when clicked.
|
||||
*/
|
||||
isBlacklisted(element: HTMLElement|null): boolean {
|
||||
const clickRoot = this.getClickRootElement();
|
||||
while (element && element !== clickRoot) {
|
||||
if (element.hasAttribute('cfcexpandingrowblacklist')) {
|
||||
return true;
|
||||
}
|
||||
element = element.parentElement;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes focus state from a previously focused row. We blur this row and
|
||||
* set the focusedRow to undefined in this method. This usually happens when
|
||||
* another row is focused.
|
||||
*/
|
||||
private removePreviousFocus(): void {
|
||||
if (this.focusedRow) {
|
||||
this.focusedRow.blur();
|
||||
this.focusedRow = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the expanded state from a previously expanded row. We collapse this
|
||||
* row and set the expandedRow to undefined in this method. This usually
|
||||
* happens when another row is expanded.
|
||||
*/
|
||||
private removePreviousExpansion(): void {
|
||||
if (this.expandedRow) {
|
||||
this.expandedRow.collapse();
|
||||
this.expandedRow = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the collapsed height of the currently expanded row. We need this for
|
||||
* scroll adjustments. Note that collapsed height of a cfc-expanding-row
|
||||
* component is equal to height of cfc-expanding-row-summary component within
|
||||
* the row.
|
||||
*/
|
||||
private getSelectedRowCollapsedHeight(): number {
|
||||
if (this.expandedRow) {
|
||||
return this.expandedRow.collapsedHeight;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current height of the expanded row. We need this value for the
|
||||
* scroll adjustment computation.
|
||||
*/
|
||||
private getSelectedRowExpandedHeight(): number {
|
||||
if (this.expandedRow) {
|
||||
return this.expandedRow.getHeight();
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTML element described by scrollElementSelector @Input value.
|
||||
* We need this value for scroll adjustments.
|
||||
*/
|
||||
private getScrollElement(): HTMLElement|undefined {
|
||||
if (!this.scrollElementSelector) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return document.querySelector(this.scrollElementSelector) as HTMLElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles escape presses on the host element. Escape removes previous focus
|
||||
* if there is one. If there is an expanded row, escape row collapses this
|
||||
* row and focuses on it. A subsequent escape press will blur this row.
|
||||
*/
|
||||
private handleEscapePress(): void {
|
||||
this.removePreviousFocus();
|
||||
|
||||
if (this.expandedRow) {
|
||||
this.expandedRow.collapse();
|
||||
this.expandedRow.focus();
|
||||
this.expandedRow = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles enter keypress. If there is a focused row, an enter key press on
|
||||
* host element will expand this row.
|
||||
*/
|
||||
private handleEnterPress(): void {
|
||||
if (document.activeElement !== this.focusedRowSummary()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.focusedRow) {
|
||||
this.focusedRow.expand();
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns the HTMLElement that is the currently focused row summary. */
|
||||
private focusedRowSummary(): HTMLElement|undefined {
|
||||
return this.focusedRow ? this.focusedRow.summaryViewChild.mainElementRef.nativeElement :
|
||||
undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the index of a given row. This enables us to figure out the row
|
||||
* above/below the focused row.
|
||||
*/
|
||||
private getRowIndex(rowToLookFor: ExpandingRow): number {
|
||||
return rowToLookFor ? rowToLookFor.index : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles up/down arrow presses on the host element. Up arrow press will
|
||||
* focus/expand on the row above. Down arrow press will focus/expand the row
|
||||
* below. If we have a focus on the current row, this function will focus on
|
||||
* the computed (the one above or below) row. If host has an expanded row,
|
||||
* this function will expand the computed row.
|
||||
*/
|
||||
private handleUpOrDownPressOnce(upOrDown: UpOrDown, event: KeyboardEvent): void {
|
||||
event.preventDefault();
|
||||
|
||||
// If row is expanded but focus is inside the expanded element, arrow
|
||||
// key presses should not do anything.
|
||||
if (this.expandedRow &&
|
||||
document.activeElement !== this.expandedRow.expandingRowMainElement.nativeElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If focus is inside a collapsed row header, arrow key presses should not
|
||||
// do anything.
|
||||
if (this.focusedRow && document.activeElement !== this.focusedRowSummary()) {
|
||||
return;
|
||||
}
|
||||
// We only want screen reader to read the message the first time we enter
|
||||
// the list of expanding rows, so we must reset the variable here
|
||||
this.lastFocusedRow = undefined;
|
||||
|
||||
const rowToLookFor: ExpandingRow|undefined = this.expandedRow || this.focusedRow;
|
||||
if (!rowToLookFor) {
|
||||
return;
|
||||
}
|
||||
|
||||
const isFocus: boolean = (rowToLookFor === this.focusedRow);
|
||||
|
||||
const rowIndex: number = this.getRowIndex(rowToLookFor);
|
||||
const contentRowsArray: ExpandingRow[] = this.contentRows.toArray();
|
||||
|
||||
if (rowIndex < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const potentialIndex: number = (upOrDown === 'up' ? -1 : +1) + rowIndex;
|
||||
if (potentialIndex < 0) {
|
||||
this.onPrepend.emit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (potentialIndex >= contentRowsArray.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const potentialRow: ExpandingRow = contentRowsArray[potentialIndex];
|
||||
if (isFocus) {
|
||||
potentialRow.focus();
|
||||
} else {
|
||||
potentialRow.expand();
|
||||
}
|
||||
}
|
||||
|
||||
// Updates all of the rows with their new index.
|
||||
private recalcRowIndexes() {
|
||||
let index = 0;
|
||||
setTimeout(
|
||||
() => { this.contentRows.forEach((row: ExpandingRow) => { row.index = index++; }); });
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {NgModule} from '@angular/core';
|
||||
|
||||
import {ExpandingRow} from './expanding_row';
|
||||
import {ExpandingRowBlacklist} from './expanding_row_blacklist';
|
||||
import {ExpandingRowDetailsCaption} from './expanding_row_details_caption';
|
||||
import {ExpandingRowDetailsContent} from './expanding_row_details_content';
|
||||
import {ExpandingRowHost} from './expanding_row_host';
|
||||
import {ExpandingRowSummary} from './expanding_row_summary';
|
||||
|
||||
/** The main module for the cfc-expanding-row component. */
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ExpandingRow,
|
||||
ExpandingRowDetailsCaption,
|
||||
ExpandingRowDetailsContent,
|
||||
ExpandingRowHost,
|
||||
ExpandingRowSummary,
|
||||
ExpandingRowBlacklist,
|
||||
],
|
||||
exports: [
|
||||
ExpandingRow,
|
||||
ExpandingRowDetailsCaption,
|
||||
ExpandingRowDetailsContent,
|
||||
ExpandingRowHost,
|
||||
ExpandingRowSummary,
|
||||
ExpandingRowBlacklist,
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
],
|
||||
})
|
||||
export class ExpandingRowModule {
|
||||
}
|
@ -1,207 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Host, HostListener, OnDestroy, ViewChild} from '@angular/core';
|
||||
import {Subscription} from 'rxjs';
|
||||
|
||||
import {ExpandingRow} from './expanding_row';
|
||||
import {expanding_row_css} from './expanding_row_css';
|
||||
|
||||
const KEY_CODE_TAB = 9;
|
||||
|
||||
/**
|
||||
* This component should be used within cfc-expanding-row component. Note that
|
||||
* summary is visible only when the row is collapsed.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'cfc-expanding-row-summary',
|
||||
styles: [expanding_row_css],
|
||||
template: `
|
||||
<div *ngIf="!expandingRow.isExpanded"
|
||||
#expandingRowSummaryMainElement
|
||||
class="cfc-expanding-row-summary"
|
||||
tabindex="-1"
|
||||
(click)="expandingRow.handleSummaryClick()"
|
||||
(focus)="handleFocus()">
|
||||
<ng-content></ng-content>
|
||||
<div class="cfc-expanding-row-accessibility-text">.</div>
|
||||
<div class="cfc-expanding-row-accessibility-text"
|
||||
i18n="This is the label used to indicate that the user is in a list of expanding rows.">
|
||||
Row {{expandingRow.index + 1}} in list of expanding rows.
|
||||
</div>
|
||||
<div *ngIf="isPreviouslyFocusedRow()"
|
||||
class="cfc-expanding-row-accessibility-text"
|
||||
i18n="This is the label used for the first row in list of expanding rows.">
|
||||
Use arrow keys to navigate.
|
||||
</div>
|
||||
</div>`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ExpandingRowSummary implements OnDestroy {
|
||||
/**
|
||||
* A reference to the main element. This element should be focusable. We need
|
||||
* reference to compute collapsed height of the row. We also use this
|
||||
* reference for focus and blur methods below.
|
||||
*/
|
||||
@ViewChild('expandingRowSummaryMainElement', {static: false})
|
||||
mainElementRef !: ElementRef;
|
||||
|
||||
/** Subscription for changes in parent isExpanded property. */
|
||||
private isExpandedSubscription: Subscription;
|
||||
|
||||
/** Subscription for changes in parent index property. */
|
||||
private indexSubscription: Subscription;
|
||||
|
||||
/**
|
||||
* We need the parent cfc-expanding-row component here to hide this element
|
||||
* when the row is expanded. cfc-expanding-row-details-caption element
|
||||
* will act as a header for expanded rows. We also need to relay tab-in and
|
||||
* click events to the parent.
|
||||
*/
|
||||
constructor(@Host() public expandingRow: ExpandingRow, changeDetectorRef: ChangeDetectorRef) {
|
||||
this.expandingRow.summaryViewChild = this;
|
||||
this.isExpandedSubscription =
|
||||
this.expandingRow.isExpandedChange.subscribe(() => { changeDetectorRef.markForCheck(); });
|
||||
|
||||
this.indexSubscription =
|
||||
this.expandingRow.indexChange.subscribe(() => { changeDetectorRef.markForCheck(); });
|
||||
}
|
||||
|
||||
|
||||
/** When component is destroyed, unlisten to isExpanded. */
|
||||
ngOnDestroy(): void {
|
||||
if (this.isExpandedSubscription) {
|
||||
this.isExpandedSubscription.unsubscribe();
|
||||
}
|
||||
if (this.indexSubscription) {
|
||||
this.indexSubscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles focus event on the element. We basically want to detect any focus
|
||||
* in this component and relay this information to parent cfc-expanding-row
|
||||
* component.
|
||||
*/
|
||||
handleFocus(): void {
|
||||
// Clicking causes a focus event to occur before the click event. Filter
|
||||
// out click events using the cdkFocusMonitor.
|
||||
//
|
||||
// TODO(b/62385992) Use the KeyboardFocusService to detect focus cause
|
||||
// instead of creating multiple monitors on a page.
|
||||
if (this.expandingRow.expandingRowMainElement.nativeElement.classList.contains(
|
||||
'cdk-mouse-focused')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.expandingRow.isFocused && !this.expandingRow.isExpanded) {
|
||||
this.expandingRow.handleSummaryFocus();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles tab & shift+tab presses on expanding row summaries in case there
|
||||
* are tabbable elements inside the summaries.
|
||||
*/
|
||||
@HostListener('keydown', ['$event'])
|
||||
handleKeyDown(event: KeyboardEvent) {
|
||||
const charCode = event.which || event.keyCode;
|
||||
if (charCode === KEY_CODE_TAB) {
|
||||
this.handleTabKeypress(event);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles tab and shift+tab presses inside expanding row summaries;
|
||||
*
|
||||
* From inside collapsed row summary:
|
||||
* - Tab: If focus was on the last focusable child, should shift focus to
|
||||
* the next focusable element outside the list of expanding rows.
|
||||
* - Shift+tab: If focus was on first focusable child, should shift focus to
|
||||
* the main collapsed row summary element
|
||||
* If focus was on main collapsed row summary element, should
|
||||
* shift focus to the last focusable element before the list of
|
||||
* expanding rows.
|
||||
*/
|
||||
handleTabKeypress(event: KeyboardEvent): void {
|
||||
const focusableChildren = this.getFocusableChildren();
|
||||
|
||||
if (focusableChildren.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Shift+tab on expanding row summary should focus on last focusable element
|
||||
// before expanding row list. Otherwise, if shift+tab is pressed on first
|
||||
// focusable child inside expanding row summary, it should focus on main
|
||||
// expanding row summary element.
|
||||
if (event.shiftKey && document.activeElement === this.mainElementRef.nativeElement) {
|
||||
event.preventDefault();
|
||||
this.expandingRow.expandingRowHost.focusOnPreviousFocusableElement();
|
||||
return;
|
||||
} else if (event.shiftKey && document.activeElement === focusableChildren[0]) {
|
||||
event.preventDefault();
|
||||
this.expandingRow.focus();
|
||||
}
|
||||
|
||||
// If tab is pressed on the last focusable element inside an expanding row
|
||||
// summary, focus should be set to the next focusable element after the list
|
||||
// of expanding rows.
|
||||
if (!event.shiftKey &&
|
||||
document.activeElement === focusableChildren[focusableChildren.length - 1]) {
|
||||
event.preventDefault();
|
||||
this.expandingRow.expandingRowHost.focusOnNextFocusableElement();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the row that had focus before focus left the list of expanding rows
|
||||
* and checks if the current row summary is that row.
|
||||
*/
|
||||
isPreviouslyFocusedRow(): boolean {
|
||||
if (!this.expandingRow.expandingRowHost.contentRows) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const expandingRowHost = this.expandingRow.expandingRowHost;
|
||||
|
||||
if (!this.mainElementRef || !expandingRowHost.lastFocusedRow) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!expandingRowHost.lastFocusedRow.summaryViewChild.mainElementRef) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the current expanding row summary was the last focused one before
|
||||
// focus exited the list, then return true to trigger the screen reader
|
||||
if (this.mainElementRef.nativeElement ===
|
||||
expandingRowHost.lastFocusedRow.summaryViewChild.mainElementRef.nativeElement) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Puts the DOM focus on the main element. */
|
||||
focus(): void {
|
||||
if (this.mainElementRef && document.activeElement !== this.mainElementRef.nativeElement) {
|
||||
this.mainElementRef.nativeElement.focus();
|
||||
}
|
||||
}
|
||||
|
||||
/** Removes the DOM focus on the main element. */
|
||||
blur(): void {
|
||||
if (!this.mainElementRef) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.mainElementRef.nativeElement.blur();
|
||||
}
|
||||
|
||||
/** Returns array of focusable elements within this component. */
|
||||
private getFocusableChildren(): HTMLElement[] { return []; }
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* This interface is used to send toggle (expand/collapse) events to the user
|
||||
* code.
|
||||
*/
|
||||
export interface ExpandingRowToggleEvent {
|
||||
/** The identifier of the row that was toggled. */
|
||||
rowId: string;
|
||||
|
||||
/**
|
||||
* A boolean indicating whether or not this row was expanded. This is set to
|
||||
* false if the row was collapsed.
|
||||
*/
|
||||
isExpand: boolean;
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<!-- Prevent the browser from requesting any favicon. -->
|
||||
<link rel="icon" href="data:,">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Change Detection Benchmark</h1>
|
||||
<div id="rendererMode">...</div>
|
||||
|
||||
<benchmark-root>loading...</benchmark-root>
|
||||
|
||||
<script>
|
||||
addEventListener('DOMContentLoaded', () => {
|
||||
// DevServer has automatic bootstrap code, so if we already have <scripts> than we don't need to bootstrap
|
||||
var alreadyBootstraped = document.querySelectorAll('script').length > 1; // 1 for ourselves
|
||||
if (!alreadyBootstraped) {
|
||||
function loadScript(url) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
var script = document.createElement('script');
|
||||
script.src = url;
|
||||
script.onload = resolve;
|
||||
script.onerror = reject;
|
||||
document.body.append(script);
|
||||
});
|
||||
}
|
||||
// zone.js must be loaded and processed before Angular bundle gets executed
|
||||
loadScript('/npm/node_modules/zone.js/dist/zone.js').then(function () {
|
||||
loadScript(document.location.search.endsWith('debug') ? 'bundle.min_debug.js' : 'bundle.min.js');
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,20 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {enableProdMode} from '@angular/core';
|
||||
import {platformBrowser} from '@angular/platform-browser';
|
||||
|
||||
import {ExpandingRowBenchmarkModule} from './benchmark';
|
||||
import {ExpandingRowBenchmarkModuleNgFactory} from './benchmark.ngfactory';
|
||||
|
||||
setMode(ExpandingRowBenchmarkModule.hasOwnProperty('ngModuleDef') ? 'Ivy' : 'ViewEngine');
|
||||
enableProdMode();
|
||||
platformBrowser().bootstrapModuleFactory(ExpandingRowBenchmarkModuleNgFactory);
|
||||
|
||||
function setMode(name: string): void {
|
||||
document.querySelector('#rendererMode') !.textContent = `Render Mode: ${name}`;
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ɵRenderFlags, ɵrenderComponent as renderComponent, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵdefineComponent, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵselect, ɵɵstyleProp, ɵɵstyling, ɵɵtext, ɵɵtextInterpolate1} from '@angular/core';
|
||||
import {ɵRenderFlags, ɵrenderComponent as renderComponent, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵdefineComponent, ɵɵelementEnd, ɵɵelementStart, ɵɵelementStyleProp, ɵɵelementStyling, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵinterpolation1, ɵɵtext, ɵɵtextBinding} from '@angular/core';
|
||||
|
||||
import {bindAction, profile} from '../../util';
|
||||
import {createDom, destroyDom, detectChanges} from '../render3/tree';
|
||||
@ -38,7 +38,7 @@ export function TreeTpl(rf: ɵRenderFlags, ctx: TreeNode) {
|
||||
ɵɵelementStart(0, 'tree');
|
||||
{
|
||||
ɵɵelementStart(1, 'span');
|
||||
ɵɵstyling(null, c1);
|
||||
ɵɵelementStyling(null, c1);
|
||||
{ ɵɵtext(2); }
|
||||
ɵɵelementEnd();
|
||||
ɵɵcontainer(3);
|
||||
@ -47,11 +47,8 @@ export function TreeTpl(rf: ɵRenderFlags, ctx: TreeNode) {
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & ɵRenderFlags.Update) {
|
||||
ɵɵselect(1);
|
||||
ɵɵstyleProp(0, ctx.depth % 2 ? '' : 'grey');
|
||||
ɵɵstyling();
|
||||
ɵɵselect(2);
|
||||
ɵɵtextInterpolate1(' ', ctx.value, ' ');
|
||||
ɵɵelementStyleProp(1, 0, ctx.depth % 2 ? '' : 'grey');
|
||||
ɵɵtextBinding(2, ɵɵinterpolation1(' ', ctx.value, ' '));
|
||||
ɵɵcontainerRefreshStart(3);
|
||||
{
|
||||
if (ctx.left != null) {
|
||||
|
12
package.json
12
package.json
@ -1,7 +1,8 @@
|
||||
{
|
||||
"name": "angular-srcs",
|
||||
"version": "8.1.0-next.3",
|
||||
"version": "8.0.2",
|
||||
"private": true,
|
||||
"branchPattern": "2.0.*",
|
||||
"description": "Angular - a web framework for modern web apps",
|
||||
"homepage": "https://github.com/angular/angular",
|
||||
"bugs": "https://github.com/angular/angular/issues",
|
||||
@ -42,7 +43,6 @@
|
||||
"@schematics/angular": "^8.0.0-beta.15",
|
||||
"@types/angular": "^1.6.47",
|
||||
"@types/base64-js": "1.2.5",
|
||||
"@types/bluebird": "^3.5.27",
|
||||
"@types/chai": "^4.1.2",
|
||||
"@types/chokidar": "^1.7.5",
|
||||
"@types/convert-source-map": "^1.5.1",
|
||||
@ -58,7 +58,6 @@
|
||||
"@types/selenium-webdriver": "3.0.7",
|
||||
"@types/shelljs": "^0.7.8",
|
||||
"@types/source-map": "^0.5.1",
|
||||
"@types/systemjs": "0.19.32",
|
||||
"@types/yargs": "^11.1.1",
|
||||
"@webcomponents/custom-elements": "^1.0.4",
|
||||
"angular": "npm:angular@1.7",
|
||||
@ -68,14 +67,12 @@
|
||||
"angular-mocks-1.5": "npm:angular-mocks@1.5",
|
||||
"angular-mocks-1.6": "npm:angular-mocks@1.6",
|
||||
"base64-js": "1.2.1",
|
||||
"bluebird": "^3.5.5",
|
||||
"brotli": "^1.3.2",
|
||||
"canonical-path": "1.0.0",
|
||||
"chai": "^4.1.2",
|
||||
"chalk": "^2.3.1",
|
||||
"chokidar": "^2.1.1",
|
||||
"convert-source-map": "^1.5.1",
|
||||
"core-js": "^2.4.1",
|
||||
"dependency-graph": "^0.7.2",
|
||||
"diff": "^3.5.0",
|
||||
"domino": "2.1.2",
|
||||
@ -92,7 +89,6 @@
|
||||
"minimist": "1.2.0",
|
||||
"mock-fs": "^4.10.1",
|
||||
"node-uuid": "1.4.8",
|
||||
"nodejs-websocket": "^1.7.2",
|
||||
"protractor": "^5.4.2",
|
||||
"reflect-metadata": "^0.1.3",
|
||||
"rollup": "^1.1.0",
|
||||
@ -126,6 +122,7 @@
|
||||
"@bazel/buildifier": "^0.25.1",
|
||||
"@bazel/ibazel": "~0.9.0",
|
||||
"@types/minimist": "^1.2.0",
|
||||
"@types/systemjs": "0.19.32",
|
||||
"browserstacktunnel-wrapper": "2.0.1",
|
||||
"check-side-effects": "0.0.21",
|
||||
"clang-format": "1.0.41",
|
||||
@ -133,13 +130,14 @@
|
||||
"cldr-data-downloader": "0.3.2",
|
||||
"cldrjs": "0.5.0",
|
||||
"conventional-changelog": "^2.0.3",
|
||||
"core-js": "^2.4.1",
|
||||
"cors": "2.8.4",
|
||||
"entities": "1.1.1",
|
||||
"firebase-tools": "5.1.1",
|
||||
"firefox-profile": "1.0.3",
|
||||
"glob": "7.1.2",
|
||||
"gulp": "3.9.1",
|
||||
"gulp-clang-format": "1.0.27",
|
||||
"gulp-clang-format": "1.0.23",
|
||||
"gulp-connect": "5.0.0",
|
||||
"gulp-conventional-changelog": "^2.0.3",
|
||||
"gulp-filter": "^5.1.0",
|
||||
|
29
packages/animations/browser/testing/tsconfig-build.json
Normal file
29
packages/animations/browser/testing/tsconfig-build.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"extends": "../tsconfig-build.json",
|
||||
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"rootDir": "../../",
|
||||
"paths": {
|
||||
"@angular/animations": ["../../../../dist/packages/animations"],
|
||||
"@angular/animations/browser": ["../../../../dist/packages/animations/browser"],
|
||||
"@angular/core": ["../../../../dist/packages/core"]
|
||||
},
|
||||
"outDir": "../../../../dist/packages/animations"
|
||||
},
|
||||
|
||||
"files": [
|
||||
"public_api.ts",
|
||||
"../../../../node_modules/@types/hammerjs/index.d.ts",
|
||||
"../../../../node_modules/@types/jasmine/index.d.ts",
|
||||
"../../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
],
|
||||
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"strictMetadataEmit": false,
|
||||
"skipTemplateCodegen": true,
|
||||
"flatModuleOutFile": "testing.js",
|
||||
"flatModuleId": "@angular/animations/browser/testing"
|
||||
}
|
||||
}
|
28
packages/animations/browser/tsconfig-build.json
Normal file
28
packages/animations/browser/tsconfig-build.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"extends": "../tsconfig-build.json",
|
||||
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"rootDir": "../",
|
||||
"paths": {
|
||||
"@angular/animations": ["../../../dist/packages/animations"],
|
||||
"@angular/core": ["../../../dist/packages/core"]
|
||||
},
|
||||
"outDir": "../../../dist/packages/animations"
|
||||
},
|
||||
|
||||
"files": [
|
||||
"public_api.ts",
|
||||
"../../../node_modules/@types/node/index.d.ts",
|
||||
"../../../node_modules/zone.js/dist/zone.js.d.ts",
|
||||
"../../system.d.ts"
|
||||
],
|
||||
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"strictMetadataEmit": false,
|
||||
"skipTemplateCodegen": true,
|
||||
"flatModuleOutFile": "browser.js",
|
||||
"flatModuleId": "@angular/animations/browser"
|
||||
}
|
||||
}
|
26
packages/animations/tsconfig-build.json
Normal file
26
packages/animations/tsconfig-build.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"extends": "../tsconfig-build.json",
|
||||
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"rootDir": ".",
|
||||
"paths": {
|
||||
"@angular/core": ["../../dist/packages/core"]
|
||||
},
|
||||
"outDir": "../../dist/packages/animations"
|
||||
},
|
||||
|
||||
"files": [
|
||||
"public_api.ts",
|
||||
"../../node_modules/zone.js/dist/zone.js.d.ts",
|
||||
"../system.d.ts"
|
||||
],
|
||||
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"strictMetadataEmit": false,
|
||||
"skipTemplateCodegen": true,
|
||||
"flatModuleOutFile": "animations.js",
|
||||
"flatModuleId": "@angular/animations"
|
||||
}
|
||||
}
|
@ -21,8 +21,6 @@
|
||||
"node_modules/@angular/compiler-cli/**",
|
||||
"node_modules/@angular/**/testing/**",
|
||||
"node_modules/@angular/common/upgrade*",
|
||||
"node_modules/@angular/router/upgrade*",
|
||||
"node_modules/@angular/cdk/schematics*",
|
||||
"node_modules/@angular/material/schematics*"
|
||||
"node_modules/@angular/router/upgrade*"
|
||||
]
|
||||
}
|
||||
|
@ -61,38 +61,22 @@ describe('ng-add schematic', () => {
|
||||
new SchematicTestRunner('@angular/bazel', require.resolve('../collection.json'));
|
||||
});
|
||||
|
||||
it('throws if package.json is not found', async() => {
|
||||
it('throws if package.json is not found', () => {
|
||||
expect(host.files).toContain('/package.json');
|
||||
host.delete('/package.json');
|
||||
|
||||
let message = 'No error';
|
||||
|
||||
try {
|
||||
await schematicRunner.runSchematicAsync('ng-add', defaultOptions).toPromise();
|
||||
} catch (e) {
|
||||
message = e.message;
|
||||
}
|
||||
|
||||
expect(message).toBe('Could not find package.json');
|
||||
expect(() => schematicRunner.runSchematic('ng-add', defaultOptions))
|
||||
.toThrowError('Could not find package.json');
|
||||
});
|
||||
|
||||
it('throws if angular.json is not found', async() => {
|
||||
it('throws if angular.json is not found', () => {
|
||||
expect(host.files).toContain('/angular.json');
|
||||
host.delete('/angular.json');
|
||||
|
||||
let message = 'No error';
|
||||
|
||||
try {
|
||||
await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
} catch (e) {
|
||||
message = e.message;
|
||||
}
|
||||
|
||||
expect(message).toBe('Could not find angular.json');
|
||||
expect(() => schematicRunner.runSchematic('ng-add', defaultOptions, host))
|
||||
.toThrowError('Could not find angular.json');
|
||||
});
|
||||
|
||||
it('should add @angular/bazel to package.json dependencies', async() => {
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
it('should add @angular/bazel to package.json dependencies', () => {
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
const {files} = host;
|
||||
expect(files).toContain('/package.json');
|
||||
const content = host.readContent('/package.json');
|
||||
@ -107,8 +91,8 @@ describe('ng-add schematic', () => {
|
||||
expect(json.dependencies[core]).toBe(json.devDependencies[bazel]);
|
||||
});
|
||||
|
||||
it('should add @bazel/* dev dependencies', async() => {
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
it('should add @bazel/* dev dependencies', () => {
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
const content = host.readContent('/package.json');
|
||||
const json = JSON.parse(content);
|
||||
const devDeps = Object.keys(json.devDependencies);
|
||||
@ -117,12 +101,12 @@ describe('ng-add schematic', () => {
|
||||
expect(devDeps).toContain('@bazel/karma');
|
||||
});
|
||||
|
||||
it('should replace an existing dev dependency', async() => {
|
||||
it('should replace an existing dev dependency', () => {
|
||||
expect(host.files).toContain('/package.json');
|
||||
const packageJson = JSON.parse(host.readContent('/package.json'));
|
||||
packageJson.devDependencies['@angular/bazel'] = '4.2.42';
|
||||
host.overwrite('/package.json', JSON.stringify(packageJson));
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
const content = host.readContent('/package.json');
|
||||
// It is possible that a dep gets added twice if the package already exists.
|
||||
expect(content.match(/@angular\/bazel/g) !.length).toEqual(1);
|
||||
@ -130,29 +114,29 @@ describe('ng-add schematic', () => {
|
||||
expect(json.devDependencies['@angular/bazel']).toBe('1.2.3');
|
||||
});
|
||||
|
||||
it('should remove an existing dependency', async() => {
|
||||
it('should remove an existing dependency', () => {
|
||||
expect(host.files).toContain('/package.json');
|
||||
const packageJson = JSON.parse(host.readContent('/package.json'));
|
||||
packageJson.dependencies['@angular/bazel'] = '4.2.42';
|
||||
expect(Object.keys(packageJson.dependencies)).toContain('@angular/bazel');
|
||||
host.overwrite('/package.json', JSON.stringify(packageJson));
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
const content = host.readContent('/package.json');
|
||||
const json = JSON.parse(content);
|
||||
expect(Object.keys(json.dependencies)).not.toContain('@angular/bazel');
|
||||
expect(json.devDependencies['@angular/bazel']).toBe('1.2.3');
|
||||
});
|
||||
|
||||
it('should not create Bazel workspace file', async() => {
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
it('should not create Bazel workspace file', () => {
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
const {files} = host;
|
||||
expect(files).not.toContain('/WORKSPACE');
|
||||
expect(files).not.toContain('/BUILD.bazel');
|
||||
});
|
||||
|
||||
it('should produce main.dev.ts and main.prod.ts for AOT', async() => {
|
||||
it('should produce main.dev.ts and main.prod.ts for AOT', () => {
|
||||
host.create('/src/main.ts', 'generated by CLI');
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
const {files} = host;
|
||||
// main.dev.ts and main.prod.ts are used by Bazel for AOT
|
||||
expect(files).toContain('/src/main.dev.ts');
|
||||
@ -162,9 +146,9 @@ describe('ng-add schematic', () => {
|
||||
expect(files).toContain('/src/main.ts');
|
||||
});
|
||||
|
||||
it('should not overwrite index.html with script tags', async() => {
|
||||
it('should not overwrite index.html with script tags', () => {
|
||||
host.create('/src/index.html', '<html>Hello World</html>');
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
const {files} = host;
|
||||
expect(files).toContain('/src/index.html');
|
||||
const content = host.readContent('/src/index.html');
|
||||
@ -172,34 +156,34 @@ describe('ng-add schematic', () => {
|
||||
expect(content).not.toMatch('<script src="/bundle.min.js"></script>');
|
||||
});
|
||||
|
||||
it('should generate main.dev.ts and main.prod.ts', async() => {
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
it('should generate main.dev.ts and main.prod.ts', () => {
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
const {files} = host;
|
||||
expect(files).toContain('/src/main.dev.ts');
|
||||
expect(files).toContain('/src/main.prod.ts');
|
||||
});
|
||||
|
||||
it('should overwrite .gitignore for bazel-out directory', async() => {
|
||||
it('should overwrite .gitignore for bazel-out directory', () => {
|
||||
host.create('.gitignore', '\n# compiled output\n');
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
const {files} = host;
|
||||
expect(files).toContain('/.gitignore');
|
||||
const content = host.readContent('/.gitignore');
|
||||
expect(content).toMatch('\n# compiled output\n/bazel-out\n');
|
||||
});
|
||||
|
||||
it('should create a backup for original angular.json', async() => {
|
||||
it('should create a backup for original angular.json', () => {
|
||||
expect(host.files).toContain('/angular.json');
|
||||
const original = host.readContent('/angular.json');
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
expect(host.files).toContain('/angular.json.bak');
|
||||
const content = host.readContent('/angular.json.bak');
|
||||
expect(content.startsWith('// This is a backup file')).toBe(true);
|
||||
expect(content).toMatch(original);
|
||||
});
|
||||
|
||||
it('should update angular.json to use Bazel builder', async() => {
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
it('should update angular.json to use Bazel builder', () => {
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
const {files} = host;
|
||||
expect(files).toContain('/angular.json');
|
||||
const content = host.readContent('/angular.json');
|
||||
@ -219,9 +203,9 @@ describe('ng-add schematic', () => {
|
||||
expect(lint.builder).toBe('@angular-devkit/build-angular:tslint');
|
||||
});
|
||||
|
||||
it('should get defaultProject if name is not provided', async() => {
|
||||
it('should get defaultProject if name is not provided', () => {
|
||||
const options = {};
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', options, host).toPromise();
|
||||
host = schematicRunner.runSchematic('ng-add', options, host);
|
||||
const content = host.readContent('/angular.json');
|
||||
const json = JSON.parse(content);
|
||||
const builder = json.projects.demo.architect.build.builder;
|
||||
@ -244,7 +228,7 @@ describe('ng-add schematic', () => {
|
||||
['~7.0.1', false],
|
||||
];
|
||||
for (const [version, upgrade] of cases) {
|
||||
it(`should ${upgrade ? '' : 'not '}upgrade v${version}')`, async() => {
|
||||
it(`should ${upgrade ? '' : 'not '}upgrade v${version}')`, () => {
|
||||
host.overwrite('package.json', JSON.stringify({
|
||||
name: 'demo',
|
||||
dependencies: {
|
||||
@ -255,7 +239,7 @@ describe('ng-add schematic', () => {
|
||||
'typescript': '3.2.2',
|
||||
},
|
||||
}));
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
expect(host.files).toContain('/package.json');
|
||||
const content = host.readContent('/package.json');
|
||||
const json = JSON.parse(content);
|
||||
@ -268,15 +252,15 @@ describe('ng-add schematic', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('should add a postinstall step to package.json', async() => {
|
||||
host = await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
it('should add a postinstall step to package.json', () => {
|
||||
host = schematicRunner.runSchematic('ng-add', defaultOptions, host);
|
||||
expect(host.files).toContain('/package.json');
|
||||
const content = host.readContent('/package.json');
|
||||
const json = JSON.parse(content);
|
||||
expect(json.scripts.postinstall).toBe('ngc -p ./angular-metadata.tsconfig.json');
|
||||
});
|
||||
|
||||
it('should work when run on a minimal project (without test and e2e targets)', async() => {
|
||||
it('should work when run on a minimal project (without test and e2e targets)', () => {
|
||||
host.overwrite('angular.json', JSON.stringify({
|
||||
projects: {
|
||||
'demo': {
|
||||
@ -291,15 +275,7 @@ describe('ng-add schematic', () => {
|
||||
},
|
||||
}));
|
||||
|
||||
let error: Error|null = null;
|
||||
|
||||
try {
|
||||
await schematicRunner.runSchematicAsync('ng-add', defaultOptions, host).toPromise();
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error).toBeNull();
|
||||
expect(() => schematicRunner.runSchematic('ng-add', defaultOptions, host)).not.toThrowError();
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -16,18 +16,18 @@ describe('ng-new schematic', () => {
|
||||
version: '7.0.0',
|
||||
};
|
||||
|
||||
it('should call external @schematics/angular', async() => {
|
||||
it('should call external @schematics/angular', () => {
|
||||
const options = {...defaultOptions};
|
||||
const host = await schematicRunner.runSchematicAsync('ng-new', options).toPromise();
|
||||
const host = schematicRunner.runSchematic('ng-new', options);
|
||||
const {files} = host;
|
||||
// External schematic should produce workspace file angular.json
|
||||
expect(files).toContain('/demo/angular.json');
|
||||
expect(files).toContain('/demo/package.json');
|
||||
});
|
||||
|
||||
it('should call ng-add to generate additional files needed by Bazel', async() => {
|
||||
it('should call ng-add to generate additional files needed by Bazel', () => {
|
||||
const options = {...defaultOptions};
|
||||
const host = await schematicRunner.runSchematicAsync('ng-new', options).toPromise();
|
||||
const host = schematicRunner.runSchematic('ng-new', options);
|
||||
const {files} = host;
|
||||
expect(files).toContain('/demo/src/main.dev.ts');
|
||||
expect(files).toContain('/demo/src/main.prod.ts');
|
||||
|
21
packages/benchpress/tsconfig-build.json
Normal file
21
packages/benchpress/tsconfig-build.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"extends": "../tsconfig-build.json",
|
||||
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"baseUrl": ".",
|
||||
"rootDir": ".",
|
||||
"sourceRoot": ".",
|
||||
"paths": {
|
||||
"@angular/core": ["../../dist/packages/core"]
|
||||
},
|
||||
"outDir": "../../dist/packages/benchpress"
|
||||
},
|
||||
|
||||
"files": [
|
||||
"index.ts",
|
||||
"../../node_modules/@types/node/index.d.ts",
|
||||
"../../node_modules/@types/jasmine/index.d.ts",
|
||||
"../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
]
|
||||
}
|
27
packages/common/http/testing/tsconfig-build.json
Normal file
27
packages/common/http/testing/tsconfig-build.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"extends": "../tsconfig-build.json",
|
||||
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"rootDir": "../../",
|
||||
"paths": {
|
||||
"@angular/core": ["../../../../dist/packages/core"],
|
||||
"@angular/common": ["../../../../dist/packages/common"],
|
||||
"@angular/common/http": ["../../../../dist/packages/common/http"],
|
||||
"@angular/platform-browser": ["../../../../dist/packages/platform-browser"]
|
||||
},
|
||||
"outDir": "../../../../dist/packages/common"
|
||||
},
|
||||
|
||||
"files": [
|
||||
"public_api.ts"
|
||||
],
|
||||
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"strictMetadataEmit": false,
|
||||
"skipTemplateCodegen": true,
|
||||
"flatModuleOutFile": "testing.js",
|
||||
"flatModuleId": "@angular/common/http/testing"
|
||||
}
|
||||
}
|
25
packages/common/http/tsconfig-build.json
Normal file
25
packages/common/http/tsconfig-build.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"extends": "../tsconfig-build.json",
|
||||
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"rootDir": "../",
|
||||
"paths": {
|
||||
"@angular/common": ["../../../dist/packages/common"],
|
||||
"@angular/core": ["../../../dist/packages/core"]
|
||||
},
|
||||
"outDir": "../../../dist/packages/common"
|
||||
},
|
||||
|
||||
"files": [
|
||||
"public_api.ts"
|
||||
],
|
||||
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"strictMetadataEmit": false,
|
||||
"skipTemplateCodegen": true,
|
||||
"flatModuleOutFile": "http.js",
|
||||
"flatModuleId": "@angular/common/http"
|
||||
}
|
||||
}
|
27
packages/common/locales/tsconfig-build.json
Normal file
27
packages/common/locales/tsconfig-build.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"declaration": true,
|
||||
"stripInternal": true,
|
||||
"experimentalDecorators": true,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "../../../dist/packages/common/locales",
|
||||
"paths": {
|
||||
"@angular/common": ["../../../dist/packages/common"],
|
||||
"@angular/core": ["../../../dist/packages/core"]
|
||||
},
|
||||
"sourceMap": true,
|
||||
"inlineSources": true,
|
||||
"target": "es5",
|
||||
"skipLibCheck": true,
|
||||
"lib": ["es2015", "dom"]
|
||||
},
|
||||
"exclude": [
|
||||
"./closure-locale.ts"
|
||||
],
|
||||
"angularCompilerOptions": {
|
||||
"skipTemplateCodegen": true,
|
||||
"skipMetadataEmit": true
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {Directive, DoCheck, Input, ɵRenderFlags, ɵɵclassMap, ɵɵdefineDirective, ɵɵstyling, ɵɵstylingApply} from '@angular/core';
|
||||
import {Directive, DoCheck, Input, ɵRenderFlags, ɵɵdefineDirective, ɵɵelementHostStyling, ɵɵelementHostStylingApply, ɵɵelementHostStylingMap} from '@angular/core';
|
||||
|
||||
import {NgClassImpl, NgClassImplProvider} from './ng_class_impl';
|
||||
|
||||
@ -35,11 +35,11 @@ export const ngClassDirectiveDef__POST_R3__ = ɵɵdefineDirective({
|
||||
factory: () => {},
|
||||
hostBindings: function(rf: ɵRenderFlags, ctx: any, elIndex: number) {
|
||||
if (rf & ɵRenderFlags.Create) {
|
||||
ɵɵstyling();
|
||||
ɵɵelementHostStyling();
|
||||
}
|
||||
if (rf & ɵRenderFlags.Update) {
|
||||
ɵɵclassMap(ctx.getValue());
|
||||
ɵɵstylingApply();
|
||||
ɵɵelementHostStylingMap(ctx.getValue());
|
||||
ɵɵelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -219,12 +219,12 @@ export class NgIf {
|
||||
/**
|
||||
* Assert the correct type of the expression bound to the `ngIf` input within the template.
|
||||
*
|
||||
* The presence of this static field is a signal to the Ivy template type check compiler that
|
||||
* when the `NgIf` structural directive renders its template, the type of the expression bound
|
||||
* to `ngIf` should be narrowed in some way. For `NgIf`, the binding expression itself is used to
|
||||
* narrow its type, which allows the strictNullChecks feature of TypeScript to work with `NgIf`.
|
||||
* The presence of this method is a signal to the Ivy template type check compiler that when the
|
||||
* `NgIf` structural directive renders its template, the type of the expression bound to `ngIf`
|
||||
* should be narrowed in some way. For `NgIf`, it is narrowed to be non-null, which allows the
|
||||
* strictNullChecks feature of TypeScript to work with `NgIf`.
|
||||
*/
|
||||
static ngTemplateGuard_ngIf: 'binding';
|
||||
static ngTemplateGuard_ngIf<E>(dir: NgIf, expr: E): expr is NonNullable<E> { return true; }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {Directive, DoCheck, Input, ɵRenderFlags, ɵɵdefineDirective, ɵɵstyleMap, ɵɵstyling, ɵɵstylingApply} from '@angular/core';
|
||||
import {Directive, DoCheck, Input, ɵRenderFlags, ɵɵdefineDirective, ɵɵelementHostStyling, ɵɵelementHostStylingApply, ɵɵelementHostStylingMap} from '@angular/core';
|
||||
|
||||
import {NgStyleImpl, NgStyleImplProvider} from './ng_style_impl';
|
||||
|
||||
@ -35,11 +35,11 @@ export const ngStyleDirectiveDef__POST_R3__ = ɵɵdefineDirective({
|
||||
factory: () => {},
|
||||
hostBindings: function(rf: ɵRenderFlags, ctx: any, elIndex: number) {
|
||||
if (rf & ɵRenderFlags.Create) {
|
||||
ɵɵstyling();
|
||||
ɵɵelementHostStyling();
|
||||
}
|
||||
if (rf & ɵRenderFlags.Update) {
|
||||
ɵɵstyleMap(ctx.getValue());
|
||||
ɵɵstylingApply();
|
||||
ɵɵelementHostStylingMap(null, ctx.getValue());
|
||||
ɵɵelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -6,7 +6,10 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ɵLOCALE_DATA as LOCALE_DATA, ɵLocaleDataIndex as LocaleDataIndex} from '@angular/core';
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export const LOCALE_DATA: {[localeId: string]: any} = {};
|
||||
|
||||
/**
|
||||
* Register global data to be used internally by Angular. See the
|
||||
@ -30,6 +33,32 @@ export function registerLocaleData(data: any, localeId?: string | any, extraData
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Index of each type of locale data from the locale data array
|
||||
*/
|
||||
export const enum LocaleDataIndex {
|
||||
LocaleId = 0,
|
||||
DayPeriodsFormat,
|
||||
DayPeriodsStandalone,
|
||||
DaysFormat,
|
||||
DaysStandalone,
|
||||
MonthsFormat,
|
||||
MonthsStandalone,
|
||||
Eras,
|
||||
FirstDayOfWeek,
|
||||
WeekendRange,
|
||||
DateFormat,
|
||||
TimeFormat,
|
||||
DateTimeFormat,
|
||||
NumberSymbols,
|
||||
NumberFormats,
|
||||
CurrencySymbol,
|
||||
CurrencyName,
|
||||
Currencies,
|
||||
PluralCase,
|
||||
ExtraData
|
||||
}
|
||||
|
||||
/**
|
||||
* Index of each type of locale data from the extra locale data array
|
||||
*/
|
||||
|
@ -6,9 +6,9 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ɵLocaleDataIndex as LocaleDataIndex, ɵfindLocaleData as findLocaleData, ɵgetLocalePluralCase} from '@angular/core';
|
||||
import localeEn from './locale_en';
|
||||
import {LOCALE_DATA, LocaleDataIndex, ExtraLocaleDataIndex, CurrencyIndex} from './locale_data';
|
||||
import {CURRENCIES_EN, CurrenciesSymbols} from './currencies';
|
||||
import {CurrencyIndex, ExtraLocaleDataIndex} from './locale_data';
|
||||
|
||||
/**
|
||||
* Format styles that can be used to represent numbers.
|
||||
@ -31,8 +31,7 @@ export enum NumberFormatStyle {
|
||||
* @see `NgPluralCase`
|
||||
* @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
* @publicApi */
|
||||
export enum Plural {
|
||||
Zero = 0,
|
||||
One = 1,
|
||||
@ -486,11 +485,19 @@ function getLocaleCurrencies(locale: string): {[code: string]: CurrenciesSymbols
|
||||
}
|
||||
|
||||
/**
|
||||
* @alias core/ɵgetLocalePluralCase
|
||||
* Retrieves the plural function used by ICU expressions to determine the plural case to use
|
||||
* for a given locale.
|
||||
* @param locale A locale code for the locale format rules to use.
|
||||
* @returns The plural function for the locale.
|
||||
* @see `NgPlural`
|
||||
* @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const getLocalePluralCase: (locale: string) => ((value: number) => Plural) =
|
||||
ɵgetLocalePluralCase;
|
||||
export function getLocalePluralCase(locale: string): (value: number) => Plural {
|
||||
const data = findLocaleData(locale);
|
||||
return data[LocaleDataIndex.PluralCase];
|
||||
}
|
||||
|
||||
function checkFullData(data: any) {
|
||||
if (!data[LocaleDataIndex.ExtraData]) {
|
||||
@ -602,7 +609,37 @@ function extractTime(time: string): Time {
|
||||
return {hours: +h, minutes: +m};
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the locale data for a given locale.
|
||||
*
|
||||
* @param locale The locale code.
|
||||
* @returns The locale data.
|
||||
* @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function findLocaleData(locale: string): any {
|
||||
const normalizedLocale = locale.toLowerCase().replace(/_/g, '-');
|
||||
|
||||
let match = LOCALE_DATA[normalizedLocale];
|
||||
if (match) {
|
||||
return match;
|
||||
}
|
||||
|
||||
// let's try to find a parent locale
|
||||
const parentLocale = normalizedLocale.split('-')[0];
|
||||
match = LOCALE_DATA[parentLocale];
|
||||
|
||||
if (match) {
|
||||
return match;
|
||||
}
|
||||
|
||||
if (parentLocale === 'en') {
|
||||
return localeEn;
|
||||
}
|
||||
|
||||
throw new Error(`Missing locale data for the locale "${locale}".`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the currency symbol for a given currency code.
|
||||
|
@ -25,7 +25,7 @@ export interface PopStateEvent {
|
||||
*
|
||||
* A service that applications can use to interact with a browser's URL.
|
||||
*
|
||||
* Depending on the `LocationStrategy` used, `Location` will either persist
|
||||
* Depending on the {@link LocationStrategy} used, `Location` will either persist
|
||||
* to the URL's path or the URL's hash segment.
|
||||
*
|
||||
* @usageNotes
|
||||
@ -43,8 +43,7 @@ export interface PopStateEvent {
|
||||
*
|
||||
* ### Example
|
||||
*
|
||||
* <code-example path='common/location/ts/path_location_component.ts'
|
||||
* region='LocationComponent'></code-example>
|
||||
* {@example common/location/ts/path_location_component.ts region='LocationComponent'}
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
|
@ -10,17 +10,18 @@ import {InjectionToken} from '@angular/core';
|
||||
import {LocationChangeListener} from './platform_location';
|
||||
|
||||
/**
|
||||
* Enables the `Location` service to read route state from the browser's URL.
|
||||
* Angular provides two strategies:
|
||||
* `HashLocationStrategy` and `PathLocationStrategy`.
|
||||
* `LocationStrategy` is responsible for representing and reading route state
|
||||
* from the browser's URL. Angular provides two strategies:
|
||||
* {@link HashLocationStrategy} and {@link PathLocationStrategy}.
|
||||
*
|
||||
* Applications should use the `Router` or `Location` services to
|
||||
* This is used under the hood of the {@link Location} service.
|
||||
*
|
||||
* Applications should use the {@link Router} or {@link Location} services to
|
||||
* interact with application route state.
|
||||
*
|
||||
* For instance, `HashLocationStrategy` produces URLs like
|
||||
* <code class="no-auto-link">http://example.com#/foo</code>,
|
||||
* and `PathLocationStrategy` produces
|
||||
* <code class="no-auto-link">http://example.com/foo</code> as an equivalent URL.
|
||||
* For instance, {@link HashLocationStrategy} produces URLs like
|
||||
* `http://example.com#/foo`, and {@link PathLocationStrategy} produces
|
||||
* `http://example.com/foo` as an equivalent URL.
|
||||
*
|
||||
* See these two classes for more.
|
||||
*
|
||||
|
@ -22,7 +22,6 @@ export abstract class ViewportScroller {
|
||||
// See #23917
|
||||
/** @nocollapse */
|
||||
static ngInjectableDef = ɵɵdefineInjectable({
|
||||
token: ViewportScroller,
|
||||
providedIn: 'root',
|
||||
factory: () => new BrowserViewportScroller(ɵɵinject(DOCUMENT), window, ɵɵinject(ErrorHandler))
|
||||
});
|
||||
|
@ -204,20 +204,6 @@ describe('NgTemplateOutlet', () => {
|
||||
fixture.componentInstance.value = 'baz';
|
||||
detectChangesAndExpectText('');
|
||||
});
|
||||
|
||||
// https://github.com/angular/angular/issues/30801
|
||||
it('should not throw if the context is left blank', () => {
|
||||
const template = `
|
||||
<ng-template #testTemplate>test</ng-template>
|
||||
<ng-template [ngTemplateOutlet]="testTemplate" [ngTemplateOutletContext]=""></ng-template>
|
||||
`;
|
||||
|
||||
expect(() => {
|
||||
fixture = createTestComponent(template);
|
||||
detectChangesAndExpectText('test');
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@Injectable()
|
||||
|
@ -6,7 +6,6 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ɵfindLocaleData as findLocaleData} from '@angular/core';
|
||||
import localeCaESVALENCIA from '@angular/common/locales/ca-ES-VALENCIA';
|
||||
import localeEn from '@angular/common/locales/en';
|
||||
import localeFr from '@angular/common/locales/fr';
|
||||
@ -14,7 +13,7 @@ import localeZh from '@angular/common/locales/zh';
|
||||
import localeFrCA from '@angular/common/locales/fr-CA';
|
||||
import localeEnAU from '@angular/common/locales/en-AU';
|
||||
import {registerLocaleData} from '../../src/i18n/locale_data';
|
||||
import {getCurrencySymbol, getLocaleDateFormat, FormatWidth, getNumberOfCurrencyDigits} from '../../src/i18n/locale_data_api';
|
||||
import {findLocaleData, getCurrencySymbol, getLocaleDateFormat, FormatWidth, getNumberOfCurrencyDigits} from '../../src/i18n/locale_data_api';
|
||||
|
||||
{
|
||||
describe('locale data api', () => {
|
||||
|
27
packages/common/testing/tsconfig-build.json
Normal file
27
packages/common/testing/tsconfig-build.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"extends": "../tsconfig-build.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"rootDir": "../",
|
||||
"paths": {
|
||||
"@angular/core": [
|
||||
"../../../dist/packages/core"
|
||||
],
|
||||
"@angular/common": [
|
||||
"../../../dist/packages/common"
|
||||
]
|
||||
},
|
||||
"outDir": "../../../dist/packages/common"
|
||||
},
|
||||
"files": [
|
||||
"public_api.ts",
|
||||
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
],
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"strictMetadataEmit": false,
|
||||
"skipTemplateCodegen": true,
|
||||
"flatModuleOutFile": "testing.js",
|
||||
"flatModuleId": "@angular/common/testing"
|
||||
}
|
||||
}
|
25
packages/common/tsconfig-build.json
Normal file
25
packages/common/tsconfig-build.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"extends": "../tsconfig-build.json",
|
||||
|
||||
"compilerOptions": {
|
||||
"rootDir": ".",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@angular/core": ["../../dist/packages/core"]
|
||||
},
|
||||
"outDir": "../../dist/packages/common"
|
||||
},
|
||||
|
||||
"files": [
|
||||
"public_api.ts",
|
||||
"../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
],
|
||||
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"strictMetadataEmit": false,
|
||||
"skipTemplateCodegen": true,
|
||||
"flatModuleOutFile": "common.js",
|
||||
"flatModuleId": "@angular/common"
|
||||
}
|
||||
}
|
29
packages/common/upgrade/tsconfig-build.json
Normal file
29
packages/common/upgrade/tsconfig-build.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"extends": "../tsconfig-build.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"rootDir": "../",
|
||||
"paths": {
|
||||
"@angular/common": [
|
||||
"../../../dist/packages/common"
|
||||
],
|
||||
"@angular/core": [
|
||||
"../../../dist/packages/core"
|
||||
],
|
||||
"@angular/platform-browser": [
|
||||
"../../../dist/packages/platform-browser"
|
||||
]
|
||||
},
|
||||
"outDir": "../../../dist/packages/common"
|
||||
},
|
||||
"files": [
|
||||
"public_api.ts"
|
||||
],
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"strictMetadataEmit": false,
|
||||
"skipTemplateCodegen": true,
|
||||
"flatModuleOutFile": "upgrade.js",
|
||||
"flatModuleId": "@angular/common/upgrade"
|
||||
}
|
||||
}
|
@ -29,7 +29,6 @@ ts_library(
|
||||
"//packages/compiler-cli/src/ngtsc/entry_point",
|
||||
"//packages/compiler-cli/src/ngtsc/imports",
|
||||
"//packages/compiler-cli/src/ngtsc/incremental",
|
||||
"//packages/compiler-cli/src/ngtsc/indexer",
|
||||
"//packages/compiler-cli/src/ngtsc/metadata",
|
||||
"//packages/compiler-cli/src/ngtsc/partial_evaluator",
|
||||
"//packages/compiler-cli/src/ngtsc/path",
|
||||
|
@ -12,7 +12,6 @@ import {EntryPointJsonProperty, EntryPointPackageJson} from './src/packages/entr
|
||||
export {ConsoleLogger, LogLevel} from './src/logging/console_logger';
|
||||
export {Logger} from './src/logging/logger';
|
||||
export {NgccOptions, mainNgcc as process} from './src/main';
|
||||
export {PathMappings} from './src/utils';
|
||||
|
||||
export function hasBeenProcessed(packageJson: object, format: string) {
|
||||
// We are wrapping this function to hide the internal types.
|
||||
|
@ -6,9 +6,9 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import * as path from 'canonical-path';
|
||||
import * as yargs from 'yargs';
|
||||
|
||||
import {AbsoluteFsPath} from '../src/ngtsc/path';
|
||||
import {mainNgcc} from './src/main';
|
||||
import {ConsoleLogger, LogLevel} from './src/logging/console_logger';
|
||||
|
||||
@ -56,7 +56,7 @@ if (require.main === module) {
|
||||
'The formats option (-f/--formats) has been removed. Consider the properties option (-p/--properties) instead.');
|
||||
process.exit(1);
|
||||
}
|
||||
const baseSourcePath = AbsoluteFsPath.resolve(options['s'] || './node_modules');
|
||||
const baseSourcePath = path.resolve(options['s'] || './node_modules');
|
||||
const propertiesToConsider: string[] = options['p'];
|
||||
const targetEntryPointPath = options['t'] ? options['t'] : undefined;
|
||||
const compileAllFormats = !options['first-only'];
|
||||
|
@ -6,6 +6,9 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {ConstantPool} from '@angular/compiler';
|
||||
import {NOOP_PERF_RECORDER} from '@angular/compiler-cli/src/ngtsc/perf';
|
||||
import * as path from 'canonical-path';
|
||||
import * as fs from 'fs';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {BaseDefDecoratorHandler, ComponentDecoratorHandler, DirectiveDecoratorHandler, InjectableDecoratorHandler, NgModuleDecoratorHandler, PipeDecoratorHandler, ReferencesRegistry, ResourceLoader} from '../../../src/ngtsc/annotations';
|
||||
@ -14,10 +17,9 @@ import {AbsoluteModuleStrategy, LocalIdentifierStrategy, LogicalProjectStrategy,
|
||||
import {CompoundMetadataReader, CompoundMetadataRegistry, DtsMetadataReader, LocalMetadataRegistry} from '../../../src/ngtsc/metadata';
|
||||
import {PartialEvaluator} from '../../../src/ngtsc/partial_evaluator';
|
||||
import {AbsoluteFsPath, LogicalFileSystem} from '../../../src/ngtsc/path';
|
||||
import {ClassDeclaration, ClassSymbol, Decorator} from '../../../src/ngtsc/reflection';
|
||||
import {LocalModuleScopeRegistry, MetadataDtsModuleScopeResolver} from '../../../src/ngtsc/scope';
|
||||
import {CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence} from '../../../src/ngtsc/transform';
|
||||
import {FileSystem} from '../file_system/file_system';
|
||||
import {DecoratedClass} from '../host/decorated_class';
|
||||
import {NgccReflectionHost} from '../host/ngcc_host';
|
||||
import {isDefined} from '../utils';
|
||||
|
||||
@ -26,10 +28,7 @@ export interface AnalyzedFile {
|
||||
analyzedClasses: AnalyzedClass[];
|
||||
}
|
||||
|
||||
export interface AnalyzedClass {
|
||||
name: string;
|
||||
decorators: Decorator[]|null;
|
||||
declaration: ClassDeclaration;
|
||||
export interface AnalyzedClass extends DecoratedClass {
|
||||
diagnostics?: ts.Diagnostic[];
|
||||
matches: {handler: DecoratorHandler<any, any>; analysis: any;}[];
|
||||
}
|
||||
@ -54,12 +53,11 @@ export interface MatchingHandler<A, M> {
|
||||
* Simple class that resolves and loads files directly from the filesystem.
|
||||
*/
|
||||
class NgccResourceLoader implements ResourceLoader {
|
||||
constructor(private fs: FileSystem) {}
|
||||
canPreload = false;
|
||||
preload(): undefined|Promise<void> { throw new Error('Not implemented.'); }
|
||||
load(url: string): string { return this.fs.readFile(AbsoluteFsPath.resolve(url)); }
|
||||
load(url: string): string { return fs.readFileSync(url, 'utf8'); }
|
||||
resolve(url: string, containingFile: string): string {
|
||||
return AbsoluteFsPath.resolve(AbsoluteFsPath.dirname(AbsoluteFsPath.from(containingFile)), url);
|
||||
return path.resolve(path.dirname(containingFile), url);
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,17 +65,16 @@ class NgccResourceLoader implements ResourceLoader {
|
||||
* This Analyzer will analyze the files that have decorated classes that need to be transformed.
|
||||
*/
|
||||
export class DecorationAnalyzer {
|
||||
resourceManager = new NgccResourceLoader(this.fs);
|
||||
resourceManager = new NgccResourceLoader();
|
||||
metaRegistry = new LocalMetadataRegistry();
|
||||
dtsMetaReader = new DtsMetadataReader(this.typeChecker, this.reflectionHost);
|
||||
fullMetaReader = new CompoundMetadataReader([this.metaRegistry, this.dtsMetaReader]);
|
||||
refEmitter = new ReferenceEmitter([
|
||||
new LocalIdentifierStrategy(),
|
||||
new AbsoluteModuleStrategy(
|
||||
this.program, this.typeChecker, this.options, this.host, this.reflectionHost),
|
||||
new AbsoluteModuleStrategy(this.program, this.typeChecker, this.options, this.host),
|
||||
// TODO(alxhub): there's no reason why ngcc needs the "logical file system" logic here, as ngcc
|
||||
// projects only ever have one rootDir. Instead, ngcc should just switch its emitted import
|
||||
// based on whether a bestGuessOwningModule is present in the Reference.
|
||||
// projects only ever have one rootDir. Instead, ngcc should just switch its emitted imort based
|
||||
// on whether a bestGuessOwningModule is present in the Reference.
|
||||
new LogicalProjectStrategy(this.typeChecker, new LogicalFileSystem(this.rootDirs)),
|
||||
]);
|
||||
dtsModuleScopeResolver =
|
||||
@ -113,7 +110,7 @@ export class DecorationAnalyzer {
|
||||
];
|
||||
|
||||
constructor(
|
||||
private fs: FileSystem, private program: ts.Program, private options: ts.CompilerOptions,
|
||||
private program: ts.Program, private options: ts.CompilerOptions,
|
||||
private host: ts.CompilerHost, private typeChecker: ts.TypeChecker,
|
||||
private reflectionHost: NgccReflectionHost, private referencesRegistry: ReferencesRegistry,
|
||||
private rootDirs: AbsoluteFsPath[], private isCore: boolean) {}
|
||||
@ -136,18 +133,19 @@ export class DecorationAnalyzer {
|
||||
}
|
||||
|
||||
protected analyzeFile(sourceFile: ts.SourceFile): AnalyzedFile|undefined {
|
||||
const analyzedClasses = this.reflectionHost.findClassSymbols(sourceFile)
|
||||
.map(symbol => this.analyzeClass(symbol))
|
||||
.filter(isDefined);
|
||||
return analyzedClasses.length ? {sourceFile, analyzedClasses} : undefined;
|
||||
const decoratedClasses = this.reflectionHost.findDecoratedClasses(sourceFile);
|
||||
return decoratedClasses.length ? {
|
||||
sourceFile,
|
||||
analyzedClasses: decoratedClasses.map(clazz => this.analyzeClass(clazz)).filter(isDefined)
|
||||
} :
|
||||
undefined;
|
||||
}
|
||||
|
||||
protected analyzeClass(symbol: ClassSymbol): AnalyzedClass|null {
|
||||
const declaration = symbol.valueDeclaration;
|
||||
const decorators = this.reflectionHost.getDecoratorsOfSymbol(symbol);
|
||||
protected analyzeClass(clazz: DecoratedClass): AnalyzedClass|null {
|
||||
const matchingHandlers = this.handlers
|
||||
.map(handler => {
|
||||
const detected = handler.detect(declaration, decorators);
|
||||
const detected =
|
||||
handler.detect(clazz.declaration, clazz.decorators);
|
||||
return {handler, detected};
|
||||
})
|
||||
.filter(isMatchingHandler);
|
||||
@ -185,19 +183,13 @@ export class DecorationAnalyzer {
|
||||
const matches: {handler: DecoratorHandler<any, any>, analysis: any}[] = [];
|
||||
const allDiagnostics: ts.Diagnostic[] = [];
|
||||
for (const {handler, detected} of detections) {
|
||||
const {analysis, diagnostics} = handler.analyze(declaration, detected.metadata);
|
||||
const {analysis, diagnostics} = handler.analyze(clazz.declaration, detected.metadata);
|
||||
if (diagnostics !== undefined) {
|
||||
allDiagnostics.push(...diagnostics);
|
||||
}
|
||||
matches.push({handler, analysis});
|
||||
}
|
||||
return {
|
||||
name: symbol.name,
|
||||
declaration,
|
||||
decorators,
|
||||
matches,
|
||||
diagnostics: allDiagnostics.length > 0 ? allDiagnostics : undefined
|
||||
};
|
||||
return {...clazz, matches, diagnostics: allDiagnostics.length > 0 ? allDiagnostics : undefined};
|
||||
}
|
||||
|
||||
protected compileFile(analyzedFile: AnalyzedFile): CompiledFile {
|
||||
|
@ -63,7 +63,7 @@ export class ModuleWithProvidersAnalyzer {
|
||||
ngModule = {node: dtsNgModule, viaModule: null};
|
||||
}
|
||||
const dtsFile = dtsFn.getSourceFile();
|
||||
const analysis = analyses.has(dtsFile) ? analyses.get(dtsFile) : [];
|
||||
const analysis = analyses.get(dtsFile) || [];
|
||||
analysis.push({declaration: dtsFn, ngModule});
|
||||
analyses.set(dtsFile, analysis);
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
*/
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {AbsoluteFsPath} from '../../../src/ngtsc/path';
|
||||
import {Declaration} from '../../../src/ngtsc/reflection';
|
||||
import {NgccReflectionHost} from '../host/ngcc_host';
|
||||
import {hasNameIdentifier, isDefined} from '../utils';
|
||||
@ -15,8 +14,8 @@ import {NgccReferencesRegistry} from './ngcc_references_registry';
|
||||
|
||||
export interface ExportInfo {
|
||||
identifier: string;
|
||||
from: AbsoluteFsPath;
|
||||
dtsFrom?: AbsoluteFsPath|null;
|
||||
from: string;
|
||||
dtsFrom?: string|null;
|
||||
alias?: string|null;
|
||||
}
|
||||
export type PrivateDeclarationsAnalyses = ExportInfo[];
|
||||
@ -49,8 +48,8 @@ export class PrivateDeclarationsAnalyzer {
|
||||
if (exports) {
|
||||
exports.forEach((declaration, exportedName) => {
|
||||
if (hasNameIdentifier(declaration.node)) {
|
||||
if (privateDeclarations.has(declaration.node.name)) {
|
||||
const privateDeclaration = privateDeclarations.get(declaration.node.name) !;
|
||||
const privateDeclaration = privateDeclarations.get(declaration.node.name);
|
||||
if (privateDeclaration) {
|
||||
if (privateDeclaration.node !== declaration.node) {
|
||||
throw new Error(`${declaration.node.name.text} is declared multiple times.`);
|
||||
}
|
||||
@ -94,12 +93,11 @@ export class PrivateDeclarationsAnalyzer {
|
||||
});
|
||||
|
||||
return Array.from(privateDeclarations.keys()).map(id => {
|
||||
const from = AbsoluteFsPath.fromSourceFile(id.getSourceFile());
|
||||
const from = id.getSourceFile().fileName;
|
||||
const declaration = privateDeclarations.get(id) !;
|
||||
const alias = exportAliasDeclarations.has(id) ? exportAliasDeclarations.get(id) ! : null;
|
||||
const alias = exportAliasDeclarations.get(id) || null;
|
||||
const dtsDeclaration = this.host.getDtsDeclaration(declaration.node);
|
||||
const dtsFrom =
|
||||
dtsDeclaration && AbsoluteFsPath.fromSourceFile(dtsDeclaration.getSourceFile());
|
||||
const dtsFrom = dtsDeclaration && dtsDeclaration.getSourceFile().fileName;
|
||||
|
||||
return {identifier: id.text, from, dtsFrom, alias};
|
||||
});
|
||||
|
@ -1,107 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {AbsoluteFsPath, PathSegment} from '../../../src/ngtsc/path';
|
||||
import {FileSystem} from '../file_system/file_system';
|
||||
import {isRequireCall} from '../host/commonjs_host';
|
||||
|
||||
import {DependencyHost, DependencyInfo} from './dependency_host';
|
||||
import {ModuleResolver, ResolvedDeepImport, ResolvedRelativeModule} from './module_resolver';
|
||||
|
||||
/**
|
||||
* Helper functions for computing dependencies.
|
||||
*/
|
||||
export class CommonJsDependencyHost implements DependencyHost {
|
||||
constructor(private fs: FileSystem, private moduleResolver: ModuleResolver) {}
|
||||
|
||||
/**
|
||||
* Find all the dependencies for the entry-point at the given path.
|
||||
*
|
||||
* @param entryPointPath The absolute path to the JavaScript file that represents an entry-point.
|
||||
* @returns Information about the dependencies of the entry-point, including those that were
|
||||
* missing or deep imports into other entry-points.
|
||||
*/
|
||||
findDependencies(entryPointPath: AbsoluteFsPath): DependencyInfo {
|
||||
const dependencies = new Set<AbsoluteFsPath>();
|
||||
const missing = new Set<AbsoluteFsPath|PathSegment>();
|
||||
const deepImports = new Set<AbsoluteFsPath>();
|
||||
const alreadySeen = new Set<AbsoluteFsPath>();
|
||||
this.recursivelyFindDependencies(
|
||||
entryPointPath, dependencies, missing, deepImports, alreadySeen);
|
||||
return {dependencies, missing, deepImports};
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the dependencies of the given file.
|
||||
*
|
||||
* @param file An absolute path to the file whose dependencies we want to get.
|
||||
* @param dependencies A set that will have the absolute paths of resolved entry points added to
|
||||
* it.
|
||||
* @param missing A set that will have the dependencies that could not be found added to it.
|
||||
* @param deepImports A set that will have the import paths that exist but cannot be mapped to
|
||||
* entry-points, i.e. deep-imports.
|
||||
* @param alreadySeen A set that is used to track internal dependencies to prevent getting stuck
|
||||
* in a
|
||||
* circular dependency loop.
|
||||
*/
|
||||
private recursivelyFindDependencies(
|
||||
file: AbsoluteFsPath, dependencies: Set<AbsoluteFsPath>, missing: Set<string>,
|
||||
deepImports: Set<AbsoluteFsPath>, alreadySeen: Set<AbsoluteFsPath>): void {
|
||||
const fromContents = this.fs.readFile(file);
|
||||
if (!this.hasRequireCalls(fromContents)) {
|
||||
// Avoid parsing the source file as there are no require calls.
|
||||
return;
|
||||
}
|
||||
|
||||
// Parse the source into a TypeScript AST and then walk it looking for imports and re-exports.
|
||||
const sf =
|
||||
ts.createSourceFile(file, fromContents, ts.ScriptTarget.ES2015, false, ts.ScriptKind.JS);
|
||||
|
||||
for (const statement of sf.statements) {
|
||||
const declarations =
|
||||
ts.isVariableStatement(statement) ? statement.declarationList.declarations : [];
|
||||
for (const declaration of declarations) {
|
||||
if (declaration.initializer && isRequireCall(declaration.initializer)) {
|
||||
const importPath = declaration.initializer.arguments[0].text;
|
||||
const resolvedModule = this.moduleResolver.resolveModuleImport(importPath, file);
|
||||
if (resolvedModule) {
|
||||
if (resolvedModule instanceof ResolvedRelativeModule) {
|
||||
const internalDependency = resolvedModule.modulePath;
|
||||
if (!alreadySeen.has(internalDependency)) {
|
||||
alreadySeen.add(internalDependency);
|
||||
this.recursivelyFindDependencies(
|
||||
internalDependency, dependencies, missing, deepImports, alreadySeen);
|
||||
}
|
||||
} else {
|
||||
if (resolvedModule instanceof ResolvedDeepImport) {
|
||||
deepImports.add(resolvedModule.importPath);
|
||||
} else {
|
||||
dependencies.add(resolvedModule.entryPointPath);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
missing.add(importPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a source file needs to be parsed for imports.
|
||||
* This is a performance short-circuit, which saves us from creating
|
||||
* a TypeScript AST unnecessarily.
|
||||
*
|
||||
* @param source The content of the source file to check.
|
||||
*
|
||||
* @returns false if there are definitely no require calls
|
||||
* in this file, true otherwise.
|
||||
*/
|
||||
hasRequireCalls(source: string): boolean { return /require\(['"]/.test(source); }
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {AbsoluteFsPath, PathSegment} from '../../../src/ngtsc/path';
|
||||
|
||||
export interface DependencyHost {
|
||||
findDependencies(entryPointPath: AbsoluteFsPath): DependencyInfo;
|
||||
}
|
||||
|
||||
export interface DependencyInfo {
|
||||
dependencies: Set<AbsoluteFsPath>;
|
||||
missing: Set<AbsoluteFsPath|PathSegment>;
|
||||
deepImports: Set<AbsoluteFsPath>;
|
||||
}
|
@ -1,117 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {AbsoluteFsPath, PathSegment} from '../../../src/ngtsc/path';
|
||||
import {FileSystem} from '../file_system/file_system';
|
||||
import {DependencyHost, DependencyInfo} from './dependency_host';
|
||||
import {ModuleResolver, ResolvedDeepImport, ResolvedRelativeModule} from './module_resolver';
|
||||
|
||||
|
||||
/**
|
||||
* Helper functions for computing dependencies.
|
||||
*/
|
||||
export class EsmDependencyHost implements DependencyHost {
|
||||
constructor(private fs: FileSystem, private moduleResolver: ModuleResolver) {}
|
||||
|
||||
/**
|
||||
* Find all the dependencies for the entry-point at the given path.
|
||||
*
|
||||
* @param entryPointPath The absolute path to the JavaScript file that represents an entry-point.
|
||||
* @returns Information about the dependencies of the entry-point, including those that were
|
||||
* missing or deep imports into other entry-points.
|
||||
*/
|
||||
findDependencies(entryPointPath: AbsoluteFsPath): DependencyInfo {
|
||||
const dependencies = new Set<AbsoluteFsPath>();
|
||||
const missing = new Set<AbsoluteFsPath|PathSegment>();
|
||||
const deepImports = new Set<AbsoluteFsPath>();
|
||||
const alreadySeen = new Set<AbsoluteFsPath>();
|
||||
this.recursivelyFindDependencies(
|
||||
entryPointPath, dependencies, missing, deepImports, alreadySeen);
|
||||
return {dependencies, missing, deepImports};
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the dependencies of the given file.
|
||||
*
|
||||
* @param file An absolute path to the file whose dependencies we want to get.
|
||||
* @param dependencies A set that will have the absolute paths of resolved entry points added to
|
||||
* it.
|
||||
* @param missing A set that will have the dependencies that could not be found added to it.
|
||||
* @param deepImports A set that will have the import paths that exist but cannot be mapped to
|
||||
* entry-points, i.e. deep-imports.
|
||||
* @param alreadySeen A set that is used to track internal dependencies to prevent getting stuck
|
||||
* in a
|
||||
* circular dependency loop.
|
||||
*/
|
||||
private recursivelyFindDependencies(
|
||||
file: AbsoluteFsPath, dependencies: Set<AbsoluteFsPath>, missing: Set<string>,
|
||||
deepImports: Set<string>, alreadySeen: Set<AbsoluteFsPath>): void {
|
||||
const fromContents = this.fs.readFile(file);
|
||||
if (!this.hasImportOrReexportStatements(fromContents)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Parse the source into a TypeScript AST and then walk it looking for imports and re-exports.
|
||||
const sf =
|
||||
ts.createSourceFile(file, fromContents, ts.ScriptTarget.ES2015, false, ts.ScriptKind.JS);
|
||||
sf.statements
|
||||
// filter out statements that are not imports or reexports
|
||||
.filter(this.isStringImportOrReexport)
|
||||
// Grab the id of the module that is being imported
|
||||
.map(stmt => stmt.moduleSpecifier.text)
|
||||
// Resolve this module id into an absolute path
|
||||
.forEach(importPath => {
|
||||
const resolvedModule = this.moduleResolver.resolveModuleImport(importPath, file);
|
||||
if (resolvedModule) {
|
||||
if (resolvedModule instanceof ResolvedRelativeModule) {
|
||||
const internalDependency = resolvedModule.modulePath;
|
||||
if (!alreadySeen.has(internalDependency)) {
|
||||
alreadySeen.add(internalDependency);
|
||||
this.recursivelyFindDependencies(
|
||||
internalDependency, dependencies, missing, deepImports, alreadySeen);
|
||||
}
|
||||
} else {
|
||||
if (resolvedModule instanceof ResolvedDeepImport) {
|
||||
deepImports.add(resolvedModule.importPath);
|
||||
} else {
|
||||
dependencies.add(resolvedModule.entryPointPath);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
missing.add(importPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the given statement is an import with a string literal module specifier.
|
||||
* @param stmt the statement node to check.
|
||||
* @returns true if the statement is an import with a string literal module specifier.
|
||||
*/
|
||||
isStringImportOrReexport(stmt: ts.Statement): stmt is ts.ImportDeclaration&
|
||||
{moduleSpecifier: ts.StringLiteral} {
|
||||
return ts.isImportDeclaration(stmt) ||
|
||||
ts.isExportDeclaration(stmt) && !!stmt.moduleSpecifier &&
|
||||
ts.isStringLiteral(stmt.moduleSpecifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a source file needs to be parsed for imports.
|
||||
* This is a performance short-circuit, which saves us from creating
|
||||
* a TypeScript AST unnecessarily.
|
||||
*
|
||||
* @param source The content of the source file to check.
|
||||
*
|
||||
* @returns false if there are definitely no import or re-export statements
|
||||
* in this file, true otherwise.
|
||||
*/
|
||||
hasImportOrReexportStatements(source: string): boolean {
|
||||
return /(import|export)\s.+from/.test(source);
|
||||
}
|
||||
}
|
@ -1,280 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {AbsoluteFsPath} from '../../../src/ngtsc/path';
|
||||
import {FileSystem} from '../file_system/file_system';
|
||||
import {PathMappings, isRelativePath} from '../utils';
|
||||
|
||||
/**
|
||||
* This is a very cut-down implementation of the TypeScript module resolution strategy.
|
||||
*
|
||||
* It is specific to the needs of ngcc and is not intended to be a drop-in replacement
|
||||
* for the TS module resolver. It is used to compute the dependencies between entry-points
|
||||
* that may be compiled by ngcc.
|
||||
*
|
||||
* The algorithm only finds `.js` files for internal/relative imports and paths to
|
||||
* the folder containing the `package.json` of the entry-point for external imports.
|
||||
*
|
||||
* It can cope with nested `node_modules` folders and also supports `paths`/`baseUrl`
|
||||
* configuration properties, as provided in a `ts.CompilerOptions` object.
|
||||
*/
|
||||
export class ModuleResolver {
|
||||
private pathMappings: ProcessedPathMapping[];
|
||||
|
||||
constructor(private fs: FileSystem, pathMappings?: PathMappings, private relativeExtensions = [
|
||||
'.js', '/index.js'
|
||||
]) {
|
||||
this.pathMappings = pathMappings ? this.processPathMappings(pathMappings) : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve an absolute path for the `moduleName` imported into a file at `fromPath`.
|
||||
* @param moduleName The name of the import to resolve.
|
||||
* @param fromPath The path to the file containing the import.
|
||||
* @returns A path to the resolved module or null if missing.
|
||||
* Specifically:
|
||||
* * the absolute path to the package.json of an external module
|
||||
* * a JavaScript file of an internal module
|
||||
* * null if none exists.
|
||||
*/
|
||||
resolveModuleImport(moduleName: string, fromPath: AbsoluteFsPath): ResolvedModule|null {
|
||||
if (isRelativePath(moduleName)) {
|
||||
return this.resolveAsRelativePath(moduleName, fromPath);
|
||||
} else {
|
||||
return this.pathMappings.length && this.resolveByPathMappings(moduleName, fromPath) ||
|
||||
this.resolveAsEntryPoint(moduleName, fromPath);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the `pathMappings` into a collection of `PathMapper` functions.
|
||||
*/
|
||||
private processPathMappings(pathMappings: PathMappings): ProcessedPathMapping[] {
|
||||
const baseUrl = AbsoluteFsPath.from(pathMappings.baseUrl);
|
||||
return Object.keys(pathMappings.paths).map(pathPattern => {
|
||||
const matcher = splitOnStar(pathPattern);
|
||||
const templates = pathMappings.paths[pathPattern].map(splitOnStar);
|
||||
return {matcher, templates, baseUrl};
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to resolve a module name, as a relative path, from the `fromPath`.
|
||||
*
|
||||
* As it is relative, it only looks for files that end in one of the `relativeExtensions`.
|
||||
* For example: `${moduleName}.js` or `${moduleName}/index.js`.
|
||||
* If neither of these files exist then the method returns `null`.
|
||||
*/
|
||||
private resolveAsRelativePath(moduleName: string, fromPath: AbsoluteFsPath): ResolvedModule|null {
|
||||
const resolvedPath = this.resolvePath(
|
||||
AbsoluteFsPath.resolve(AbsoluteFsPath.dirname(fromPath), moduleName),
|
||||
this.relativeExtensions);
|
||||
return resolvedPath && new ResolvedRelativeModule(resolvedPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to resolve the `moduleName`, by applying the computed `pathMappings` and
|
||||
* then trying to resolve the mapped path as a relative or external import.
|
||||
*
|
||||
* Whether the mapped path is relative is defined as it being "below the `fromPath`" and not
|
||||
* containing `node_modules`.
|
||||
*
|
||||
* If the mapped path is not relative but does not resolve to an external entry-point, then we
|
||||
* check whether it would have resolved to a relative path, in which case it is marked as a
|
||||
* "deep-import".
|
||||
*/
|
||||
private resolveByPathMappings(moduleName: string, fromPath: AbsoluteFsPath): ResolvedModule|null {
|
||||
const mappedPaths = this.findMappedPaths(moduleName);
|
||||
if (mappedPaths.length > 0) {
|
||||
const packagePath = this.findPackagePath(fromPath);
|
||||
if (packagePath !== null) {
|
||||
for (const mappedPath of mappedPaths) {
|
||||
const isRelative =
|
||||
mappedPath.startsWith(packagePath) && !mappedPath.includes('node_modules');
|
||||
if (isRelative) {
|
||||
return this.resolveAsRelativePath(mappedPath, fromPath);
|
||||
} else if (this.isEntryPoint(mappedPath)) {
|
||||
return new ResolvedExternalModule(mappedPath);
|
||||
} else if (this.resolveAsRelativePath(mappedPath, fromPath)) {
|
||||
return new ResolvedDeepImport(mappedPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to resolve the `moduleName` as an external entry-point by searching the `node_modules`
|
||||
* folders up the tree for a matching `.../node_modules/${moduleName}`.
|
||||
*
|
||||
* If a folder is found but the path does not contain a `package.json` then it is marked as a
|
||||
* "deep-import".
|
||||
*/
|
||||
private resolveAsEntryPoint(moduleName: string, fromPath: AbsoluteFsPath): ResolvedModule|null {
|
||||
let folder = fromPath;
|
||||
while (!AbsoluteFsPath.isRoot(folder)) {
|
||||
folder = AbsoluteFsPath.dirname(folder);
|
||||
if (folder.endsWith('node_modules')) {
|
||||
// Skip up if the folder already ends in node_modules
|
||||
folder = AbsoluteFsPath.dirname(folder);
|
||||
}
|
||||
const modulePath = AbsoluteFsPath.resolve(folder, 'node_modules', moduleName);
|
||||
if (this.isEntryPoint(modulePath)) {
|
||||
return new ResolvedExternalModule(modulePath);
|
||||
} else if (this.resolveAsRelativePath(modulePath, fromPath)) {
|
||||
return new ResolvedDeepImport(modulePath);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to resolve a `path` to a file by appending the provided `postFixes`
|
||||
* to the `path` and checking if the file exists on disk.
|
||||
* @returns An absolute path to the first matching existing file, or `null` if none exist.
|
||||
*/
|
||||
private resolvePath(path: AbsoluteFsPath, postFixes: string[]): AbsoluteFsPath|null {
|
||||
for (const postFix of postFixes) {
|
||||
const testPath = AbsoluteFsPath.fromUnchecked(path + postFix);
|
||||
if (this.fs.exists(testPath)) {
|
||||
return testPath;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can we consider the given path as an entry-point to a package?
|
||||
*
|
||||
* This is achieved by checking for the existence of `${modulePath}/package.json`.
|
||||
*/
|
||||
private isEntryPoint(modulePath: AbsoluteFsPath): boolean {
|
||||
return this.fs.exists(AbsoluteFsPath.join(modulePath, 'package.json'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the `pathMappers` to the `moduleName` and return all the possible
|
||||
* paths that match.
|
||||
*
|
||||
* The mapped path is computed for each template in `mapping.templates` by
|
||||
* replacing the `matcher.prefix` and `matcher.postfix` strings in `path with the
|
||||
* `template.prefix` and `template.postfix` strings.
|
||||
*/
|
||||
private findMappedPaths(moduleName: string): AbsoluteFsPath[] {
|
||||
const matches = this.pathMappings.map(mapping => this.matchMapping(moduleName, mapping));
|
||||
|
||||
let bestMapping: ProcessedPathMapping|undefined;
|
||||
let bestMatch: string|undefined;
|
||||
|
||||
for (let index = 0; index < this.pathMappings.length; index++) {
|
||||
const mapping = this.pathMappings[index];
|
||||
const match = matches[index];
|
||||
if (match !== null) {
|
||||
// If this mapping had no wildcard then this must be a complete match.
|
||||
if (!mapping.matcher.hasWildcard) {
|
||||
bestMatch = match;
|
||||
bestMapping = mapping;
|
||||
break;
|
||||
}
|
||||
// The best matched mapping is the one with the longest prefix.
|
||||
if (!bestMapping || mapping.matcher.prefix > bestMapping.matcher.prefix) {
|
||||
bestMatch = match;
|
||||
bestMapping = mapping;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (bestMapping && bestMatch) ? this.computeMappedTemplates(bestMapping, bestMatch) : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to find a mapped path for the given `path` and a `mapping`.
|
||||
*
|
||||
* The `path` matches the `mapping` if if it starts with `matcher.prefix` and ends with
|
||||
* `matcher.postfix`.
|
||||
*
|
||||
* @returns the wildcard segment of a matched `path`, or `null` if no match.
|
||||
*/
|
||||
private matchMapping(path: string, mapping: ProcessedPathMapping): string|null {
|
||||
const {prefix, postfix, hasWildcard} = mapping.matcher;
|
||||
if (path.startsWith(prefix) && path.endsWith(postfix)) {
|
||||
return hasWildcard ? path.substring(prefix.length, path.length - postfix.length) : '';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the candidate paths from the given mapping's templates using the matched
|
||||
* string.
|
||||
*/
|
||||
private computeMappedTemplates(mapping: ProcessedPathMapping, match: string) {
|
||||
return mapping.templates.map(
|
||||
template =>
|
||||
AbsoluteFsPath.resolve(mapping.baseUrl, template.prefix + match + template.postfix));
|
||||
}
|
||||
|
||||
/**
|
||||
* Search up the folder tree for the first folder that contains `package.json`
|
||||
* or `null` if none is found.
|
||||
*/
|
||||
private findPackagePath(path: AbsoluteFsPath): AbsoluteFsPath|null {
|
||||
let folder = path;
|
||||
while (!AbsoluteFsPath.isRoot(folder)) {
|
||||
folder = AbsoluteFsPath.dirname(folder);
|
||||
if (this.fs.exists(AbsoluteFsPath.join(folder, 'package.json'))) {
|
||||
return folder;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** The result of resolving an import to a module. */
|
||||
export type ResolvedModule = ResolvedExternalModule | ResolvedRelativeModule | ResolvedDeepImport;
|
||||
|
||||
/**
|
||||
* A module that is external to the package doing the importing.
|
||||
* In this case we capture the folder containing the entry-point.
|
||||
*/
|
||||
export class ResolvedExternalModule {
|
||||
constructor(public entryPointPath: AbsoluteFsPath) {}
|
||||
}
|
||||
|
||||
/**
|
||||
* A module that is relative to the module doing the importing, and so internal to the
|
||||
* source module's package.
|
||||
*/
|
||||
export class ResolvedRelativeModule {
|
||||
constructor(public modulePath: AbsoluteFsPath) {}
|
||||
}
|
||||
|
||||
/**
|
||||
* A module that is external to the package doing the importing but pointing to a
|
||||
* module that is deep inside a package, rather than to an entry-point of the package.
|
||||
*/
|
||||
export class ResolvedDeepImport {
|
||||
constructor(public importPath: AbsoluteFsPath) {}
|
||||
}
|
||||
|
||||
function splitOnStar(str: string): PathMappingPattern {
|
||||
const [prefix, postfix] = str.split('*', 2);
|
||||
return {prefix, postfix: postfix || '', hasWildcard: postfix !== undefined};
|
||||
}
|
||||
|
||||
interface ProcessedPathMapping {
|
||||
baseUrl: AbsoluteFsPath;
|
||||
matcher: PathMappingPattern;
|
||||
templates: PathMappingPattern[];
|
||||
}
|
||||
|
||||
interface PathMappingPattern {
|
||||
prefix: string;
|
||||
postfix: string;
|
||||
hasWildcard: boolean;
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {AbsoluteFsPath, PathSegment} from '../../../src/ngtsc/path';
|
||||
import {FileSystem} from '../file_system/file_system';
|
||||
import {getImportsOfUmdModule, parseStatementForUmdModule} from '../host/umd_host';
|
||||
|
||||
import {DependencyHost, DependencyInfo} from './dependency_host';
|
||||
import {ModuleResolver, ResolvedDeepImport, ResolvedRelativeModule} from './module_resolver';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Helper functions for computing dependencies.
|
||||
*/
|
||||
export class UmdDependencyHost implements DependencyHost {
|
||||
constructor(private fs: FileSystem, private moduleResolver: ModuleResolver) {}
|
||||
|
||||
/**
|
||||
* Find all the dependencies for the entry-point at the given path.
|
||||
*
|
||||
* @param entryPointPath The absolute path to the JavaScript file that represents an entry-point.
|
||||
* @returns Information about the dependencies of the entry-point, including those that were
|
||||
* missing or deep imports into other entry-points.
|
||||
*/
|
||||
findDependencies(entryPointPath: AbsoluteFsPath): DependencyInfo {
|
||||
const dependencies = new Set<AbsoluteFsPath>();
|
||||
const missing = new Set<AbsoluteFsPath|PathSegment>();
|
||||
const deepImports = new Set<AbsoluteFsPath>();
|
||||
const alreadySeen = new Set<AbsoluteFsPath>();
|
||||
this.recursivelyFindDependencies(
|
||||
entryPointPath, dependencies, missing, deepImports, alreadySeen);
|
||||
return {dependencies, missing, deepImports};
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the dependencies of the given file.
|
||||
*
|
||||
* @param file An absolute path to the file whose dependencies we want to get.
|
||||
* @param dependencies A set that will have the absolute paths of resolved entry points added to
|
||||
* it.
|
||||
* @param missing A set that will have the dependencies that could not be found added to it.
|
||||
* @param deepImports A set that will have the import paths that exist but cannot be mapped to
|
||||
* entry-points, i.e. deep-imports.
|
||||
* @param alreadySeen A set that is used to track internal dependencies to prevent getting stuck
|
||||
* in a
|
||||
* circular dependency loop.
|
||||
*/
|
||||
private recursivelyFindDependencies(
|
||||
file: AbsoluteFsPath, dependencies: Set<AbsoluteFsPath>, missing: Set<string>,
|
||||
deepImports: Set<string>, alreadySeen: Set<AbsoluteFsPath>): void {
|
||||
const fromContents = this.fs.readFile(file);
|
||||
if (!this.hasRequireCalls(fromContents)) {
|
||||
// Avoid parsing the source file as there are no require calls.
|
||||
return;
|
||||
}
|
||||
|
||||
// Parse the source into a TypeScript AST and then walk it looking for imports and re-exports.
|
||||
const sf =
|
||||
ts.createSourceFile(file, fromContents, ts.ScriptTarget.ES2015, false, ts.ScriptKind.JS);
|
||||
if (sf.statements.length !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
const umdModule = parseStatementForUmdModule(sf.statements[0]);
|
||||
const umdImports = umdModule && getImportsOfUmdModule(umdModule);
|
||||
if (umdImports === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
umdImports.forEach(umdImport => {
|
||||
const resolvedModule = this.moduleResolver.resolveModuleImport(umdImport.path, file);
|
||||
if (resolvedModule) {
|
||||
if (resolvedModule instanceof ResolvedRelativeModule) {
|
||||
const internalDependency = resolvedModule.modulePath;
|
||||
if (!alreadySeen.has(internalDependency)) {
|
||||
alreadySeen.add(internalDependency);
|
||||
this.recursivelyFindDependencies(
|
||||
internalDependency, dependencies, missing, deepImports, alreadySeen);
|
||||
}
|
||||
} else {
|
||||
if (resolvedModule instanceof ResolvedDeepImport) {
|
||||
deepImports.add(resolvedModule.importPath);
|
||||
} else {
|
||||
dependencies.add(resolvedModule.entryPointPath);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
missing.add(umdImport.path);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a source file needs to be parsed for imports.
|
||||
* This is a performance short-circuit, which saves us from creating
|
||||
* a TypeScript AST unnecessarily.
|
||||
*
|
||||
* @param source The content of the source file to check.
|
||||
*
|
||||
* @returns false if there are definitely no require calls
|
||||
* in this file, true otherwise.
|
||||
*/
|
||||
hasRequireCalls(source: string): boolean { return /require\(['"]/.test(source); }
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {AbsoluteFsPath, PathSegment} from '../../../src/ngtsc/path';
|
||||
|
||||
/**
|
||||
* A basic interface to abstract the underlying file-system.
|
||||
*
|
||||
* This makes it easier to provide mock file-systems in unit tests,
|
||||
* but also to create clever file-systems that have features such as caching.
|
||||
*/
|
||||
export interface FileSystem {
|
||||
exists(path: AbsoluteFsPath): boolean;
|
||||
readFile(path: AbsoluteFsPath): string;
|
||||
writeFile(path: AbsoluteFsPath, data: string): void;
|
||||
readdir(path: AbsoluteFsPath): PathSegment[];
|
||||
lstat(path: AbsoluteFsPath): FileStats;
|
||||
stat(path: AbsoluteFsPath): FileStats;
|
||||
pwd(): AbsoluteFsPath;
|
||||
copyFile(from: AbsoluteFsPath, to: AbsoluteFsPath): void;
|
||||
moveFile(from: AbsoluteFsPath, to: AbsoluteFsPath): void;
|
||||
ensureDir(path: AbsoluteFsPath): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information about an object in the FileSystem.
|
||||
* This is analogous to the `fs.Stats` class in Node.js.
|
||||
*/
|
||||
export interface FileStats {
|
||||
isFile(): boolean;
|
||||
isDirectory(): boolean;
|
||||
isSymbolicLink(): boolean;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import * as fs from 'fs';
|
||||
import {cp, mkdir, mv} from 'shelljs';
|
||||
import {AbsoluteFsPath, PathSegment} from '../../../src/ngtsc/path';
|
||||
import {FileSystem} from './file_system';
|
||||
|
||||
/**
|
||||
* A wrapper around the Node.js file-system (i.e the `fs` package).
|
||||
*/
|
||||
export class NodeJSFileSystem implements FileSystem {
|
||||
exists(path: AbsoluteFsPath): boolean { return fs.existsSync(path); }
|
||||
readFile(path: AbsoluteFsPath): string { return fs.readFileSync(path, 'utf8'); }
|
||||
writeFile(path: AbsoluteFsPath, data: string): void {
|
||||
return fs.writeFileSync(path, data, 'utf8');
|
||||
}
|
||||
readdir(path: AbsoluteFsPath): PathSegment[] { return fs.readdirSync(path) as PathSegment[]; }
|
||||
lstat(path: AbsoluteFsPath): fs.Stats { return fs.lstatSync(path); }
|
||||
stat(path: AbsoluteFsPath): fs.Stats { return fs.statSync(path); }
|
||||
pwd() { return AbsoluteFsPath.from(process.cwd()); }
|
||||
copyFile(from: AbsoluteFsPath, to: AbsoluteFsPath): void { cp(from, to); }
|
||||
moveFile(from: AbsoluteFsPath, to: AbsoluteFsPath): void { mv(from, to); }
|
||||
ensureDir(path: AbsoluteFsPath): void { mkdir('-p', path); }
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user