Skip to content

Commit 0727604

Browse files
committedOct 17, 2015
Upgrade to ASP.NET 5 Beta 8. reactjs#171
1 parent 5378776 commit 0727604

File tree

8 files changed

+48
-35
lines changed

8 files changed

+48
-35
lines changed
 

‎appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ os: Visual Studio 2015
33
install:
44
- set PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin;%PATH%
55
- dnvm update-self
6-
- dnvm install 1.0.0-beta7
6+
- dnvm install 1.0.0-beta8
77
build:
88
project: build.proj
99
verbosity: normal

‎src/React.AspNet/BabelFileSystem.cs

+9-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using IOwinFileSystem = Microsoft.Owin.FileSystems.IFileSystem;
1818
#else
1919
using Microsoft.AspNet.FileProviders;
20-
using Microsoft.Framework.Caching;
20+
using Microsoft.Framework.Primitives;
2121
using IOwinFileSystem = Microsoft.AspNet.FileProviders.IFileProvider;
2222
using PhysicalFileSystem = Microsoft.AspNet.FileProviders.PhysicalFileProvider;
2323
#endif
@@ -129,21 +129,23 @@ public IDirectoryContents GetDirectoryContents(string subpath)
129129
}
130130

131131
/// <summary>
132-
/// Creates a change trigger with the specified filter.
132+
/// Creates a <see cref="T:Microsoft.Framework.Primitives.IChangeToken"/> for the
133+
/// specified <paramref name="filter"/>.
133134
/// </summary>
134135
/// <param name="filter">
135-
/// Filter string used to determine what files or folders to monitor. Example: **/*.cs, *.*, subFolder/**/*.cshtml.
136-
/// </param>
136+
/// Filter string used to determine what files or folders to monitor.
137+
/// Example: **/*.cs, *.*, subFolder/**/*.cshtml.</param>
137138
/// <returns>
138-
/// An <see cref="IExpirationTrigger"/> that is triggered when a file matching <paramref name="filter"/> is added, modified or deleted.
139+
/// An <see cref="T:Microsoft.Framework.Primitives.IChangeToken"/> that is notified
140+
/// when a file matching <paramref name="filter"/> is added, modified or deleted.
139141
/// </returns>
140-
IExpirationTrigger IOwinFileSystem.Watch(string filter)
142+
public IChangeToken Watch(string filter)
141143
{
142144
return _physicalFileSystem.Watch(filter);
143145
}
144146
#endif
145147

146-
private class BabelFileInfo : IFileInfo
148+
private class BabelFileInfo : IFileInfo
147149
{
148150
private readonly IBabel _babel;
149151
private readonly IFileInfo _fileInfo;

‎src/React.AspNet/HtmlHelperExtensions.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,16 @@ public static IHtmlString ReactWithInit<T>(
116116
reactComponent.ContainerTag = htmlTag;
117117
}
118118
var html = reactComponent.RenderHtml(clientOnly);
119+
120+
#if LEGACYASPNET
119121
var script = new TagBuilder("script")
120122
{
121-
#if LEGACYASPNET
122123
InnerHtml = reactComponent.RenderJavaScript()
124+
};
123125
#else
124-
InnerHtml = new HtmlString(reactComponent.RenderJavaScript())
126+
var script = new TagBuilder("script");
127+
script.InnerHtml.AppendEncoded(reactComponent.RenderJavaScript());
125128
#endif
126-
};
127129
return new HtmlString(html + System.Environment.NewLine + script.ToString());
128130
}
129131

@@ -142,10 +144,8 @@ public static IHtmlString ReactInitJavaScript(this IHtmlHelper htmlHelper)
142144
};
143145
return new HtmlString(tag.ToString());
144146
#else
145-
var tag = new TagBuilder("script")
146-
{
147-
InnerHtml = new HtmlString(script)
148-
};
147+
var tag = new TagBuilder("script");
148+
tag.InnerHtml.AppendEncoded(script);
149149
return tag;
150150
#endif
151151
}

‎src/React.AspNet/project.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
},
1717
"dependencies": {
1818
"JsPool": "0.3.0",
19-
"Microsoft.Framework.DependencyInjection": "1.0.0-beta7",
20-
"Microsoft.AspNet.Mvc.Core": "6.0.0-beta7",
21-
"Microsoft.AspNet.StaticFiles": "1.0.0-beta7",
22-
"Microsoft.AspNet.FileProviders.Physical": "1.0.0-beta7",
23-
"Microsoft.AspNet.Mvc.ViewFeatures": "6.0.0-beta7",
19+
"Microsoft.Framework.DependencyInjection": "1.0.0-beta8",
20+
"Microsoft.AspNet.Mvc.Core": "6.0.0-beta8",
21+
"Microsoft.AspNet.StaticFiles": "1.0.0-beta8",
22+
"Microsoft.AspNet.FileProviders.Physical": "1.0.0-beta8",
23+
"Microsoft.AspNet.Mvc.ViewFeatures": "6.0.0-beta8",
2424
"MsieJavaScriptEngine": "1.5.1",
2525
"React.Core": "",
2626
"JavaScriptEngineSwitcher.Core": "1.2.4.0",

‎src/React.Sample.Mvc6/Startup.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ public class Startup
2222
public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
2323
{
2424
// Setup configuration sources.
25-
var builder = new ConfigurationBuilder(appEnv.ApplicationBasePath)
26-
.AddEnvironmentVariables();
25+
var builder = new ConfigurationBuilder().AddEnvironmentVariables();
2726

2827
Configuration = builder.Build();
2928
}
@@ -44,20 +43,23 @@ public void ConfigureServices(IServiceCollection services)
4443
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerfactory)
4544
{
4645
// Configure the HTTP request pipeline.
46+
// Add the platform handler to the request pipeline.
47+
app.UseIISPlatformHandler();
48+
4749
// Add the console logger.
4850
loggerfactory.AddConsole();
4951

5052
// Add the following to the request pipeline only in development environment.
5153
if (env.IsDevelopment())
5254
{
5355
//app.UseBrowserLink();
54-
app.UseErrorPage();
56+
app.UseDeveloperExceptionPage();
5557
}
5658
else
5759
{
5860
// Add Error handling middleware which catches all application specific errors and
5961
// send the request to the following path or controller action.
60-
app.UseErrorHandler("/Home/Error");
62+
app.UseExceptionHandler("/Home/Error");
6163
}
6264

6365
// Initialise ReactJS.NET. Must be before static files.

‎src/React.Sample.Mvc6/project.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
"webroot": "wwwroot",
33
"version": "2.0.0-*",
44
"dependencies": {
5-
"Microsoft.AspNet.Mvc": "6.0.0-beta7",
6-
"Microsoft.AspNet.Diagnostics": "1.0.0-beta7",
7-
"Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
8-
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta7",
9-
"Microsoft.AspNet.StaticFiles": "1.0.0-beta7",
10-
"Microsoft.Framework.Configuration.EnvironmentVariables": "1.0.0-beta7",
11-
"Microsoft.Framework.Configuration.Json": "1.0.0-beta7",
12-
"Microsoft.Framework.Logging": "1.0.0-beta7",
13-
"Microsoft.Framework.Logging.Console": "1.0.0-beta7",
5+
"Microsoft.AspNet.Mvc": "6.0.0-beta8",
6+
"Microsoft.AspNet.Diagnostics": "1.0.0-beta8",
7+
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-beta8",
8+
"Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8",
9+
"Microsoft.AspNet.StaticFiles": "1.0.0-beta8",
10+
"Microsoft.Framework.Configuration.EnvironmentVariables": "1.0.0-beta8",
11+
"Microsoft.Framework.Configuration.Json": "1.0.0-beta8",
12+
"Microsoft.Framework.Logging": "1.0.0-beta8",
13+
"Microsoft.Framework.Logging.Console": "1.0.0-beta8",
1414
"React.AspNet": "",
1515
"React.Core": "",
1616
"JavaScriptEngineSwitcher.V8": "1.2.4.0",
1717
"JavaScriptEngineSwitcher.Msie": "1.2.4.0"
1818
},
1919
"commands": {
20-
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
20+
"web": "Microsoft.AspNet.Server.Kestrel",
2121
"gen": "Microsoft.Framework.CodeGeneration"
2222
},
2323
"frameworks": {
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<system.webServer>
4+
<handlers>
5+
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
6+
</handlers>
7+
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" forwardWindowsAuthToken="false" startupTimeLimit="3600" />
8+
</system.webServer>
9+
</configuration>

‎src/global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"wrap"
44
],
55
"sdk": {
6-
"version": "1.0.0-beta7"
6+
"version": "1.0.0-beta8"
77
},
88
"projects": [
99
"wrap"

0 commit comments

Comments
 (0)