diff --git a/.gitignore b/.gitignore
index e28ef49b..a241d7e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,6 +34,7 @@ hsenv.log
*_stub.h
.cabal-sandbox/
cabal.sandbox.config
+cabal.project.local
.stack-work
codex.tags
*.dump-*
diff --git a/cabal.project b/cabal.project
index 1362d589..c1b15c7d 100644
--- a/cabal.project
+++ b/cabal.project
@@ -8,3 +8,5 @@ if arch(javascript)
extra-packages: ghci
import: cabal.dependencies.project
+
+allow-newer: reflex-dom:all, reflex-dom-core:all
diff --git a/reflex-dom-core/reflex-dom-core.cabal b/reflex-dom-core/reflex-dom-core.cabal
index 6f623b8d..c7d3a68e 100644
--- a/reflex-dom-core/reflex-dom-core.cabal
+++ b/reflex-dom-core/reflex-dom-core.cabal
@@ -1,262 +1,280 @@
-cabal-version: 1.24
-Name: reflex-dom-core
-Version: 0.8.0.0
-Synopsis: Functional Reactive Web Apps with Reflex
-Description:
- Web applications without callbacks or side-effects.
- Reflex-DOM brings the power of functional reactive programming (FRP) to the web.
- Build HTML and other Document Object Model (DOM) data with a pure functional interface.
- .
- Reflex-DOM is a Functional Reactive web framework based on the Reflex FRP engine: .
- .
- The @reflex-dom@ package is a small wrapper around the @reflex-dom-core@ package. It pulls in the
- correct set of dependencies for each target platform (GHCJS, WebKitGTK, WASM, mobile, etc.).
- Libraries should depend on @reflex-dom-core@ and executables will usually depend on @reflex-dom@.
- All of @reflex-dom-core@'s modules are re-exported by @reflex-dom@.
-License: BSD3
-License-file: LICENSE
-Author: Ryan Trinkle
-Maintainer: ryan.trinkle@gmail.com
-Stability: Experimental
-Category: FRP, Web, GUI, HTML, Javascript, Reactive, Reactivity, User Interfaces, User-interface
-Build-type: Simple
--- Deal with https://github.com/haskell/cabal/issues/2544 / https://github.com/haskell/cabal/issues/367
-extra-source-files: src-ghc/Foreign/JavaScript/Internal/Utils.hs
- src-ghcjs/Foreign/JavaScript/Internal/Utils.hs
- src/Reflex/Dom/Xhr/Foreign.hs
- src/Reflex/Dom/WebSocket/Foreign.hs
- src/Reflex/Dom/Xhr/ResponseType.hs
- src/Reflex/Dom/Xhr/Exception.hs
- ChangeLog.md
+cabal-version: 1.24
+name: reflex-dom-core
+version: 0.8.0.0
+license: BSD3
+license-file: LICENSE
+maintainer: ryan.trinkle@gmail.com
+author: Ryan Trinkle
+stability: Experimental
+synopsis: Functional Reactive Web Apps with Reflex
+description:
+ Web applications without callbacks or side-effects.
+ Reflex-DOM brings the power of functional reactive programming (FRP) to the web.
+ Build HTML and other Document Object Model (DOM) data with a pure functional interface.
+ .
+ Reflex-DOM is a Functional Reactive web framework based on the Reflex FRP engine: .
+ .
+ The @reflex-dom@ package is a small wrapper around the @reflex-dom-core@ package. It pulls in the
+ correct set of dependencies for each target platform (GHCJS, WebKitGTK, WASM, mobile, etc.).
+ Libraries should depend on @reflex-dom-core@ and executables will usually depend on @reflex-dom@.
+ All of @reflex-dom-core@'s modules are re-exported by @reflex-dom@.
+
+category:
+ FRP, Web, GUI, HTML, Javascript, Reactive, Reactivity, User Interfaces, User-interface
+
+build-type: Simple
+extra-source-files:
+ src-ghc/Foreign/JavaScript/Internal/Utils.hs
+ src-ghcjs/Foreign/JavaScript/Internal/Utils.hs
+ src/Reflex/Dom/Xhr/Foreign.hs
+ src/Reflex/Dom/WebSocket/Foreign.hs
+ src/Reflex/Dom/Xhr/ResponseType.hs
+ src/Reflex/Dom/Xhr/Exception.hs
+ ChangeLog.md
+
+source-repository head
+ type: git
+ location: https://github.com/reflex-frp/reflex-dom
+ subdir: reflex-dom-core
flag use-template-haskell
- description: Use template haskell to generate lenses
- default: True
- manual: True
+ description: Use template haskell to generate lenses
+ manual: True
flag use-reflex-optimizer
- description: Use the GHC plugin Reflex.Optimizer on some of the modules in the package. This is still experimental.
- default: False
- manual: True
+ description:
+ Use the GHC plugin Reflex.Optimizer on some of the modules in the package. This is still experimental.
+
+ default: False
+ manual: True
flag expose-all-unfoldings
- description: Build the library with -fexpose-all-unfoldings which can help client code specialize better
- default: False
- manual: True
+ description:
+ Build the library with -fexpose-all-unfoldings which can help client code specialize better
+
+ default: False
+ manual: True
flag profile-reflex
- description: Add a layer of profiling to all Reflex events in the system
- default: False
- manual: True
+ description: Add a layer of profiling to all Reflex events in the system
+ default: False
+ manual: True
flag split-these
- description: Use split these/semialign packages
- manual: False
- default: True
+ description: Use split these/semialign packages
flag hydration-tests
- description: Whether to run the hydration tests (currently only available on linux)
- default: True
- manual: True
+ description:
+ Whether to run the hydration tests (currently only available on linux)
+
+ manual: True
flag gc-tests
- description: Whether to run the gc tests (currently only available on linux)
- default: True
- manual: True
+ description:
+ Whether to run the gc tests (currently only available on linux)
+
+ manual: True
library
- hs-source-dirs: src
- build-depends:
- aeson >= 0.8 && < 2.3,
- base >= 4.7 && <= 4.21,
- bifunctors >= 4.2 && < 6,
- bimap >= 0.3 && < 0.6,
- blaze-builder >= 0.4.1 && < 0.5,
- bytestring >= 0.10 && < 0.13,
- case-insensitive < 1.3,
- commutative-semigroups >=0.1 && <0.3,
- containers >= 0.6 && <= 0.7,
- constraints >= 0.9 && < 0.15,
- contravariant >= 1.4 && < 1.6,
- data-default >= 0.5 && < 0.8,
- dependent-map >= 0.3 && < 0.5,
- dependent-sum >= 0.6 && < 0.8,
- dependent-sum-template >= 0.2 && < 0.3,
- directory >= 1.2 && < 1.4,
- exception-transformers == 0.4.*,
- ghcjs-dom >= 0.9.1.0 && < 0.10,
- jsaddle >= 0.9.0.0 && < 0.10,
- -- keycode-0.2 has a bug on firefox
- keycode >= 0.2.1 && < 0.3,
- lens >= 4.7 && <= 5.3.2,
- monad-control >= 1.0.1 && < 1.1,
- mtl >= 2.1 && < 2.4,
- primitive >= 0.5 && <= 0.9.1.0,
- random >= 1.1 && < 1.3,
- ref-tf >= 0.4 && < 0.6,
- reflex >= 0.8.2.1 && < 1,
- semigroups >= 0.16 && < 0.21,
- stm >= 2.4 && < 2.6,
- text >= 1.2 && <= 2.1.1,
- transformers >= 0.3 && < 0.7,
- network-uri >= 2.6.1 && < 2.7,
- zenc == 0.1.*
-
- if impl(ghcjs) || arch(javascript)
- hs-source-dirs: src-ghcjs
- build-depends:
- ghcjs-base,
- hashable >= 1.2 && < 1.5
- else
- hs-source-dirs: src-ghc
- if !os(windows)
- build-depends: unix >= 2.7 && <2.9
-
- if flag(split-these)
- build-depends:
- semialign >= 1 && < 1.4,
- these >= 1 && < 1.3
- else
- build-depends:
- these >= 0.4 && < 1.0
-
- exposed-modules:
- Foreign.JavaScript.TH
- Foreign.JavaScript.Orphans
- Foreign.JavaScript.Utils
- Reflex.Dom.Builder.Class
- Reflex.Dom.Builder.Class.Events
- Reflex.Dom.Builder.Immediate
- Reflex.Dom.Builder.InputDisabled
- Reflex.Dom.Builder.Hydratable
- Reflex.Dom.Builder.Static
- Reflex.Dom.Class
- Reflex.Dom.Core
- Reflex.Dom.Location
- Reflex.Dom.Main
- Reflex.Dom.Modals.Class
- Reflex.Dom.Old
- Reflex.Dom.Prerender
- Reflex.Dom.Time
- Reflex.Dom.WebSocket
- Reflex.Dom.WebSocket.Query
- Reflex.Dom.Widget
- Reflex.Dom.Widget.Basic
- Reflex.Dom.Widget.Input
- Reflex.Dom.Widget.Lazy
- Reflex.Dom.Widget.Resize
- Reflex.Dom.Xhr
- Reflex.Dom.Xhr.FormData
- other-modules:
- Foreign.JavaScript.Internal.Utils
- Reflex.Dom.WebSocket.Foreign
- Reflex.Dom.Xhr.Foreign
- Reflex.Dom.Xhr.ResponseType
- Reflex.Dom.Xhr.Exception
-
- default-language: Haskell98
- ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans -fspecialise-aggressively
- ghc-prof-options: -fprof-auto
-
- if flag(expose-all-unfoldings)
- ghc-options: -fexpose-all-unfoldings
-
- if flag(use-reflex-optimizer)
- ghc-options: -fplugin=Reflex.Optimizer
-
- if flag(profile-reflex)
- cpp-options: -DPROFILE_REFLEX
-
- if flag(use-template-haskell)
- build-depends:
- dependent-sum-template >= 0.1 && < 0.3,
- template-haskell >= 2.12.0 && < 2.23
- other-extensions: TemplateHaskell
- cpp-options: -DUSE_TEMPLATE_HASKELL
+ exposed-modules:
+ Foreign.JavaScript.TH
+ Foreign.JavaScript.Orphans
+ Foreign.JavaScript.Utils
+ Reflex.Dom.Builder.Class
+ Reflex.Dom.Builder.Class.Events
+ Reflex.Dom.Builder.Immediate
+ Reflex.Dom.Builder.InputDisabled
+ Reflex.Dom.Builder.Hydratable
+ Reflex.Dom.Builder.Static
+ Reflex.Dom.Class
+ Reflex.Dom.Core
+ Reflex.Dom.Location
+ Reflex.Dom.Main
+ Reflex.Dom.Modals.Class
+ Reflex.Dom.Old
+ Reflex.Dom.Prerender
+ Reflex.Dom.Time
+ Reflex.Dom.WebSocket
+ Reflex.Dom.WebSocket.Query
+ Reflex.Dom.Widget
+ Reflex.Dom.Widget.Basic
+ Reflex.Dom.Widget.Input
+ Reflex.Dom.Widget.Lazy
+ Reflex.Dom.Widget.Resize
+ Reflex.Dom.Xhr
+ Reflex.Dom.Xhr.FormData
+
+ hs-source-dirs: src
other-modules:
- Reflex.Dom.Builder.Class.TH
+ Foreign.JavaScript.Internal.Utils
+ Reflex.Dom.WebSocket.Foreign
+ Reflex.Dom.Xhr.Foreign
+ Reflex.Dom.Xhr.ResponseType
+ Reflex.Dom.Xhr.Exception
+
+ default-language: Haskell98
+ ghc-options:
+ -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
+ -fspecialise-aggressively
+
+ ghc-prof-options: -fprof-auto
+ build-depends:
+ aeson >=0.8 && <2.3,
+ base >=4.7 && <4.21,
+ bifunctors >=4.2 && <6,
+ bimap >=0.3 && <0.6,
+ blaze-builder >=0.4.1 && <0.5,
+ bytestring >=0.10 && <0.13,
+ case-insensitive <1.3,
+ commutative-semigroups >=0.1 && <0.3,
+ containers >=0.6 && <0.8,
+ constraints >=0.9 && <0.15,
+ contravariant >=1.4 && <1.6,
+ data-default >=0.5 && <0.8,
+ dependent-map >=0.3 && <0.5,
+ dependent-sum >=0.6 && <0.8,
+ dependent-sum-template >=0.2 && <0.3,
+ directory >=1.2 && <1.4,
+ exception-transformers >=0.4 && <0.5,
+ ghcjs-dom >=0.9.1.0 && <0.10,
+ jsaddle >=0.9.0.0 && <0.10,
+ keycode >=0.2.1 && <0.3,
+ lens >=4.7 && <5.4,
+ monad-control >=1.0.1 && <1.1,
+ mtl >=2.1 && <2.4,
+ primitive >=0.5 && <0.10,
+ random >=1.1 && <1.3,
+ ref-tf >=0.4 && <0.6,
+ reflex >=0.8.2.1 && <1,
+ semigroups >=0.16 && <0.21,
+ stm >=2.4 && <2.6,
+ text >=1.2 && <2.2,
+ transformers >=0.3 && <0.7,
+ network-uri >=2.6.1 && <2.7,
+ zenc >=0.1 && <0.2
+
+ if (impl(ghcjs >=0) || arch(javascript))
+ hs-source-dirs: src-ghcjs
+ build-depends:
+ ghcjs-base,
+ hashable >=1.2 && <1.5
+
+ else
+ hs-source-dirs: src-ghc
+
+ if !os(windows)
+ build-depends: unix >=2.7 && <2.9
+
+ if flag(split-these)
+ build-depends:
+ semialign >=1 && <1.4,
+ these >=1 && <1.3
+
+ else
+ build-depends: these >=0.4 && <1.0
+
+ if flag(expose-all-unfoldings)
+ ghc-options: -fexpose-all-unfoldings
+
+ if flag(use-reflex-optimizer)
+ ghc-options: -fplugin=Reflex.Optimizer
+
+ if flag(profile-reflex)
+ cpp-options: -DPROFILE_REFLEX
+
+ if flag(use-template-haskell)
+ cpp-options: -DUSE_TEMPLATE_HASKELL
+ other-modules: Reflex.Dom.Builder.Class.TH
+ other-extensions: TemplateHaskell
+ build-depends:
+ dependent-sum-template >=0.1 && <0.3,
+ template-haskell >=2.12.0 && <2.23
test-suite hlint
- build-depends:
- base,
- hlint >= 2.0 && < 4.0
- hs-source-dirs: test
- main-is: hlint.hs
- type: exitcode-stdio-1.0
- default-language: Haskell98
- if arch(javascript)
- buildable: False
+ type: exitcode-stdio-1.0
+ main-is: hlint.hs
+ hs-source-dirs: test
+ default-language: Haskell98
+ build-depends:
+ base,
+ hlint >=2.0 && <4.0
+
+ if arch(javascript)
+ buildable: False
test-suite hydration
- build-depends: base
- , aeson
- , async
- , bytestring
- , chrome-test-utils
- , constraints
- , constraints-extras
- , containers
- , dependent-map
- , dependent-sum
- , dependent-sum-template
- , directory
- , exceptions
- , filepath
- , ghcjs-dom
- , hspec
- , hspec-core
- , hspec-webdriver
- , http-types
- , HUnit
- , jsaddle
- , jsaddle-warp
- , lens
- , lifted-base
- , network
- , random
- , ref-tf
- , reflex
- , reflex-dom-core
- , process
- , silently
- , temporary
- , text
- , wai
- , wai-websockets
- , warp
- , webdriver
- , websockets
- , which
- hs-source-dirs: test
- ghc-options: -rtsopts "-with-rtsopts=-T -V0" -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
- ghc-prof-options: -fprof-auto -optP-DPROFILING
- main-is: hydration.hs
- type: exitcode-stdio-1.0
- default-language: Haskell98
- if !os(linux) || !arch(x86_64) || flag(profile-reflex) || !flag(hydration-tests)
- buildable: False
-
--- broken test on base 4.11 & ghc 8.4.3
--- needs to be updated for changes in GHC.Stats
+ type: exitcode-stdio-1.0
+ main-is: hydration.hs
+ hs-source-dirs: test
+ default-language: Haskell98
+ ghc-options:
+ -rtsopts "-with-rtsopts=-T -V0" -Wall -fwarn-tabs
+ -funbox-strict-fields -O2 -ferror-spans
+
+ ghc-prof-options: -fprof-auto -optP-DPROFILING
+ build-depends:
+ base,
+ aeson <2.3,
+ async <2.3,
+ bytestring,
+ chrome-test-utils,
+ constraints <0.15,
+ constraints-extras <0.5,
+ containers <0.7,
+ dependent-map <0.5,
+ dependent-sum <0.8,
+ dependent-sum-template <0.3,
+ directory,
+ exceptions,
+ filepath,
+ ghcjs-dom <0.10,
+ hspec <2.12,
+ hspec-core <2.12,
+ hspec-webdriver <1.3,
+ http-types <0.13,
+ HUnit <1.7,
+ jsaddle <0.10,
+ jsaddle-warp <0.10,
+ lens <5.4,
+ lifted-base <0.3,
+ network <3.3,
+ random <1.3,
+ ref-tf <0.6,
+ reflex <0.10,
+ reflex-dom-core,
+ process,
+ silently <1.3,
+ temporary <1.4,
+ text <2.2,
+ wai <3.3,
+ wai-websockets <3.1,
+ warp <3.5,
+ webdriver <0.13,
+ websockets <0.14,
+ which <0.3
+
+ if (((!os(linux) || !arch(x86_64)) || flag(profile-reflex)) || !flag(hydration-tests))
+ buildable: False
+
test-suite gc
- build-depends: base
- , chrome-test-utils
- , jsaddle
- , jsaddle-warp
- , process
- , reflex
- , reflex-dom-core
- , text
- hs-source-dirs: test
- ghc-options: -rtsopts -with-rtsopts=-T -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
- ghc-prof-options: -fprof-auto -optP-DPROFILING
- main-is: gc.hs
- type: exitcode-stdio-1.0
- default-language: Haskell98
- if !os(linux) || !arch(x86_64) || !flag(gc-tests)
- buildable: False
+ type: exitcode-stdio-1.0
+ main-is: gc.hs
+ hs-source-dirs: test
+ default-language: Haskell98
+ ghc-options:
+ -rtsopts -with-rtsopts=-T -Wall -fwarn-tabs -funbox-strict-fields
+ -O2 -ferror-spans
-source-repository head
- type: git
- location: https://github.com/reflex-frp/reflex-dom
- subdir: reflex-dom-core
+ ghc-prof-options: -fprof-auto -optP-DPROFILING
+ build-depends:
+ base,
+ chrome-test-utils,
+ jsaddle <0.10,
+ jsaddle-warp <0.10,
+ process,
+ reflex <0.10,
+ reflex-dom-core,
+ text <2.2
+
+ if ((!os(linux) || !arch(x86_64)) || !flag(gc-tests))
+ buildable: False
diff --git a/reflex-dom-core/src-ghcjs/Foreign/JavaScript/Internal/Utils.hs b/reflex-dom-core/src-ghcjs/Foreign/JavaScript/Internal/Utils.hs
index 323637a0..8bdd7adb 100644
--- a/reflex-dom-core/src-ghcjs/Foreign/JavaScript/Internal/Utils.hs
+++ b/reflex-dom-core/src-ghcjs/Foreign/JavaScript/Internal/Utils.hs
@@ -1,5 +1,8 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
+#ifdef __GHCJS__
+{-# LANGUAGE JavaScriptFFI #-}
+#endif
module Foreign.JavaScript.Internal.Utils
( synchronously
diff --git a/reflex-dom-core/src/Foreign/JavaScript/TH.hs b/reflex-dom-core/src/Foreign/JavaScript/TH.hs
index 732ee639..c5c2d004 100644
--- a/reflex-dom-core/src/Foreign/JavaScript/TH.hs
+++ b/reflex-dom-core/src/Foreign/JavaScript/TH.hs
@@ -10,12 +10,17 @@
{-# LANGUAGE UndecidableInstances #-}
#ifdef ghcjs_HOST_OS
{-# LANGUAGE ForeignFunctionInterface #-}
+#ifdef __GHCJS__
+{-# LANGUAGE JavaScriptFFI #-}
+#endif
#endif
-module Foreign.JavaScript.TH ( module Foreign.JavaScript.TH
+
+module Foreign.JavaScript.TH
+ ( module Foreign.JavaScript.TH
#ifdef USE_TEMPLATE_HASKELL
- , Safety (..)
+ , Safety (..)
#endif
- ) where
+ ) where
import Foreign.JavaScript.Orphans ()
import Prelude hiding ((!!))
@@ -32,7 +37,22 @@ import GHCJS.DOM.Types (JSContextRef, askJSM)
#ifdef ghcjs_HOST_OS
import GHCJS.DOM.Types (MonadJSM)
#ifdef __GHCJS__
+import qualified GHCJS.Buffer as JS
+import qualified GHCJS.DOM.Types as JS
+import qualified GHCJS.Foreign as JS
+import qualified GHCJS.Foreign.Callback as JS
import qualified GHCJS.Foreign.Callback.Internal (Callback (..))
+import qualified JavaScript.Array as JS
+import qualified JavaScript.Array.Internal (SomeJSArray (..))
+import qualified JavaScript.Object as JS
+import qualified JavaScript.Object.Internal (Object (..))
+import qualified JavaScript.TypedArray.ArrayBuffer as JSArrayBuffer
+
+import Data.Hashable
+import Data.Word
+import Foreign.C.Types
+import Foreign.Ptr
+import Text.Encoding.Z
#endif
#else
diff --git a/reflex-dom-core/src/Reflex/Dom/Builder/Class.hs b/reflex-dom-core/src/Reflex/Dom/Builder/Class.hs
index c4cd5339..ebef16b3 100644
--- a/reflex-dom-core/src/Reflex/Dom/Builder/Class.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Builder/Class.hs
@@ -31,22 +31,6 @@ module Reflex.Dom.Builder.Class
, module Reflex.NotReady.Class
) where
-import Reflex.Adjustable.Class
-import Reflex.Class as Reflex
-import Reflex.Dom.Builder.Class.Events
-#ifdef USE_TEMPLATE_HASKELL
-import Reflex.Dom.Builder.Class.TH
-#endif
-import Reflex.BehaviorWriter.Base
-import Reflex.DynamicWriter.Base
-import Reflex.EventWriter.Base
-import Reflex.NotReady.Class
-import Reflex.PerformEvent.Class
-import Reflex.PostBuild.Base
-import Reflex.Query.Base
-import Reflex.Query.Class
-import Reflex.Requester.Base
-
import qualified Control.Category
import Control.Lens hiding (element)
import Control.Monad.Fix
@@ -68,6 +52,26 @@ import Data.Type.Coercion
import GHCJS.DOM.Types (JSM)
import qualified GHCJS.DOM.Types as DOM
+#if !MIN_VERSION_base(4,18,0)
+import Data.Semigroup
+#endif
+
+import Reflex.Adjustable.Class
+import Reflex.Class as Reflex
+import Reflex.Dom.Builder.Class.Events
+#ifdef USE_TEMPLATE_HASKELL
+import Reflex.Dom.Builder.Class.TH
+#endif
+import Reflex.BehaviorWriter.Base
+import Reflex.DynamicWriter.Base
+import Reflex.EventWriter.Base
+import Reflex.NotReady.Class
+import Reflex.PerformEvent.Class
+import Reflex.PostBuild.Base
+import Reflex.Query.Base
+import Reflex.Query.Class
+import Reflex.Requester.Base
+
class Default (EventSpec d EventResult) => DomSpace d where
type EventSpec d :: (EventTag -> Type) -> Type
type RawDocument d :: Type
diff --git a/reflex-dom-core/src/Reflex/Dom/Builder/Hydratable.hs b/reflex-dom-core/src/Reflex/Dom/Builder/Hydratable.hs
index 24400361..32bcb62b 100644
--- a/reflex-dom-core/src/Reflex/Dom/Builder/Hydratable.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Builder/Hydratable.hs
@@ -19,6 +19,7 @@ import qualified Data.Map as Map
#ifndef ghcjs_HOST_OS
import GHCJS.DOM.Types (MonadJSM (..))
#endif
+
import Reflex
import Reflex.Dom.Builder.Class
import Reflex.Dom.Builder.Immediate (hydratableAttribute)
diff --git a/reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs b/reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs
index fb72a314..d3ce97d2 100644
--- a/reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs
@@ -25,7 +25,11 @@
{-# LANGUAGE UndecidableInstances #-}
#ifdef ghcjs_HOST_OS
{-# LANGUAGE ForeignFunctionInterface #-}
+#ifdef __GHCJS__
+{-# LANGUAGE JavaScriptFFI #-}
+#endif
#endif
+
-- | This is a builder to be used on the client side. It can be run in two modes:
--
-- 1. in "hydration mode", reusing DOM nodes already in the page (as produced
@@ -157,24 +161,6 @@ import GHCJS.DOM.UIEvent
#ifndef ghcjs_HOST_OS
import Language.Javascript.JSaddle (call, eval) -- Avoid using eval in ghcjs. Use ffi instead
#endif
-import Reflex.Adjustable.Class
-import Reflex.Class as Reflex
-import Reflex.Dom.Builder.Class
-import Reflex.Dynamic
-import Reflex.Host.Class
-import Reflex.Patch.MapWithMove (PatchMapWithMove(..))
-import Reflex.PerformEvent.Base (PerformEventT)
-import Reflex.PerformEvent.Class
-import Reflex.PostBuild.Base (PostBuildT)
-import Reflex.PostBuild.Class
-#ifdef PROFILE_REFLEX
-import Reflex.Profiled
-#endif
-import Reflex.Requester.Base
-import Reflex.Requester.Class
-import Reflex.Spider (Spider, SpiderHost, Global)
-import Reflex.TriggerEvent.Base hiding (askEvents)
-import Reflex.TriggerEvent.Class
import qualified Data.Dependent.Map as DMap
import qualified Data.FastMutableIntMap as FastMutableIntMap
@@ -201,6 +187,31 @@ import qualified GHCJS.DOM.TouchList as TouchList
import qualified GHCJS.DOM.Types as DOM
import qualified GHCJS.DOM.Window as Window
import qualified GHCJS.DOM.WheelEvent as WheelEvent
+
+#if !MIN_VERSION_base(4,18,0)
+import Data.FastMutableIntMap (PatchIntMap (..))
+import Data.Monoid ((<>))
+import GHCJS.DOM.Types (KeyboardEvent, ClipboardEvent)
+#endif
+
+import Reflex.Adjustable.Class
+import Reflex.Class as Reflex
+import Reflex.Dom.Builder.Class
+import Reflex.Dynamic
+import Reflex.Host.Class
+import Reflex.Patch.MapWithMove (PatchMapWithMove(..))
+import Reflex.PerformEvent.Base (PerformEventT)
+import Reflex.PerformEvent.Class
+import Reflex.PostBuild.Base (PostBuildT)
+import Reflex.PostBuild.Class
+#ifdef PROFILE_REFLEX
+import Reflex.Profiled
+#endif
+import Reflex.Requester.Base
+import Reflex.Requester.Class
+import Reflex.Spider (Spider, SpiderHost, Global)
+import Reflex.TriggerEvent.Base hiding (askEvents)
+import Reflex.TriggerEvent.Class
import qualified Reflex.Patch.DMap as PatchDMap
import qualified Reflex.Patch.DMapWithMove as PatchDMapWithMove
import qualified Reflex.Patch.MapWithMove as PatchMapWithMove
diff --git a/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs b/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs
index b493e4ae..2835667a 100644
--- a/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
@@ -47,6 +48,12 @@ import qualified Data.Text as T
import Data.Text.Encoding
import Data.Tuple
import GHC.Generics
+
+#if !MIN_VERSION_base(4,18,0)
+import Control.Monad.Identity
+import Data.Monoid ((<>))
+#endif
+
import Reflex.Adjustable.Class
import Reflex.Class
import Reflex.Dom.Main (DomHost, DomTimeline, runDomHost)
diff --git a/reflex-dom-core/src/Reflex/Dom/Location.hs b/reflex-dom-core/src/Reflex/Dom/Location.hs
index 0f47bd8d..7f68d83e 100644
--- a/reflex-dom-core/src/Reflex/Dom/Location.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Location.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
@@ -22,9 +23,6 @@ module Reflex.Dom.Location
, popHistoryState
) where
-import Reflex
-import Reflex.Dom.Builder.Immediate (wrapDomEvent)
-
import Control.Lens ((^.))
import Control.Monad ((>=>))
import Control.Monad.Fix (MonadFix)
@@ -43,6 +41,13 @@ import qualified GHCJS.DOM.WindowEventHandlers as DOM
import Language.Javascript.JSaddle (FromJSString, MonadJSM, ToJSString, fromJSValUnchecked, js1, ToJSVal (..), FromJSVal (..))
import Network.URI
+#if !MIN_VERSION_base(4,18,0)
+import Data.Monoid
+#endif
+
+import Reflex
+import Reflex.Dom.Builder.Immediate (wrapDomEvent)
+
withLocation :: (MonadJSM m) => (Location -> m a) -> m a
withLocation f = DOM.currentWindowUnchecked >>= Window.getLocation >>= f
diff --git a/reflex-dom-core/src/Reflex/Dom/Main.hs b/reflex-dom-core/src/Reflex/Dom/Main.hs
index 0ce27b91..3345fba8 100644
--- a/reflex-dom-core/src/Reflex/Dom/Main.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Main.hs
@@ -17,24 +17,14 @@ module Reflex.Dom.Main where
import Prelude hiding (concat, mapM, mapM_, sequence, sequence_)
-import Reflex.Adjustable.Class
-import Reflex.Class
-import Reflex.Dom.Builder.Immediate
-import Reflex.Dom.Class
-import Reflex.Host.Class
-import Reflex.PerformEvent.Base
-import Reflex.PostBuild.Base
-import Reflex.Spider (Global, Spider, SpiderHost, runSpiderHost)
-import Reflex.TriggerEvent.Base
-import Reflex.TriggerEvent.Class
-#ifdef PROFILE_REFLEX
-import Reflex.Profiled
-#endif
-
import Control.Concurrent
import Control.Lens
import Control.Monad
+#if MIN_VERSION_base(4,18,0)
import Control.Monad.Reader
+#else
+import Control.Monad.Reader hiding (forM, forM_, mapM, mapM_, sequence, sequence_)
+#endif
import Control.Monad.Ref
import Data.ByteString (ByteString)
import Data.Dependent.Sum (DSum (..))
@@ -52,6 +42,20 @@ import GHCJS.DOM.NonElementParentNode
import GHCJS.DOM.Types (JSM)
import qualified GHCJS.DOM.Types as DOM
+#if !MIN_VERSION_base(4,18,0)
+import Data.Monoid ((<>))
+#endif
+
+import Reflex.Adjustable.Class
+import Reflex.Class
+import Reflex.Dom.Builder.Immediate
+import Reflex.Dom.Class
+import Reflex.Host.Class
+import Reflex.PerformEvent.Base
+import Reflex.PostBuild.Base
+import Reflex.Spider (Global, Spider, SpiderHost, runSpiderHost)
+import Reflex.TriggerEvent.Base
+import Reflex.TriggerEvent.Class
#ifdef PROFILE_REFLEX
import Reflex.Profiled
#endif
diff --git a/reflex-dom-core/src/Reflex/Dom/Prerender.hs b/reflex-dom-core/src/Reflex/Dom/Prerender.hs
index 7fce9dc5..702b4587 100644
--- a/reflex-dom-core/src/Reflex/Dom/Prerender.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Prerender.hs
@@ -33,7 +33,19 @@ import Data.Kind (Type)
import Data.Semigroup.Commutative
import Data.Text (Text)
import Data.Void
+import Data.IntMap.Strict (IntMap)
+import qualified Data.IntMap.Strict as IntMap
+
+#if !MIN_VERSION_base(4,18,0)
+import Data.Semigroup (Semigroup)
+import Foreign.JavaScript.TH
+#endif
+
import GHCJS.DOM.Types (MonadJSM)
+import qualified GHCJS.DOM.Document as Document
+import qualified GHCJS.DOM.Node as Node
+import qualified GHCJS.DOM.Types as DOM
+
import Reflex hiding (askEvents)
import Reflex.Dom.Builder.Class
import Reflex.Dom.Builder.Hydratable
@@ -41,12 +53,6 @@ import Reflex.Dom.Builder.Immediate
import Reflex.Dom.Builder.InputDisabled
import Reflex.Dom.Builder.Static
import Reflex.Host.Class
-import Data.IntMap.Strict (IntMap)
-import qualified Data.IntMap.Strict as IntMap
-
-import qualified GHCJS.DOM.Document as Document
-import qualified GHCJS.DOM.Node as Node
-import qualified GHCJS.DOM.Types as DOM
type PrerenderClientConstraint t m =
( DomBuilder t m
diff --git a/reflex-dom-core/src/Reflex/Dom/WebSocket.hs b/reflex-dom-core/src/Reflex/Dom/WebSocket.hs
index b85faacf..fb9770b5 100644
--- a/reflex-dom-core/src/Reflex/Dom/WebSocket.hs
+++ b/reflex-dom-core/src/Reflex/Dom/WebSocket.hs
@@ -8,6 +8,9 @@
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+#ifdef __GHCJS__
+{-# LANGUAGE JavaScriptFFI #-}
+#endif
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
@@ -29,17 +32,15 @@ module Reflex.Dom.WebSocket
import Prelude hiding (all, concat, concatMap, div, mapM, mapM_, sequence, span)
-import Reflex.Class
-import Reflex.Dom.WebSocket.Foreign
-import Reflex.PerformEvent.Class
-import Reflex.PostBuild.Class
-import Reflex.TriggerEvent.Class
-
import Control.Concurrent
import Control.Concurrent.STM
import Control.Exception
import Control.Lens
+#if MIN_VERSION_base(4,18,0)
import Control.Monad hiding (forM, mapM, mapM_, sequence)
+#else
+import Control.Monad hiding (forM, forM_, mapM, mapM_, sequence)
+#endif
import Control.Monad.IO.Class
import Data.Aeson
import Data.ByteString (ByteString)
@@ -56,6 +57,16 @@ import GHCJS.DOM.WebSocket (getReadyState)
import GHCJS.Marshal
import qualified Language.Javascript.JSaddle.Monad as JS (catch)
+#if !MIN_VERSION_base(4,18,0)
+import Control.Monad.State
+#endif
+
+import Reflex.Class
+import Reflex.Dom.WebSocket.Foreign
+import Reflex.PerformEvent.Class
+import Reflex.PostBuild.Class
+import Reflex.TriggerEvent.Class
+
data WebSocketConfig t a
= WebSocketConfig { _webSocketConfig_send :: Event t [a]
, _webSocketConfig_close :: Event t (Word, Text)
diff --git a/reflex-dom-core/src/Reflex/Dom/WebSocket/Foreign.hs b/reflex-dom-core/src/Reflex/Dom/WebSocket/Foreign.hs
index 4e274b82..753e6c13 100644
--- a/reflex-dom-core/src/Reflex/Dom/WebSocket/Foreign.hs
+++ b/reflex-dom-core/src/Reflex/Dom/WebSocket/Foreign.hs
@@ -1,6 +1,9 @@
{-# LANGUAGE CPP #-}
#ifdef ghcjs_HOST_OS
{-# LANGUAGE ForeignFunctionInterface #-}
+#ifdef __GHCJS__
+{-# LANGUAGE JavaScriptFFI #-}
+#endif
#endif
{-# LANGUAGE LambdaCase #-}
diff --git a/reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs b/reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs
index 9ab64b8f..95ce2f55 100644
--- a/reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
@@ -61,21 +62,12 @@ module Reflex.Dom.Widget.Basic
, partitionMapBySetLT
) where
-import Reflex.Adjustable.Class
-import Reflex.Class
-import Reflex.Collection
-import Reflex.Dom.Builder.Class
-import Reflex.Dom.Class
-import Reflex.Dynamic
-import Reflex.Network
-import Reflex.PostBuild.Class
-import Reflex.Workflow
+import Prelude hiding (mapM, mapM_, sequence, sequence_)
import Control.Lens hiding (children, element)
import Control.Monad.Fix
import Data.Align
import Data.Default
-import Data.Either
import Data.Foldable
import Data.Functor (void)
import Data.Kind (Type)
@@ -89,7 +81,22 @@ import Data.Text (Text)
import qualified Data.Text as T
import Data.These
import Data.Traversable
-import Prelude hiding (mapM, mapM_, sequence, sequence_)
+
+#if !MIN_VERSION_base(4,18,0)
+import Control.Arrow
+import Control.Monad.Reader hiding (forM, forM_, mapM, mapM_, sequence, sequence_)
+import Data.Either
+#endif
+
+import Reflex.Adjustable.Class
+import Reflex.Class
+import Reflex.Collection
+import Reflex.Dom.Builder.Class
+import Reflex.Dom.Class
+import Reflex.Dynamic
+import Reflex.Network
+import Reflex.PostBuild.Class
+import Reflex.Workflow
-- | Breaks the given Map into pieces based on the given Set. Each piece will contain only keys that are less than the key of the piece, and greater than or equal to the key of the piece with the next-smaller key. There will be one additional piece containing all keys from the original Map that are larger or equal to the largest key in the Set.
-- Either k () is used instead of Maybe k so that the resulting map of pieces is sorted so that the additional piece has the largest key.
diff --git a/reflex-dom-core/src/Reflex/Dom/Widget/Input.hs b/reflex-dom-core/src/Reflex/Dom/Widget/Input.hs
index 87d4f03c..e745b7b8 100644
--- a/reflex-dom-core/src/Reflex/Dom/Widget/Input.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Widget/Input.hs
@@ -39,10 +39,19 @@ import qualified Data.Map as Map
import Data.Maybe
import Data.Text (Text)
import qualified Data.Text as T
+import qualified Text.Read as T
+
+#if !MIN_VERSION_base(4,18,0)
+import Data.Semigroup
+#endif
+
+import qualified GHCJS.DOM.Event as Event
+import qualified GHCJS.DOM.HTMLInputElement as Input
import GHCJS.DOM.HTMLInputElement (HTMLInputElement)
import GHCJS.DOM.HTMLTextAreaElement (HTMLTextAreaElement)
import GHCJS.DOM.Types (MonadJSM, File, uncheckedCastTo)
import qualified GHCJS.DOM.Types as DOM (HTMLElement(..), EventTarget(..))
+
import Reflex.Class
import Reflex.Collection
import Reflex.Dom.Builder.Class
@@ -52,10 +61,6 @@ import Reflex.Dom.Widget.Basic
import Reflex.Dynamic
import Reflex.PostBuild.Class
import Reflex.TriggerEvent.Class
-import qualified Text.Read as T
-
-import qualified GHCJS.DOM.Event as Event
-import qualified GHCJS.DOM.HTMLInputElement as Input
{-# DEPRECATED TextInput, _textInput_element, TextInputConfig, textInput "Use 'inputElement' directly" #-}
data TextInput t
diff --git a/reflex-dom-core/src/Reflex/Dom/Widget/Lazy.hs b/reflex-dom-core/src/Reflex/Dom/Widget/Lazy.hs
index bc031e9c..db67c92d 100644
--- a/reflex-dom-core/src/Reflex/Dom/Widget/Lazy.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Widget/Lazy.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
@@ -8,6 +9,19 @@
module Reflex.Dom.Widget.Lazy where
+import Control.Monad.Fix
+import Data.Fixed
+import Data.Map (Map)
+import qualified Data.Map as Map
+import Data.Text (Text)
+import qualified Data.Text as T
+import GHCJS.DOM.Element
+import GHCJS.DOM.Types (MonadJSM)
+
+#if !MIN_VERSION_base(4,18,0)
+import Data.Monoid
+#endif
+
import Reflex.Class
import Reflex.Collection
import Reflex.Dom.Builder.Class
@@ -18,15 +32,6 @@ import Reflex.Dynamic
import Reflex.PerformEvent.Class
import Reflex.PostBuild.Class
-import Control.Monad.Fix
-import Data.Fixed
-import Data.Map (Map)
-import qualified Data.Map as Map
-import Data.Text (Text)
-import qualified Data.Text as T
-import GHCJS.DOM.Element
-import GHCJS.DOM.Types (MonadJSM)
-
-- |A list view for long lists. Creates a scrollable element and only renders child row elements near the current scroll position.
virtualListWithSelection :: forall t m k v. (DomBuilder t m, PostBuild t m, MonadHold t m, PerformEvent t m, MonadJSM (Performable m), DomBuilderSpace m ~ GhcjsDomSpace, MonadFix m, Ord k, Eq v)
=> Dynamic t Int -- ^ The height of the visible region in pixels
diff --git a/reflex-dom-core/src/Reflex/Dom/Widget/Resize.hs b/reflex-dom-core/src/Reflex/Dom/Widget/Resize.hs
index 8dd6e5a8..65b71930 100644
--- a/reflex-dom-core/src/Reflex/Dom/Widget/Resize.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Widget/Resize.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
@@ -8,16 +9,6 @@
module Reflex.Dom.Widget.Resize where
-import Reflex.Class
-import Reflex.Time
-import Reflex.Dom.Builder.Class
-import Reflex.Dom.Builder.Immediate
-import Reflex.Dom.Class
-import Reflex.Dom.Widget.Basic
-import Reflex.PerformEvent.Class
-import Reflex.PostBuild.Class
-import Reflex.TriggerEvent.Class
-
import Control.Monad.Fix
import Control.Monad.IO.Class
import Data.Map (Map)
@@ -31,6 +22,21 @@ import GHCJS.DOM.Types (MonadJSM, liftJSM, uncheckedCastTo, HTMLElement(..))
import GHCJS.DOM.HTMLElement (getOffsetWidth, getOffsetHeight)
import qualified GHCJS.DOM.Types as DOM
+#if !MIN_VERSION_base(4,18,0)
+import Control.Monad
+import Data.Monoid
+#endif
+
+import Reflex.Class
+import Reflex.Time
+import Reflex.Dom.Builder.Class
+import Reflex.Dom.Builder.Immediate
+import Reflex.Dom.Class
+import Reflex.Dom.Widget.Basic
+import Reflex.PerformEvent.Class
+import Reflex.PostBuild.Class
+import Reflex.TriggerEvent.Class
+
-- | A widget that wraps the given widget in a div and fires an event when resized.
-- Adapted from @github.com\/marcj\/css-element-queries@
--
diff --git a/reflex-dom-core/src/Reflex/Dom/Xhr/Foreign.hs b/reflex-dom-core/src/Reflex/Dom/Xhr/Foreign.hs
index 3a72526f..09d476ad 100644
--- a/reflex-dom-core/src/Reflex/Dom/Xhr/Foreign.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Xhr/Foreign.hs
@@ -1,4 +1,8 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
+#ifdef __GHCJS__
+{-# LANGUAGE JavaScriptFFI #-}
+#endif
{-# LANGUAGE OverloadedStrings #-}
module Reflex.Dom.Xhr.Foreign
diff --git a/reflex-dom-core/src/Reflex/Dom/Xhr/FormData.hs b/reflex-dom-core/src/Reflex/Dom/Xhr/FormData.hs
index 43094af0..556e0e64 100644
--- a/reflex-dom-core/src/Reflex/Dom/Xhr/FormData.hs
+++ b/reflex-dom-core/src/Reflex/Dom/Xhr/FormData.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
@@ -17,6 +18,11 @@ import qualified GHCJS.DOM.FormData as FD
import GHCJS.DOM.File (getName)
import GHCJS.DOM.Types (File, IsBlob)
import Language.Javascript.JSaddle.Monad (MonadJSM, liftJSM)
+
+#if !MIN_VERSION_base(4,18,0)
+import Foreign.JavaScript.TH
+#endif
+
import Reflex
import Reflex.Dom.Xhr
diff --git a/reflex-dom-test-selenium/reflex-dom-test-selenium.cabal b/reflex-dom-test-selenium/reflex-dom-test-selenium.cabal
index ee601e72..a536b3bd 100644
--- a/reflex-dom-test-selenium/reflex-dom-test-selenium.cabal
+++ b/reflex-dom-test-selenium/reflex-dom-test-selenium.cabal
@@ -1,44 +1,45 @@
cabal-version: 1.24
-Name: reflex-dom-test-selenium
-Version: 0.0.0.1
-Synopsis: Testing framework for selenium tests
-Description:
-License: BSD3
-License-file: LICENSE
-Author: Ryan Trinkle
-Maintainer: ryan.trinkle@gmail.com
-Stability: Experimental
-Category: FRP, Web, GUI, HTML, Javascript, Reactive, Reactivity, User Interfaces, User-interface
-Build-type: Simple
+name: reflex-dom-test-selenium
+version: 0.0.0.1
+license: BSD3
+license-file: LICENSE
+maintainer: ryan.trinkle@gmail.com
+author: Ryan Trinkle
+stability: Experimental
+synopsis: Testing framework for selenium tests
+category:
+ FRP, Web, GUI, HTML, Javascript, Reactive, Reactivity, User Interfaces, User-interface
-library
- hs-source-dirs: src
- build-depends:
- async,
- base >= 4.7 && <= 4.21,
- bytestring >= 0.10 && < 0.13,
- chrome-test-utils,
- exceptions,
- hspec-core < 2.12,
- hspec-webdriver >= 1.2.2,
- http-types,
- jsaddle >= 0.9.0.0 && < 0.10,
- jsaddle-warp,
- network,
- process,
- reflex-dom-core,
- silently,
- text >= 1.2 && <= 2.1.1,
- wai,
- warp,
- webdriver,
- websockets
+build-type: Simple
- exposed-modules:
- Reflex.Dom.Test.Selenium
+library
+ exposed-modules: Reflex.Dom.Test.Selenium
+ hs-source-dirs: src
+ default-language: Haskell98
+ ghc-options:
+ -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
+ -fspecialise-aggressively
- default-language: Haskell98
- ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans -fspecialise-aggressively
+ build-depends:
+ async <2.3,
+ base >=4.7 && <=4.21,
+ bytestring >=0.10 && <0.13,
+ chrome-test-utils,
+ exceptions,
+ hspec-core <2.12,
+ hspec-webdriver >=1.2.2 && <1.3,
+ http-types <0.13,
+ jsaddle >=0.9.0.0 && <0.10,
+ jsaddle-warp <0.10,
+ network <3.3,
+ process,
+ reflex-dom-core,
+ silently <1.3,
+ text >=1.2 && <2.2,
+ wai <3.3,
+ warp <3.5,
+ webdriver <0.13,
+ websockets <0.14
- if !os(linux) || !arch(x86_64)
- buildable: False
+ if (!os(linux) || !arch(x86_64))
+ buildable: False
diff --git a/reflex-dom/reflex-dom.cabal b/reflex-dom/reflex-dom.cabal
index 47eaed31..487db377 100644
--- a/reflex-dom/reflex-dom.cabal
+++ b/reflex-dom/reflex-dom.cabal
@@ -1,211 +1,238 @@
-cabal-version: 1.24
-Name: reflex-dom
-Version: 0.6.3.1
-Synopsis: Functional Reactive Web Apps with Reflex
-Description:
- Web applications without callbacks or side-effects.
- Reflex-DOM brings the power of functional reactive programming (FRP) to the web.
- Build HTML and other Document Object Model (DOM) data with a pure functional interface.
- .
- Reflex-DOM is a Functional Reactive web framework based on the Reflex FRP engine: .
- .
- The @reflex-dom@ package is a small wrapper around the @reflex-dom-core@ package. It pulls in the
- correct set of dependencies for each target platform (GHCJS, WebKitGTK, WASM, mobile, etc.).
- Libraries should depend on @reflex-dom-core@ and executables will usually depend on @reflex-dom@.
- All of @reflex-dom-core@'s modules are re-exported by @reflex-dom@.
- .
- For Hackage documentation, please see: .
-License: BSD3
-License-file: LICENSE
-Author: Ryan Trinkle
-Maintainer: ryan.trinkle@gmail.com
-Stability: Experimental
-Category: FRP, Web, GUI, HTML, Javascript, Reactive, Reactivity, User Interfaces, User-interface
-Build-type: Simple
+cabal-version: 1.24
+name: reflex-dom
+version: 0.6.3.1
+license: BSD3
+license-file: LICENSE
+maintainer: ryan.trinkle@gmail.com
+author: Ryan Trinkle
+stability: Experimental
+synopsis: Functional Reactive Web Apps with Reflex
+description:
+ Web applications without callbacks or side-effects.
+ Reflex-DOM brings the power of functional reactive programming (FRP) to the web.
+ Build HTML and other Document Object Model (DOM) data with a pure functional interface.
+ .
+ Reflex-DOM is a Functional Reactive web framework based on the Reflex FRP engine: .
+ .
+ The @reflex-dom@ package is a small wrapper around the @reflex-dom-core@ package. It pulls in the
+ correct set of dependencies for each target platform (GHCJS, WebKitGTK, WASM, mobile, etc.).
+ Libraries should depend on @reflex-dom-core@ and executables will usually depend on @reflex-dom@.
+ All of @reflex-dom-core@'s modules are re-exported by @reflex-dom@.
+ .
+ For Hackage documentation, please see: .
+
+category:
+ FRP, Web, GUI, HTML, Javascript, Reactive, Reactivity, User Interfaces, User-interface
+
+build-type: Simple
extra-source-files:
- java/org/reflexfrp/reflexdom/MainWidget.java
- ChangeLog.md
+ java/org/reflexfrp/reflexdom/MainWidget.java
+ ChangeLog.md
+
+source-repository head
+ type: git
+ location: https://github.com/reflex-frp/reflex-dom
+ subdir: reflex-dom
flag use-warp
- description: Use jsaddle-warp server
- default: False
- manual: True
+ description: Use jsaddle-warp server
+ default: False
+ manual: True
flag webkit2gtk
- description: Use WebKit2 version of WebKitGTK.
- default: True
+ description: Use WebKit2 version of WebKitGTK.
flag use-reflex-optimizer
- description: Use the GHC plugin Reflex.Optimizer on some of the modules in the package. This is still experimental.
- default: False
- manual: True
+ description:
+ Use the GHC plugin Reflex.Optimizer on some of the modules in the package. This is still experimental.
+
+ default: False
+ manual: True
flag expose-all-unfoldings
- description: Build the library with -fexpose-all-unfoldings which can help client code specialize better
- default: False
- manual: True
+ description:
+ Build the library with -fexpose-all-unfoldings which can help client code specialize better
+
+ default: False
+ manual: True
flag build-examples
- description: Build the executables in ./examples
- default: False
- manual: True
+ description: Build the executables in ./examples
+ default: False
+ manual: True
flag wasm32
- description: Build for wasm32 architecture
- default: False
- manual: True
+ description: Build for wasm32 architecture
+ default: False
+ manual: True
library
- hs-source-dirs: src
- if os(android)
- hs-source-dirs: src-android
- other-modules: Reflex.Dom.Android.MainWidget
+ exposed-modules:
+ Reflex.Dom
+ Reflex.Dom.Internal
+ Reflex.Dom.Location.Platform
+
+ reexported-modules:
+ Foreign.JavaScript.Orphans,
+ Foreign.JavaScript.TH,
+ Foreign.JavaScript.Utils,
+ Reflex.Dom.Builder.Class,
+ Reflex.Dom.Builder.Class.Events,
+ Reflex.Dom.Builder.Hydratable,
+ Reflex.Dom.Builder.Immediate,
+ Reflex.Dom.Builder.InputDisabled,
+ Reflex.Dom.Builder.Static,
+ Reflex.Dom.Class,
+ Reflex.Dom.Core,
+ Reflex.Dom.Location,
+ Reflex.Dom.Main,
+ Reflex.Dom.Modals.Class,
+ Reflex.Dom.Old,
+ Reflex.Dom.Prerender,
+ Reflex.Dom.Time,
+ Reflex.Dom.WebSocket,
+ Reflex.Dom.WebSocket.Query,
+ Reflex.Dom.Widget,
+ Reflex.Dom.Widget.Basic,
+ Reflex.Dom.Widget.Input,
+ Reflex.Dom.Widget.Lazy,
+ Reflex.Dom.Widget.Resize,
+ Reflex.Dom.Xhr,
+ Reflex.Dom.Xhr.FormData
+
+ cc-options: -fPIC
+ hs-source-dirs: src
+ default-language: Haskell2010
+ ghc-options:
+ -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans -fPIC
+
build-depends:
- aeson >= 1.4 && < 2.3,
- android-activity == 0.2.*,
- data-default == 0.7.*,
- jsaddle >= 0.9.6 && < 0.10
- c-sources: cbits/MainWidget.c
- include-dirs: cbits/include
- install-includes: MainWidget.h
- cpp-options: -DANDROID
- build-tools: hsc2hs
- build-depends:
- base >= 4.7 && <= 4.21,
- bytestring >= 0.10 && < 0.13,
- reflex >= 0.8 && < 1,
- reflex-dom-core >= 0.6.1.0 && <0.9,
- text >= 1.2 && < 2.2
- if !(impl(ghcjs) || arch(javascript))
- if flag(use-warp)
- build-depends:
- jsaddle >= 0.9.6 && < 0.10,
- jsaddle-warp >= 0.9.6 && < 0.10
- else
- if os(osx) || os(ios)
+ base >=4.7 && <4.21,
+ bytestring >=0.10 && <0.13,
+ reflex >=0.8 && <1,
+ reflex-dom-core >=0.6.1.0 && <0.9,
+ text >=1.2 && <2.2
+
+ if os(android)
+ build-tools: hsc2hs >=0
+ cpp-options: -DANDROID
+ c-sources: cbits/MainWidget.c
+ hs-source-dirs: src-android
+ other-modules: Reflex.Dom.Android.MainWidget
+ include-dirs: cbits/include
+ install-includes: MainWidget.h
build-depends:
- data-default == 0.7.*,
- jsaddle >= 0.9.6 && < 0.10,
- jsaddle-wkwebview >= 0.9.6 && < 0.10
- else
- if flag(wasm32)
- build-depends:
- jsaddle >= 0.9.6 && < 0.10,
- jsaddle-wasm >= 0.1 && < 0.2
- else
- if flag(webkit2gtk) && !os(android)
+ aeson >=1.4 && <2.3,
+ android-activity >=0.2 && <0.3,
+ data-default >=0.7 && <0.8,
+ jsaddle >=0.9.6 && <0.10
+
+ if !(impl(ghcjs >=0) || arch(javascript))
+ if flag(use-warp)
build-depends:
- jsaddle-webkit2gtk >= 0.9.6 && < 0.10
-
- exposed-modules:
- Reflex.Dom
- Reflex.Dom.Internal
- Reflex.Dom.Location.Platform
- reexported-modules:
- Foreign.JavaScript.Orphans
- , Foreign.JavaScript.TH
- , Foreign.JavaScript.Utils
- , Reflex.Dom.Builder.Class
- , Reflex.Dom.Builder.Class.Events
- , Reflex.Dom.Builder.Hydratable
- , Reflex.Dom.Builder.Immediate
- , Reflex.Dom.Builder.InputDisabled
- , Reflex.Dom.Builder.Static
- , Reflex.Dom.Class
- , Reflex.Dom.Core
- , Reflex.Dom.Location
- , Reflex.Dom.Main
- , Reflex.Dom.Modals.Class
- , Reflex.Dom.Old
- , Reflex.Dom.Prerender
- , Reflex.Dom.Time
- , Reflex.Dom.WebSocket
- , Reflex.Dom.WebSocket.Query
- , Reflex.Dom.Widget
- , Reflex.Dom.Widget.Basic
- , Reflex.Dom.Widget.Input
- , Reflex.Dom.Widget.Lazy
- , Reflex.Dom.Widget.Resize
- , Reflex.Dom.Xhr
- , Reflex.Dom.Xhr.FormData
- ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans -fPIC
- cc-options: -fPIC
- if flag(expose-all-unfoldings)
- ghc-options: -fexpose-all-unfoldings
- if flag(use-reflex-optimizer)
- ghc-options: -fplugin=Reflex.Optimizer
- default-language: Haskell2010
+ jsaddle >=0.9.6 && <0.10,
+ jsaddle-warp >=0.9.6 && <0.10
+
+ else
+ if (os(osx) || os(ios))
+ build-depends:
+ data-default >=0.7 && <0.8,
+ jsaddle >=0.9.6 && <0.10,
+ jsaddle-wkwebview >=0.9.6 && <0.10
+
+ else
+ if flag(wasm32)
+ build-depends:
+ jsaddle >=0.9.6 && <0.10,
+ jsaddle-wasm >=0.1 && <0.2
+
+ else
+ if (flag(webkit2gtk) && !os(android))
+ build-depends: jsaddle-webkit2gtk >=0.9.6 && <0.10
+
+ if flag(expose-all-unfoldings)
+ ghc-options: -fexpose-all-unfoldings
+
+ if flag(use-reflex-optimizer)
+ ghc-options: -fplugin=Reflex.Optimizer
executable sortableList
- build-depends: base
- , containers
- , dependent-map
- , lens
- , mtl
- , random
- , reflex
- , reflex-dom
- , text
- , time
- , transformers
- hs-source-dirs: examples
- main-is: sortableList.hs
- ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans -fspecialise-aggressively
- if !flag(build-examples)
- buildable: False
- if flag(expose-all-unfoldings)
- ghc-options: -fexpose-all-unfoldings
- if flag(use-reflex-optimizer)
- ghc-options: -fplugin=Reflex.Optimizer
- default-language: Haskell2010
+ main-is: sortableList.hs
+ hs-source-dirs: examples
+ default-language: Haskell2010
+ ghc-options:
+ -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
+ -fspecialise-aggressively
+
+ build-depends:
+ base,
+ containers <0.8,
+ dependent-map <0.5,
+ lens <5.4,
+ mtl,
+ random <1.3,
+ reflex <0.10,
+ reflex-dom,
+ text <2.2,
+ time,
+ transformers
+
+ if !flag(build-examples)
+ buildable: False
+
+ if flag(expose-all-unfoldings)
+ ghc-options: -fexpose-all-unfoldings
+
+ if flag(use-reflex-optimizer)
+ ghc-options: -fplugin=Reflex.Optimizer
executable benchmark
- build-depends: base
- , containers
- , dependent-map
- , dependent-sum
- , ghc-prim
- , ghcjs-dom
- , mtl
- , prim-uniq
- , random
- , reflex
- , reflex-dom
- , text
- , transformers
- hs-source-dirs: .
- main-is: benchmark.hs
- ghc-options: -O2 -fspecialise-aggressively
- if !impl(ghcjs)
- buildable: False
- default-language: Haskell2010
+ main-is: benchmark.hs
+ hs-source-dirs: .
+ default-language: Haskell2010
+ ghc-options: -O2 -fspecialise-aggressively
+ build-depends:
+ base,
+ containers <0.8,
+ dependent-map <0.5,
+ dependent-sum <0.8,
+ ghc-prim,
+ ghcjs-dom <0.10,
+ mtl,
+ prim-uniq <0.3,
+ random <1.3,
+ reflex <0.10,
+ reflex-dom,
+ text <2.2,
+ transformers
+
+ if !impl(ghcjs >=0)
+ buildable: False
executable krausest
- build-depends: base
- , containers
- , dependent-map
- , dependent-sum
- , ghc-prim
- , ghcjs-dom
- , mtl
- , prim-uniq
- , random
- , reflex
- , reflex-dom
- , text
- , transformers
- , vector
- hs-source-dirs: benchmarks
- main-is: krausest.hs
- ghc-options: -O2 -fspecialise-aggressively
- if impl(ghcjs)
- ghcjs-options: -dedupe
- cpp-options: -DGHCJS_BROWSER -DGHCJS_GC_INTERVAL=60000
- else
- buildable: False
- default-language: Haskell2010
+ main-is: krausest.hs
+ hs-source-dirs: benchmarks
+ default-language: Haskell2010
+ ghc-options: -O2 -fspecialise-aggressively
+ build-depends:
+ base,
+ containers <0.8,
+ dependent-map <0.5,
+ dependent-sum <0.8,
+ ghc-prim,
+ ghcjs-dom <0.10,
+ mtl,
+ prim-uniq <0.3,
+ random <1.3,
+ reflex <0.10,
+ reflex-dom,
+ text <2.2,
+ transformers,
+ vector <0.14
-source-repository head
- type: git
- location: https://github.com/reflex-frp/reflex-dom
- subdir: reflex-dom
+ if impl(ghcjs >=0)
+ cpp-options: -DGHCJS_BROWSER -DGHCJS_GC_INTERVAL=60000
+ ghcjs-options: -dedupe
+
+ else
+ buildable: False