websharper

WebSharper: Rpc-returned object are unusuable on the client or cause error

爱⌒轻易说出口 提交于 2020-01-06 07:53:10
问题 I have a few server-side objects with inheritrence hierarchy, like this: [<JavaScriptExport>] type [<AbstractClass>] A() = ... [<JavaScriptExport>] type [<AbstractClass>] B() = inherit A() [<JavaScriptExport>] type C() = inherit B() The above objects have certain fields and methods, which I have omitted for brevity. All of those can be compiled to javascript -- I receive no build errors. I have an RPC that would return a server-side created instance of such an object: module Remoting = [<Rpc>

Changing dependency of WebSharper.JQueryUI to load jquery-ui.js locally

落花浮王杯 提交于 2020-01-05 21:14:27
问题 I'm writing on a WebSharper sitelet that uses the JQueryUI extension. The HTML generated by the WebSharper sitelet looks like this: <html> <head> ... <script src="//code.jquery.com/ui/1.11.1/jquery-ui.js" ...></script> I'm frequently without internet while developing, so I'd really like to serve jquery-ui.js off the development server instead. That is, I'd much rather have this: <html> <head> ... <script src="/Scripts/jquery-ui.js" ...></script> The docs say this should be possible by setting

F# ionide websharperserverclient - how to run

北战南征 提交于 2019-12-14 01:00:44
问题 I have a problem with running websharperserverclient template app from ionide project generator, and cannot find any information on the web how to do it - the closest thing i got was this question - I actually tried to run it with xsp4 in the project folder (where the Web.config file is) but every time got a 404 (screenshot attached: xsp4 error). Of course before starting xsp i run the ./build.sh (or FAKE build ) script and it finishes with no errors. I had no problems with websharpersuave

How do I generate data for Google Visualizations on the server using WebSharper

别说谁变了你拦得住时间么 提交于 2019-12-11 03:54:44
问题 My goal is to be able to generate data for a Google Visualizations on the server, and then pass it to the client as java script so that it can be rendered as a line chart. My example below compiles correctly, but produces an error when rendered in a browser. What do I need to do to get the DataCommon object to render correctly as java script, after it has been built on the server? namespace Website open System type Action = | Test module Page = open System.Web open IntelliFactory.WebSharper

WebSharper F# - How to run a template project created with VS Code and Ionide?

谁说我不能喝 提交于 2019-12-10 21:44:09
问题 I have never worked with .NET before and I would like to know how to run a WebSharper F# project without any IDE. Context I'm running Linux with Mono 4.4.2 The project was created with VS Code and Ionide, using the template websharperserverclient I'm able to compile the code using the automatically generated file build.sh or by executing xbuild , but only .dll files are generated, I couldn't see any .exe I thank in advance for any help! Updates Using websharperserverclient I get weird results

Deploy WebSharper.Suave web application to Heroku

岁酱吖の 提交于 2019-12-10 21:09:42
问题 I can not understand what I need to change to make it. I created a demo project from this blogpost with app.json and Procfile: web: fsharpi-heroku WebsahrperSuaveHerokuExample1.sln Next, I tried to deploy it to Heroku in accordance with these recommendations: heroku create websahrper-with-suave-example --buildpack https://github.com/SuaveIO/mono-script-buildpack.git heroku git:remote -a websahrper-with-suave-example git push heroku master There was an error in Heroku when building the project

WebSharper JQuery Mobile Page Hidden

不想你离开。 提交于 2019-12-10 19:38:51
问题 I'm trying to put together a JQuery Mobile site using the F# WebSharper Framework. In WebSharper parlance I have created a Pagelet using JQueryMObile controls which is being served by a Sitelet. Everything compiles and runs, the problem is in the html that is generated. The page I have declared (simplePage) clearly exists in the markup and is marked with the JQueryMobile css class ui-active to make it visible. However, it is surrounded by a div that is also a page but is not marked with the

WebSharper - How to expose dynamically mapped strategy-pattern objects on the server to the client?

◇◆丶佛笑我妖孽 提交于 2019-12-06 12:28:39
问题 I am at the process of learning WebSharper, and I am struggling with making some of my logic work on the client-side. I have a few server-side objects with inheritance hierarchy, which I need to expose to the client-side. They deal with generating different parts of the page as doc fragments -- but on the client. [<JavaScriptExport>] type [<AbstractClass>] A() = abstract member Doc: Map<string, A> -> Doc ... [<JavaScriptExport>] type [<AbstractClass>] B() = inherit A() [<JavaScriptExport>]