Commit Graph

539 Commits

Author SHA1 Message Date
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
Ryan Nowak b106cf4d6c Update non-product dependencies 2018-04-08 14:24:06 -07:00
chassq 3f0c2b31a0 Update README.md
Wanted to make sure people knew to get the latest preview of VS 2017...
2018-04-07 19:29:41 -07:00
Daniel Roth 08d5a15013 Update survey links for 0.2.0 2018-04-06 15:15:48 -07:00
Ryan Nowak da3f686f0c Update KoreBuild and SDK
This updates the toolset the repo is using to build. Will merge this if
it passes.
2018-04-06 13:25:47 -07:00
Ryan Nowak c3366bc956 Add event handlers as tag helpers
This change adds support for mapping DOM event handlers as tag helpers
that function in a bi-modal way.

This is a new first-class feature for DOM events, and replaces a few
workarounds like using `@onclick(...)` or `click=@{ ... }`. I haven't
removed those things yet, this is a first pass to get the new support
in, we'll remove those things when we're totally satisfied.

When used with a string like `<button onclick="foo" />` the result is
a simple HTML attribute .

But when used with an implicit expression like
`<button onclick="@Foo" />` or
`<button onclick="@(x => Clicked = true)" />` a C# function is bound to
the click event from the DOM.
2018-04-06 13:00:04 -07:00
flash2048 3369208c28 Fix mistake in array index 2018-04-06 11:41:47 +01:00
Steve Sanderson a82fd5099e Force browsers to check for modifications to Blazor-served resources. Fixes #371 2018-04-06 10:58:23 +01:00
Steve Sanderson fef5a52183 Reference static content from referenced assemblies. Implements #340 2018-04-06 09:50:10 +01:00
Daniel Roth 05059d9aa3 Rename configure parameter to services 2018-04-05 12:03:54 -07:00