Compare commits

..

34 Commits

Author SHA1 Message Date
Steve Sanderson
117c1a6cbd Implement workaround for #1066 2017-06-26 12:51:03 +01:00
Steve Sanderson
53f5a77490 Use preview2-final NuGet feed until it ships to NuGet.org 2017-06-23 12:08:14 +01:00
Steve Sanderson
5fd9b93324 Switch to a specific version of .NET Core 2.0 Preview 2, because "latest" is 2.1 and breaks. Fixes #1058 2017-06-23 11:59:34 +01:00
Scott Addie
55bd0c05cb Update SpaServices NuGet package installation requirement 2017-06-23 11:55:00 +01:00
Steve Sanderson
f9068819be Update AppVeyor builds to use latest .NET Core SDK. Fixes #1058 2017-06-23 11:52:09 +01:00
Steve Sanderson
85bf621386 Merge branch 'rel/2.0.0-preview2-templates' into dev 2017-06-22 16:39:58 +01:00
Steve Sanderson
bc7742148e Remove duplicate var definition as in #966 2017-06-21 15:06:07 +01:00
Sławomir Rosiek
4ceed817a3 Removed unused methods 2017-06-20 16:33:34 +01:00
Sławomir Rosiek
6d85e752e1 Throwing HttpInvocationException instead of generic Exception 2017-06-20 16:33:34 +01:00
Steve Sanderson
460f202832 In React templates, update @types/react to 15.0.29 for compatibility with TypeScript 2.4.0+ 2017-06-20 15:17:19 +01:00
Steve Sanderson
73054559cc Bump aspnet-prerendering version to 2.0.6 for publish 2017-06-20 15:11:23 +01:00
Steve Sanderson
d007a3fbba In aspnet-prerendering, fix type definitions to satisfy TypeScript 2.4.0. Fixes #1034 2017-06-20 15:10:29 +01:00
Steve Sanderson
fcd3cf9dd7 In aspnet-prerendering, simply type imports/exports by changing PrerenderingInterfaces to a regular module (not a .d.ts file) 2017-06-20 15:07:11 +01:00
Sławomir Rosiek
48bca777fe Added "private": true to package.json 2017-06-19 15:04:42 +02:00
Steve Sanderson
aadcfa1fb7 Revert change that added preview2-final NuGet feed as it's not required in dev branch 2017-06-16 13:28:00 +02:00
Steve Sanderson
f683b39806 Merge branch 'rel/2.0.0-preview2' into dev 2017-06-16 13:26:56 +02:00
Kiran Challa
ed7e07a057 Updated to use latest netstandard.library 2017-06-15 05:20:36 -07:00
Kiran Challa
749d112b08 Merge branch 'rel/2.0.0-preview2' into dev-gate 2017-06-15 03:38:10 -07:00
Steve Sanderson
90922fb3c6 Merge branch 'rel/2.0.0-preview2' into dev 2017-06-13 22:06:55 +01:00
Nate McMaster
bcb359e355 Update System.Threading.Tasks.Dataflow dependency to latest corefx version 2017-06-13 11:37:59 -07:00
Steve Sanderson
a7a3a359fa Merge branch 'rel/2.0.0-preview2' into dev 2017-06-13 09:47:18 +01:00
Steve Sanderson
627da65692 Merge branch 'rel/2.0.0-preview2' into dev 2017-06-13 09:39:17 +01:00
Steve Sanderson
67ba6271a0 Merge branch 'rel/2.0.0-preview2' into dev 2017-06-11 20:33:23 +01:00
Steve Sanderson
32d9bdee6c Merge branch 'rel/2.0.0-preview2' into dev 2017-06-10 14:36:36 +01:00
Steve Sanderson
e50d4825c3 Merge branch 'rel/2.0.0-preview2' into dev 2017-06-08 11:44:53 +01:00
Steve Sanderson
06c94d54eb Merge branch 'rel/2.0.0-preview2' into dev 2017-06-08 11:15:48 +01:00
Steve Sanderson
3685592b01 Merge branch 'rel/2.0.0-preview2' into dev 2017-06-08 11:09:51 +01:00
Steve Sanderson
2acdad38cd Merge branch 'rel/2.0.0-preview2' into dev 2017-06-08 10:40:05 +01:00
Steve Sanderson
e331355c1d Merge branch 'rel/2.0.0-preview2' into dev 2017-06-07 22:57:37 +01:00
Steve Sanderson
d8c0bd8898 Merge branch 'rel/2.0.0-preview2' into dev 2017-06-07 15:02:29 +01:00
Josef Ottosson
0626bb1594 Update README.md
Fixes small typo.
2017-06-05 11:14:04 +01:00
Pranav K
d9e75c89ae Updating versions to preview3 2017-06-01 10:47:12 -07:00
Pranav K
ebe9d8ae92 Merge remote-tracking branch 'origin/rel/2.0.0-preview2' into dev 2017-05-31 20:00:38 -07:00
Pranav K
d42cd10975 Merge remote-tracking branch 'origin/rel/2.0.0-preview2' into dev 2017-05-31 19:44:28 -07:00
31 changed files with 135 additions and 15655 deletions

