aspnet / templating Goto Github PK
View Code? Open in Web Editor NEW[Archived] ASP.NET Core templates for .NET CLI and Visual Studio. Project moved to https://github.com/aspnet/AspNetCore
License: Apache License 2.0
[Archived] ASP.NET Core templates for .NET CLI and Visual Studio. Project moved to https://github.com/aspnet/AspNetCore
License: Apache License 2.0
Moved from dotnet/AspNetCore.Docs#4547. Originally logged by @BlanketGuy.
I've been having a lot of trouble with the dependencies when creating a project with the Angular template on VS 2017.
First I had to install all the npm packages one by one, and some of them stopped working out of the blue.
Every time I fix something and re-open the project, something else stops working. Anyone else had this problem? How did you solve it?
Server-side rendering requires a significant amount of non-trivial boilerplate code to be added for React and Angular. Making it a part of the template could save days of work for someone who has never done it.
It would add more clutter though if it's not something that the user needs, so it should be optional.
From @phenning on July 6, 2017 17:26
In the Individual Auth template for Core Web Application, there is exactly one Web Helper, at line 38 in Views/Accout/Login.cshtml.
This should be changed to a TagHelper.
<div class="checkbox">
<label asp-for="RememberMe">
<input asp-for="RememberMe" />
@Html.DisplayNameFor(m => m.RememberMe)
</label>
</div>
Copied from original issue: dotnet/templating#1024
From @peterblazejewicz on February 3, 2017 20:52
The 2.2.3 works just fine:
https://github.com/OmniSharp/generator-aspnet/blob/master/templates/projects/web/bower.json#L6
Copied from original issue: dotnet/templating#249
Use the semantic main
element in the _Layout.cshtml
file.
The semantic header
element could be used too.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header
From @Eilon on August 8, 2017 19:49
The ApplicationException
has been essentially obsolete since .NET 1.0, and MSDN specifically recommends avoiding it:
https://msdn.microsoft.com/en-us/library/system.applicationexception(v=vs.110).aspx
You should derive custom exceptions from the Exception class rather than the ApplicationException class. You should not throw an ApplicationException exception in your code, and you should not catch an ApplicationException exception unless you intend to re-throw the original exception.
We should fix this ASAP in the project templates, as it is not a good practice.
Copied from original issue: dotnet/templating#1191
Moved from dotnet/efcore#10002 by @smitpatel
Steps:
Create new ASP.NET Core Web Application
Choose Web Application template for 2.0
Add individual accounts auth
Enable Docker support for windows.
Restore packages/build solution etc.
Press F5
Above will fail due to aspnet/Mvc#6923
Once you correct the URL to http://172.21.203.31/
Website loads correctly. But when trying to register User, it fails with following error
Essentially it is trying to connect to localdb which does not exist inside docker container (for obvious reason)
Hi,
I am using the Angular SPA template and have been facing issues with how to correctly configure webpack for several days now. And editing the large webpack.config is rather hard :)
I added ngx-mqtt to my package.json this results in the error:
Module not found : error : Can't resolve 'mqtt'
The package mqtt is imported in ngx-mqtt however it is also listed as a devDependency in ngx-mqtt's package.json so should't it just work?
I tried to add mqtt to my package.json (again I thought this isn't how it is done) and then this results in:
node_modules\mqtt\mqtt.js Unexpected character '#'
This probably could be fixed by using shebang-loader or something in my webpack.config, but honestly I have no idea where I would add this without breaking everything.
From @omajid on August 18, 2017 16:5
Some files have only this license header, which doesn't explicitly confirm that the file is licensed under the license documented in the https://github.com/dotnet/templating/blob/rel/2.1.0-preview1/LICENSE file:
/*!
** Unobtrusive validation support library for jQuery and jQuery Validate
** Copyright (C) Microsoft Corporation. All rights reserved.
*/
For example, https://github.com/dotnet/templating/blob/rel/2.1.0-preview1/template_feed/Microsoft.DotNet.Web.ProjectTemplates.1.x/content/StarterWeb-CSharp/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js. Can you please somehow clarify this header? The "All Rights Reserved" and no mention of MIT or jquery license makes me feel uncomfortable.
cc @leecow
Copied from original issue: dotnet/templating#1216
From @pakrym on September 20, 2017 20:36
Copied from original issue: dotnet/templating#1247
This exception type is not recommended by MSDN because it carries no meaning (you might as well throw Exception).
For each current usage we need to either:
cc @ajcvickers FYI
Move the call to app.UseBrowserLink();
up so it runs before the call to app.UseDeveloperExceptionPage();
in the Web Application templates (both Razor Pages and MVC).
This enables Browser Link to run on error pages which is a super important workflow enhancement
We create the templates with a pre-initialized app.db instance which causes that when we make changes to the migration and instantiate the template (and try to run the migrations) we get the message that everything is up to date when it is not.
Instead of that, we should just run the migrations in the same way we do for local db today.
Any thoughts? @ajcvickers
From @danroth27 on June 1, 2017 22:33
From @danroth27 on May 5, 2017 6:5
The client_info
parameter needs to be updated to look like this:
"client_info": { "uid": "c765bd67-ca10-4337-ad54-fa82babad87a-<policy>", "utid": "1350dd1f-7f35-43b7-8d0f-bf80031d668a" }
Where = whatever policy as used for authentication. For example,
"client_info": { "uid": "c765bd67-ca10-4337-ad54-fa82babad87a-B2C_1_signupsignin", "utid": "1350dd1f-7f35-43b7-8d0f-bf80031d668a" }
Copied from original issue: aspnet/IdentityService#101
Copied from original issue: dotnet/templating#874
The ASP.NET Core Angular template's csproj runs npm install
as part of running webpack for publishing, but not as a pre-build step (when webpack is also run).
We should make sure the SPA templates run npm install
prior to build so that packages are available for webpack build, etc.
From @jkotalik on October 13, 2017 19:22
With aspnet/BasicMiddleware#264 being added, @Eilon asked me to write templates for this feature.
cc/ @javiercn @Tratcher
Copied from original issue: aspnet/Templates#871
Seems like it would be a bit nicer to work with the project file (in non-VS; hand-editing) scenarios to include some vertical space among the sections.
Here is a current project file for a Razor Pages app produced from the template (also note the strange extra line between <TargetFramework> and <UserSecretsId>):
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<UserSecretsId>aspnet-sample-C1C143B5-1151-4D1A-855C-A3AC600D099A</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<None Update="app.db" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>
</Project>
... I wonder if you support the idea of going with ...
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<UserSecretsId>aspnet-sample-C1C143B5-1151-4D1A-855C-A3AC600D099A</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<None Update="app.db" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>
</Project>
From @danroth27 on July 20, 2017 5:54
We need to update https://go.microsoft.com/fwlink/?Linkid=852423 to point to the QR code doc dotnet/AspNetCore.Docs#3780
Copied from original issue: dotnet/templating#1121
I want to create multiple .net core projects with solution files.
Also project other referenced added in them.
My Directory structure is like:
|- data (blank or may contain some files)
|- design
|- help
|- src
|-.sln (VS solution file)
|-Libraries|-LIB1.csproj
|-LIB2.csproj
|-LIB3.csproj
|-Presentation
|-PRE1.csproj
|-PRE2.csproj
|-Tests
|-TEST1.csproj
|-TEST2.csproj
|-Plugins
|-Plugin1.csproj
|-Plugin2.csproj
Using exactly the same code as in the angular-animations-example branch, any changes to the app that invokes the webpack hot module replacement results in the previous app element being left behind underneath the newlay added app element. A browser refresh is necessary to get rid of it and test as normal.
This seems to be provoked merely by importing the two AnimationsModules into the browser and server app modules.
Here's my demo of the problem.
From @peterblazejewicz on May 13, 2017 21:3
The mvc
and razor
templates ship with bundleconfig.json
but I think the integration is broken. I'm not using VS. The 2.0 uses blank platform meta package dependency Microsoft.AspNetCore.All
and cli tool for Secret manager tool Microsoft.Extensions.SecretManager.Tools
and that's all. Whenever I made a changes in content client code (JS, CSS that is) I would expect new minified version to be created, but the bundler integration is broken.
How am I supposed to use bundler with 2.0 version? With 1/1.1 everytime the build command is used the bundler produces updated content.
Thanks!
dotnet --info
.NET Command Line Tools (2.0.0-preview1-005977)
Product Information:
Version: 2.0.0-preview1-005977
Commit SHA-1 hash: 414cab8a0b
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.0.0-preview1-005977/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0-preview1-002111-00
Build : 1ff021936263d492539399688f46fd3827169983
Copied from original issue: dotnet/templating#786
A new jquery-unobtrusive adapter was added for handling validation of file extensions. aspnet/jquery-validation-unobtrusive@e7444c9
This adapter uses 'extension' method from the jquery-validation's 'additional-methods.js' file. This file is already being downloaded as part of the jquery-validation package. We just need to include it in the template's .cshtml file: https://github.com/aspnet/templating/blob/dev/src/Microsoft.DotNet.Web.ProjectTemplates.2.0/content/StarterWeb-CSharp/Views/Shared/_ValidationScriptsPartial.cshtml
Example from Aurelia, but applies to other templates too.
Usually lockfiles should be committed to source control (e.g. Yarn documentation for yarn.lock: https://yarnpkg.com/en/docs/yarn-lock#toc-check-into-source-control). Is there a reason yarn.lock is being ignored?
I created angular project with dotnet cli. The project is created nicely, however, the namespace is something a bit different than I expected.
$ dotnet --version
2.0.0
$ dotnet new angular --output src/HelloWorld.AngularApp --name HelloWorld.AngularApp
The template "ASP.NET Core with Angular" was created successfully.
// ...
$ cat src/HelloWorld.AngularApp/Startup.cs
// ...
namespace HelloWorld_AngularApp
{
// ...
What I expected is below:
// ...
namespace HelloWorld.AngularApp
{
// ...
I can replace the namespace manually though, it would be nice to have a --namespace
parameter for this case like dotnet new mvc
.
Also, name property in project.json
needs to check together.
From @peterblazejewicz on February 3, 2017 20:23
Not sure if this is a correct repo:
I'm missing a warm welcome page (README) for content:
Remove Project_ReadMe.txt from templates
Replacement for content in README.md
aspnet/Templates#681 (comment)
I've used to write a script to scrap relevant content:
https://github.com/peterblazejewicz/missing-aspnet-readme
but aspnet/Templates#681 removed that option.
The somehow close one startup page from docs is too long I think
I could be missing bit of info, but is there a source or content similar to this one from VS2017 RC?
Have you folks discussed that topic?
or even this old one:
https://cloud.githubusercontent.com/assets/14539/22607067/8cd81246-ea56-11e6-94c2-8cde68e7c208.png
Thanks!
Copied from original issue: dotnet/templating#247
An update was made to the unobtrusive script, so we need to use this latest version
Related issue: #14
From @peterblazejewicz on February 3, 2017 20:53
The 1.15.0 version works just fine with scaffolded content:
https://github.com/OmniSharp/generator-aspnet/blob/master/templates/projects/web/bower.json#L7
Copied from original issue: dotnet/templating#250
What does everyone think about regenerating the wwwroot/dist folder on rebuild? Something like this:
<Target Name="DebugRunWebpack" BeforeTargets="Rebuild" Condition=" '$(Configuration)' == 'Debug'">
<RemoveDir Directories="wwwroot/dist" />
<Message Importance="high" Text="Performing re-run Webpack build..." />
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js" />
<Exec Command="node node_modules/webpack/bin/webpack.js" />
</Target>
When I start an project off of the Angular template, it says that NodeJS is needed. I had to install NodeJS separately.
What's the best way to work with JQuery UI with server-side pre-rendering?
Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException: 'Prerendering failed because of error: TypeError: $.each is not a function
I got it to work without server-side pre-rendering, by adding
, 'jquery-ui-bundle', 'jquery-ui-bundle/jquery-ui.css'
to webpack.config.vendor.js and
/// <reference path='../../node_modules/@types/jqueryui/index.d.ts' />
import * as $ from "jquery";
import "jquery-ui-bundle";
to the component.
jquery-validation is now at 1.17.0
https://github.com/jquery-validation/jquery-validation/releases
Updated: 8/6/2018
This is probably just a localization issue, but the template is in English. Do you want to set a lang="en"
here? I do set it on our doc samples.
crossorigin
Only missing for the Bootstrap stylesheet. Recent updates have squared it (and integrity
) away in the 2.1 template.
Pages and views should provide the page/view title in <h1> headings. The current templates ignore W3C advice (ref: https://www.w3.org/QA/Tips/Use_h1_for_Title). I suggest raising the <h2> headings to <h1>, and there's nothing wrong with changing the four <h2> elements on the Index page to <h1> elements ... nothing prevents multiple <h1> elements in HTML5. Could set the sizes of headers in the stylesheet (make them smaller than default) to preserve the current style.
Some of us in the community feel that W3C hacked their own spec to allow closing void elements. IIRC Razor needs them generally closed; however, the void elements in the template aren't processed by Razor. I think it would be safe to not close most/all of them (i.e., <link>, <meta>, <hr>).
I recommend some language updates to the Error page. Something like ...
<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications</strong>. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong> and restarting the app or calling <code>UseEnvironment("Development")</code> on the host in <strong>Program.Main</strong> and restarting the app.
</p>
Except for a few style updates, the proposal surfaces .UseEnvironment()
.
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
At least in the RP template, there seems to be an extra line space before AddMvc
.
From @peterblazejewicz on May 21, 2017 17:50
Hi folks,
Just to let you know, the Bower package manager tool has been put into maintenance mode officially:
bower/bower@0bd318d
The related issues was closed on the Bower project discussion list:
bower/bower#2298
The templates ships with Bower configuration and implicit dependency (as precaution the dependencies are bundled with template)
If you start some serious discussion on how to migrate templates to not use Bower and move to NPM/Yarn/Webpack, I'd gladly help.
Copied from original issue: dotnet/templating#840
On macOS/Linux, there appears to be some race condition with the tests and the template engine, leading to errors such as:
==> /Users/namc/.dotnet/dotnet new web [/Users/namc/dev/aspnet/templating/test/Templates.Test/bin/Debug/netcoreapp2.0/TestTemplates/37025cf1fb724909ad785b6ef06a34ac]
[ERROR] Unexpected end when reading JSON. Path 'TemplateInfo[19].Tags.language.Description', line 1365, position 26.
[ERROR] at Newtonsoft.Json.JsonTextReader.ParseValue()
[ERROR] at Newtonsoft.Json.JsonTextReader.Read()
[ERROR] at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)
[ERROR] at Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options)
[ERROR] at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
[ERROR] at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
[ERROR] at Newtonsoft.Json.Linq.JObject.Parse(String json)
[ERROR] at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.EnsureTemplatesLoaded()
[ERROR] at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.WriteTemplateCache(IList`1 templates, String locale)
[ERROR] at Microsoft.TemplateEngine.Edge.Settings.TemplateCache.WriteTemplateCacheForLocale(String locale, String existingCacheVersion)
[ERROR] at Microsoft.TemplateEngine.Edge.Settings.TemplateCache.WriteTemplateCaches(String existingCacheVersion)
[ERROR] at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.Save(TemplateCache cacheToSave)
I've disabled test parallelization for now a4ba5a1, but it means a full test run can take 10-15 minutes.
From @HeMinzhang on August 26, 2017 12:23
I use Visual Studio community 2017 15.3.1 create a asp.net core 2.0 angular project.But simplified Chinese characters garbled.
I convert
project\ClientApp\app\components\app\app.component.html project\ClientApp\app\components\home\home.component.html
project\ClientApp\app\components\fetchdata\fetchdata.component.html
Ansi file format to uft8 file.
simplified Chinese characters show normal.Can you fix the bug?
Copied from original issue: aspnet/Mvc#6716
We are adding some new Web API specific conventions that we will need the Web API project and time templates to react to.
We are adding [ApiController]
attribute as the way to opt-in to new API specific conventions and behaviors that are tuned around best practices for APIs.
This will include:
[FromBody]
for complex types, [FromRoute]
when possible, otherwise [FromQuery]
)The user Id is provided in the callback link:
https://github.com/aspnet/templating/blob/a80061f42be6ba7de36f8fea35086da58e08a69b/src/Microsoft.DotNet.Web.ProjectTemplates.2.0/content/StarterWeb-CSharp/Controllers/AccountController.cs#L424
But in the controller action only code is used:
https://github.com/aspnet/templating/blob/a80061f42be6ba7de36f8fea35086da58e08a69b/src/Microsoft.DotNet.Web.ProjectTemplates.2.0/content/StarterWeb-CSharp/Controllers/AccountController.cs#L443
In my opinion it's better not to provide more information than necessary.
Copy of: aspnet/Templates#872
From @josephwoodward on August 3, 2017 21:57
In a similar vein to a previous issue raised, given .NET Core is targeted towards cross-platform development in a range of IDEs and editors, I feel it doesn't make sense to have Visual Studio specific packages (Microsoft.VisualStudio.Web.CodeGeneration.Tools
in this case) referenced in the default template created when calling dotnet new mvc
in the .NET Core 2 preview (2.0.0-preview2-006497)
A better, IDE agnostic alternative could be to add a reference to the package once Visual Studio has created the project?
Copied from original issue: dotnet/templating#1183
Hi!
Is it possible to use #if (condition) #endif into .ts and .html files?
I found a problem with the MVC 2.0 template, related to running 'dotnet ef database update'.
Repro steps:
dotnet new mvc -au Individual -uld -f netcoreapp2.0
dotnet restore
dotnet build
dotnet ef database update
Relevant part of the error:
System.Data.SqlClient.SqlException (0x80131904): Foreign key 'FK_AspNetUserTokens_AspNetUsers_UserId' references invalid table 'AspNetUsers'.
Fix:
The problem occurs because the AspNetUserTokens table includes a foreign key to the AspNetUsers table, but the AspNetUsers table is not defined when the AspNetUserTokens table create is attempted.
To fix the problem, in the file https://github.com/aspnet/templating/blob/dev/src/Microsoft.DotNet.Web.ProjectTemplates.2.0/content/StarterWeb-CSharp/Data/Migrations/00000000000000_CreateIdentitySchema.cs
move the creation of AspNetUsers table above the creation of AspNetUserTokens
The problem was introduced here:
dotnet/templating@5c7443f#diff-442acc416eaa9c694efaa1c5106bce88
Both the Razor Pages and MVC project templates contain a GenerateQrCodeUri
method. It makes use of a constant named AuthenicatorUriFormat
, which is spelled incorrectly.
From @mlorbetske on August 3, 2017 17:56
From @Rick-Anderson on July 28, 2017 2:6
I recommend the templates use app.UseMvcWithDefaultRoute();
rather than
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action=Index}/{id?}");
});
The more complex code is a barrier to entry for new users who don't need this flexibility. Advanced users will have no problem adding the above code when they need it. The code above doesn't make much sense to Razor Pages developers. Recommend this change for all templates but especially for the Razor Pages template.
cc @DamianEdwards - part of the lower the barrier to entry effort.
Copied from original issue: aspnet/Templates#857
Copied from original issue: dotnet/templating#1180
From @danroth27 on May 15, 2017 22:11
From @Ponant on May 14, 2017 21:29
OpenID appears as button in the ManageLogins for a registered user in ASP.NET Core 2.0 in-app Identity whereas it is not expected, a priori.
Furthermore, clicking on this button leads to the Server Error The view 'AccessDenied' was not found.
Copied from original issue: aspnet/Tooling#1040
Copied from original issue: dotnet/templating#801
From @danroth27 on May 15, 2017 21:52
We had some requests to provide an option for only doing cookie auth with the OIDC stuff:
aspnet/Identity#1187 (comment)
We should see based on the preview1 feedback how many folks want this and react accordingly.
Daniel Roth
Copied from original issue: dotnet/templating#800
I modified the app.module.browser and app.module.server as shown here:
aspnet/JavaScriptServices@c0c47e3
This was a response to the following issue:
aspnet/JavaScriptServices#1160
However when trying to add to the animations array in a component decorator, I get the error described in this issue:
angular/angular#18562
ERROR TypeError: Cannot read property 'display' of undefined
...
Looks like this may be an Angular problem, not necessarily one with the templates? I'm not sure what, if anything, I'm overlooking.
I'm using the React/Redux template. I'm not sure how to hold the authenticated state for the logged in user after page refresh. I can't use local storage to store the value since I'm using server rendering. One of the option I can think of is to do an API authentication request every time the user refresh the page. Not sure if this is the right approach. If it is can someone share the implementation please. Thank you.
I installed a new project using:
dotnet new reactredux
Since I want to use React 16, I went ahead and updated the package.json to the following versions:
"dependencies": {
"@types/history": "^4.6.0",
"@types/react": "^16.0.8",
"@types/react-dom": "^16.0.0",
"@types/react-hot-loader": "^3.0.4",
"@types/react-redux": "^5.0.10",
"@types/react-router": "^4.0.15",
"@types/react-router-dom": "^4.0.8",
"@types/react-router-redux": "^5.0.8",
"@types/webpack": "^3.0.12",
"@types/webpack-env": "^1.13.1",
"aspnet-prerendering": "^3.0.1",
"aspnet-webpack": "^2.0.1",
"aspnet-webpack-react": "^3.0.0",
"awesome-typescript-loader": "^3.2.3",
"bootstrap": "^3.3.7",
"css-loader": "^0.28.7",
"domain-task": "^3.0.3",
"event-source-polyfill": "0.0.9",
"extract-text-webpack-plugin": "^3.0.1",
"file-loader": "^1.1.4",
"history": "^4.7.2",
"jquery": "^3.2.1",
"json-loader": "^0.5.7",
"node-noop": "^1.0.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-hot-loader": "^3.0.0-beta.7",
"react-redux": "^5.0.6",
"react-router-dom": "^4.2.2",
"react-router-redux": "^5.0.0-alpha.6",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
"style-loader": "^0.19.0",
"typescript": "^2.5.3",
"url-loader": "^0.5.9",
"webpack": "^3.6.0",
"webpack-hot-middleware": "^2.19.1",
"webpack-merge": "^4.1.0"
}
These are the newest versions of all of these libraries.
Unfortunately the TypeScript fails to compile anymore. This line in Counter.tsx fails:
// Wire up the React component to the Redux store
export default connect(
(state: ApplicationState) => state.counter, // Selects which state properties are merged into the component's props
CounterStore.actionCreators // Selects which action creators are merged into the component's props
)(Counter) as typeof Counter;
The compiler complains that the resulting datatype lacks the 'count' property and thus cannot be cast to Counter. I tried debugging the types of the various steps in that call, but I was unsuccessful at understanding the complexity of the types involved.
Before giving up, I added an as any
cast before as typeof Counter
, to fool the compiler into letting it happen. It worked, it compiled, and the example runs.
My question is:
Remove Bower completely from the ASP.NET Core project templates and just leave the client-side files in their existing places (e.g. wwwroot/lib/blah
).
We'll be moving to the new Library Manager (PackMan) in a release later on, but Bower is done now.
From @pakrym on August 14, 2017 23:28
Expected:
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
Actual:
"Logging": {
"IncludeScopes": false,
"Debug": {
"LogLevel": {
"Default": "Warning"
}
},
"Console": {
"LogLevel": {
"Default": "Warning"
}
}
}
Copied from original issue: dotnet/templating#1208
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.