Skip to content

Commit 3ffb237

Browse files
Splaktarjelbourn
authored andcommittedOct 7, 2019
feat: update to 9.0.0-next.x and enable Ivy rendering engine (#645)
* fix(stack-blitz): add more configuration files to the template allow the exported/downloaded project from StackBlitz to be functional - move files into /src and /src/app to match a normal configuration rename Stackblitz to StackBlitz use StackBlitz logo to launch examples use a relative URL for downloading `versions.json` update Ivy fix for VersionPicker log errors during app bootstrap in StackBlitz switch StackBlitz examples to SCSS fix lint warnings in deploy script add ignores for Firebase Fixes #623. Fixes #629. Relates to #642. * migrate workspace for @angular/core@9.0.0-beta Decorates all declared undecorated provider classes with @Injectable * feat: update to 9.0.0-next.x and enable Ivy rendering engine add 9.0.0-next.0 to versions list - point it to material2-docs-dev for now * fix(ci): update docker image to latest CircleCI NodeJS LTS the prior version used `yarn@1.10.1` - @angular-devkit/build-angular@0.900.0-next.8 throws an error - Expected version ">= 1.13.0". Got "1.10.1" * refactor(tools): convert deploy script from npm to yarn re-enable Angular CLI's build-optimizer
1 parent b14539b commit 3ffb237

34 files changed

+1036
-565
lines changed
 

‎material.angular.io/.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cache key for CircleCI. We want to invalidate the cache whenever the Yarn lock file changes.
22
var_1: &cache_key material-angular-io-{{ checksum "yarn.lock" }}
3-
var_2: &default_docker_image circleci/node:10.12-browsers
3+
var_2: &default_docker_image circleci/node:10.16.3-browsers
44

55
# Settings common to each job
66
var_3: &job_defaults

‎material.angular.io/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ speed-measure-plugin*.json
4040
npm-debug.log
4141
yarn-error.log
4242
testem.log
43+
firebase-debug.log
44+
.firebase/
4345
/typings
4446

4547
#System Files

‎material.angular.io/angular.json

+18-9
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,36 @@
4646
"input": "src/highlightjs/material-light.scss"
4747
},
4848
{
49+
"inject": false,
4950
"input": "src/assets/pink-bluegrey.css",
50-
"lazy": true,
5151
"bundleName": "pink-bluegrey"
5252
},
5353
{
54+
"inject": false,
5455
"input": "src/assets/deeppurple-amber.css",
55-
"lazy": true,
5656
"bundleName": "deeppurple-amber"
5757
},
5858
{
59+
"inject": false,
5960
"input": "src/assets/indigo-pink.css",
60-
"lazy": true,
6161
"bundleName": "indigo-pink"
6262
},
6363
{
64+
"inject": false,
6465
"input": "src/assets/purple-green.css",
65-
"lazy": true,
6666
"bundleName": "purple-green"
6767
}
6868
],
6969
"scripts": []
7070
},
7171
"configurations": {
7272
"production": {
73+
"budgets": [
74+
{
75+
"type": "anyComponentStyle",
76+
"maximumWarning": "6kb"
77+
}
78+
],
7379
"optimization": true,
7480
"outputHashing": "all",
7581
"sourceMap": false,
@@ -121,23 +127,23 @@
121127
"input": "src/highlightjs/material-light.scss"
122128
},
123129
{
130+
"inject": false,
124131
"input": "src/assets/pink-bluegrey.css",
125-
"lazy": true,
126132
"bundleName": "pink-bluegrey"
127133
},
128134
{
135+
"inject": false,
129136
"input": "src/assets/deeppurple-amber.css",
130-
"lazy": true,
131137
"bundleName": "deeppurple-amber"
132138
},
133139
{
140+
"inject": false,
134141
"input": "src/assets/indigo-pink.css",
135-
"lazy": true,
136142
"bundleName": "indigo-pink"
137143
},
138144
{
145+
"inject": false,
139146
"input": "src/assets/purple-green.css",
140-
"lazy": true,
141147
"bundleName": "purple-green"
142148
}
143149
],
@@ -182,5 +188,8 @@
182188
}
183189
}
184190
}
191+
},
192+
"cli": {
193+
"analytics": "cf155f04-1636-4df9-9ce2-870ba25ad38d"
185194
}
186-
}
195+
}

‎material.angular.io/package.json

