by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Maxime Mangel
    @MangelMaxime
    Yes, or you can attach a hook to fable-splitter and copy the file in your hook
    There is also a PR for adding Glob support to Fable fsproj but I am not sure if it will support it for non F# file.
    fable-compiler/Fable#1946
    Cody Johnson
    @Shmew
    Yeah that's my PR :)
    Maxime Mangel
    @MangelMaxime
    Ah :p
    At least you know I saw it ^^ and you can answer my question ^^
    Cody Johnson
    @Shmew
    yeah it should include anything as far as libraries go, but that shouldn't help in this case. I already have a .snap in my proj and it doesn't copy it
    but that's with fable-splitter specifically
    Maxime Mangel
    @MangelMaxime

    Yes, I guess webpack understand .snap thanks to a loader or something.

    But fable-splitter is more limited I would say.

    Cody Johnson
    @Shmew
    so if I rename the file to .snap.js then it copies it
    but if it isn't fs related or .js it ignores :(
    ah there's a babel-plugin-file-loader package that ought to do it
    robertj
    @robkuz
    Hey,
    is anybody using Fulma/Bulma and Bootstrap together?
    in one project
    Maxime Mangel
    @MangelMaxime

    I don't think and I if someone does I think it will end up creating conflict.

    Indeed, both project are using the same class and you will end up with a mix of style. I suppose try to add a div wrapper to isolte which framework to use when but not sure if this will work.

    <div class="use-bulma"><div class="button">I am a button styled with Bulma</div></div>
    
    <div class="use-bootstrap"><div class="button">I am a button styled with Bootstrap</div></div>

    Or use CSS modules but I don't know them enough to say how to set them up.

    robertj
    @robkuz
    OK. cool. thx for the suggestion
    Aleksander Spro
    @projecteon
    I would highly advice against using 2 css frameworks together. It will also increase bundle size considerably.
    Balinth
    @Balinth
    While trying out the VS Code Debugger for Chrome thingy, for some reason starting the server from the debug window changes the base path where the server looks for additional files (eg appsettings.json) versus building from fake (even with a new SAFE template, and using it's fake script, versus the provided "Debug SAFE application" debug target. Where or what kind of setting should I look for to specify this base path?
    as far as I could tell, starting from the debugger still runs the fake build -t run command in the end
    Florian Verdonck
    @nojaf
    Hey @MangelMaxime

    Thoth.Json decode question: How would I decode

    type Node =
        { Type: string
          Range: Range option
          Properties: Map<string, obj>
          Childs: Node list }

    The Properties, I don't really care what is in the object. I only need to display it in my view.
    It could look like:

        {
          "Type": "SynModuleOrNamespace.AnonModule",
          "Range": {
            "StartLine": 1,
            "StartCol": 0,
            "EndLine": 1,
            "EndCol": 0
          },
          "Properties": {
            "isModule": "AnonModule",
            "isRecursive": false,
            "longIdent": [
              {
                "Ident": "Script",
                "Range": {
                  "StartLine": 1,
                  "StartCol": 0,
                  "EndLine": 1,
                  "EndCol": 0
                }
              }
            ]
          },
          "Childs": []
        }
    Florian Verdonck
    @nojaf
    Found a workaround:
    let decodeKeyValue : Decoder<obj> = fun _key jsonValue -> Ok jsonValue
    Pieter Bryon
    @pbryon
    Hi guys. I'm not sure this is the place to ask and I apologise upfront if the answer is in the docs somewhere but I couldn't find it.
    When testing my (first) SAFE app, I keep getting connection refused WebSocket errors when running it. What am I missing?
    Cody Johnson
    @Shmew
    do you have a dev server proxy setup in your webpack.config.js?
    Pieter Bryon
    @pbryon
    The standard version that came with the SAFE template, I think:
    devServerPort: 8080,
        // When using webpack-dev-server, you may need to redirect some calls
        // to a external API server. See https://webpack.js.org/configuration/dev-server/#devserver-proxy
        devServerProxy: {
            // redirect requests that start with /api/* to the server on port 8085
            '/api/*': {
                target: 'http://localhost:' + (process.env.SERVER_PROXY_PORT || "8085"),
                   changeOrigin: true
               },
            // redirect websocket requests that start with /socket/* to the server on the port 8085
            '/socket/*': {
                target: 'http://localhost:' + (process.env.SERVER_PROXY_PORT || "8085"),
                ws: true
               }
           },
    Cody Johnson
    @Shmew
    that's pretty much how mine is setup, except I also have changeOrigin: true on my socket proxy, might want to try that as well
    Pieter Bryon
    @pbryon
    @Shmew that didn't do the trick. I'm also getting uncaught exception: SocketProtocolError: Socket hung up from scclientsocket.js, if that helps

    and:

    {
      "name": "BadConnectionError",
      "message": "Event 'login' was aborted due to a bad connection",
      "type": "connectAbort",
      "stack": "BadConnectionError@webpack-internal:///./node_modules/sc-errors/index.js:182:19\nSCClientSocket.prototype._abortAllPendingEventsDueToBadConnection@webpack-internal:///./node_modules/socketcluster-client/lib/scclientsocket.js:586:19\nSCClientSocket.prototype._onSCClose@webpack-internal:///./node_modules/socketcluster-client/lib/scclientsocket.js:609:8\nSCClientSocket.prototype.open/<@webpack-internal:///./node_modules/socketcluster-client/lib/scclientsocket.js:297:12\nEmitter.prototype.emit@webpack-internal:///./node_modules/component-emitter/index.js:133:20\nSCTransport.prototype._onClose@webpack-internal:///./node_modules/socketcluster-client/lib/sctransport.js:217:28\nSCTransport/wsSocket.onerror@webpack-internal:///./node_modules/socketcluster-client/lib/sctransport.js:81:12\n"
    }

    from devtools.js

    Cody Johnson
    @Shmew
    only other advice I have is to try these:
    devServer: {
            ...
            inline: true,
            historyApiFallback: true,
            ...
        },
    I use Elmish.Bridge, so I can't help you any further than that if it doesn't work.
    Pieter Bryon
    @pbryon
    thanks for trying!
    Cody Johnson
    @Shmew
    np
    gl
    Pieter Bryon
    @pbryon
    thanks
    njlr
    @njlr
    Can Thoth.Json decode an plain-old-javascript object to give something like a runtime schema checker?
    Florian Verdonck
    @nojaf
    Yes, I believe you have Decode.fromObject
    Or it is called .from value
    Maxime Mangel
    @MangelMaxime

    @njlr Yes it can and it's actually how Thoth.Json is working :)

    Soure code

        let fromValue (path : string) (decoder : Decoder<'T>) =
            fun value ->
                match decoder path value with
                | Ok success ->
                    Ok success
                | Error error ->
                    Error (errorToString error)
    
        let fromString (decoder : Decoder<'T>) =
            fun value ->
                try
                   let json = JS.JSON.parse value
                   fromValue "$" decoder json
                with
                    | ex when Helpers.isSyntaxError ex ->
                        Error("Given an invalid JSON: " + ex.Message)

    See how fromString use fromValue by passing the result of JS.JSON.parse which gives you an "obj".

    This is also how Nacara use Thoth.Json to explore the global configuration and the configuration of a page etc. Mentioning that to say that's supported
    Ben Collins
    @aggieben
    Trying to work through the elmish book and found that the elmish-getting-started project fails somewhere in Fable build:
    image.png
    totally newbie question: how do we troubleshoot?
    Ben Collins
    @aggieben
    looks like maybe the Fable.Elmish.3.0.0 project in .fable is expecting a Paket.Restore.targets file that doesn't exist?
    njlr
    @njlr
    @MangelMaxime Perfect! Turns out I can remove a redundant JSON.parse(JSON.stringify(x) from my app!
    Ben Collins
    @aggieben
    Opened this issue over at Zaid's repo: Zaid-Ajaj/elmish-getting-started#2
    Peter Keše
    @pkese
    I'm banging my head on trying to understand async code
    All I want is to cache an async result (wrap it in lazy) and then use it in several places (but accessing the server just once)
    But I'm finding out that that the async code is being executed multiple times:
    let asyncData = lazy (async { return fetchSomeUrl () })
    let getOrFetch = asyncData.Force
    ...then when I intialize my state, I add initial command
    state, Cmd.OfAsync.either getOrFetch () ConsumeServerData ConsumeServerError
    Cody Johnson
    @Shmew
    @pkese I'd recommend just putting the result in local storage, and then when making calls it can check if it already exists and if so, not make the call
    Peter Keše
    @pkese
    @Shmew thanks for suggestion.
    There seems to be a mismatch between my conceptual map of the world (i.e. how I think async works) and how async really works. I can of course do a workaround, but that's just a way to avoid understanding what's going on.
    And then I'll get bitten again next time I try to use async.
    njlr
    @njlr
    I think you are caching the construction of the async, not the execution of the async?