Commit Graph

594 Commits

Author SHA1 Message Date
Robin Sue b5128a7efd Add support for sending and receiving arbitrary HttpContent, refs #479 (#815)
* Add support for zero copy byte array marshalling

* Add support for sending arbitrary HttpContent, refs #479

* Fix unit test to set ContentType correctly

* Add support for receiving binary data

* Compare header case insensitive

* Add unit test for binary http requests
2018-05-23 10:16:27 +01:00
Ryan Nowak e801707706 Add regression test for 609 2018-05-22 13:58:04 -07:00
Ryan Nowak 3af9f4abd9 Update Korebuild 2018-05-22 13:53:14 -07:00
Ryan Nowak c6148b6fe6 Fix #784 - allow complex content for HTML
The logic that binds event handlers was interfering with the code that
prevents component properties from receiving complex content.

This check was a little overzealous.
2018-05-22 11:58:46 -07:00
Ryan Nowak 9aed80aaed Refactor VS references
Changing to a different set of references for tooling. This is a more
conservative set and will be less likely to break in the future.
2018-05-22 11:10:15 -07:00
Ryan Nowak a88b24ed76 Resolves #297
Removes the workaround for #297 and sets the langauge version to
experimental.

This will require 2.1.0-rc of Razor.
2018-05-22 11:10:15 -07:00
Ryan Nowak eeed731587 Update ASP.NET Core dependencies to RC 2018-05-22 11:10:15 -07:00
Attila Hajdrik 480691d3ed Convert the member names to camelCase for interfaces/class/types getting marshalled to C# side. 2018-05-22 13:19:09 +01:00
Gutemberg Ribeiro ad501dc77f Event payloads for DOM event types 2018-05-22 13:12:55 +01:00
Steve Sanderson 866368192f Remove launchSettings.json from standalone template now we support
running on IISExpress by default

