Skip to content

Commit bbc95e0

Browse files
committed
Merge remote-tracking branch 'refs/remotes/aspnet/dev' into dev
2 parents c81c19d + b71d139 commit bbc95e0

File tree

114 files changed

+1560
-676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1560
-676
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ npm-debug.log
3636
# repo have to be excluded here.
3737
/templates/*/node_modules/
3838
/templates/*/wwwroot/dist/
39+
.vscode/

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This repo contains:
2020
* A Yeoman generator that creates preconfigured app starting points ([guide](http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/))
2121
* Samples and docs
2222

23-
Everything here is cross-platform, and works with .NET Core 1.0 RC2 or later on Windows, Linux, or OS X.
23+
Everything here is cross-platform, and works with .NET Core 1.0 (RTM) or later on Windows, Linux, or OS X.
2424

2525
## Creating new applications
2626

@@ -69,8 +69,10 @@ Also in this repo, [the `samples` directory](https://github.com/aspnet/JavaScrip
6969
**To run the samples:**
7070

7171
* Clone this repo
72-
* Change directory to the same you want to run (e.g., `cd samples/angular/MusicStore`)
73-
* Restore dependencies (run `dotnet restore` and `npm install`)
72+
* At the repo's root directory (the one containing `src`, `samples`, etc.), run `dotnet restore`
73+
* Change directory to the sample you want to run (e.g., `cd samples/angular/MusicStore`)
74+
* Restore Node dependencies by running `npm install`
75+
* If you're trying to run the Angular 2 "Music Store" sample, then also run `gulp` (which you need to have installed globally). None of the other samples require this.
7476
* Run the application (`dotnet run`)
7577
* Browse to [http://localhost:5000](http://localhost:5000)
7678

samples/angular/MusicStore/Views/Home/Index.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
<cache vary-by="@Context.Request.Path">
66
<app asp-prerender-module="wwwroot/ng-app/boot-server">Loading...</app>
7-
@await Html.PrimeCache(Url.Action("GenreMenuList", "GenresApi"))
8-
@await Html.PrimeCache(Url.Action("MostPopular", "AlbumsApi"))
7+
@await Html.PrimeCacheAsync(Url.Action("GenreMenuList", "GenresApi"))
8+
@await Html.PrimeCacheAsync(Url.Action("MostPopular", "AlbumsApi"))
99
</cache>
1010

1111
@section scripts {

samples/misc/LatencyTest/Program.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using System.Threading.Tasks;
55
using Microsoft.AspNetCore.NodeServices;
6+
using Microsoft.Extensions.DependencyInjection;
67

78
namespace ConsoleApplication
89
{
@@ -12,7 +13,17 @@ namespace ConsoleApplication
1213
public class Program
1314
{
1415
public static void Main(string[] args) {
15-
using (var nodeServices = CreateNodeServices(NodeServicesOptions.DefaultNodeHostingModel)) {
16+
// Set up the DI system
17+
var services = new ServiceCollection();
18+
services.AddNodeServices(options => {
19+
options.HostingModel = NodeServicesOptions.DefaultNodeHostingModel;
20+
options.ProjectPath = Directory.GetCurrentDirectory();
21+
options.WatchFileExtensions = new string[] {}; // Don't watch anything
22+
});
23+
var serviceProvider = services.BuildServiceProvider();
24+
25+
// Now instantiate an INodeServices and use it
26+
using (var nodeServices = serviceProvider.GetRequiredService<INodeServices>()) {
1627
MeasureLatency(nodeServices).Wait();
1728
}
1829
}
@@ -34,13 +45,5 @@ private static async Task MeasureLatency(INodeServices nodeServices) {
3445
Console.WriteLine("\nTotal time: {0:F2} milliseconds", 1000 * elapsedSeconds);
3546
Console.WriteLine("\nTime per invocation: {0:F2} milliseconds", 1000 * elapsedSeconds / requestCount);
3647
}
37-
38-
private static INodeServices CreateNodeServices(NodeHostingModel hostingModel) {
39-
return Configuration.CreateNodeServices(new NodeServicesOptions {
40-
HostingModel = hostingModel,
41-
ProjectPath = Directory.GetCurrentDirectory(),
42-
WatchFileExtensions = new string[] {} // Don't watch anything
43-
});
44-
}
4548
}
4649
}

samples/misc/LatencyTest/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"version": "1.0.0",
99
"type": "platform"
1010
},
11-
"Microsoft.AspNetCore.NodeServices": "1.0.0-*"
11+
"Microsoft.AspNetCore.NodeServices": "1.0.0-*",
12+
"Microsoft.Extensions.DependencyInjection": "1.0.0"
1213
},
1314
"frameworks": {
1415
"netcoreapp1.0": {

samples/misc/Webpack/Webpack.xproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<ProjectGuid>a8905301-8492-42fd-9e83-f715a0fdc3a2</ProjectGuid>
1111
<RootNamespace>Webpack</RootNamespace>
1212
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
13-
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\JavaScriptServices.sln\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
13+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1414
</PropertyGroup>
1515
<PropertyGroup>
1616
<SchemaVersion>2.0</SchemaVersion>
1717
<DevelopmentServerPort>2018</DevelopmentServerPort>
1818
</PropertyGroup>
1919
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
20-
</Project>
20+
</Project>

samples/misc/Webpack/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = merge({
1010
},
1111
module: {
1212
loaders: [
13-
{ test: /\.ts(x?)$/, exclude: /node_modules/, loader: 'ts-loader' }
13+
{ test: /\.ts(x?)$/, exclude: /node_modules/, loader: 'ts-loader?silent' }
1414
],
1515
},
1616
entry: {

samples/react/MusicStore/MusicStore.xproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<ProjectGuid>c870a92c-9e3f-4bf2-82b8-5758545a8b7c</ProjectGuid>
1111
<RootNamespace>MusicStore</RootNamespace>
1212
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
13-
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\JavaScriptServices.sln\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
13+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1414
</PropertyGroup>
1515
<PropertyGroup>
1616
<SchemaVersion>2.0</SchemaVersion>
1717
<DevelopmentServerPort>2018</DevelopmentServerPort>
1818
</PropertyGroup>
1919
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
20-
</Project>
20+
</Project>

samples/react/ReactGrid/ReactApp/components/PeopleGrid.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import { fakeData } from '../data/fakeData.js';
55
import { columnMeta } from '../data/columnMeta.jsx';
66
const resultsPerPage = 10;
77

8+
// Griddle requires each row to have a property matching each column, even if you're not displaying
9+
// any data from the row in that column
10+
fakeData.forEach(row => { row.actions = ''; });
11+
812
export class PeopleGrid extends React.Component {
913
render() {
1014
var pageIndex = this.props.params ? (this.props.params.pageIndex || 1) - 1 : 0;

samples/react/ReactGrid/package.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,38 @@
22
"name": "ReactExample",
33
"version": "0.0.0",
44
"dependencies": {
5-
"babel-core": "^6.4.5",
6-
"bootstrap": "^3.3.5",
7-
"domain-task": "^2.0.0",
8-
"formsy-react": "^0.17.0",
9-
"formsy-react-components": "^0.6.3",
10-
"griddle-react": "^0.3.1",
11-
"history": "^1.12.6",
5+
"babel-core": "^6.13.2",
6+
"bootstrap": "^3.3.7",
7+
"domain-task": "^2.0.1",
8+
"formsy-react": "^0.18.1",
9+
"formsy-react-components": "^0.8.1",
10+
"griddle-react": "^0.6.1",
11+
"history": "^3.0.0",
1212
"memory-fs": "^0.3.0",
13-
"react": "^0.14.7",
14-
"react-dom": "^0.14.7",
15-
"react-router": "^2.0.0-rc5",
16-
"require-from-string": "^1.1.0",
13+
"react": "^15.3.0",
14+
"react-dom": "^15.3.0",
15+
"react-router": "^2.6.1",
16+
"require-from-string": "^1.2.0",
1717
"underscore": "^1.8.3",
1818
"webpack-externals-plugin": "^1.0.0"
1919
},
2020
"devDependencies": {
21-
"aspnet-prerendering": "^1.0.0",
22-
"aspnet-webpack": "^1.0.3",
21+
"aspnet-prerendering": "^1.0.4",
22+
"aspnet-webpack": "^1.0.9",
2323
"aspnet-webpack-react": "^1.0.1",
24-
"babel-loader": "^6.2.1",
25-
"babel-plugin-react-transform": "^2.0.0",
26-
"babel-preset-es2015": "^6.3.13",
27-
"babel-preset-react": "^6.3.13",
28-
"css-loader": "^0.21.0",
29-
"express": "^4.13.4",
30-
"extract-text-webpack-plugin": "^0.8.2",
31-
"file-loader": "^0.8.4",
32-
"react-transform-hmr": "^1.0.1",
33-
"style-loader": "^0.13.0",
34-
"url-loader": "^0.5.6",
35-
"webpack": "^1.12.2",
36-
"webpack-dev-middleware": "^1.5.1",
37-
"webpack-hot-middleware": "^2.6.4"
24+
"babel-loader": "^6.2.4",
25+
"babel-plugin-react-transform": "^2.0.2",
26+
"babel-preset-es2015": "^6.13.2",
27+
"babel-preset-react": "^6.11.1",
28+
"css-loader": "^0.23.1",
29+
"express": "^4.14.0",
30+
"extract-text-webpack-plugin": "^1.0.1",
31+
"file-loader": "^0.9.0",
32+
"react-transform-hmr": "^1.0.4",
33+
"style-loader": "^0.13.1",
34+
"url-loader": "^0.5.7",
35+
"webpack": "^1.13.1",
36+
"webpack-dev-middleware": "^1.6.1",
37+
"webpack-hot-middleware": "^2.12.2"
3838
}
3939
}

0 commit comments

Comments
 (0)