Commit Graph

548 Commits

Author SHA1 Message Date
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
Daniel Roth d0e09a066c Change blazorlib output type to Library 2018-04-19 16:06:32 -07:00
Ryan Nowak f5dc6df13d Fix #597 Allow multiple tokens in attributes
The issue here is that we were missing tests for the design time code
path. We have tests that the bind-... cases work at runtime but were
missing coverage for the editor.

I took the most relevant set of the tests for running bind-... code and
added them to the tests for codegen.
2018-04-19 16:14:10 -04:00
Steve Sanderson d02436d55c Bootstrap 4 and new styling (#619)
* Upgrade to bootstrap v4

Remove  redundant MIME type

* Add new styling to StandaloneApp

* Update THIRD-PARTY-NOTICES.txt

* Update version of Blazor used by templates when running from source

* Update styling on BlazorStandalone.CSharp template

* Tweak brace style

* Update styling in BlazorHosted.CSharp template

* Update E2E tests that rely on specific CSS

* Add Open Ionic fonts license to notices too
2018-04-19 21:06:28 +01:00
Ryan Nowak 195bf63c6c Fix line endings on OSX
This change makes our baseline system use CRLF for line endings end to
end. This isn't needed for correctness, but it helps with quality of
life when developing on OSX.

This will avoid churn to the baseline files related to line endings when
updating.

This might only take effect if you nuke the TestFiles directory and
check it out again.
2018-04-18 15:04:35 -04:00
Steve Sanderson ac1af2274b Eliminate wrapper elements (#602)
* Factor out all DOM-structure modifying code into an abstraction. Currently, implementation is still backed by the same underlying DOM APIs

* Implement LogicalElement properly (store hierarchy in own property; use comment nodes as containers)

* In LogicalElement, be explicit about unsupported scenarios

* Update E2E tests to stop assuming existence of wrapper elements

* Where supported, store private properties using opaque symbols as keys
2018-04-18 13:54:25 +01:00
Daniel Roth ab023a375d Fix readme typo 2018-04-17 16:14:29 -07:00
Daniel Roth 5a29f2934e Point to Blazor getting started guide 2018-04-17 11:22:51 -07:00
Zachary Becknell dd7bd2ba20 Update README.md
Update SDK link
2018-04-17 11:17:00 -07:00
Zachary Becknell a9dc626cbe SimpleJson: more informative exception when attempting to deserialize
object with non-empty constructor
2018-04-17 14:35:02 +01:00
Steve Sanderson 6c5f2a2262 Fix for logic around whether to include custom restore sources in template output 2018-04-17 09:43:45 +01:00
Ryan Nowak 2027dd4acd Quote MSBuild arguments 2018-04-16 15:08:22 -07:00
Ryan Nowak fb560b0c7b Update README.md
Fix typos
2018-04-16 14:34:19 -07:00
Ryan Nowak 62de983753 Update README.md 2018-04-16 13:06:29 -07:00
Guillaume ZAHRA 5112f9b310 AutoRebuild: System.ComponentModel.Win32Exception : 'Access denied'
Current AutoRebuild implementation crash if trying to launch the app hosted in IIS.

Current found hierarchy:

- svchost
|
   -- w3wp
   |
     -- VSIISExeLauncher
     |
       -- dotnet

devenv is not found of course in this scenario.

Even if the try catch seem to be good, when accessing the root process svchost, this exception is thrown:

System.ComponentModel.Win32Exception : 'Access denied'

in the 'while' statement

Due to this behavior, the try/catch need to be bubbled on the top of the while loop in order to have the correct behavior in case of fatal failure.
2018-04-16 16:01:39 +01:00
Steve Sanderson 03b8f2c99f Update templates' global.json files to require SDK 2.1.300-preview2-008533 2018-04-16 10:03:19 +01:00
Steve Sanderson b4c023b053 Only remove templates' custom RestoreSources for final 'rtm' builds 2018-04-16 09:52:28 +01:00
Zachary Becknell 1ef5429ca9 Remove extra apostrophe 2018-04-16 09:39:32 +01:00
Steve Sanderson edf84cb80a Update link in compiler error message 2018-04-13 17:02:07 +01:00
Steve Sanderson 4cbf6cc64b Enable GenerateDocumentationFile. Add/fix XML docs. 2018-04-13 16:57:09 +01:00
Steve Sanderson 2f792cf53b Pass list of embedded resources candidate assemblies via temp file in intermediate dir. Fixes #554 2018-04-13 16:55:30 +01:00
Steve Sanderson ce8088f9a3 Inject MSBuild properties into templates during build 2018-04-13 16:50:33 +01:00
Steve Sanderson ce3c79e051 Reject script tags in components, but allow overriding. Fixes #552 (#553) 2018-04-12 16:28:31 +01:00
Steve Sanderson 2f4e60b134 Set 'NoRestartServerOnBuild' by default. This means we can re-enable IISExpress when we think people are all on VS15.7Pre3 or later 2018-04-12 12:12:09 +01:00
Steve Sanderson 2b5f61c8b1 Fixed version number of built templates package 2018-04-12 11:53:52 +01:00
Ryan Nowak 846d377b2c Update version numbers to 0.2 in preparation for 0.2 2018-04-11 11:10:17 -07:00
Steve Sanderson 7ec405f87e Update binding redirects for 0.3.0 builds 2018-04-11 18:39:23 +01:00
Steve Sanderson c91d250ab7 Bump package versions to 0.3.0-preview1-* 2018-04-11 18:17:00 +01:00
Steve Sanderson 50c4f4910f Update templates to Blazor 0.2.0-preview1-10195 2018-04-11 18:08:04 +01:00
Steve Sanderson fc4179efe6 Have server project template use Microsoft.AspNetCore.App preview 2 now we're requiring the newer .NET SDK 2018-04-11 18:08:04 +01:00
Steve Sanderson c9ecf46ed0 Change templates' global.json to specify SDK 2.1.300-preview2-008530 2018-04-11 18:08:04 +01:00
Steve Sanderson 39238d1884 Show templates in VS for ASP.NET 2.0 and 2.1 2018-04-11 18:08:04 +01:00
Ryan Nowak 8485e2ea10 Add support for Action event handlers
This change adds `Action` to the set of types that have an overload on
RenderTreeBuilder. Additionally, we special case `Action` in the runtime
because passing the event args via DynamicInvoke() would throw.

Finally, reverted some of the clutter introduced by the first pass of
the event handler feature.
2018-04-11 07:36:05 -07:00
Ryan Nowak 6d3838ef9d [WIP] Update templates
This is work in progress right now. We'll need to update again once
there's a build with the Action fix in it, and again to point to the
final package versions.

Just getting things staged ahead of time.
2018-04-11 14:25:54 +01:00
Steve Sanderson e727cf2419 Rename "blazor content" project to "blazor library". Fixes #539 2018-04-11 14:26:29 +01:00
Steve Sanderson 2478c164b5 Update Mono to 078d5147836 (#543)
* Update Mono to 078d5147836

* Update driver.c to match updated Mono version

* Rebuild Mono binaries

* Update dependency resolution baseline to match updated Mono BCL

* Add E2E test for new RuntimeInformation values
2018-04-11 14:00:03 +01:00
Steve Sanderson 3d787d7988 Auto rebuild when reloading after a file change. 2018-04-11 10:51:44 +01:00
Luke Latham 945995199c Template/sample updates 2018-04-10 22:41:07 -07:00
Ryan Nowak ed2dbbd2f8 Update to preview2 release versions 2018-04-10 18:14:40 -07:00
Ryan Nowak 15ba614e6f Remove old workaround @onclick and @bind
This change removes support for the old syntax used for event handlers
and two-way binding.

See the relevant issues for details on the new features and
improvements:

bind https://github.com/aspnet/Blazor/issues/409
event handlers https://github.com/aspnet/Blazor/issues/503

Along with this change we've removed a few additional things Blazor
could do that aren't part of Razor's usual syntax.

----

The features that was used to make something like:
```
<button @onclick(...) />
```

is an expression that's embedded in a an element's attribute. This
feature might be useful in the future if we want to support 'splatting'
arbitrary attributes into a tag, but the runtime support for this isn't
accessible outside the Blazor core.

----

The features that implement:
```
<button onclick=@{ } />
```

have been removed in favor of a better design for lambdas, method group
conversions and other things for event handler attributes.

use `<button onclick=@(x => ...} />` instead.

We think is a better approach in general, because we want the app
developer to write and see the parameter list.

----

Both syntactic features that have been removed have dedicated error
messages in the compiler. If you're porting old code it should help you
figure out what to do.
2018-04-10 16:54:15 -07:00
Ryan Nowak 05c166eafa Fix failing test
This is failing due to Steve and I's changes passing in the night.
2018-04-10 16:35:37 -07:00
Steve Sanderson bd2c8a09ef Improve JS-side event handling code. Fixes #433 2018-04-10 18:15:22 +01:00
Ryan Nowak df13669362 Improvements for delegate types (#516)
* Improve support for more types of event handlers

Improves support for for other types of event handlers with eventargs
types derived from UIEventArgs. Additionally fleshes out the set of
event handler types.

This change improves support for using more specific event handler types
like:

```
<button onclick="@Clicked" />

@functions {
    public void Clicked(UIMouseEventArgs e) { ... }
}
```

And:
```
builder.AddAttribute(12, "onkeypressed", KeyPressed);

...

void KeyPressed(UIKeyboardEventArgs e) { ... }

```

In particular what got better is:
- overload resolution for the AddAttribute method
- performance of different cases for AddAttribute

-----

The runtime now treats delegates as one of three types:
- arbitrary delegate: not attached to DOM events, not tracked by
renderer
- UIEventHandler: can attach to DOM events, tracked by renderer, first
class in IHandleEvents
- UIEventHandler-like: can attach to DOM events, tracked by renderer,
requires some special runtime support.

The set of overloads on AddAttribute has been tuned with a few specific
cases in mind.

Lambda expressions in an attribute will be inferred as UIEventHandler
unless the compiler does something more specific. So for instance,
passing a lambda as an attribute value for a component, where the
component doesn't define a matching attribute, will always be inferred
as UIEventHandler.

We now support method-group to delegate conversion for methods that
accept a derived UIEventArgs type. This means you can use a signature
like `void KeyPressed(UIKeyboardEventArgs e)` without any compiler
magic, and this will work in the runtime as long as the event type
produced by the runtime matches.

We also allow user-defined UIEventArgs-derived types. There's a pattern
for this and it requires defining an extension method and delegate type.

The method-group to delegate conversion part required some doing. It
doesn't play well with generics (Action<T> where T : UIEventArgs)
doesn't work at all. Adding more actual overloads (as opposed to
extensions) would cause lambda cases we want to work to be ambiguous.

----

The performance win here is to remove the need for a 'wrapper' delegate
created by the event handler tag helper code. This wrapper is now
created by the runtime, but only *after* we have checked the frame for
changes. This requires more heavy lifting in the runtime, but has the
advantage of producing no-op diffs as often as possible.

You will still get some inefficient behavior if your component uses a
capturing lambda in an event handler, so don't do that.

* Add selenium logs to test output

* Minor feedback

* WIP
2018-04-09 13:21:12 -07:00
Steve Sanderson 281d5a8751 Enable same-origin credentials by default. Add E2E test to show they can be sent to different-origin domains too. 2018-04-09 12:54:13 +01:00
flash2048 e096d7e0b1 Correct the use of a parameter 'autoSpace' in the constructor 2018-04-09 12:08:20 +01:00
Ryan Nowak d3bdb987b0 Add a new feed dotnet-core
This is the *new* and most correct feed for our developer builds.
Leaving the old ones there for now because the other ASP.NET Repos also
left them there.
2018-04-08 14:24:06 -07:00
Ryan Nowak f2c78b0776 Update Razor dependency (non-template) 2018-04-08 14:24:06 -07:00