Commit Graph

53 Commits

Author SHA1 Message Date
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
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 4202a6c9e1 In JsonUtil, support DateTimeOffset. Fixes #218. 2018-03-15 17:25:50 +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 3ef78dcb7b Stop treating RenderFragment as immutable, because its output isn't 2018-03-05 02:02:26 +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 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 58ae5dea9a Additional methods on ParameterCollection to simplify usage 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 95023c0300 In RazorCompiler, support components with children 2018-02-22 11:07:03 +00:00
Steve Sanderson 7073429cd5 Clean up and include routing unit tests 2018-02-21 10:22:03 +00:00
Steve Sanderson 6e7c4ec6c0 Tests for LayoutDisplay component 2018-02-16 17:23:12 +00:00
Steve Sanderson df825de86d Reorganise some test helpers in shared locations 2018-02-16 17:23:04 +00:00
Steve Sanderson f91d1d4803 Better handling of render-after-disposed scenarios 2018-02-16 12:10:44 +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
Steve Sanderson acc5b9461b Add ability to add component frame using runtime type object instead of generic param 2018-02-16 10:10:07 +00:00
Steve Sanderson 848f24536a Support "Region" frames in diffing 2018-02-14 23:41:24 +00:00
Steve Sanderson a9822216f1 Add the concept of a "Region" render tree frame 2018-02-14 23:41:24 +00:00
Steve Sanderson 0eb0555303 Eliminate IComponent.BuildRenderTree to guarantee that components are only rendered by themselves 2018-02-13 19:47:37 +00:00
Steve Sanderson 70a3ee3d98 Remove externally-callable Renderer.RenderInNewBatch() now that rendering is triggered by components themselves 2018-02-13 17:06:00 +00:00
Steve Sanderson 804ab2d89f Add IHandleEvent concept so components can define their own lifecycle around events 2018-02-13 16:42:21 +00:00
Steve Sanderson 861154764c Introduce IComponent.SetParameters, moving parameter-setting and rerendering logic into component base class 2018-02-13 15:00:53 +00:00
Steve Sanderson 37217db73a Implement ParameterCollection 2018-02-13 13:14:55 +00:00
Steve Sanderson 695ddc0fd6 Add Init/RenderHandle concepts so components can rerender themselves arbitrarily (e.g., after internal state change) 2018-02-13 11:49:33 +00:00
Steve Sanderson e37e22aa27 Further renderer refactoring 2018-02-10 10:55:44 +00:00
Steve Sanderson 15ddcd03b0 Major refactor of responsibilities in rendering code. Not quite done
with this yet either.
2018-02-09 14:50:07 +00:00
Steve Sanderson 91314ee8c8 Rename RenderTreeDiffComputer -> RenderTreeDiffBuilder 2018-02-08 15:50:14 +00:00
Steve Sanderson b8ed7bc2c5 Track event handlers via explicit IDs rather than by index into frames
array
2018-02-08 15:31:45 +00:00
Steve Sanderson 83fa72bc7e Have RenderTreeDiff build its own array of referenced frames rather than pointing to the latest render tree
This is in preparation for supporting multiple diffs for the same
component in a single batch (which means we can't rely on there being at
most only new render tree per component)
2018-02-07 10:27:32 +00:00
Steve Sanderson 33932f41fc Replace "DescendantsEndIndex" concept with "SubtreeLength"
In other words, use relative addressing so that frame data is
independent of its position in the array
2018-02-07 10:27:32 +00:00
Steve Sanderson 93f17219ea Rename OpenComponentElement -> OpenComponent for consistency 2018-02-05 00:19:44 +00:00
Steve Sanderson 1fda744770 Make RenderTreeFrame properly readonly to allow more pass-by-ref cases 2018-02-05 00:16:08 +00:00
Steve Sanderson f1332919bc Rename RenderTreeNode -> RenderTreeFrame (and correspondingly, "node" ->
"frame" everywhere)
2018-02-04 22:21:29 +00:00
Steve Sanderson 76dafa819f Mechanism for components running logic when parents change their properties 2018-01-31 16:19:01 +00:00
Steve Sanderson 50a5baa872 Dispose components on removal 2018-01-30 10:00:30 +00:00
Steve Sanderson 55592f583b Update RendererTests to be more explicit about batch expectations 2018-01-29 20:28:38 +00:00
Steve Sanderson 080e6395cb Move to batched rendering 2018-01-29 20:16:42 +00:00
Steve Sanderson 27d0ce4da9 Begin differentiating between rendering as a new batch on in an existing batch (even though batches don't exist yet) 2018-01-29 16:47:52 +00:00
Steve Sanderson 882096755b Rerender child components when their parameters change 2018-01-26 14:25:26 -08:00
Steve Sanderson 94ad26a479 Update properties on retained child components 2018-01-26 11:58:43 -08:00
Steve Sanderson 9f7dab3096 Better error handling when setting properties on child components 2018-01-26 10:10:06 -08:00
Steve Sanderson 3940ca8b60 For components, allow attribute values to be arbitrary objects 2018-01-26 09:54:35 -08:00