Commit Graph

206 Commits

Author SHA1 Message Date
Steve Sanderson fb3beab270 Link on build by default for all configurations, not only Release 2018-03-21 15:58:49 +00:00
Steve Sanderson cf237707f9 Log info message if IL linking is disabled. Fixes #302 2018-03-20 22:28:43 +00:00
Steve Sanderson 5bf0b891e9 In NavLink, support matching either complete URLs or just URL prefixes (both are necessary for typical nav menus) 2018-03-20 13:15:37 +00:00
Steve Sanderson d921705881 Add ParameterCollection.GetValueOrDefault methods 2018-03-20 12:18:44 +00:00
Steve Sanderson a88ab0db49 Support route constraints of the form ":type" (e.g, ":int", ":guid", etc.) 2018-03-20 10:17:00 +00:00
Steve Sanderson c58df0b739 Temporary workaround for #219 ("data-" attributes don't compile) 2018-03-19 18:09:53 +00:00
Steve Sanderson 87c4d3c53e Cover case-insensitive child component parameter names in E2E test 2018-03-19 12:59:59 +00:00
Javier Calvarro Nelson 70c4501497 [Fixes #220] Support `@page` with custom route template on components
* Updates the router component to scan for components within assemblies.
* Parses the templates on `[Route]` in component instances and builds a
  route table that maps paths to components.
* Uses the route table to map paths to components.
2018-03-16 19:15:00 -07:00
Steve Sanderson 2150820efe Implement Blazor.navigateTo for triggering navigation from JS code, and use it in E2E tests 2018-03-16 16:55:46 +00:00
Steve Sanderson d0731c337d Add IUriHelper.NavigateTo 2018-03-16 11:19:09 +00:00
Steve Sanderson cb473e8ad7 Add test case to show base-relative links work 2018-03-16 11:17:54 +00:00
Steve Sanderson a02ac60c8c Fix selection on <select> box. Fixes #157 2018-03-16 10:27:26 +00:00
Steve Sanderson 4202a6c9e1 In JsonUtil, support DateTimeOffset. Fixes #218. 2018-03-15 17:25:50 +00:00
Steve Sanderson 6b73892e78 Avoid culture assumption in SupportsTwoWayBindingForDateValuesWithFormatString test. Fixes #268 2018-03-15 13:25:52 +00:00
Steve Sanderson 0e9d52fe11 Support components and static content in external NuGet packages (#247)
* On build, drop <BlazorPackageContentFiles> items into dist\_content\(PackageName)\

* Add <script> and <link> tags to generated index.html

* Add testapp coverage of external content package. Still need to add E2E tests that uses it.

* Add missing unit test update

* Add example of packaging an entire Blazor component including CSS and images

* Add E2E test for component from NuGet package
2018-03-14 11:23:43 +00:00
Ryan Nowak 9549dccc54 Add @page directive
Adds the @page directive and support for specifying routes in components
at compile time.

For now the route is required and must begin with a leading /.
2018-03-14 11:23:43 +00:00
Javier Calvarro Nelson 700c2203c6 [Fixes #66] Adds linking support to the build
* Switch the tasks used to generate the blazor output to be MSBuild based.
* Package the optimized mono runtime and the BCL inside a nuget package.
* Add opt-in support for linking the application on build.
* Make the whole build process incremental.
2018-03-14 11:23:43 +00:00
Ryan Nowak ffadeecb45 Remove old <c:Foo> syntax 2018-03-14 11:23:42 +00:00
Ryan Nowak d175b4d38a Konvert to KoreBuild 2018-03-14 11:23:42 +00:00
Ryan Nowak 0c162e8c5a Allow non-property attributes to be set
This removes a limitation that prevented callers from passing
attributes to a component that aren't backed by properties.

The majority of the complication here is required to deal with the more
sophisticated way that HTML attributes are represented in the Razor IR.
2018-03-14 11:23:42 +00:00
Ryan Nowak c05657c7f2 Add support general delegate types
This builds upon existing support for UIEventHandler-typed component
properties and applies the same principle to any delegate type.

We try to help by generating the LSH of the lambda `=>` allowing you to
write `OnClick="Foo()"` rather than `OnClick="(e) => Foo()"`. You can of
course use @ as an escape.

The only rough edge here is that if the parameter names aren't memorable
for the delgate type, it's not super helpful.
2018-03-14 11:23:42 +00:00
Steve Sanderson c50f089269 Update BasicTestApp 2018-03-14 11:23:41 +00:00
Ryan Nowak 601e7914f7 Implement components as tag helpers
Implements Component code generation and tooling support end to end
udditionally adds some default `@addTagHelper` directives to make
programming in Blazor a little nicer.

Components are discovered as Tag Helpers using Razor's extensibility
during the build/IDE process. This drives the code generation during
build and lights up a bunch of editor features.

Add
2018-03-14 11:23:41 +00:00
Ryan Nowak 211561a6a6 Implement 2-phase compilation
This is a working (all tests passing) implementation of the two-phase
compilation system we will need for component discovery.

This builds on top of work we've doing in Razor, including the Razor
SDK, MSBuild tasks, and CLI/server.

This currently *does* discovery components during the build process, but
it doesn't use that data for anything yet.

It works like this:
1. Generate class declarations (structure only, no method bodies)
2. Compile a 'temp' assembly using the .cs files and output of 1.
3. Do component discovery using the 'temp' assembly
4. Generate class definitions (including method bodies)
5. Compile the 'real' assembly using the .cs files and output of 4.
2018-03-14 11:23:40 +00:00
Ryan Nowak 6182e8448d Get rid of RazorCompiler
Adds a little more use of Razor extensibility.

Razor is a plugin model, so we can't be the 'first mover' for initiating
compilation in the build tools and IDE.

Reorganizes tests and fills out more reusable test infrastructure for
Razor-driven testing.

Adds tests for declaration-only configuration.
2018-03-14 11:23:40 +00:00
Ryan Nowak daf6a404f9 Implement basic Component discovery
This is the basics of component discovery along with some tests.

The next set of changes will integrate it into the compilation process.
2018-03-14 11:23:40 +00:00
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
Florian Dohrendorf ef1b670b8b fix #216 2018-03-13 01:03:26 +01:00
Steve Sanderson 48ae58196d Add unit test to show JsonUtil handling IList<T> types 2018-03-12 10:52:59 +01: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
Steve Sanderson 649159e31d Use real BCL System.Net.Http.HttpClient. Implements #159 2018-02-28 17:37:42 +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 3e5381c17e Rename .DevHost project to .Cli, and make it work as a DotNetCliTool 2018-02-27 12:17:35 +00:00
Steve Sanderson 6995b974e9 Support @bind for textboxes and checkboxes 2018-02-26 14:39:56 +00:00
Steve Sanderson 02a0be5c2b Add JsonUtil unit tests plus E2E tests for new StandaloneApp pages 2018-02-26 13:01:11 +00:00
Steve Sanderson c0bf73234c Tweak (to force rebuild, since Travis just tried to build a branch that was already deleted) 2018-02-23 22:42:10 +00:00
Steve Sanderson 8590f6e7a5 Remainder of initial HttpClient features plus E2E tests 2018-02-23 22:31:26 +00:00
Steve Sanderson 88cc2caf45 Infrastructure for E2E tests where the app makes requests to an API server 2018-02-23 13:28:58 +00:00
Steve Sanderson ea6b6bcd19 Add an example API server project that can be used in E2E tests 2018-02-23 13:07:49 +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 82bcf9172a Convert the static UriHelper into a service, IUriHelper, and inject where needed 2018-02-23 10:35:28 +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 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
Steve Sanderson d388cb6510 Add E2E test covering nav menu and NavLink usage in StandaloneApp 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