Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static Methods/Constructors not triggering needed .js inclusion. #16

Closed
intellifactory-bb opened this issue Dec 6, 2014 · 2 comments
Closed
Labels

Comments

@intellifactory-bb
Copy link

namespace Website

module CollTest = 

    open IntelliFactory.WebSharper
    open IntelliFactory.WebSharper.Html
    open System.Collections.Generic

    [<JavaScript>]
    let private DictPart () =
        // Calling constructors won't include ...Collections.dll.js.
        let d = new Dictionary<string,string>()
        // Calling module methods (static methods) won't.
        let m = [("Aka", "Pizza")] |> Map.ofSeq
        // Calling any instance methods will cause the inclusion of ...Collections.dll.js.
        // Uncomment to make it work.
        // let m = m.Add ("Rosie", "Bagels")
         // Another module method.
        let result = m |> Map.toSeq |> Seq.map (fun (k,v) -> k + " -> " + v)
        Div [
            result 
            |> Seq.map (fun x -> LI [Text x])
            |> OL
        ]
    type CollTestControl () =
        inherit Web.Control ()
        [<JavaScript>]
        override this.Body = DictPart () :> IPagelet

@intellifactory-bb
Copy link
Author

Fix #16.

→ <<cset 3dffb88bba34>>


Original comment by: Anton Tayanovskyy

@intellifactory-bb
Copy link
Author

Thank you very much for reporting this bug. It did not affect all constructors/static methods, only the proxy ones, but still of course is a critical issue. I just committed a fix, we will try to release an installer update shortly.


Original comment by: Anton Tayanovskyy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant