Skip to content

Commit 0360ad5

Browse files
Robert ZeniMarkPieszak
Robert Zeni
authored andcommitted
feat(angular6): upgrade .net core 2.1, bootstrap 4, ngx-bootsrap 3, rxjs 6, etc
closes #619
1 parent a019c9b commit 0360ad5

File tree

11 files changed

+152
-71
lines changed

11 files changed

+152
-71
lines changed

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"type": "coreclr",
2121
"request": "launch",
2222
"preLaunchTask": "build",
23-
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.0/Asp2017.dll",
23+
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.1/Asp2017.dll",
2424
"args": [],
2525
"cwd": "${workspaceRoot}",
2626
"stopAtEntry": false,
@@ -51,7 +51,7 @@
5151
"type": "coreclr",
5252
"request": "launch",
5353
"preLaunchTask": "build",
54-
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.0/Asp2017.dll",
54+
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.1/Asp2017.dll",
5555
"args": [],
5656
"cwd": "${workspaceRoot}",
5757
"stopAtEntry": false,
@@ -82,7 +82,7 @@
8282
"type": "coreclr",
8383
"request": "launch",
8484
"preLaunchTask": "build",
85-
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.0/Asp2017.dll",
85+
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.1/Asp2017.dll",
8686
"args": [],
8787
"cwd": "${workspaceRoot}",
8888
"stopAtEntry": false,

Asp2017.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.0</TargetFramework>
3+
<TargetFramework>netcoreapp2.1</TargetFramework>
44
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
55
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88
<ItemGroup>
99
<!-- New Meta Package has SpaServices in It -->
10-
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
11-
<PackageReference Include="NETStandard.Library" Version="2.0.0" />
12-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.0" />
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.0" />
14-
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
10+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0-rc1-final" />
11+
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
12+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.0-rc1-final" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.0-rc1-final" />
14+
<PackageReference Include="Swashbuckle.AspNetCore" Version="2.4.0" />
1515
</ItemGroup>
1616
<ItemGroup>
1717
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />

Asp2017.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27703.2018
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Asp2017", "Asp2017.csproj", "{BC28E9F7-E6EC-447D-AABD-17683BEAD625}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{BC28E9F7-E6EC-447D-AABD-17683BEAD625}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{BC28E9F7-E6EC-447D-AABD-17683BEAD625}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{BC28E9F7-E6EC-447D-AABD-17683BEAD625}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{BC28E9F7-E6EC-447D-AABD-17683BEAD625}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {DE341460-9041-458F-99D5-43FC7572CFA6}
24+
EndGlobalSection
25+
EndGlobal

ClientApp/app/app.module.browser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ORIGIN_URL, REQUEST } from '@nguniversal/aspnetcore-engine/tokens';
77
import { AppModuleShared } from './app.module';
88
import { AppComponent } from './app.component';
99
import { BrowserTransferStateModule } from '@angular/platform-browser';
10-
import { BrowserPrebootModule } from 'preboot/browser';
10+
import { PrebootModule } from 'preboot';
1111