View File

@@ -94,7 +94,7 @@ If you're interested in contributing to the various packages, samples, and proje
* Run `dotnet restore` at the repo root dir
* Go to whatever sample or template you want to run (for example, `cd templates/AngularSpa`)
* Restore NPM dependencies (run `npm install`)
* If the sample/template you're trying to run has a file called `webpack.config.vendor.js` at its root, run `webpack --config webpack.config.vendor.js`. It it has a file called `webpack.config.js`, run `webpack` (no args). You might need to install webpack first, by running `npm install -g webpack`.
* If the sample/template you're trying to run has a file called `webpack.config.vendor.js` at its root, run `webpack --config webpack.config.vendor.js`. If it has a file called `webpack.config.js`, run `webpack` (no args). You might need to install webpack first, by running `npm install -g webpack`.
* Launch it (`dotnet run`)
If you're planning to submit a pull request, and if it's more than a trivial fix (for example, for a typo), it's usually a good idea first to file an issue describing what you're proposing to do and how it will work. Then you can find out if it's likely that such a pull request will be accepted, and how it fits into wider ongoing plans.

View File

@@ -3,8 +3,8 @@ init:
install:
- ps: Install-Product node 6.9.2 x64
# .NET Core SDK binaries
# Download .NET Core 2.0 Preview 1 SDK and add to PATH
- ps: $urlCurrent = "https://download.microsoft.com/download/0/6/5/0656B047-5F2F-4281-A851-F30776F8616D/dotnet-dev-win-x64.2.0.0-preview1-005977.zip"
# Download .NET Core 2.0 Preview 2 SDK and add to PATH
- ps: $urlCurrent = "https://dotnetcli.azureedge.net/dotnet/Sdk/2.0.0-preview2-006497/dotnet-sdk-2.0.0-preview2-006497-win-x64.zip"
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
- ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
- ps: $tempFileCurrent = [System.IO.Path]::GetTempFileName()

View File