+19-18
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"pree2e": "webdriver-manager update",
1414
"e2e": "yarn build-themes && ng e2e",
1515
"build": "yarn build-themes && ng build",
16+
"build:content": "yarn upgrade @angular/material-examples",
1617
"build:highmem": "yarn build-themes && node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build",
1718
"build:sm": "ng build --prod --source-map",
1819
"build-themes": "bash ./tools/build-themes.sh",
@@ -24,33 +25,33 @@
2425
},
2526
"private": true,
2627
"dependencies": {
27-
"@angular/animations": "^8.2.9",
28-
"@angular/cdk": "^8.2.2",
29-
"@angular/cdk-experimental": "^8.2.2",
30-
"@angular/common": "^8.2.9",
31-
"@angular/compiler": "^8.2.9",
32-
"@angular/core": "^8.2.9",
33-
"@angular/forms": "^8.2.9",
34-
"@angular/material": "^8.2.2",
28+
"@angular/animations": "^9.0.0-next.9",
29+
"@angular/cdk": "^9.0.0-next.0",
30+
"@angular/cdk-experimental": "^9.0.0-next.0",
31+
"@angular/common": "^9.0.0-next.9",
32+
"@angular/compiler": "^9.0.0-next.9",
33+
"@angular/core": "^9.0.0-next.9",
34+
"@angular/forms": "^9.0.0-next.9",
35+
"@angular/material": "^9.0.0-next.0",
3536
"@angular/material-examples": "angular/material2-docs-content",
36-
"@angular/material-experimental": "^8.2.2",
37-
"@angular/material-moment-adapter": "^8.2.2",
38-
"@angular/platform-browser": "^8.2.9",
39-
"@angular/platform-browser-dynamic": "^8.2.9",
40-
"@angular/router": "^8.2.9",
37+
"@angular/material-experimental": "^9.0.0-next.0",
38+
"@angular/material-moment-adapter": "^9.0.0-next.0",
39+
"@angular/platform-browser": "^9.0.0-next.9",
40+
"@angular/platform-browser-dynamic": "^9.0.0-next.9",
41+
"@angular/router": "^9.0.0-next.9",
4142
"core-js": "^2.6.9",
4243
"hammerjs": "^2.0.8",
4344
"material-components-web": "^4.0.0-alpha.0",
4445
"moment": "^2.24.0",
4546
"rxjs": "^6.5.3",
46-
"zone.js": "^0.9.1"
47+
"zone.js": "~0.10.2"
4748
},
4849
"devDependencies": {
49-
"@angular-devkit/build-angular": "^0.803.6",
50-
"@angular/cli": "^8.3.6",
51-
"@angular/compiler-cli": "^8.2.9",
50+
"@angular-devkit/build-angular": "~0.900.0-next.8",
51+
"@angular/cli": "^9.0.0-next.8",
52+
"@angular/compiler-cli": "^9.0.0-next.9",
5253
"@types/jasmine": "^3.4.1",
53-
"@types/node": "^12.7.8",
54+
"@types/node": "^12.7.11",
5455
"firebase-tools": "^7.4.0",
5556
"jasmine-core": "^3.5.0",
5657
"jasmine-spec-reporter": "~4.2.1",

‎material.angular.io/src/app/app-module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {ComponentHeaderModule} from './pages/component-page-header/component-pag
2020
import {StyleManager} from './shared/style-manager';
2121
import {SvgViewerModule} from './shared/svg-viewer/svg-viewer';
2222
import {ThemePickerModule} from './shared/theme-picker';
23-
import {StackblitzButtonModule} from './shared/stackblitz';
23+
import {StackBlitzButtonModule} from './shared/stack-blitz';
2424
import {NavBarModule} from './shared/navbar';
2525
import {ThemeStorage} from './shared/theme-picker/theme-storage/theme-storage';
2626
import {GuideItems} from './shared/guide-items/guide-items';
@@ -58,7 +58,7 @@ import {GaService} from './shared/ga/ga';
5858
GuideViewerModule,
5959
HomepageModule,
6060
NavBarModule,
61-
StackblitzButtonModule,
61+
StackBlitzButtonModule,
6262
SvgViewerModule,
6363
ThemePickerModule,
6464
],

‎material.angular.io/src/app/shared/doc-viewer/doc-viewer-module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {DocViewer} from './doc-viewer';
22
import {ExampleViewer} from '../example-viewer/example-viewer';
3-
import {StackblitzButtonModule} from '../stackblitz/stackblitz-button';
3+
import {StackBlitzButtonModule} from '../stack-blitz/stack-blitz-button';
44
import {MatButtonModule} from '@angular/material/button';
55
import {MatIconModule} from '@angular/material/icon';
66
import {MatSnackBarModule} from '@angular/material/snack-bar';
@@ -23,7 +23,7 @@ import {CopierService} from '../copier/copier.service';
2323
MatTabsModule,
2424
CommonModule,
2525
PortalModule,
26-
StackblitzButtonModule
26+
StackBlitzButtonModule
2727
],
2828
providers: [CopierService],
2929
declarations: [DocViewer, ExampleViewer, HeaderLink],

‎material.angular.io/src/app/shared/example-viewer/example-viewer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</mat-icon>
1313
</button>
1414

