Releases: fsbolero/Bolero
Bolero 0.14
-
#135 Inferred router performs URL encoding/decoding on
string
-typed parameters. -
#151 Accept either a relative or absolute path in custom router's
getRoute
. -
#155 Add function
fragment
to create a BoleroNode
from a BlazorRenderFragment
. -
#159 Breaking change: Remove the module
Bolero.Json
, and use System.Text.Json together with FSharp.SystemTextJson instead for remoting.Remoting serialization can be customized by passing an additional argument
configureSerialization: JsonSerializerOptions -> unit
toservices.AddRemoting()
in both the server-side and client-side startup functions.
Bolero 0.13
This release upgrades the minimal required version of .NET Core SDK to 3.1.300.
-
Update dependencies to Blazor 3.2.0.
-
Add Elmish commands for JavaScript interop:
Cmd.ofJS : IJSRuntime -> string -> obj[] -> ('res -> 'msg) -> (exn -> 'msg) -> Cmd<'msg> Cmd.performJS : IJSRuntime -> string -> obj[] -> ('res -> 'msg) -> Cmd<'msg>
-
#127 Add
lazyComp*By
family functions based on a key function (as opposed tolazyComp*With
's equality function):lazyCompBy : ('model -> 'key) -> ('model -> Node) -> 'model -> Node when 'key : equality lazyComp2By : ('model -> 'key) -> ('model -> Dispatch<'msg> -> Node) -> 'model -> Dispatch<'msg> -> Node when 'key : equality lazyComp3By : ('model1 * 'model2 -> 'key) -> ('model1 -> 'model2 -> Dispatch<'msg> -> Node) -> 'model1 -> 'model2 -> Dispatch<'msg> -> Node when 'key : equality
-
#142 Add functions to create Blazor component attributes of certain types for which
=>
is not sufficient:- For parameters of type
EventCallback<'T>
:attr.callback : string -> ('T -> unit) -> Attr attr.async.callback : string -> ('T -> Async<unit>) -> Attr attr.task.callback : string -> ('T -> Task) -> Attr
- For parameters of type
RenderFragment
:attr.fragment : string -> Node -> Attr
- For parameters of type
RenderFragment<'T>
:attr.fragmentWith : string -> ('T -> Node) -> Attr
- For parameters of type
-
#141 Add injectable
Bolero.Server.RazorHost.IBoleroHostConfig
to provide configuration for the server-side Razor host. This is used within the Razor page by calling the extension methods onIHtmlHelper
:member RenderComponentAsync<'T when 'T :> IComponent> : IBoleroHostConfig -> Task<IHtmlContent> member RenderBoleroScript : IBoleroHostConfig -> IHtmlContent
and injected using the extension method on
IServiceCollection
:member AddBoleroHost : ?server: bool * ?prerendered: bool * ?devToggle: bool -> IServiceCollection
Bolero 0.12
- #119: Correctly apply model changes to inputs using
bind.*
- Upgrade to Blazor 3.2-preview2
Bolero 0.11
This release upgrades the minimal required version of .NET Core to 3.1.
Features
-
#95 Add
on.async.*
andon.task.*
event handlers that use callbacks returningAsync<unit>
andTask
, respectively. -
#86 Add
attr.aria
to create ARIA accessibility attributes. -
#97 Add
on.preventDefault
andon.stopPropagation
to prevent the default behavior of an event and to stop its propagation to parent elements, respectively. -
#102 BREAKING CHANGE: The API for binders have been changed. The
bind
module now contains submodulesbind.input
andbind.change
which in turn contain functions for the type of value being bound:string
,int
,int64
,float
,float32
,decimal
,dateTime
anddateTimeOffset
. Additionally, a modulebind.withCulture
contains the same submodules with functions taking an additionalCultureInfo
as argument to specify the culture to use to parse the value. -
#103: Optimization: use
Async.StartImmediateAsTask
rather thanAsync.StartAsTask
internally. -
#105: New functions
lazyComp
,lazyCompWith
,lazyComp2
,lazyComp2With
,lazyComp3
andlazyComp3With
allow creating components whose view is only updated when the model is actually changed. For users familiar with Fable, they are close equivalents to itslazyView
family of functions. -
#106:
ProgramComponent.Dispatch
is now public, and can be used for scenarios whereProgram.withSubscription
is insufficient.
Bolero 0.10
Features
-
#82 Calls to
attr.classes
andattr.``class``
are now combined into a singleclass
attribute.div [attr.classes ["a"; "b"]; attr.``class`` "c"; attr.classes ["d"]] []
becomes:
<div class="a b c d"></div>
-
#87
ecomp
now takes an additional list of attributes as first argument. -
#89
ProgramComponent
now has the same methodShouldRender : 'model * 'model -> bool
thatElmishComponent
has. The full program is not re-rendered if this returns false after an update. Thanks @laenas! -
A new type alias
Program<'model, 'msg>
represents the exact type of Elmish programs used by Bolero. It corresponds toProgram<ProgramComponent<'model, 'msg>, 'model, 'msg, Node>
.
Bolero 0.9
.NET Core version requirement
- Updated .NET Core dependency to version 3.0 RTM and Blazor to 3.0-preview9.
New features
-
#78, #79: Add PageModels. PageModels allow adding a model specific to a page. The new APIs are:
namespace Bolero type PageModel<'T> = { Model : 'T } module Router = val inferWithModel : makeMessage: ('page -> 'msg) -> getEndPoint: ('model -> 'page) -> defaultPageModel: ('page -> unit) -> Router<'page, 'model, 'msg> val noModel : PageModel<'T> val definePageModel : PageModel<'T> -> 'T -> unit
Bolero 0.8
.NET Core version requirement
- Updated Blazor and .NET Core dependencies to version 3.0-preview8, with associated API changes.
Breaking changes
-
#73 Removed the server-side module
Bolero.Remoting.Server.Remote
with its functionswithHttpContext
,authorize
andauthorizeWith
.Instead, a new type
IRemoteContext
is provided via dependency injection:type IRemoteContext = inherit IHttpContextAccessor // member HttpContext : HttpContext with get, set member Authorize : ('req -> Async<'resp>) -> ('req -> Async<'resp>) member AuthorizeWith : seq<IAuthorizeData> -> ('req -> Async<'resp>) -> ('req -> Async<'resp>)
There are also new overloads on
IServiceCollection.AddRemoting
that takeIRemoteContext -> 'Handler
as argument, so that remote handlers that use authorization don't need to switch to using DI.
New features
-
#61 Add
attr.key
to uniquely identify elements in a list to help the renderer. See the corresponding @key attribute in the Blazor documentation. -
#70 Correctly provide the
HttpContext
to remote functions when running in server mode. -
#71 Add new exception
RemoteException of HttpResponseMessage
, which is thrown on the client side when the response code is neither 200 OK (which succeeds) nor 401 Unauthorized (which throwsRemoteUnauthorizedException
).
Bolero 0.5
- Updated Blazor and .NET Core dependencies to version 3.0-preview5, with associated API changes
- Remove the use of a ThreadLocal in Remote.withContext
Bolero 0.4
Breaking changes
-
NuGet package reorganization:
- The package
Bolero.HotReload.Server
is obsolete. - The new package
Bolero.Server
contains the assembliesBolero.HotReload.Server.dll
, moved from packageBolero.HotReload.Server
, andBolero.Server.dll
, moved from packageBolero
.
- The package
-
#22 Move the server-side and client-side
AddRemoting
extension methods to namespacesBolero.Remoting.Server
andBolero.Remoting.Client
, respectively.
Features
-
#24 Add remoting authentication.
-
Add F#-friendly extension methods on
HttpContext
for authentication:member AsyncSignIn : name: string * ?persistsFor: TimeSpan * ?claims: seq<Claim> * ?properties: AuthenticationProperties * ?authenticationType: string -> Async<unit> member AsyncSignOut : ?properties: AuthenticationProperties -> Async<unit> member TryUsername : unit -> option<string> member TryIdentity : unit -> option<Identity>
-
Add module
Bolero.Remoting.Server.Remote
with remote function wrappers to get access to theHttpContext
and mark a function as requiring authorization:module Remote = val withContext : (HttpContext -> 'req -> Async<'resp>) -> ('req -> Async<'resp>) val authorize : (HttpContext -> 'req -> Async<'resp>) -> ('req -> Async<'resp>) val authorizeWith : seq<IAuthorizeData> -> (HttpContext -> 'req -> Async<'resp>) -> ('req -> Async<'resp>)
-
-
#28 Templating: Holes that fill an HTML attribute's value (eg:
some-attr="${SomeHole}"
) now have typeobj
rather thanstring
.
Bug fixes
- #29 Templating: fix exception when using the bound value of a number input as a text hole.
Bolero 0.3
Features
- #26 Template hot reloading.
HTML templates can now be reloaded live while the application is running. See the documentation.