I've been playing around with WebSharper for a couple of weeks now and am working on my first major sample. Hopefully, the FPish community can help me perform a sanity check to see if I'm making the following decisions for the right reasons:
(1) I decided to go with creating an offline HTML application (in the templates, it is "WebSharper 2.4 HTML Application (Sitelets)") because the website is hosted on a LAMP server and doesn't have the ability to host a DLL file or any server-side content. Any server-side functionality that the client needs is provided through an existing RESTful service. I was planning to use jQuery or some other asynchronous mechanism to retrieve/save data as needed. Is this the right decision? Should I create a "WebSharper 2.4 Web Application (Sitelets)"?
(2) When I created a couple of test offline applications, they started with sample code that includes server-side concepts. Upon compiling the application, it creates both a DLL and a HTML/JS-only set of files. Just running the HTML files off my local computer without a server seems to work. I integrated some of the Formlet examples from the manual and it looks like they are working correctly. I'm assuming that the DLL is used by WebSharper to translate some of the code from F# to JS, but I'm not sure. Is the DLL file just a by-product of the compilation process that I can ignore?
(3) When I integrated the Formlet examples into the applications, I ended up creating viewers similar to this:
type PersonFormViewer () =
inherit IntelliFactory.WebSharper.Web.Control ()
override this.Body = PersonFormlet :> IntelliFactory.WebSharper.Html.IPagelet
However, the documentation for
says that it is for creating server-side ASP.NET controls. Is this the correct way to do it or should I be doing something else?
(4) From my limited understanding of .NET and WebSharper (this is the first time I've ever played with .NET, ASP or a windows-based server framework for web development), [<RPC>]-tagged sections of code should not exist in a client-only app. My mental picture of the whole RPC process is similar to how Google does it with GWT and GAE. I assume that all RPC-tagged sections are compiled to .NET code that runs on the server. Is this a correct assumption? Also, are there other parts of WebSharper that I should not use when writing a client-only application?
Those are just the questions I can think of at this time but if anyone has any advice on creating a client-only website that integrates with an existing network-based service, I would really appreciate your insights.
Thank you for your time and help,
z.EDIT: I was able to answer question 3 myself after reading [link:groups.google.com] where Anton explains the bridging between server and client-side combinators. Apparently I did it correctly.