15-
<stackblitz-button [example]="example"></stackblitz-button>
15+
<stack-blitz-button [example]="example"></stack-blitz-button>
1616
</div>
1717

1818
<div class="docs-example-viewer-source" *ngIf="showSource">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './stack-blitz-button';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div [matTooltip]="isDisabled ? 'Building StackBlitz example...' : 'Edit in StackBlitz'">
2+
<button mat-icon-button type="button"
3+
(click)="openStackBlitz()"
4+
[disabled]="isDisabled">
5+
<mat-icon>
6+
<svg width='24px' height='24px' viewBox='0 -3 23 40' version='1.1'
7+
xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
8+
<title>StackBlitz Logo</title>
9+
<desc>Created with Sketch.</desc>
10+
<g id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'>
11+
<g fill='#1389FD' fill-rule='nonzero'>
12+
<polygon id='Path'
13+
points='0 19.9187087 9.87007874 19.9187087 4.12007874 34 23 13.9612393 13.0846457 13.9612393 18.7893701 0'>
14+
</polygon>
15+
</g>
16+
</g>
17+
</svg>
18+
</mat-icon>
19+
</button>
20+
</div>
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,60 @@
11
import {Component, Input, NgModule} from '@angular/core';
2-
import {StackblitzWriter} from './stackblitz-writer';
32
import {ExampleData} from '@angular/material-examples';
43
import {MatButtonModule} from '@angular/material/button';
54
import {MatIconModule} from '@angular/material/icon';
65
import {MatTooltipModule} from '@angular/material/tooltip';
6+
import {StackBlitzWriter} from './stack-blitz-writer';
77

88
@Component({
9-
selector: 'stackblitz-button',
10-
templateUrl: './stackblitz-button.html',
11-
providers: [StackblitzWriter],
9+
selector: 'stack-blitz-button',
10+
templateUrl: './stack-blitz-button.html',
11+
providers: [StackBlitzWriter],
1212
host: {
13-
'(mouseover)': 'isDisabled = !stackblitzForm'
13+
'(mouseover)': 'isDisabled = !stackBlitzForm'
1414
}
1515
})
16-
export class StackblitzButton {
16+
export class StackBlitzButton {
1717
/**
18-
* The button becomes disabled if the user hovers over the button before the stackblitz form
18+
* The button becomes disabled if the user hovers over the button before the StackBlitz form
1919
* is created. After the form is created, the button becomes enabled again.
2020
* The form creation usually happens extremely quickly, but we handle the case of the
21-
* stackblitz not yet being ready for people with poor network connections or slow devices.
21+
* StackBlitz not yet being ready for people with poor network connections or slow devices.
2222
*/
2323
isDisabled = false;
24-
stackblitzForm: HTMLFormElement;
24+
stackBlitzForm: HTMLFormElement;
2525

2626
@Input()
2727
set example(example: string) {
2828
const exampleData = new ExampleData(example);
2929

3030
if (example) {
31-
this.stackblitzWriter.constructStackblitzForm(exampleData).then(stackblitzForm => {
32-
this.stackblitzForm = stackblitzForm;
31+
this.stackBlitzWriter.constructStackBlitzForm(exampleData)
32+
.then((stackBlitzForm: HTMLFormElement) => {
33+
this.stackBlitzForm = stackBlitzForm;
3334
this.isDisabled = false;
3435
});
3536
} else {
3637
this.isDisabled = true;
3738
}
3839
}
3940

40-
constructor(private stackblitzWriter: StackblitzWriter) {}
41+
constructor(private stackBlitzWriter: StackBlitzWriter) {}
4142

42-
openStackblitz(): void {
43+
openStackBlitz(): void {
4344
// When the form is submitted, it must be in the document body. The standard of forms is not
4445
// to submit if it is detached from the document. See the following chromium commit for
4546
// more details:
4647
// https://chromium.googlesource.com/chromium/src/+/962c2a22ddc474255c776aefc7abeba00edc7470%5E!
47-
document.body.appendChild(this.stackblitzForm);
48-
this.stackblitzForm.submit();
49-
document.body.removeChild(this.stackblitzForm);
48+
document.body.appendChild(this.stackBlitzForm);
49+
this.stackBlitzForm.submit();
50+
document.body.removeChild(this.stackBlitzForm);
5051
}
5152
}
5253

5354
@NgModule({
5455
imports: [MatTooltipModule, MatButtonModule, MatIconModule],
55-
exports: [StackblitzButton],
56-
declarations: [StackblitzButton],
57-
providers: [StackblitzWriter],
56+
exports: [StackBlitzButton],
57+
declarations: [StackBlitzButton],
58+
providers: [StackBlitzWriter],
5859
})
59-
export class StackblitzButtonModule {}
60+
export class StackBlitzButtonModule {}

0 commit comments

Comments
 (0)
Please sign in to comment.