Commit Graph

524 Commits

Author SHA1 Message Date
Steve Sanderson 52813ddf63 Eliminate temporary MemoryStream buffers used during RenderBatch serialization (#1329)
* Eliminate temporary MemoryStream buffers used during RenderBatch serialization. Fixes #1132

* CR: Fix namespace
2018-08-21 14:08:39 +01:00
Daniel Roth 7a763fc4f6 Scan only declared methods for JS interop (#1320)
* Scan only declared methods for JS interop

* Add DotNetDispatcher test for JS invokable method on base class
2018-08-17 12:35:24 +01:00
Steve Sanderson 04427d2e28 Fix publishing following recent build changes (now that $(OutDir) is relative) 2018-08-15 13:55:54 +01:00
Ryan Nowak fd5426943f Merge sibling nodes during markup block rewrite
This change adds the ability to merge sibling nodes when possible during
markup block rewriting. We retain that invariant that each markup block
is a valid chunk of markup containing properly nested tags.

We still haven't done any work to remove whitespace yet, so most of the
cases where this comes into play right now will merge an element with
its surrounding whitespace.
2018-08-13 11:17:11 -07:00
Ryan Nowak a05cb42845 Reenable markup blocks (#1286)
* Reenable HtmlBlock unit tests

* Add E2E tests for HTML Block cases

* Remove harded GenerateBaselines=true

* Fix #1193

This commit addresses the root cause of #1193. When we merge HTML
text nodes into HTML blocks we need to re-encode any HTML entities that
were encoded eariler.

I did a bit of a deep dive on how HTML encoding is handled in Blazor and
I think this is the best strategy. I think it's valuable that the
BrowserRenderer uses document.createTextNode, which will always encode
the text - this handles dynamic content. We want to keep this in place
to avoid HTML injection attacks.

* Fix #1265 Reenable MarkupBlock

* test cleanup
2018-08-10 16:29:39 -07:00
uazo 7d92c07fba fix HtmlBlock codegen (#1209) 2018-08-08 17:46:37 -07:00
Nate McMaster 78045b2177 Automate authenticode code-signing using Roslyn sign tool
* Change project layout to prepare for upcoming Arcade changes
* Add signtool config file to configure OPC, NuGet, and Authenticode signing
* Fix a bug when BaseIntermediateOutputPath is set to an absolute path
2018-08-08 08:52:46 -07:00
Ryouko Konpaku e5ea2526b1 Fix for builds when the assembly has spaces on it's name. 2018-08-08 13:02:21 +01:00
Nate McMaster 22a3fbf861 Use $(TargetDir) instead of $(ProjectDir)$(OutputPath) 2018-08-06 16:48:36 -07:00
Steve Sanderson 16d005e00c Fix returning arrays in async JS interop calls. Fixes #1205 2018-07-27 10:11:45 -07:00
Steve Sanderson 4b861929be Temporarily disable HtmlBlockPass for 0.5.1. Will be re-enabled later. 2018-07-27 10:11:31 -07:00
Steve Sanderson 26aa6e838f Auto-remove the AspNetCorePackageVersion attribute from templates 2018-07-25 12:43:40 -07:00
Steve Sanderson a46dd91fd4 Fix server-side template custom restore sources condition 2018-07-25 11:24:07 -07:00
Steve Sanderson 4e892e74da Fix handling nonvoid elements in markup blocks (#1190)
* Fix empty nonvoid elements in markup blocks. Fixes #1186

* Also update another test
2018-07-25 09:53:52 -07:00
Steve Sanderson 0f8fdad593 Further 0.5.0 tweaks (#1191)
* Clarify debug instructions further

* Fix error message

* Add "using Microsoft.JSInterop" in templates

* Clarify template descriptions
2018-07-25 09:33:12 -07:00
Steve Sanderson b5ff6db1d4 Fixes for 0.5.0 (#1183)
* Fix macOS debug launch instructions

* Remove license headers from template files
2018-07-24 16:51:00 -07:00
Steve Sanderson 1236b77dfc Server template tweaks (#1181)
* Add server template projects to Blazor.sln

* Disable linking for server execution

* Minor tweaks to Startup.cs
2018-07-24 12:00:07 -07:00
Steve Sanderson 4aaeac1e51 preventDefault for form onsubmit handlers. Fixes #951 2018-07-24 08:11:02 -07:00
Daniel Roth 79c60c91af Fixup default value for TemplateBlazorPackageVersion in server-side template 2018-07-23 23:26:20 -07:00
Daniel Roth 214598e579 Update survey link for 0.5.0 2018-07-23 22:11:00 -07:00
Ryan Nowak 65d9499e57 Template updates for 0.5 (#1177)
* Add startup pattern for client-side templates

* Add Server Side Blazor template

* minor feedback

* rename project
2018-07-23 21:54:50 -07:00
Ryan Nowak 8b3f26b962 Fix #1169 ignore DOCTYPE
This change will cause the compiler to ignore <!DOCTYPE ...>
declarations in Blazor components. We don't think there's much useful
Blazor can do with doctype, since we don't generate textual output for
the browser the parse. The sanest thing to do for now is just to skip
over it.
2018-07-23 17:42:47 -07:00
Steve Sanderson d2f74249b1 Fix updating attributes on SVG elements. Fixes #934 and #1114 2018-07-23 16:03:18 -07:00
Steve Sanderson d3f74b9f43 Fix for blazor.config issue reported in #376 2018-07-23 13:30:50 -07:00
Steve Sanderson 0062ce2563 Fix publishing projects with content packages. Fixes #1156 2018-07-23 12:49:08 -07:00
Ryan Nowak 8f072a0711 Add HTML Block rewriting (#1146)
* Add HTML Block rewriter

* Baseline updates

* test gaps

* Update some unit tests to represent same behavior as before

* Define Markup frame type. Tests for rendering markup frames into render tree.

* Support markup frames during diffing (retain, insert, update, delete)

* Support markup blocks on WebAssembly

* Support rendering markup frames with server-side execution too

* Support markup blocks with multiple top-level nodes. Support updating markup dynamically.

* Define MarkupString type as a way to insert dynamic markup without needing custom RenderFragment code

* Remove comment

* CR: Better null value handling
2018-07-23 18:18:07 +01:00
Steve Sanderson 17b55b983a Export Blazor.platform for back-compat. Covers #1157 2018-07-23 10:15:58 -07:00
Steve Sanderson 0e4a657d2e TextDecoder polyfill (#1168)
* Polyfill for TextDecoder

* Move UTF8 decoder logic into a separate file. Don't polyfill globally.

* Workaround issue in UTF8 decoder logic

* Add attribution for fast-text-encoding

* Added TPN for fast-text-encoding
2018-07-23 17:33:39 +01:00
Steve Sanderson 41fcf65c05 Run E2E tests for server execution as well as WebAssembly. Fixes several
server-execution bugs uncovered by the E2E tests.
2018-07-19 18:57:17 +01:00
Steve Sanderson 154289ed3d Allow passing DotNetObjectRef to JS in interop calls, and invoking
instance methods on it
2018-07-19 18:57:17 +01:00
Ryan Nowak 38b3051d09 Fix Blazor tooling on 15.8 2018-07-17 15:18:40 -07:00
Steve Sanderson 970f591803 Support loading embedded resources for server-side execution too 2018-07-16 13:57:01 +01:00
Ryan Nowak 9778b2054a Add blazor.server.js (#1116)
Adds a server-side flavored blazor script.
2018-07-13 18:01:05 -07:00
Steve Sanderson ad7e98be04 Make index.html static again (#1123)
* Add build command for generating the new boot JSON file

* Remove build command for generating index.html

* Update build targets to generate blazor.boot.json

* Change SPA fallback routing to look for index.html in regular wwwroot. Will need to update setup for published apps later.

* Stop autorebuild when index.html changes, since we no longer 'build' that file

* Update Boot.WebAssembly.ts logic to use boot JSON info on startup

* Restore support for loading CSS/JS from Blazor library projects

* Use new startup script tag in all samples and templates

* Fix MonoSanity sample - it must now be an exe because we use that as the trigger to generate the boot json (not the presence of index.html any more)

* Fix SPA fallback routing for published apps

Because in a previous commit, I changed it to look for index.html inside "wwwroot" instead of "dist" (because we no longer build it). But "wwwroot" doesn't exist for published apps, because static file servers wouldn't understand it.

* CR: Fix path normalization
2018-07-13 09:49:34 +01:00
Steve Sanderson d9aafb05c1 In ws-proxy, don't let the debugger die just because some .pdb doesn't correspond to files we have locally 2018-07-10 13:49:55 +01:00
Steve Sanderson a728b42181 Avoid some ws-proxy crashes 2018-07-10 10:34:06 +01:00
Steve Sanderson 4868cdbfa3 Change BrowserRendererRegistry not to be static, and to scope the BrowserRenderer IDs to each instance
This is to ensure that, in multiuser scenarios, users can't interfere with each other by posting events for somebody else's renderer ID.

TODO: Still need to wire up or replace the temporary static BrowserRendererRegistry.CurrentUserInstance property to provide per-user storage.
2018-07-10 09:56:00 +01:00
Steve Sanderson 767a2373c8 Eliminate ElementRef's static incrementing ID for remote rendering cases
... because it's important not to disclose cross-user state, such as the number of IDs that have been assigned. Plus we don't want to run out of unique IDs, which we could if it's limited by the range of an 'int'.
2018-07-10 09:52:19 +01:00
Steve Sanderson c2f3128ef9 Extremely minor cleanups 2018-07-10 09:52:19 +01:00
Ryan Nowak ee62bd8d45 Add startup for client/mono Blazor
This change adds a host builder, and the startup pattern for client-side
Blazor apps running in mono/wasm. This will help us align better with
server side Blazor.
2018-07-09 11:13:26 -07:00
Joseph Musser ed57767e6a Removed trailing space from template survey link (#1099) 2018-07-09 13:47:07 +01:00
Steve Sanderson 7bc67e1481 Simple approach for minifying blazor.*.js on release builds. Fixes #1003
Later we might want to emit both min and non-min variants of the file, when there is some way for developers to control which one they use
2018-07-09 11:04:14 +01:00
Steve Sanderson 5bccac05fc Refactoring to prepare for remote rendering.
- Prepare for building multiple entrypoint variants of the .js library
- Use async interop more consistently for rendering and event handling
- Add binary serializer for RenderBatch with tests
2018-07-09 11:04:14 +01:00
Steve Sanderson cafb56569d Initial debugger support 2018-07-06 11:56:21 +01:00
Steve Sanderson c881a63a78 Include Mono Debug proxy code in Server project (temporarily until it's shipped as a NuGet package) 2018-07-06 11:56:21 +01:00
Steve Sanderson f483e6293e Update linker config following Mono upgrade to f382b069151 2018-07-06 11:56:21 +01:00
Ryan Nowak e0168eb0c8 Implement server-side sync context
This is a synchronization context we can use for server side blazor to
support a single logical thread of execution. This is optimized for
scalability and non-blocking behavior.
2018-07-05 12:41:31 -07:00
Ryan Nowak 8724b84a14 Fix #1068
This changes the bind lowering pass to be more tolerant of unexpected
and invalid content.
2018-07-05 11:28:54 -07:00
Ryan Nowak 844e38e641 Update versions to 2.1
Updates ASP.NET package versions to 2.1

Tweaks TFMs
- libraries = netstandard2.0
- exes/apps/tools = netcoreapp2.1
- unit tests = netcoreapp2.0
- e2e tests = netcoreapp2.1 (dependency on apps)

The exception to this is the Browser.JS project which depends on our
tool for its build. however this project just builds the js code so its
TFM doesn't really matter.
2018-07-05 09:53:55 -07:00
Ryan Nowak 45544858a3 Fix #954 - use weak typing for 'event handlers'
This change introduces a mechanism for bypassing type checking and then
uses for the 'event handlers'. The event handler tag helpers have some
ideosyncratic behaviors and rely on overloading at the render tree
builder level.
2018-07-05 09:15:01 -07:00