core
core copied to clipboard
WebSharper - Full-stack, functional, reactive web apps and microservices in F# and C#
`DomElement.ReplaceChildren` can't be used easily with empty params because of overload resolution: ![image](https://github.com/dotnet-websharper/core/assets/3116993/5a195947-b934-4a6f-a731-4f2eaa91a172) This is defined in WIG as such: `"replaceChildren" => !+(T + Node) ^-> T`. This is a...
For instance, `XMLHttpRequest.Onreadystatechange` should be correctly capitalized as `OnReadyStateChange`. https://github.com/dotnet-websharper/core/blob/bdb53e91665cd66d462851eaa85c47e962969db4/src/stdlib/WebSharper.JavaScript/Html5.fs#L2266 Be sure to keep the old variants as obsolete, with a message to update calls to the new one.
I am throwing an exception with `failwithf "...."` and catch it as: ```fsharp try ... with | exn -> printfn "%A" exn ``` ... and find that the error message...
Given the following F# code: ```fsharp [] type Position = { pos_fname: string pos_lnum: int pos_orig_lnum: int pos_bol: int pos_cnum: int } member pos.FileName = pos.pos_fname member pos.Line = pos.pos_lnum...
A debug-oriented middleware to use readable WebSharper outputs through vite: ```fsharp .Use(fun context (next: RequestDelegate) -> if context.Request.Path.StartsWithSegments("/Scripts") || context.Request.Path.StartsWithSegments("/@vite") then let proxyRequest = context.Request.Path.Value context.Response.Redirect($"http://localhost:5173{proxyRequest}") Task.CompletedTask else next.Invoke(context) )...
Last piece needed for working with Sitelets using module-based JS. For local debug mode, for readability and quick iteration, it would be best if one-file-per-class readable .js files are used....