mirror of
https://github.com/ilyakooo0/reflex-dom.git
synced 2024-09-11 06:35:30 +03:00
Split into reflex-dom-core and reflex-dom
reflex-dom-core contains all the code that does not depend on WebKitGTK
This commit is contained in:
parent
9b63cd5611
commit
04a33a6720
@ -1,4 +1,4 @@
|
||||
Name: reflex-dom
|
||||
Name: reflex-dom-core
|
||||
Version: 0.4
|
||||
Synopsis: Functional Reactive Web Apps with Reflex
|
||||
Description: Reflex-DOM is a Functional Reactive web framework based on the Reflex FRP engine
|
||||
@ -71,15 +71,15 @@ library
|
||||
|
||||
exposed-modules:
|
||||
Foreign.JavaScript.TH
|
||||
Reflex.Dom
|
||||
Reflex.Dom.Builder.Class
|
||||
Reflex.Dom.Builder.Class.Events
|
||||
Reflex.Dom.Builder.Immediate
|
||||
Reflex.Dom.Builder.InputDisabled
|
||||
Reflex.Dom.Builder.Static
|
||||
Reflex.Dom.Class
|
||||
Reflex.Dom.Internal
|
||||
Reflex.Dom.Core
|
||||
Reflex.Dom.Location
|
||||
Reflex.Dom.Main
|
||||
Reflex.Dom.Old
|
||||
Reflex.Dom.Time
|
||||
Reflex.Dom.WebSocket
|
||||
@ -120,3 +120,4 @@ library
|
||||
source-repository head
|
||||
type: git
|
||||
location: https://github.com/reflex-frp/reflex-dom
|
||||
subdir: reflex-dom-core
|
@ -1,4 +1,4 @@
|
||||
module Reflex.Dom (module X) where
|
||||
module Reflex.Dom.Core (module X) where
|
||||
|
||||
import Reflex as X hiding (askEvents)
|
||||
import Reflex.Dom.Builder.Class as X
|
||||
@ -6,8 +6,8 @@ import Reflex.Dom.Builder.Immediate as X
|
||||
import Reflex.Dom.Builder.InputDisabled as X
|
||||
import Reflex.Dom.Builder.Static as X
|
||||
import Reflex.Dom.Class as X
|
||||
import Reflex.Dom.Internal as X
|
||||
import Reflex.Dom.Location as X
|
||||
import Reflex.Dom.Main as X
|
||||
import Reflex.Dom.Old as X
|
||||
import Reflex.Dom.Time as X
|
||||
import Reflex.Dom.WebSocket as X
|
@ -13,7 +13,7 @@
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
{-# LANGUAGE UndecidableInstances #-}
|
||||
{-# LANGUAGE PatternSynonyms #-}
|
||||
module Reflex.Dom.Internal where
|
||||
module Reflex.Dom.Main where
|
||||
|
||||
import Prelude hiding (concat, mapM, mapM_, sequence, sequence_)
|
||||
|
12
reflex-dom/LICENSE
Normal file
12
reflex-dom/LICENSE
Normal file
@ -0,0 +1,12 @@
|
||||
Copyright (c) 2015, Obsidian Systems LLC
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2
reflex-dom/Setup.hs
Normal file
2
reflex-dom/Setup.hs
Normal file
@ -0,0 +1,2 @@
|
||||
import Distribution.Simple
|
||||
main = defaultMain
|
67
reflex-dom/reflex-dom.cabal
Normal file
67
reflex-dom/reflex-dom.cabal
Normal file
@ -0,0 +1,67 @@
|
||||
Name: reflex-dom
|
||||
Version: 0.4
|
||||
Synopsis: Functional Reactive Web Apps with Reflex
|
||||
Description: Reflex-DOM is a Functional Reactive web framework based on the Reflex FRP engine
|
||||
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
|
||||
-- Deal with https://github.com/haskell/cabal/issues/2544 / https://github.com/haskell/cabal/issues/367
|
||||
extra-source-files: src/Reflex/Dom/Xhr/Foreign.hs
|
||||
src/Reflex/Dom/WebSocket/Foreign.hs
|
||||
src/Reflex/Dom/Xhr/ResponseType.hs
|
||||
src/Reflex/Dom/Xhr/Exception.hs
|
||||
|
||||
flag webkit2gtk
|
||||
description: Use WebKit2 version of WebKitGTK.
|
||||
default: True
|
||||
|
||||
library
|
||||
hs-source-dirs: src
|
||||
build-depends:
|
||||
base >= 4.7 && < 4.10,
|
||||
bytestring == 0.10.*,
|
||||
reflex == 0.5.*,
|
||||
reflex-dom-core >=0.4 && <0.5,
|
||||
text == 1.2.*
|
||||
if flag(webkit2gtk)
|
||||
build-depends:
|
||||
jsaddle-webkit2gtk
|
||||
else
|
||||
build-depends:
|
||||
jsaddle-webkitgtk
|
||||
|
||||
exposed-modules:
|
||||
Reflex.Dom
|
||||
Reflex.Dom.Internal
|
||||
reexported-modules:
|
||||
Foreign.JavaScript.TH
|
||||
, Reflex.Dom.Builder.Class
|
||||
, Reflex.Dom.Builder.Class.Events
|
||||
, 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.Old
|
||||
, Reflex.Dom.Time
|
||||
, Reflex.Dom.WebSocket
|
||||
, Reflex.Dom.Widget
|
||||
, Reflex.Dom.Widget.Basic
|
||||
, Reflex.Dom.Widget.Input
|
||||
, Reflex.Dom.Widget.Lazy
|
||||
, Reflex.Dom.Widget.Resize
|
||||
, Reflex.Dom.Xhr
|
||||
|
||||
ghc-options: -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
|
7
reflex-dom/src/Reflex/Dom.hs
Normal file
7
reflex-dom/src/Reflex/Dom.hs
Normal file
@ -0,0 +1,7 @@
|
||||
module Reflex.Dom (module X) where
|
||||
|
||||
import Reflex.Dom.Core as X hiding
|
||||
(mainWidget, mainWidgetWithHead, mainWidgetWithCss,
|
||||
mainWidgetWithHead', mainWidgetInElementById, runApp')
|
||||
import Reflex.Dom.Internal as X
|
||||
|
41
reflex-dom/src/Reflex/Dom/Internal.hs
Normal file
41
reflex-dom/src/Reflex/Dom/Internal.hs
Normal file
@ -0,0 +1,41 @@
|
||||
{-# LANGUAGE RankNTypes #-}
|
||||
{-# LANGUAGE TypeFamilies #-}
|
||||
module Reflex.Dom.Internal
|
||||
(module Main, mainWidget, mainWidgetWithHead, mainWidgetWithCss,
|
||||
mainWidgetWithHead', mainWidgetInElementById, runApp') where
|
||||
|
||||
import Data.ByteString (ByteString)
|
||||
import Data.Text (Text)
|
||||
import Reflex.Spider (Spider)
|
||||
import Reflex.Dom.Core (Widget)
|
||||
import Reflex.Dom.Main as Main hiding
|
||||
(mainWidget, mainWidgetWithHead, mainWidgetWithCss,
|
||||
mainWidgetWithHead', mainWidgetInElementById, runApp')
|
||||
import qualified Reflex.Dom.Main as Main
|
||||
(mainWidget, mainWidgetWithHead, mainWidgetWithCss,
|
||||
mainWidgetWithHead', mainWidgetInElementById, runApp')
|
||||
import Language.Javascript.JSaddle.WebKitGTK (run)
|
||||
|
||||
mainWidget :: (forall x. Widget x ()) -> IO ()
|
||||
mainWidget w = run $ Main.mainWidget w
|
||||
{-# INLINE mainWidget #-}
|
||||
|
||||
mainWidgetWithHead :: (forall x. Widget x ()) -> (forall x. Widget x ()) -> IO ()
|
||||
mainWidgetWithHead h b = run $ Main.mainWidgetWithHead h b
|
||||
{-# INLINE mainWidgetWithHead #-}
|
||||
|
||||
mainWidgetWithCss :: ByteString -> (forall x. Widget x ()) -> IO ()
|
||||
mainWidgetWithCss css w = run $ Main.mainWidgetWithCss css w
|
||||
{-# INLINE mainWidgetWithCss #-}
|
||||
|
||||
mainWidgetWithHead' :: (forall x. (a -> Widget x b, b -> Widget x a)) -> IO ()
|
||||
mainWidgetWithHead' w = run $ Main.mainWidgetWithHead' w
|
||||
{-# INLINE mainWidgetWithHead' #-}
|
||||
|
||||
mainWidgetInElementById :: Text -> (forall x. Widget x ()) -> IO ()
|
||||
mainWidgetInElementById eid w = run $ Main.mainWidgetInElementById eid w
|
||||
{-# INLINE mainWidgetInElementById #-}
|
||||
|
||||
runApp' :: (t ~ Spider) => (forall x. AppInput t -> Widget x (AppOutput t)) -> IO ()
|
||||
runApp' app = run $ Main.runApp' app
|
||||
{-# INLINE runApp' #-}
|
Loading…
Reference in New Issue
Block a user