@@ -33,7 +33,7 @@ cd $PSScriptRoot
$repoFolder = $PSScriptRoot
$env:REPO_FOLDER = $repoFolder
$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0-preview2.zip"
$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
if ($env:KOREBUILD_ZIP)
{
$koreBuildZip=$env:KOREBUILD_ZIP

View File

@@ -2,7 +2,7 @@
repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $repoFolder
koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0-preview2.zip"
koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
if [ ! -z $KOREBUILD_ZIP ]; then
koreBuildZip=$KOREBUILD_ZIP
fi

View File

@@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework'">
<PackageReference Include="NETStandard.Library" Version="$(BundledNETStandardPackageVersion)" />
<PackageReference Include="NETStandard.Library" Version="$(NETStandardImplicitPackageVersion)" />
<PackageReference Include="NETStandard.Library.NETFramework" Version="$(NETStandardLibraryNETFrameworkVersion)" />
</ItemGroup>
</Project>

View File

@@ -1,12 +1,12 @@
<Project>
<PropertyGroup>
<AspNetCoreVersion>2.0.0-preview2-*</AspNetCoreVersion>
<AspNetCoreVersion>2.0.0-*</AspNetCoreVersion>
<AutoMapperVersion>5.0.2</AutoMapperVersion>
<InternalAspNetCoreSdkVersion>2.1.0-*</InternalAspNetCoreSdkVersion>
<JsonNetVersion>10.0.1</JsonNetVersion>
<NETStandardImplicitPackageVersion>$(BundledNETStandardPackageVersion)</NETStandardImplicitPackageVersion>
<NETStandardImplicitPackageVersion>2.0.0-*</NETStandardImplicitPackageVersion>
<NETStandardLibraryNETFrameworkVersion>2.0.0-*</NETStandardLibraryNETFrameworkVersion>
<RuntimeFrameworkVersion Condition="'$(TargetFramework)'=='netcoreapp2.0'">2.0.0-*</RuntimeFrameworkVersion>
<ThreadingDataflowVersion>4.7.0</ThreadingDataflowVersion>
<ThreadingDataflowVersion>4.8.0-*</ThreadingDataflowVersion>
</PropertyGroup>
</Project>

View File

@@ -67,8 +67,10 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
if (!response.IsSuccessStatusCode)
{
// Unfortunately there's no true way to cancel ReadAsStringAsync calls, hence AbandonIfCancelled
var responseErrorString = await response.Content.ReadAsStringAsync().OrThrowOnCancellation(cancellationToken);
throw new Exception("Call to Node module failed with error: " + responseErrorString);
var responseJson = await response.Content.ReadAsStringAsync().OrThrowOnCancellation(cancellationToken);
var responseError = JsonConvert.DeserializeObject<RpcJsonResponse>(responseJson, jsonSerializerSettings);
throw new NodeInvocationException(responseError.ErrorMessage, responseError.ErrorDetails);
}
var responseContentType = response.Content.Headers.ContentType;
@@ -136,5 +138,13 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
_disposed = true;
}
}
#pragma warning disable 649 // These properties are populated via JSON deserialization
private class RpcJsonResponse
{
public string ErrorMessage { get; set; }
public string ErrorDetails { get; set; }
}
#pragma warning restore 649
}
}

View File