This reverts commit 84e6d259af314a9564521033d069dd30ac1fe8e8.
2018-05-22 13:02:59 +01:00
Steve Sanderson e33cb4a354 Simple autorebuild mechanism for hosted apps (#787)
* Simple autorebuild mechanism for hosted apps

* CR feedback: DI changes; use Directory.EnumerateFiles

* CR feedback: Ensure FileSystemWatcher isn't GCed
2018-05-22 13:02:36 +01:00
Ryan Nowak e4cf7a6d3e Fix #773 (for real this time)
The problem is that the new HTML rewrite pass was traversing into
attributes of all kinds and would turn any HTML content inside those
attributes into elements where possible. The solution is to not do
that.
2018-05-14 10:47:36 -07:00
Ryan Nowak 3142217bec Fix #745 - allow multiple implements directives
The pass for this was 'break'ing after the first directive for no real
reason. Oops.
2018-05-08 14:06:22 -07:00
Ryan Nowak e1c2efb5ce Add tests for #773
This doesn't seem to repro anymore after fixing #772. Adding tests
anyway.
2018-05-08 13:38:23 -07:00
Ryan Nowak 3f5d25d314 Fix 773
We weren't handling a few cases that can occur during typing correctly.
Our passes that look at the content of attributes need to be prepared
for it to be empty in cases where the attribute has been partially
typed in the editor.

I added a smoke test for this that attempts to simulate typing and found
another issue to fix.

The end result of this is that the design for this kind of code is
simpler and takes a more 'brute-force' approach to understanding
attributes. I think this is a good change based on the problems with how
this code has been written today, there are too many possible cases to
try and have the code express and document them all.
2018-05-08 12:39:18 -07:00
Steve Sanderson 37788f3c9d In Blazor cshtml, auto-reference Microsoft.AspNetCore.Blazor and .Components (#751)
* In Blazor cshtml files, auto-import Microsoft.AspNetCore.Blazor and Microsoft.AspNetCore.Blazor.Components. Fixes #749

* Remove redundant @using directives from tests

* Update assertion in test

* Update all affected baselines
2018-05-05 17:55:08 +01:00
Suchiman 2192e00da5 Don't schedule StateHasChanged if async lifecycle events complete synchronously, fixes #760 2018-05-05 17:41:07 +01:00
Attila Hajdrik 043556d111 Add support for pointer events
Change oncontextmenu event from pointerevent to mouseevent (based on MDN docs) - it
2018-05-04 16:29:00 -07:00
Emiel Koning 6d872377ef typo
Just a small typo... ;-)
2018-05-04 10:42:28 -07:00
Steve Sanderson 20e43adac5 camelCase all the JSONs (#746)
* Add camelCase utility

* Use camelCase when JSON-serializing (but not for dictionary keys)

* Make JSON deserialization treat member names case-insensitively (but retain case on dictionary keys)

* Use camelCase in JSON in the samples and templates

* Reverse the order of the params for the camelcase test because it's weird otherwise

* CR feedback
2018-05-04 16:14:38 +01:00
Mark Dickinson f9ab9cc6e5 Added readFloatField 2018-05-04 15:12:26 +01:00
Steve Sanderson 27a676c4c7 Update TemplateBlazorPackageVersion in development 2018-05-04 09:13:18 +01:00
Ryan Nowak b390ae0c1c Rewrite of HTML handling for Blazor
This change replaces the parsing of HTML that we perform during the code
generation phase, which parsing of HTML during the IR lowering phase.
The main benefit of this change is that the structure of the HTML is
reflected in the IR tree, allowing us to do more more advance
transformations.

As an example, see how the the handling of `<script>` tags is now a
separate pass.

As an aside from this I also redesigned the structure of component IR
nodes to match the new HTML element nodes. Passes are now more easily
aware of the nodes they are expected to handle and are more easily aware
of the difference between a component and element. This still isn't as
clean as I would like, but I think it's a reasonable improvement.

Another benefit of this is that the code generation is much simpler and
requires much less bookkeeping and statefulness.
2018-05-03 21:56:03 -07:00
Steve Sanderson b4e70e72a0 Disable autorebuild in hosted projects due to VS 15.7pre5+ issue 2018-05-02 18:34:16 +01:00
Ryan Nowak 6a28aa99c6 remove inadvertant test code 2018-05-02 11:07:52 +01:00
Ryan Nowak 87375f6ba1 Add support for most (if not all events)
This change adds tag helpers and defines event types for all of the DOM
events we could find. You'll find it much easier now to subcribe to
these events.

While we did define new event types, we didn't substantially expand the
set of data that we serialize for events. We're looking for feedback on
what is most critical to have, and looking for contributions adding
those data and tests.
2018-05-02 11:07:49 +01:00
Steve Sanderson 05f5bb423a Update binding redirection version range for 0.4.0 2018-05-01 19:36:11 +01:00
Steve Sanderson e55509e187 Update version to 0.4.0-preview1-* 2018-05-01 19:32:13 +01:00
Daniel Roth 6a4e5726ac Update survey link 2018-05-01 09:55:11 -07:00
Steve Sanderson 20a7fe7c2e Add isMultiProjectTemplate to hosted template vs-2017.3.host.json. Fixes #332 2018-05-01 17:49:57 +01:00
Steve Sanderson be8f2d43ee Support custom events and non-bubbling standard events (#722)
* Support non-bubbling events

* Support responding to arbitrary events. E2E coverage of this and bubbling.

* Rename E2E test files to avoid clash with other PR
2018-05-01 17:12:03 +01:00
Steve Sanderson f61ed4df4f For checkboxes, bind to 'checked'. Fix special property handling in BrowserRenderer.ts. Fixes #659 and #703
* Stop the value<-->checked conversions for checkboxes. Just use native 'checked' property. Fixes #703

* Properly handle removal of 'checked' and 'value' attributes

* E2E coverage for removing 'value'
2018-05-01 16:40:07 +01:00
Steve Sanderson 644bd37e8c Add [Parameter] to route parameter in paging sample 2018-05-01 13:48:38 +01:00
Steve Sanderson 370edda02d Use separate filenames for the two different reference arg files 2018-05-01 10:15:21 +01:00
Marcus Bowyer e5d78f8886 Pass list of references via temp file for resolve-dependencies and build commands 2018-05-01 10:15:21 +01:00
Steve Sanderson 18b9a70dbe Encourage encapsulation of component parameter properties (#713)
* Before refactoring ParameterCollection assignment logic, add more test coverage

* Begin caching parameter assignment info

* Factor out some reflection code to a reusable location

* Use IPropertySetter to avoid all per-property-assignment reflection

* More error cases and tests for parameter assignment

* Enable binding to nonpublic properties

* Add analyzer to warn and provide fix for public component parameters

* Unit test for analyzer

* Component tag helper now includes private properties if they have [Parameter]

* CR feedback: Remove garbage from csproj

* CR feedback: Rename .Build.Analyzers to .Analyzers

* CR feedback: Move BlazorApi.cs to shared; use it from Analyzers test

* Fix incorrect test name

* Make as many parameters private as possible. Replace ILayoutComponent with BlazorLayoutComponent.

* In component tag helper discovery, consider private members too

* Reduce the work in component parameter discovery by not inspecting the BlazorComponent base class (or System.Object)
2018-05-01 10:08:01 +01:00
Daniel Roth ec1b220b7d Fixup project templates to handle project names with dashes (#692)
Fixes #291
2018-04-30 21:27:22 -07:00
Ryan Nowak f661021324 Add [Parameter] for component parameters
This change introduces ParameterAttribute to specify a bindable
component parameter. As of the 0.3 release of Blazor we plan to make
[Parameter] required to make a property bindable by callers.

This also applies to parameters when their value is set by the
infrastructure, such as `Body` for layouts, and route paramters.

The rationale behind this change is that we think there is a need to
separate the definition of properties from their suitability for a
caller to set them through markup. We plan to introduce more features in
this area in the future such as marking parameters as required. This is
first step, and we think that this approach will scale nicely as we add
more functionaly.

The 0.3 release seems like the right time to change this behavior since
we're also introducing `ref` for captures in this release.
2018-04-30 13:35:08 -07:00
Steve Sanderson 76bf82eb49 OnAfterRender / OnAfterRenderAsync (#691)
* Implement OnAfterRender and OnAfterRenderAsync

* Add E2E test combining OnAfterRender with "ref" and JS interop

... because this combination is the key to integration with 3rd-party JS
libs
2018-04-27 19:45:19 +01:00
Steve Sanderson 4033560734 Support 'ref' syntax for capturing references to elements and components (#685) 2018-04-27 17:41:21 +01:00
Steve Sanderson a700fa945e Fix ordering issue with nested logical element insertion 2018-04-27 15:43:59 +01:00
Emanuele Filardo 74b2b6b232 Set Program class as public in standalone project template 2018-04-26 23:25:13 +01:00
Ryan Nowak ed06d7b12e Rough cut at async events 2018-04-26 13:31:28 -07:00
Steve Sanderson c8cc0145e0 Make Razor.Design a transitive dependency
By making Razor.Design a transitive dependency of Blazor.Build we can
avoid the need for users to care which version of Razor we depend upon,
and take it out of the templates.
2018-04-25 15:46:48 -04:00
Zachary Becknell 0457a709be Update README.md 2018-04-24 21:31:24 -04:00
Steve Sanderson 60dcc6e568 In Razor compilation, trim leading and trailing whitespace nodes (#586)
* In Razor compilation, trim leading and trailing whitespace

* Update all unit tests to account for whitespace trimming

* Recognize that TagHelperIntermediateNode produces output too

* Skip TrimWhitespacePass during first phase of two-phase compile

* Skip TrimWhitespacePass during design-time builds

* Update baselines after rebase
2018-04-24 21:44:30 +01:00
Ryan Nowak c152ed9e2a Update baseline linendings 2018-04-23 21:48:13 -07:00
Steve Sanderson 6e85f4cb13 Replace 'nobr' with 'span.text-nowrap'. Fixes #652 2018-04-23 09:36:37 +01:00
Daniel Roth b05b3cac23 Add instructions for installing the VSIX from myget 2018-04-20 16:33:54 -07:00
Steve Sanderson 9f589b71df Fix diffing when "bind" is combined with conditional attribute. Fixes #624 2018-04-20 22:49:12 +01:00