Skip to content

Commit f82f64e

Browse files
committed
Merge branch 'master' into asp5
Conflicts: dev-build-vs2015.bat
2 parents 5d48be6 + bb8e37e commit f82f64e

File tree

7 files changed

+85
-28
lines changed

7 files changed

+85
-28
lines changed

dev-build-vs2015.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@echo off
2-
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj /p:BuildType=Dev
2+
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj /p:BuildType=Dev
33
pause

src/React.JavaScriptEngine.ClearScriptV8/React.JavaScriptEngine.ClearScriptV8.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
@@ -35,6 +35,12 @@
3535
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3636
<DocumentationFile>..\..\bin\Release\React.JavaScriptEngine.ClearScriptV8\React.JavaScriptEngine.ClearScriptV8.XML</DocumentationFile>
3737
</PropertyGroup>
38+
<PropertyGroup>
39+
<SignAssembly>true</SignAssembly>
40+
</PropertyGroup>
41+
<PropertyGroup>
42+
<AssemblyOriginatorKeyFile>..\Key.snk</AssemblyOriginatorKeyFile>
43+
</PropertyGroup>
3844
<ItemGroup>
3945
<Reference Include="ClearScript">
4046
<HintPath>..\packages\JavaScriptEngineSwitcher.V8.1.2.1\lib\net40\ClearScript.dll</HintPath>

src/React.MSBuild/React.MSBuild.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
<NoWarn>1607</NoWarn>
3535
<DocumentationFile>..\..\bin\Release\React.MSBuild\React.MSBuild.XML</DocumentationFile>
3636
</PropertyGroup>
37+
<PropertyGroup>
38+
<SignAssembly>true</SignAssembly>
39+
</PropertyGroup>
40+
<PropertyGroup>
41+
<AssemblyOriginatorKeyFile>..\Key.snk</AssemblyOriginatorKeyFile>
42+
</PropertyGroup>
3743
<ItemGroup>
3844
<Reference Include="Microsoft.Build.Framework" />
3945
<Reference Include="Microsoft.Build.Utilities.v4.0" />

src/React.sln

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.31101.0
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.22512.0
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.Sample.Mvc4", "React.Sample.Mvc4\React.Sample.Mvc4.csproj", "{22796879-968A-4C26-9B4B-4C44792B36DB}"
7-
ProjectSection(ProjectDependencies) = postProject
8-
{AF531A37-B93F-4113-9C2C-4DB28064B926} = {AF531A37-B93F-4113-9C2C-4DB28064B926}
9-
EndProjectSection
10-
EndProject
116
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F567B25C-E869-4C93-9C96-077761250F87}"
127
EndProject
138
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{A51CE5B6-294F-4D39-B32B-BF08DAF9B40B}"
149
EndProject
1510
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{681C45FB-103C-48BC-B992-20C5B6B78F92}"
1611
EndProject
17-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React", "React\React.csproj", "{D0CC8A22-CEE6-485C-924B-1F94426FEA59}"
18-
EndProject
19-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.Tests", "React.Tests\React.Tests.csproj", "{D7C645EB-7B85-45D5-AAA6-CAD3DE704381}"
20-
EndProject
2112
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CB51F03F-49BD-4B79-8AD4-67962230E76B}"
2213
ProjectSection(SolutionItems) = preProject
2314
..\.gitignore = ..\.gitignore
@@ -31,6 +22,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CB51F03F
3122
template.nuspec = template.nuspec
3223
EndProjectSection
3324
EndProject
25+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{F2875D3A-0C8A-439B-B734-ECABA00AC629}"
26+
ProjectSection(SolutionItems) = preProject
27+
.nuget\packages.config = .nuget\packages.config
28+
EndProjectSection
29+
EndProject
30+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.Sample.Mvc4", "React.Sample.Mvc4\React.Sample.Mvc4.csproj", "{22796879-968A-4C26-9B4B-4C44792B36DB}"
31+
ProjectSection(ProjectDependencies) = postProject
32+
{AF531A37-B93F-4113-9C2C-4DB28064B926} = {AF531A37-B93F-4113-9C2C-4DB28064B926}
33+
EndProjectSection
34+
EndProject
35+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React", "React\React.csproj", "{D0CC8A22-CEE6-485C-924B-1F94426FEA59}"
36+
EndProject
37+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.Tests", "React.Tests\React.Tests.csproj", "{D7C645EB-7B85-45D5-AAA6-CAD3DE704381}"
38+
EndProject
3439
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.Web", "React.Web\React.Web.csproj", "{134EDD16-8DC8-4983-A2E0-B38DAB1ECF1C}"
3540
EndProject
3641
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.Web.Mvc4", "React.Web.Mvc4\React.Web.Mvc4.csproj", "{662D52AC-1EE9-4372-BD74-379F9AC56451}"
@@ -45,11 +50,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.Web.Mvc3", "React.Web
4550
EndProject
4651
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.MSBuild", "React.MSBuild\React.MSBuild.csproj", "{AF531A37-B93F-4113-9C2C-4DB28064B926}"
4752
EndProject
48-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{F2875D3A-0C8A-439B-B734-ECABA00AC629}"
49-
ProjectSection(SolutionItems) = preProject
50-
.nuget\packages.config = .nuget\packages.config
51-
EndProjectSection
52-
EndProject
5353
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.JavaScriptEngine.VroomJs", "React.JavaScriptEngine.VroomJs\React.JavaScriptEngine.VroomJs.csproj", "{B4A5902A-70E2-4FA4-817D-DCC78D31E9B9}"
5454
EndProject
5555
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.JavaScriptEngine.ClearScriptV8", "React.JavaScriptEngine.ClearScriptV8\React.JavaScriptEngine.ClearScriptV8.csproj", "{7FBE07B3-C7BA-48DA-8B53-0DB0BB82DA09}"

