Commit Graph

321 Commits

Author SHA1 Message Date
Ryan Nowak a053155ab4 Implement layout and implements with directives
- Remove haxxxx
- Add proper directives with tooling support
2018-03-14 11:23:40 +00:00
Ryan Nowak 57a04fb178 Adopt more of Razor Exensibility
Removes some workarounds and uses Razor extensibility in a few more
places.

_ViewImports now works in VS
2018-03-14 11:23:40 +00:00
Steve Sanderson a386444b64 Make GetPropertiesIncludingInherited private to its consuming class
Just because it's not being used anywhere else currently
2018-03-13 11:54:50 +00:00
Florian Dohrendorf ef1b670b8b fix #216 2018-03-13 01:03:26 +01:00
forest93 53ab54d7b1 Fix #225. 2018-03-09 20:24:23 +08:00
Daniel Roth 969b8b86a6 Make templates show up in the One ASP.NET dialog (#208)
* Add templates parameter

* Fix primary outputs

* Reorder primary outputs

* Update hosted template name

* Fix whitespace
2018-03-05 23:56:11 +00:00
Steve Sanderson 493992ad04 Update templates to Blazor 0.0.5-preview1-10054 and use new GetJsonAsync<T> API 2018-03-05 14:38:21 -08:00
Steve Sanderson a74124efbf Add extension methods for HTTP JSON requests/responses 2018-03-05 02:02:26 +00:00
Steve Sanderson 0301250c4b In SimpleJson, support enum values serialized as numbers.
Note: still doesn't support nullable enum types.
2018-03-05 02:02:26 +00:00
Steve Sanderson 61e07eb615 Support @bind for enum and DateTime values (with optional format string) 2018-03-05 02:02:26 +00:00
Steve Sanderson 3ef78dcb7b Stop treating RenderFragment as immutable, because its output isn't 2018-03-05 02:02:26 +00:00
Alex Gavrilov 7afdccc53b Changing target framework to netstandard20 (not net461 on the CI machine) 2018-03-02 12:39:29 -08:00
Alex Gavrilov 1c15be550f VSIX Changes to have Blazor templates included into VSIX and show up in One ASP.NET Dialog 2018-03-01 20:08:34 -08:00
Steve Sanderson dc1b494df0 Update templates to Blazor 0.0.5-preview1-10041 2018-02-28 17:42:02 +00:00
Steve Sanderson 649159e31d Use real BCL System.Net.Http.HttpClient. Implements #159 2018-02-28 17:37:42 +00:00
Steve Sanderson dd831b4552 In "fetch", don't pass a "body" value if there isn't one 2018-02-28 17:37:42 +00:00
Steve Sanderson 1d07783522 Use "application/wasm" media type for .wasm files to enable streaming compilation 2018-02-28 17:37:42 +00:00
Steve Sanderson e3b995b933 Recompile Mono, updating MonoPlatform.ts to work with the newer version 2018-02-28 17:37:42 +00:00
Steve Sanderson f3b10bfa4c Template updates (#185)
* Remove unnecessary <OutputType>Exe</OutputType> from templates

* Rename BlazorHosted.* projects to BlazorHosted.CSharp.(Client|Server)

* Add empty BlazorHosted.CSharp.Shared, referenced from the two other BlazorHosted.CSharp.* projects

* Have BlazorHosted.CSharp.Client fetch data from BlazorHosted.CSharp.Server

* Update templates to Blazor 0.0.5-preview1-10037

* Make date handling consistent across the templates

* Enable response compression in "hosted" template

* Enable response compression in dev server

* Simplify template app code using new namespace arrangement

* Fix project name in hosted template
2018-02-28 12:02:35 +00:00
Steve Sanderson 4bd3cd98d6 Simplify apps by moving some commonly used types into Microsoft.AspNetCore.Blazor namespace 2018-02-28 11:29:14 +00:00
Steve Sanderson 1d5dfc2fbd In SimpleJson, support parsing Json.NET-serialized DateTimes 2018-02-28 10:28:57 +00:00
Steve Sanderson 04a69ed618 For "hosted" template, run "dotnet restore" on solution after project creation 2018-02-27 22:39:48 +00:00
Steve Sanderson f14c72bd9d Stop transitive dependency on Microsoft.AspNetCore.Blazor causing regular MVC view compilation error. Fixes #180 2018-02-27 22:23:48 +00:00
Steve Sanderson b96b78410c Minor improvements to "hosted" project template (e.g., "dotnet restore" post-action) 2018-02-27 21:57:03 +00:00
Steve Sanderson d0a05ff5db Update templates to Blazor 0.0.5-preview1-10031 2018-02-27 21:40:24 +00:00
Steve Sanderson 89ebeda38c Add multi-project template "BlazorHosted" 2018-02-27 21:40:24 +00:00
Steve Sanderson 39153955d6 Add "dotnet new" template BlazorStandalone.CSharp 2018-02-27 21:40:24 +00:00
Steve Sanderson 9a17a343cc Ensure Microsoft.AspNetCore.Blazor.Build is packed in a post-publish form so it's cross-plat compatible 2018-02-27 20:22:19 +00:00
Steve Sanderson de2bfe5162 Fix regression in app startup when running in E2E tests 2018-02-27 16:57:07 +00:00
Steve Sanderson ff5b6a7f30 Fix to "hosted in ASP.NET" startup logic when consuming via package references not project references 2018-02-27 16:38:15 +00:00
Steve Sanderson 2fc2a23d41 Include *.html in UpToDateCheckInput 2018-02-27 14:28:20 +00:00
Steve Sanderson 3e5381c17e Rename .DevHost project to .Cli, and make it work as a DotNetCliTool 2018-02-27 12:17:35 +00:00
Steve Sanderson 9d21eda9c4 Include "serve" command in dotnet-blazor tool 2018-02-26 17:37:00 +00:00
Steve Sanderson c255e77ab5 Remove redundant entry in NuSpec file 2018-02-26 17:05:45 +00:00
Steve Sanderson 44a2603720 Have the Build package include all its own dependencies (otherwise the DotNetCliTool won't work) 2018-02-26 16:34:57 +00:00
Steve Sanderson 2f9515785e Fixes for Microsoft.AspNetCore.Blazor.Build package layout 2018-02-26 16:22:06 +00:00
Steve Sanderson a5b5b3fa27 Set IsPackable=false on certain projects 2018-02-26 15:27:57 +00:00
Steve Sanderson 6995b974e9 Support @bind for textboxes and checkboxes 2018-02-26 14:39:56 +00:00
Steve Sanderson 1c5acfbdcc Temporarily rename 'Json' to 'JsonUtil' to avoid name clash 2018-02-26 12:06:28 +00:00
Steve Sanderson 1b0b5c61fe Add proper JSON-fetching example to StandaloneApp 2018-02-26 11:57:39 +00:00
Steve Sanderson 314b5c339c Add public JSON APIs to Microsoft.AspNetCore.Blazor. Swap implementation from MiniJSON to SimpleJson
MiniJSON is very small but doesn't deal with strongly-typed
deserialization by default (we can add it, but that's less
battle-tested). Also it has to allocate extra IDictionary versions of
everything before we map it to specific .NET types.

Also tried LitJSON, but has some correctness issues, e.g.,
https://github.com/LitJSON/litjson/issues/43

Also tried Json.NET but it's > 600KB
2018-02-26 11:35:27 +00:00
Steve Sanderson 8590f6e7a5 Remainder of initial HttpClient features plus E2E tests 2018-02-23 22:31:26 +00:00
Steve Sanderson ea3a18af25 Add basic support for onchange 2018-02-23 14:02:55 +00:00
Steve Sanderson 423ad85a04 Implement OnInit/OnInitAsync and use it in sample HTTP request 2018-02-23 12:47:02 +00:00
Steve Sanderson 891f2a14d0 Basic implementation of temporary HttpClient. Currently only supports GET requests and doesn't return HTTP headers. 2018-02-23 12:29:53 +00:00
Steve Sanderson 8e57261167 In BrowserUriHelper, change URI caching logic to be more defensive in case OnLocationChanged isn't being used 2018-02-23 11:05:29 +00:00
Steve Sanderson f684203721 Rename DefaultBrowserServiceProvider->BrowserServiceProvider for consistency 2018-02-23 10:50:35 +00:00
Steve Sanderson 0bb32ad628 Move BrowserRouter -> Router in Microsoft.AspNetCore.Blazor now it has no browser-specific aspects 2018-02-23 10:49:03 +00:00
Steve Sanderson eab10dcf83 Move NavLink component into Microsoft.AspNetCore.Blazor 2018-02-23 10:43:16 +00:00
Steve Sanderson 82bcf9172a Convert the static UriHelper into a service, IUriHelper, and inject where needed 2018-02-23 10:35:28 +00:00
Steve Sanderson 68f6ede3a7 Simplify UriHelper by making EnableNavigationInteception automatic 2018-02-23 09:59:56 +00:00
Steve Sanderson e1aab02228 Add name/description values for InjectDirective 2018-02-23 09:32:26 +00:00
Steve Sanderson 8ff4cee323 Make ComponentFactory thread-safe 2018-02-23 09:32:26 +00:00
Steve Sanderson c408045e31 In RazorCompiler, support @inject directive 2018-02-23 09:32:26 +00:00
Steve Sanderson 3f9d358004 Make ComponentFactory throw if you try to use [Inject] with a property that has no setter (otherwise it could be confusing) 2018-02-23 09:32:26 +00:00
Steve Sanderson b4a3c852c5 Implement DefaultBrowserServiceProvider using Microsoft.Extensions.DependencyInjection.ServiceCollection 2018-02-23 09:32:26 +00:00
Steve Sanderson e524994734 Make ComponentFactory do all the reflection up-front and cache the resulting delegates 2018-02-23 09:32:26 +00:00
Steve Sanderson ceacd489aa Simplistic implementation of property injection 2018-02-23 09:32:26 +00:00
Steve Sanderson ce10e6fa19 In preparation for DI, give every Renderer an IServiceProvider 2018-02-23 09:32:26 +00:00
Ryan Nowak dfe576f4fa Add new Razor bits
- Adds the aspnetcore-dev feed as a package source
- Updates Razor to a relatively new build
- Fixes a few issues encountered with new bits
2018-02-22 08:48:32 -08:00
Steve Sanderson f4e0d663fa Tiny simplification to NavLink 2018-02-22 15:03:49 +00:00
Steve Sanderson b705ac2c0a Switch to slightly higher-level implementation of NavLink (sacrificing some perf for better representation of current idioms) 2018-02-22 15:03:49 +00:00
Steve Sanderson 58ae5dea9a Additional methods on ParameterCollection to simplify usage 2018-02-22 15:03:49 +00:00
Steve Sanderson 3e30655ea4 Low-level NavLink implementation 2018-02-22 15:03:49 +00:00
Steve Sanderson 25b76bc6dc Skip rerendering child components if their params are definitely unchanged 2018-02-22 13:23:52 +00:00
Steve Sanderson 08d7b77d38 Avoid component syntax confusion by making it a compile-time error. Fixes #145 2018-02-22 11:07:03 +00:00
Steve Sanderson 1a31634b70 Capture component child content as a RenderFragment parameter. 2018-02-22 11:07:03 +00:00
Steve Sanderson bd455453d6 Report line/column when reporting mismatching tags 2018-02-22 11:07:03 +00:00
Steve Sanderson 0665d30e19 In RazorCompiler, reject malformed documents with mismatching tags 2018-02-22 11:07:03 +00:00
Steve Sanderson 95023c0300 In RazorCompiler, support components with children 2018-02-22 11:07:03 +00:00
Steve Sanderson d67bf63864 Update to SpaServices.Extensions 2.0.0 2018-02-22 11:07:03 +00:00
Steve Sanderson 6f25663a32 In UriHelper, cache current absolute URL 2018-02-21 10:22:03 +00:00
Steve Sanderson b764029ce0 Fix comment 2018-02-21 10:22:03 +00:00
Steve Sanderson fc9cb1af65 Add E2E tests for BrowserRouter, plus implement querystring/hash support 2018-02-21 10:22:03 +00:00
Steve Sanderson 8bc7c92683 Support hosting at non-root URL. Prove it by updating BasicTestApp to serve from non-root location. 2018-02-21 10:22:03 +00:00
Steve Sanderson 7073429cd5 Clean up and include routing unit tests 2018-02-21 10:22:03 +00:00
Steve Sanderson 78a19c07e9 In RazorCompiler, allow HTML comments 2018-02-21 10:22:03 +00:00
Steve Sanderson 7370d748c6 Initial, minimal BrowserRouter implementation. No config besides subclassing yet. 2018-02-21 10:22:03 +00:00
Steve Sanderson 0b5294a8f5 Enable SPA fallback routing on server 2018-02-21 10:22:03 +00:00
Steve Sanderson 58af3e1638 Allow blazor-boot script to be served from apps not hosted at domain root 2018-02-21 10:22:03 +00:00
Steve Sanderson 796d915526 Make spelling one step closer to correctness 2018-02-20 09:47:19 +00:00
Eugene Bekker ea2019ac39 Update a reference to the new API style 2018-02-20 09:40:09 +00:00
Eugene Bekker 79a4016b13 Refactoring middleware configuration API 2018-02-20 09:40:09 +00:00
Steve Sanderson a4c74234b4 Introduce deliberate misspelling 2018-02-19 15:14:08 +00:00
Steve Sanderson 608da4c78b Specifying entrypoint: Add tests and other stylistic tweaks 2018-02-19 14:22:03 +00:00
Eugene Bekker 1653e56b98 Adding ability to qualify the entry point of the main assembly 2018-02-19 14:11:25 +00:00
Steve Sanderson 1e0836167d Make temporary "layout" and "implements" syntax work with _ViewImports hierarchies 2018-02-19 12:48:08 +00:00
Steve Sanderson f649de2976 Support _ViewImports.cshtml files hierarchically 2018-02-18 23:57:20 +00:00
Steve Sanderson 782ca0137d Support "@inherits ..." directive 2018-02-18 22:03:15 +00:00
Steve Sanderson f6d6714251 Serve static content from wwwroot 2018-02-16 15:56:22 +00:00
Steve Sanderson 69498f68f9 Add LayoutDisplay component and use it in StandaloneApp 2018-02-16 15:04:57 +00:00
Steve Sanderson f54df27c21 Define ILayoutComponent so there's compile-time validation that layouts are defined correctly 2018-02-16 15:04:51 +00:00
Steve Sanderson 7139cb70c5 Support temporary @(Implements<MyInterfaceType>()) syntax 2018-02-16 12:39:38 +00:00
Steve Sanderson 9e333e31c5 Support temporary @(Layout<MyLayoutType>()) syntax 2018-02-16 12:10:44 +00:00
Steve Sanderson f91d1d4803 Better handling of render-after-disposed scenarios 2018-02-16 12:10:44 +00:00
Steve Sanderson 7ad88a9406 Fix ArrayBuilder capacity expansion bug 2018-02-16 10:10:13 +00:00
Steve Sanderson ad2c63ca37 Make OpenRegion/CloseRegion not public because they are only to support AddContent(seq, fragment) 2018-02-16 10:10:12 +00:00
Steve Sanderson 41aae0b7e6 Add ability to append RenderFragment into a RenderTreeBuilder 2018-02-16 10:10:11 +00:00
Steve Sanderson 29a6175ac1 Define RenderFragment concept 2018-02-16 10:10:10 +00:00
Steve Sanderson 1ac5ee25c1 Rename RenderTreeBuilder's AddText to AddContent, since it will be used for other types too 2018-02-16 10:10:08 +00:00