1212
export function getOriginUrl() {
1313
return window.location.origin;
@@ -21,7 +21,7 @@ export function getRequest() {
2121
@NgModule({
2222
bootstrap: [AppComponent],
2323
imports: [
24-
BrowserPrebootModule.replayEvents(),
24+
PrebootModule.withConfig({ appRoot: 'app-root' }),
2525
BrowserAnimationsModule,
2626

2727
// Our Common AppModule

ClientApp/app/app.module.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AppModuleShared } from './app.module';
77
import { AppComponent } from './app.component';
88
import { ServerTransferStateModule } from '@angular/platform-server';
99

10-
import { ServerPrebootModule } from 'preboot/server';
10+
import { PrebootModule } from 'preboot';
1111

1212
@NgModule({
1313
bootstrap: [AppComponent],
@@ -16,7 +16,7 @@ import { ServerPrebootModule } from 'preboot/server';
1616
AppModuleShared,
1717

1818
ServerModule,
19-
ServerPrebootModule.recordEvents({ appRoot: 'app-root' }),
19+
PrebootModule.withConfig({ appRoot: 'app-root' }),
2020
NoopAnimationsModule,
2121

2222
// HttpTransferCacheModule still needs fixes for 5.0

ClientApp/app/containers/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h2>{{ 'HOME_FEATURE_LIST_TITLE' | translate }} </h2>
1212
<ul>
1313
<li>ASP.NET Core 2.0 :: ( Visual Studio 2017 )</li>
1414
<li>
15-
Angular 5.* front-end UI framework
15+
Angular 6.* front-end UI framework
1616
<ul>
1717
<li>Angular **platform-server** (aka: Universal) - server-side rendering for SEO, deep-linking, and
1818
incredible performance.</li>

ClientApp/app/containers/users/users.component.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import {
2-
Component, OnInit,
3-
// animation imports
4-
trigger, state, style, transition, animate, Inject
2+
Component, OnInit, Inject
53
} from '@angular/core';
4+
import {
5+
trigger,
6+
state,
7+
style,
8+
animate,
9+
transition
10+
} from '@angular/animations';
611
import { IUser } from '../../models/User';
712
import { UserService } from '../../shared/user.service';
813

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# ASP.NET Core 2.0 & Angular 5(+) Advanced Starter - with Server-side prerendering (for Angular SEO)!
1+
# ASP.NET Core 2.0 & Angular 6(+) Advanced Starter - with Server-side prerendering (for Angular SEO)!
22

33
## By [DevHelp.Online](http://www.DevHelp.Online)
44

5-
> Updated to the latest Angular 5.x
5+
> Updated to the latest Angular 6.x
66
77
> Note ServerTransferModule still in the works - fix coming soon
88
@@ -81,7 +81,7 @@ This utilizes all the latest standards, no gulp, no bower, no typings, no manual
8181
- Codelyzer (for Real-time static code analysis)
8282
- VSCode & Atom provide real-time analysis out of the box.
8383

84-
- **ASP.NET Core 2.0**
84+
- **ASP.NET Core 2.1**
8585

8686
- Integration with NodeJS to provide pre-rendering, as well as any other Node module asset you want to use.
8787

@@ -113,7 +113,7 @@ This utilizes all the latest standards, no gulp, no bower, no typings, no manual
113113

114114
### Visual Studio 2017
115115

116-
Make sure you have .NET Core 2.0 installed and/or VS2017 15.3.
116+
Make sure you have .NET Core 2.1 installed and/or VS2017 15.3.
117117
VS2017 will automatically install all the neccessary npm & .NET dependencies when you open the project.
118118

119119
Simply push F5 to start debugging !

package.json

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,65 +16,65 @@
1616
"clean": "rimraf wwwroot/dist clientapp/dist"
1717
},
1818
"dependencies": {
19-
"@angular/animations": "^5.0.0",
20-
"@angular/common": "^5.0.0",
21-
"@angular/compiler": "^5.0.0",
22-
"@angular/core": "^5.0.0",
23-
"@angular/forms": "^5.0.0",
24-
"@angular/http": "^5.0.0",
25-
"@angular/platform-browser": "^5.0.0",
26-
"@angular/platform-browser-dynamic": "^5.0.0",
27-
"@angular/platform-server": "^5.0.0",
28-
"@angular/router": "^5.0.0",
29-
"@nguniversal/aspnetcore-engine": "^5.0.0-beta.8",
30-
"@nguniversal/common": "^5.0.0-beta.8",
31-
"@ngx-translate/core": "^9.1.1",
32-
"@ngx-translate/http-loader": "^2.0.1",
33-
"@types/node": "^7.0.12",
19+
"@angular/animations": "^6.0.3",
20+
"@angular/common": "^6.0.3",
21+
"@angular/compiler": "^6.0.3",
22+
"@angular/core": "^6.0.3",
23+
"@angular/forms": "^6.0.3",
24+
"@angular/http": "^6.0.3",
25+
"@angular/platform-browser": "^6.0.3",
26+
"@angular/platform-browser-dynamic": "^6.0.3",
27+
"@angular/platform-server": "^6.0.3",
28+
"@angular/router": "^6.0.3",
29+
"@nguniversal/aspnetcore-engine": "^6.0.0",
30+
"@nguniversal/common": "^6.0.0",
31+
"@ngx-translate/core": "^10.0.2",
32+
"@ngx-translate/http-loader": "^3.0.1",
33+
"@types/node": "^10.1.2",
3434
"angular2-router-loader": "^0.3.5",
3535
"angular2-template-loader": "^0.6.2",
3636
"aspnet-prerendering": "^3.0.1",
3737
"aspnet-webpack": "^2.0.3",
38-
"awesome-typescript-loader": "^3.2.3",
38+
"awesome-typescript-loader": "^5.0.0",
3939
"bootstrap": "^4.1.1",
4040
"bootstrap-sass": "^3.3.7",
4141
"core-js": "^2.5.6",
4242
"css": "^2.2.3",
4343
"css-loader": "^0.28.11",
4444
"event-source-polyfill": "^0.0.12",
4545
"expose-loader": "^0.7.5",
46-
"extract-text-webpack-plugin": "^3.0.2",
4746
"file-loader": "^1.1.11",
4847
"html-loader": "^0.5.5",
4948
"isomorphic-fetch": "^2.2.1",
5049
"jquery": "^3.3.1",
5150
"json-loader": "^0.5.7",
52-
"moment": "2.18.1",
53-
"ngx-bootstrap": "2.0.5",
51+
"moment": "2.22.1",
52+
"ngx-bootstrap": "^3.0.0",
5453
"node-sass": "^4.9.0",
55-
"preboot": "^5.0.0",
54+
"preboot": "^6.0.0-beta.4",
5655
"raw-loader": "^0.5.1",
5756
"rimraf": "^2.6.2",
58-
"rxjs": "^6.1.0",
59-
"rxjs-compat": "^6.1.0",
60-
"sass-loader": "^6.0.6",
61-
"style-loader": "^0.18.2",
57+
"rxjs": "^6.2.0",
58+
"rxjs-compat": "^6.2.0",
59+
"sass-loader": "^7.0.1",
60+
"style-loader": "^0.21.0",
6261
"to-string-loader": "^1.1.5",
6362
"typescript": "~2.7.2",
6463
"url-loader": "^1.0.1",
65-
"webpack": "^3.6.0",
66-
"webpack-hot-middleware": "^2.22.1",
67-
"webpack-merge": "^4.1.0",
64+
"webpack": "^4.9.1",
65+
"webpack-hot-middleware": "^2.22.2",
66+
"webpack-merge": "^4.1.2",
6867
"zone.js": "^0.8.26"
6968
},
7069
"devDependencies": {
71-
"@angular/cli": "^1.7.0-beta.1",
72-
"@angular/compiler-cli": "^5.2.1",
73-
"@ngtools/webpack": "^1.9.0",
70+
"@angular/cli": "^6.0.5",
71+
"@angular/compiler-cli": "6.0.3",
72+
"@ngtools/webpack": "^6.0.5",
7473
"@types/chai": "^4.1.3",
7574
"@types/jasmine": "^2.8.7",
7675
"chai": "^4.1.2",
7776
"codelyzer": "^3.1.2",
77+
"extract-text-webpack-plugin": "^4.0.0-beta.0",
7878
"istanbul-instrumenter-loader": "^3.0.1",
7979
"jasmine-core": "^2.5.2",
8080
"karma": "^1.7.1",
@@ -88,6 +88,8 @@
8888
"karma-sourcemap-loader": "^0.3.7",
8989
"karma-webpack": "^2.0.4",
9090
"tslint": "^5.10.0",
91-
"webpack-bundle-analyzer": "^2.12.0"
91+
"uglifyjs-webpack-plugin": "^1.2.5",
92+
"webpack-bundle-analyzer": "^2.13.1",
93+
"webpack-cli": "^2.1.4"
9294
}
9395
}

webpack.config.js

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = (env) => {
2121
// Configuration in common to both client-side and server-side bundles
2222
const isDevBuild = !(env && env.prod);
2323
const sharedConfig = {
24+
mode: isDevBuild ? "development" : "production",
2425
stats: { modules: false },
2526
context: __dirname,
2627
resolve: { extensions: [ '.js', '.ts' ] },
@@ -64,16 +65,26 @@ module.exports = (env) => {
6465
tsConfigPath: './tsconfig.json',
6566
entryModule: path.join(__dirname, 'ClientApp/app/app.module.browser#AppModule'),
6667
exclude: ['./**/*.server.ts']
67-
}),
68-
new webpack.optimize.UglifyJsPlugin({
69-
output: {
70-
ascii_only: true,
71-
}
72-
}),
68+
})
7369
]),
7470
devtool: isDevBuild ? 'cheap-eval-source-map' : false,
7571
node: {
7672
fs: "empty"
73+
},
74+
optimization: {
75+
minimizer: [].concat(isDevBuild ? [] : [
76+
// we specify a custom UglifyJsPlugin here to get source maps in production
77+
new UglifyJsPlugin({
78+
cache: true,
79+
parallel: true,
80+
uglifyOptions: {
81+
compress: false,
82+
ecma: 6,
83+
mangle: true
84+
},
85+
sourceMap: true
86+
})
87+
])
7788
}
7889
});
7990

