The difference between what you are doing and a usual SPA is that in a usual SPA, the assembly is actually never run on .NET, only compiled to JavaScript. Functions like Doc.Input and Doc.TextView are not implemented for .NET, which is a problem in your case since you're actually running the code. I think turning main into a function by declaring it as let main() = ... and doing compiler.Compile(<@ main () @>, context = asm) should do the trick.

By on 11/17/2015 10:07 AM ()

Thanks a lot for the reply Loic, I understand now. After changing main to a function, it compiles it fine.

Although, the bundling of a UI.Next SPA, when executed with a normal project, seems to create a different JS which contains all the librairies and it also produces a MyApp.css/MyApp.head.js/MyApp.head.html.

Is it something that I can get from the CompiledAssembly returned by the compiler.Compile()?

By on 11/17/2015 1:39 PM ()

Finally I decided to not use fsx but just fs files and I made a build script which select a specific folder to be build and compile to JS. I am using the WebSharper.exe in \tools

By on 11/18/2015 4:51 PM ()

From what I can see the Bundle in WebSharper.Compiler will help me with the task of creating the bundle JS/CSS for a UI.Next SPA (built in fsx).

1
2
3
4
Bundle.Create()
	.WithDefaultReferences()
    .WithTransitiveReferences()
    .WithAssembly(...not sure where to get the assembly...)

But I am not sure how to pass the current dynamic assembly of the fsi to get my fsx file compiled and registered to the bundle.

.WithAssembly is taking a WebSharper.Compiler.Assembly so I am not sure how to compile the current fsi assembly.

By on 11/18/2015 4:51 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper