You mean this?

By on 10/24/2016 3:29 PM ()

No, I mean a way to create Javascript at runtime, without an external C#/F#-to-Javascript compiler.

Since you can get syntax trees from F# expressions, and also to a more limited degree the in C# with C# expressions, I would think that this should be possible.

It has really nothing to do with enumerables per se.

I'm asking because I'm evaluating what options I have to create "a little" Javascript without committing to a much more involved build process. Also, that would be a great way to interactively create Javascript from C#/F# in LINQPad.

By on 10/25/2016 4:53 AM ()


it is possible to use the WebSharper compiler at runtime with the Zafir.Compiler package (for WS4 beta, or WebSharper.Compiler for stable).

For example is using this, reading the source code with FCS and Roslyn first. But it is not properly documented yet, we will create a documentation and sample soon.

For WebSharper 3, you can check out WebSharper.Warp. This is a tool for setting up WebSharper applications from the F# interactive, and also involves translating to JS from F# quotations. We will soon look into updating this for WebSharper 4 too, I will reply here when this is done.

By on 10/26/2016 8:14 AM ()

Hi AndrĂ¡s

I have been using the Zafir/Websharper Compiler for a while to generate JS code but only from the server. Is it possible to use it purely from the client side (javascript) too?

Another question I was trying to use "query expressions" (linq) in F# but I get the following message: "Type not found in JavaScript compilation: Microsoft.FSharp.Linq.QueryBuilder"" is this supported? am I missing a specific library?

By on 2/28/2018 11:25 AM ()


Compiling fully on the client would need FSharp.Compiler.Service and WebSharper compiler to run in transpiled form. There are some experiments towards this, but no definite plans.

Since WebSharper 4.x has full client-side support for System.Linq extension methods (which you can use from F# too), adding a proxy for QueryBuilder would be quite straightforward, thanks for the tip! I am adding this as a ticket on GitHub.

By on 3/1/2018 2:30 AM ()

Great! thank you!

By on 3/1/2018 4:22 AM ()

That's probably not a route I would go right now, but thanks for the answer.

By on 10/28/2016 8:06 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us
Built with WebSharper