diff --git a/src/Website/articles/20231011-bolero-0-23-released.md b/src/Website/articles/20231011-bolero-0-23-released.md new file mode 100644 index 0000000..10a3a83 --- /dev/null +++ b/src/Website/articles/20231011-bolero-0-23-released.md @@ -0,0 +1,95 @@ +--- +title: Bolero 0.23 released +subtitle: Router query parameters and .NET 8 compatibility +--- + +We are happy to announce the release of [Bolero](https://fsbolero.io) version 0.23. +Bolero is a library that enables writing full-stack applications in F#, whose client side runs in WebAssembly using Blazor. + +The main highlights of this release are: +* Improvements to routing, including query parameters, not-found handling and hash scrolling. +* .NET 8 compatibility. +* Better C# compatibility for server-side. + +Install the latest project template with: + +``` +dotnet new -i Bolero.Templates::0.23.TODO +``` + +## Routing improvements + +### Query parameters ([#309](https://github.com/fsbolero/Bolero/issues/309)) + +Inferred routers can now handle query parameter parsing. It is done using the syntax `?paramName={fieldName}`. + +```fsharp +type Page = + | [] Home + | [` (ie. an inferred router). + + * `Router.withNotFoundMsg` takes an Elmish message to send, and applies to any `IRouter<_, _>` (including manual routers). + + These functions apply when the initial URL is invalid, or when the URL is programmatically changed to be invalid. + They do not apply when the user clicks a link to an invalid URL, in order to allow external links. + +* [#309](https://github.com/fsbolero/Bolero/issues/309) Add support for query parameters in inferred routing with `EndPointAttribute`. + + * `?paramName={fieldName}` adds query parameter `paramName` corresponding to the union field named `fieldName`. This parameter is mandatory if `fieldName` is a string, boolean or number, and optional if it is an option or voption of these types. + + * `?{paramName}` is short for `?paramName={paramName}`. + +* [#313](https://github.com/fsbolero/Bolero/issues/313) Improve C# compatibility of server-side APIs. + For the following extension methods: + + * `IServiceCollection.AddBoleroHost` + * `IServiceCollection.AddBoleroRouting` + * `IEndpointRouteBuilder.MapFallbackToBolero` + + The following changes are applied: + + * Optional arguments are changed from F#-style to C#-style. This is a source breaking change for callers who use explicit syntax `?argument = optionValue`. + * Function arguments are changed from F#-style functions to C#-style `Func` or `Action`. + +* [#315](https://github.com/fsbolero/Bolero/issues/315) Support adding hash component to routing URLs: + + * Manually adding `+ "#foo"` to a routed URL will correctly scroll to the element named `foo` in the target page. + + * Methods `IRouter.Link` and `IRouter.HRef` take a new optional argument `hash: string` to link to the corresponding `#hash` in the target page. + +* [#316](https://github.com/fsbolero/Bolero/issues/316) Fix `on.stopPropagation` and `on.preventDefault` to take event names without the `on` prefix, for consistency with `on.event`. + +* [#317](https://github.com/fsbolero/Bolero/issues/317) Fix .NET 8 compatibility of the MSBuild task for scoped CSS. + +* [#317](https://github.com/fsbolero/Bolero/issues/317) Fix .NET 8 compatibility of the server-side rendering of nodes. + +* [#323](https://github.com/fsbolero/Bolero/issues/323) Use `WheelEventArgs` for wheel events and `ErrorEventArgs` for `on.error`. + +