Interface Generator

39 views
Skip to first unread message

Cameron Taggart

unread,
Apr 3, 2011, 9:26:33 PM4/3/11
to websh...@googlegroups.com
Is the WebSharper Interface Generator an IntelliFactory internal tool
or something customers can access and use as well? If so, where do I
get it? It was mentioned in a recent blog that it was used to generate
the Bing Maps Extension [1]. I have another public JavaScript API in
mind that I would like to use it on.

[1] http://www.websharper.com/blog/2011/3/623

Cameron

Adam Granicz

unread,
Apr 4, 2011, 6:03:33 AM4/4/11
to websh...@googlegroups.com
Hi Cameron,

It's included with RC2, see the blog post:

http://www.websharper.com/blog/2011/3/624

Regards,
Adam.

--
Adam Granicz, IntelliFactory
www.intellifactory.com

Cameron Taggart

unread,
Apr 4, 2011, 9:02:27 PM4/4/11
to websh...@googlegroups.com, Adam Granicz
Ah, OK. I didn't realize the "WebSharper 2.1 Binding" template was
what I was looking for. Looking at the Definition.fs that it includes,
it looks like it is a DSL. When I build the project, it creates a
bin\Debug\Generated.cs and compiles that into a
bin\Debug\Generated.exe.

What would be really helpful is a basic example where we can look at
both the JavaScript and the binding definition. I was hoping to be
able to consume OData from WebSharper. Microsoft created a new
JavaScript library for using OData services. I spent some time
yesterday reading the docs and figuring out how to use it:

http://blog.ctaggart.com/2011/04/odata-from-javascript-netflix-genres.html

I would like to do that same thing but from WebSharper. Some help with
binding to the datajs library would be very much appreciated.

Cameron

Dmitri Nesteruk

unread,
Apr 5, 2011, 11:20:49 AM4/5/11
to websh...@googlegroups.com, Adam Granicz
I gotta second that. Some sort of WIG documentation would make things a lot easier.

Adam Granicz

unread,
Apr 14, 2011, 8:04:18 AM4/14/11
to WebSharper
Hi all,

We published the WIG definition for the Bing Maps 7 bindings on
BitBucket - anyone interested in WIG-based development is welcome to
take a look:

https://bitbucket.org/IntelliFactory/ifpub-ws-bing

Regards,
Adam.

Ryan Riley

unread,
Jul 3, 2011, 4:44:58 PM7/3/11
to websh...@googlegroups.com
Thanks for posting the source for the Bing Maps sample. However, due to the lack of documentation, it's very difficult to understand what's happening. The Bing Maps and sample extension loaded with the Binding project are completely different from what is documented in the WebSharper pdf book. I'm planning to blog what I figure out, but in the meantime, is there any guidance on testing?

Also, the pdf book notes that the RequireAttribute is necessary to pull in required resources such as JavaScript libraries; however, I can't find any such thing in the Bing Maps extension.

Cheers!
Ryan

Anton Tayanovskyy

unread,
Jul 14, 2011, 9:56:28 AM7/14/11
to WebSharper
Hi Ryan,

I do struggle with WIG tool and doc maintenance, other tasks seem to
get priority.

Looking over BingMaps, it indeed needs to be brought up-to-date with
what we currently use, thanks for pointing this out.

What exactly is different from the WebSharper book? Are you referring
to Section 9 in Start > All Programs > WebSharper 2.3 Professional >
Documentation > WebSharper Manual. I just noticed the online copy is
not up-to-date, updating.

There is essentially just one way to develop extensions: write a bunch
of definitions with Inline/Require declarations. You either do it by
hand, or you do it with a WIG template, which allows to do meta-
programming: define your code as an F# value, then generate code
(actually C# code) with the Inline definitions, then compile it and
get an assembly as if you wrote all those inline definitions by hand.
Now, sadly, current WIG does not support resource/require definitions.
What we have been using, as a hack, is including C# files in WIG
projects. These get compiled-in directly at the second stage (to the
C# assembly). Then in C# we can define resource classes and put
require attributes. This is a hack and it must give way to a better
API.

Thanks,

Anton
Reply all
Reply to author
Forward
0 new messages