src/React/ReactEnvironment.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ public virtual string GetInitJavaScript()
313313
fullScript.Append(component.RenderJavaScript());
314314
fullScript.AppendLine(";");
315315
}
316+
317+
// Also propagate any server-side console.log calls to corresponding client-side calls.
318+
var consoleCalls = Execute<string>("console.getCalls()");
319+
fullScript.Append(consoleCalls);
320+
316321
return fullScript.ToString();
317322
}
318323

src/React/Resources/shims.js

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,33 @@
88
*/
99

1010
var global = global || {};
11-
// TODO: Handle errors "thrown" by console.error / console.warn?
12-
var console = console || {
13-
log: function () { },
14-
error: function () { },
15-
warn: function () { }
11+
12+
// Basic console shim. Caches all calls to console methods.
13+
function MockConsole() {
14+
this._calls = [];
15+
['log', 'error', 'warn', 'debug', 'info', 'dir', 'group', 'groupEnd', 'groupCollapsed'].forEach(function (methodName) {
16+
this[methodName] = this._handleCall.bind(this, methodName);
17+
}, this);
18+
}
19+
MockConsole.prototype = {
20+
_handleCall: function(methodName/*, ...args*/) {
21+
var serializedArgs = [];
22+
for (var i = 1; i < arguments.length; i++) {
23+
serializedArgs.push(JSON.stringify(arguments[i]));
24+
}
25+
this._calls.push({
26+
method: methodName,
27+
args: serializedArgs
28+
});
29+
},
30+
_formatCall: function(call) {
31+
return 'console.' + call.method + '("[.NET]", ' + call.args.join(', ') + ');';
32+
},
33+
getCalls: function() {
34+
return this._calls.map(this._formatCall).join('\n');
35+
}
1636
};
37+
var console = new MockConsole();
1738

1839
if (!Object.freeze) {
1940
Object.freeze = function() { };
@@ -32,11 +53,24 @@ function ReactNET_transform(input, harmony, stripTypes) {
3253

3354
function ReactNET_transform_sourcemap(input, harmony, stripTypes) {
3455
try {
35-
var result = global.JSXTransformer.transform(input, {
36-
harmony: !!harmony,
37-
stripTypes: !!stripTypes,
38-
sourceMap: true
39-
});
56+
var result;
57+
try {
58+
// First try to compile and generate a source map
59+
result = global.JSXTransformer.transform(input, {
60+
harmony: !!harmony,
61+
stripTypes: !!stripTypes,
62+
sourceMap: true
63+
});
64+
} catch (ex) {
65+
// It's possible an exception was thrown during the source map generation, and the
66+
// transform might actually work without a source map.
67+
result = global.JSXTransformer.transform(input, {
68+
harmony: !!harmony,
69+
stripTypes: !!stripTypes,
70+
sourceMap: false
71+
});
72+
}
73+
4074
if (!result.sourceMap) {
4175
return JSON.stringify({
4276
code: result.code,

src/System.Web.Optimization.React/System.Web.Optimization.React.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3737
<NoWarn>1607</NoWarn>
3838
</PropertyGroup>
39+
<PropertyGroup>
40+
<SignAssembly>true</SignAssembly>
41+
</PropertyGroup>
42+
<PropertyGroup>
43+
<AssemblyOriginatorKeyFile>..\Key.snk</AssemblyOriginatorKeyFile>
44+
</PropertyGroup>
3945
<ItemGroup>
4046
<Reference Include="Antlr3.Runtime">
4147
<HintPath>..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll</HintPath>

0 commit comments

Comments
 (0)