@@ -86,5 +86,8 @@ function readRequestBodyAsJson(request, callback) {
function respondWithError(res: http.ServerResponse, errorValue: any) {
res.statusCode = 500;
res.end(errorValue.stack || errorValue.toString());
res.end(JSON.stringify({
errorMessage: errorValue.message || errorValue,
errorDetails: errorValue.stack || null
}));
}

View File

@@ -20,7 +20,7 @@ Behind the scenes, it uses the [`Microsoft.AspNetCore.NodeServices`](https://git
### Installation into existing projects
* Add `Microsoft.AspNetCore.SpaServices` to the dependencies list in your `project.json` file
* Install the `Microsoft.AspNetCore.SpaServices` NuGet package
* Run `dotnet restore` (or if you use Visual Studio, just wait a moment - it will restore dependencies automatically)
* Install supporting NPM packages for the features you'll be using:
* For **server-side prerendering**, install `aspnet-prerendering`

View File

@@ -1,6 +1,6 @@
{
"name": "aspnet-prerendering",
"version": "2.0.5",
"version": "2.0.6",
"description": "Helpers for server-side rendering of JavaScript applications in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
"main": "index.js",
"scripts": {

View File

@@ -1,8 +1,8 @@
/// <reference path="./PrerenderingInterfaces.d.ts" />
import * as url from 'url';
import * as path from 'path';
import * as domain from 'domain';
import { run as domainTaskRun, baseUrl as domainTaskBaseUrl } from 'domain-task/main';
import { BootFunc, BootFuncParams, BootModuleInfo, RenderToStringCallback, RenderToStringFunc } from './PrerenderingInterfaces';
const defaultTimeoutMilliseconds = 30 * 1000;

View File

@@ -1,26 +1,28 @@
interface RenderToStringFunc {
export interface RenderToStringFunc {
(callback: RenderToStringCallback, applicationBasePath: string, bootModule: BootModuleInfo, absoluteRequestUrl: string, requestPathAndQuery: string, customDataParameter: any, overrideTimeoutMilliseconds: number, requestPathBase: string): void;
}
interface RenderToStringCallback {
(error: any, result?: RenderToStringResult): void;
export interface RenderToStringCallback {
(error: any, result?: RenderResult): void;
}
interface RenderToStringResult {
export interface RenderToStringResult {
html: string;
statusCode?: number;
globals?: { [key: string]: any };
}
interface RedirectResult {
export interface RedirectResult {
redirectUrl: string;
}
interface BootFunc {
(params: BootFuncParams): Promise<RenderToStringResult>;
export type RenderResult = RenderToStringResult | RedirectResult;
export interface BootFunc {
(params: BootFuncParams): Promise<RenderResult>;
}
interface BootFuncParams {
export interface BootFuncParams {
location: any; // e.g., Location object containing information '/some/path'
origin: string; // e.g., 'https://example.com:1234'
url: string; // e.g., '/some/path'
@@ -30,7 +32,7 @@ interface BootFuncParams {
data: any; // any custom object passed through from .NET
}
interface BootModuleInfo {
export interface BootModuleInfo {
moduleName: string;
exportName?: string;
webpackConfig?: string;

View File

@@ -1,5 +1,2 @@
/// <reference path="./PrerenderingInterfaces.d.ts" />
export * from './Prerendering';
export type RenderResult = RenderToStringResult | RedirectResult;
export * from './PrerenderingInterfaces';

View File

@@ -1,11 +1,12 @@
{
"name": "aspnet-webpack-react",
"version": "2.0.0",
"version": "2.0.1",
"description": "Helpers for using Webpack with React in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
"main": "index.js",
"scripts": {
"prepublish": "rimraf *.d.ts && tsc && echo 'Finished building NPM package \"aspnet-webpack-react\"'",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"postinstall": "node scripts/postinstall.js"
},
"author": "Microsoft",
"license": "Apache-2.0",
@@ -16,8 +17,12 @@
"type": "git",
"url": "https://github.com/aspnet/JavaScriptServices.git"
},
"dependencies": {
"@types/webpack": "2.2.15",
"hjson": "2.4.3"
},
"devDependencies": {
"@types/webpack": "^2.2.0",
"@types/react": "15.0.29",
"rimraf": "^2.5.4",
"typescript": "^2.0.0",
"webpack": "^2.2.0"

View File

@@ -0,0 +1,55 @@
var fs = require('fs');
var path = require('path');
var Hjson = require('hjson');
// This logic is a workaround for #1066.
// See the comment in index.ts for details.
function findInDirOrAncestor(targetFilename, rootDir) {
var candidateFilename = path.join(rootDir, targetFilename);
if (fs.existsSync(candidateFilename)) {
return candidateFilename;
}
var parentDir = path.join(rootDir, '..');
return parentDir !== rootDir ? findInDirOrAncestor(targetFilename, parentDir) : null;
}
function findTsConfigFile() {
var rootDir = path.join(__dirname, '..', '..'); // Start 2 levels up because this package has a tsconfig file of its own
var tsConfigFile = 'tsconfig.json';
var tsConfigFileName = findInDirOrAncestor(tsConfigFile, rootDir);
if (!tsConfigFileName) {
console.error('Could not locate ' + tsConfigFile + ' in ' + rootDir + ' or any ancestor directory.');
}
return tsConfigFileName;
}
function ensureTsConfigContainsTypesEntry(packageName) {
var tsConfigFileName = findTsConfigFile();
if (tsConfigFileName) {
var parsedTsConfig = Hjson.rt.parse(fs.readFileSync(tsConfigFileName, 'utf8'));
parsedTsConfig.compilerOptions = parsedTsConfig.compilerOptions || {};
parsedTsConfig.compilerOptions.types = parsedTsConfig.compilerOptions.types || [];
if (parsedTsConfig.compilerOptions.types.indexOf(packageName) < 0) {
parsedTsConfig.compilerOptions.types.push(packageName);
var hjsonOptions = {
bracesSameLine: true,
multiline: 'off',
quotes: 'all',
separator: true,
space: 2
};
fs.writeFileSync(tsConfigFileName, Hjson.rt.stringify(parsedTsConfig, hjsonOptions), 'utf8');
}
}
}
try {
ensureTsConfigContainsTypesEntry('aspnet-webpack-react');
} catch(ex) {
console.error(ex);
process.exit(0); // Don't break installation
}

View File

@@ -4,3 +4,23 @@ export { addReactHotModuleReplacementConfig } from './HotModuleReplacement';
// compatibility with aspnet-webpack 1.x. In aspnet-webpack 2.0, we can drop the old name (and also deprecate
// some other no-longer-supported functionality, such as LoadViaWebpack).
export { addReactHotModuleReplacementConfig as addReactHotModuleReplacementBabelTransform } from './HotModuleReplacement';
// Workaround for #1066
//
// The issue is that @types/react-router@4.0.12 is incompatible with @types/react@15.0.29
// This is a problem because the ReactReduxSpa template that ships in 2.0.0-preview2 is pinned
// to @types/react@15.0.29 but does *not* declare a direct dependency on @types/react-router,
// which means we end up grabbing the latest @types/react-router.
//
// The temporary solution is for aspnet-webpack-react to add the following extra type information
// that patches the compatibility issue. The longer-term solution will be for the templates to
// pin versions of *every* package in the transitive closure, not just their direct dependencies.
//
// Note that for this workaround to work, the developer also needs 'aspnet-webpack-react' to be
// present in the 'types' array in tsconfig.json. We automate the task of adding that in the
// scripts/postinstall.js file in this package. Later, that action can be removed.
import * as React from 'react';
declare module 'react' {
interface Component<P, S={}> {}
}

View File

@@ -5,7 +5,7 @@
"target": "es5",
"declaration": true,
"outDir": ".",
"lib": ["es2015"]
"lib": ["dom", "es2015"]
},
"files": [
"src/index.ts"

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
{
"name": "WebApplicationBasic",
"private": true,
"version": "0.0.0",
"scripts": {
"test": "karma start ClientApp/test/karma.conf.js"

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
{
"name": "WebApplicationBasic",
"private": true,
"version": "0.0.0",
"dependencies": {
"aurelia-bootstrapper": "^2.0.1",

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
{
"name": "WebApplicationBasic",
"private": true,
"version": "0.0.0",
"devDependencies": {
"@types/core-js": "^0.9.34",

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +1,19 @@
{
"name": "WebApplicationBasic",
"private": true,
"version": "0.0.0",
"dependencies": {
"@types/history": "4.5.1",
"@types/react": "15.0.24",
"@types/react": "15.0.29",
"@types/react-dom": "15.5.0",
"@types/react-redux": "4.4.40",
"@types/react-router": "4.0.11",
"@types/react-router-dom": "4.0.4",
"@types/react-router-redux": "5.0.1",
"@types/webpack": "2.2.15",
"@types/webpack-env": "1.13.0",
"aspnet-prerendering": "^2.0.5",
"aspnet-webpack": "^1.0.29",
"aspnet-webpack-react": "^3.0.0-beta",
"aspnet-webpack-react": "^2.0.0",
"awesome-typescript-loader": "3.1.3",
"bootstrap": "3.3.7",
"css-loader": "0.28.1",

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,15 @@
{
"name": "WebApplicationBasic",
"private": true,
"version": "0.0.0",
"devDependencies": {
"@types/history": "4.5.1",
"@types/react": "15.0.24",
"@types/react": "15.0.29",
"@types/react-dom": "15.5.0",
"@types/react-router": "4.0.9",
"@types/webpack-env": "1.13.0",
"aspnet-webpack": "^1.0.29",
"aspnet-webpack-react": "^3.0.0-beta",
"aspnet-webpack-react": "^2.0.0",
"awesome-typescript-loader": "3.1.3",
"bootstrap": "3.3.7",
"css-loader": "0.28.1",

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
{
"name": "WebApplicationBasic",
"private": true,
"version": "0.0.0",
"devDependencies": {
"@types/requirejs": "^2.1.28",

View File

@@ -7,7 +7,6 @@ const bundleOutputDir = './wwwroot/dist';
module.exports = (env) => {
const isDevBuild = !(env && env.prod);
const bundleOutputDir = './wwwroot/dist';
return [{
stats: { modules: false },
context: __dirname,

View File

@@ -2,6 +2,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>2.0.0</VersionPrefix>
<VersionSuffix>preview2</VersionSuffix>
<VersionSuffix>preview3</VersionSuffix>
</PropertyGroup>
</Project>