@@ -105,13 +116,6 @@ module.exports = (env) => {
105116
{}
106117
)
107118
] : [
108-
new webpack.optimize.UglifyJsPlugin({
109-
mangle: false,
110-
compress: false,
111-
output: {
112-
ascii_only: true,
113-
}
114-
}),
115119
// Plugins that apply in production builds only
116120
new AngularCompilerPlugin({
117121
mainPath: path.join(__dirname, 'ClientApp/boot.server.PRODUCTION.ts'),
@@ -126,7 +130,22 @@ module.exports = (env) => {
126130
},
127131
target: 'node',
128132
// switch to "inline-source-map" if you want to debug the TS during SSR
129-
devtool: isDevBuild ? 'cheap-eval-source-map' : false
133+
devtool: isDevBuild ? 'cheap-eval-source-map' : false,
134+
optimization: {
135+
minimizer: [].concat(isDevBuild ? [] : [
136+
// we specify a custom UglifyJsPlugin here to get source maps in production
137+
new UglifyJsPlugin({
138+
cache: true,
139+
parallel: true,
140+
uglifyOptions: {
141+
compress: false,
142+
ecma: 6,
143+
mangle: true
144+
},
145+
sourceMap: true
146+
})
147+
])
148+
}
130149
});
131150

132151
return [clientBundleConfig, serverBundleConfig];

0 commit comments

Comments
 (0)