jsaddle-warp 0.9.2.0 → 0.9.3.0
raw patch · 2 files changed
+6/−9 lines, 2 filesdep −uuiddep −uuid-typesPVP ok
version bump matches the API change (PVP)
Dependencies removed: uuid, uuid-types
API changes (from Hackage documentation)
Files
jsaddle-warp.cabal view
@@ -1,5 +1,5 @@ name: jsaddle-warp-version: 0.9.2.0+version: 0.9.3.0 cabal-version: >=1.10 build-type: Simple license: MIT@@ -35,8 +35,6 @@ text >=1.2.1.3 && <1.3, time >=1.5.0.1 && <1.8, transformers >=0.4.2.0 && <0.6,- uuid >=1.3.13 && <1.4,- uuid-types >=1.0.3 && <1.1, wai >=3.0.3.0 && <3.3, wai-websockets >=3.0.0.6 && <3.1, warp >=3.1.2 && <3.3,
src/Language/Javascript/JSaddle/WebSockets.hs view
@@ -55,7 +55,6 @@ import Data.IORef (writeIORef, IORef, readIORef, newIORef, atomicModifyIORef') import Data.ByteString.Lazy (ByteString)-import Data.UUID.Types (toText) import Control.Concurrent.MVar (tryPutMVar, modifyMVar_, putMVar, takeMVar, readMVar, newMVar, newEmptyMVar, modifyMVar)@@ -72,7 +71,7 @@ wsApp pending_conn = do conn <- acceptRequest pending_conn rec (processResult, processSyncResult, start) <- runJavaScript (sendTextData conn . encode) $ do- syncKey <- toText . contextId <$> askJSM+ syncKey <- T.pack . show . contextId <$> askJSM liftIO $ atomicModifyIORef' syncHandlers (\m -> (M.insert syncKey processSyncResult m, ())) liftIO $ sendTextData conn (encode syncKey) entryPoint@@ -149,11 +148,13 @@ \\n\ \ ws.onopen = function(e) {\n\ \ " <> initState <> "\n\- \ var inXhrSend = false;\n\ \\n\ \ ws.onmessage = function(e) {\n\- \ if(inXhrSend) return;\n\ \ var batch = JSON.parse(e.data);\n\+ \ if(inCallback > 0) {\n\+ \ asyncBatch = batch;\n\+ \ return;\n\+ \ }\n\ \ if(typeof batch === \"string\") {\n\ \ syncKey = batch;\n\ \ var xhr = new XMLHttpRequest();\n\@@ -168,12 +169,10 @@ \\n\ \ " <> runBatch (\a -> "ws.send(JSON.stringify(" <> a <> "));") (Just (\a -> "(function(){\n\- \ inXhrSend = true;\n\ \ var xhr = new XMLHttpRequest();\n\ \ xhr.open('POST', '/sync/'+syncKey, false);\n\ \ xhr.setRequestHeader(\"Content-type\", \"application/json\");\n\ \ xhr.send(JSON.stringify(" <> a <> "));\n\- \ inXhrSend = false;\n\ \ return JSON.parse(xhr.response);})()")) <> "\ \ };\n\ \ };\n\