Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dn-jsaddle-core2-4' into dylang/…
Browse files Browse the repository at this point in the history
…core2
  • Loading branch information
cidkidnix committed Jul 19, 2023
2 parents 6278b16 + 834b7d8 commit a9338c2
Show file tree
Hide file tree
Showing 12 changed files with 225 additions and 208 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## [Reflex-DOM](https://reflex-frp.org)

[![Haskell](https://img.shields.io/badge/language-Haskell-orange.svg)](https://haskell.org) [![Hackage](https://img.shields.io/hackage/v/reflex-dom.svg)](https://hackage.haskell.org/package/reflex-dom) [![Hackage CI](https://matrix.hackage.haskell.org/api/v2/packages/reflex-dom/badge)](https://matrix.hackage.haskell.org/#/package/reflex-dom) [![BSD3 License](https://img.shields.io/badge/license-BSD3-blue.svg)](https://github.com/reflex-frp/reflex-dom/blob/master/LICENSE)
[![Haskell](https://img.shields.io/badge/language-Haskell-orange.svg)](https://haskell.org) [![Hackage](https://img.shields.io/hackage/v/reflex-dom.svg)](https://hackage.haskell.org/package/reflex-dom) [![BSD3 License](https://img.shields.io/badge/license-BSD3-blue.svg)](https://github.com/reflex-frp/reflex-dom/blob/master/LICENSE)

Web applications without callbacks or side-effects. Reflex-DOM brings the power of [Functional Reactive Programming (FRP)](https://wiki.haskell.org/Functional_Reactive_Programming) to the web. Build [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) and other [Document Object Model (DOM)](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model) data with a pure functional interface.

Expand Down
6 changes: 3 additions & 3 deletions dep/reflex-platform/github.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"owner": "reflex-frp",
"repo": "reflex-platform",
"branch": "develop",
"branch": "release/1.0.1.0",
"private": false,
"rev": "ac66356c8839d1dc16cc60887c2db5988a60e6c4",
"sha256": "0zk8pf72lid6cqq4mlr1mcwh6zd5lz9i83kw519aci6mfba1afvq"
"rev": "50099ce2bca93ef69cea615ec72152b4a7648de4",
"sha256": "1ldzf3qznpysf4drkrvj7ysmdvrv6ddprnniylvcxccpp0f4krb7"
}
5 changes: 4 additions & 1 deletion dep/reflex-platform/thunk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
if !fetchSubmodules && !private then builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
} else (import <nixpkgs> {}).fetchFromGitHub {
} else (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
}) {}).fetchFromGitHub {
inherit owner repo rev sha256 fetchSubmodules private;
};
json = builtins.fromJSON (builtins.readFile ./github.json);
Expand Down
12 changes: 9 additions & 3 deletions reflex-dom-core/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Revision history for reflex-dom-core

## Unreleased
## 0.8.0.0

* Support reflex 0.9
* *Breaking change*: tableDynAttr now requires an `Eq` constraint on the row value type
* *Breaking change*: all of the virtualList functions in Reflex.Dom.Widget.Lazy now require an `Eq` constraint on the row value type

## 0.7.0.3

* Loosen version bounds of aeson, ref-tf and constraints

* Loosen version bounds of ref-tf and constraints
*
## 0.7.0.2

* Require reflex >= 0.8.2.1 and switch to `commutative-semigroups`
Expand Down
10 changes: 6 additions & 4 deletions reflex-dom-core/reflex-dom-core.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.24
Name: reflex-dom-core
Version: 0.7.0.2
Version: 0.8.0.0
Synopsis: Functional Reactive Web Apps with Reflex
Description:
Web applications without callbacks or side-effects.
Expand Down Expand Up @@ -67,7 +67,7 @@ flag gc-tests
library
hs-source-dirs: src
build-depends:
aeson >= 0.8 && < 2.1,
aeson >= 0.8 && < 2.2,
base >= 4.7 && < 4.15,
bifunctors >= 4.2 && < 6,
bimap >= 0.3 && < 0.5,
Expand All @@ -89,13 +89,14 @@ library
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.1,
lens >= 4.7 && < 5.3,
monad-control >= 1.0.1 && < 1.1,
mtl >= 2.1 && < 2.3,
patch >= 0.0.7 && < 0.1,
primitive >= 0.5 && < 0.8,
random >= 1.1 && < 1.3,
ref-tf >= 0.4 && < 0.6,
reflex >= 0.8.2.1 && < 0.9,
reflex >= 0.8.2.1 && < 1,
semigroups >= 0.16 && < 0.20,
stm >= 2.4 && < 2.6,
text == 1.2.*,
Expand Down Expand Up @@ -226,6 +227,7 @@ test-suite hydration
, webdriver
, websockets
, which
, patch
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
Expand Down
3 changes: 2 additions & 1 deletion reflex-dom-core/src/Reflex/Dom/Builder/Class/Events.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module Reflex.Dom.Builder.Class.Events where
import Data.GADT.Compare.TH
#else
import Data.GADT.Compare
(GOrdering(..), (:~:)(..), GEq(..), GCompare(..))
(GOrdering(..), GEq(..), GCompare(..))
import Data.Type.Equality ((:~:)(..))
#endif
import Data.Text (Text)

Expand Down
364 changes: 182 additions & 182 deletions reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ blank = return ()

-- TODO: Move to an example project.
-- | A widget to display a table with static columns and dynamic rows.
tableDynAttr :: forall t m r k v. (Ord k, DomBuilder t m, MonadHold t m, PostBuild t m, MonadFix m)
tableDynAttr :: forall t m r k v. (Ord k, Eq r, DomBuilder t m, MonadHold t m, PostBuild t m, MonadFix m)
=> Text -- ^ Class applied to <table> element
-> [(Text, k -> Dynamic t r -> m v)] -- ^ Columns of (header, row key -> row value -> child widget)
-> Dynamic t (Map k r) -- ^ Map from row key to row value
Expand Down
6 changes: 3 additions & 3 deletions reflex-dom-core/src/Reflex/Dom/Widget/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ 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)
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
-> Int -- ^ The height of each row in pixels
-> Dynamic t Int -- ^ The total number of items
Expand Down Expand Up @@ -81,7 +81,7 @@ virtualListWithSelection heightPx rowPx maxIndex i0 setI listTag listAttrs rowTa
preItems = min startingIndex numItems
in (topPx - preItems * sizeIncrement, (startingIndex - preItems, preItems + numItems * 2))

virtualList :: forall t m k v a. (DomBuilder t m, PostBuild t m, MonadHold t m, PerformEvent t m, MonadJSM (Performable m), DomBuilderSpace m ~ GhcjsDomSpace, MonadFix m, Ord k)
virtualList :: forall t m k v a. (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 -- ^ A 'Dynamic' of the visible region's height in pixels
-> Int -- ^ The fixed height of each row in pixels
-> Dynamic t Int -- ^ A 'Dynamic' of the total number of items
Expand Down Expand Up @@ -126,7 +126,7 @@ virtualList heightPx rowPx maxIndex i0 setI keyToIndex items0 itemsUpdate itemBu
in (startingIndex, numItems)

virtualListBuffered
:: (DomBuilder t m, PostBuild t m, MonadHold t m, PerformEvent t m, MonadJSM (Performable m), DomBuilderSpace m ~ GhcjsDomSpace, MonadFix m, Ord k)
:: (DomBuilder t m, PostBuild t m, MonadHold t m, PerformEvent t m, MonadJSM (Performable m), DomBuilderSpace m ~ GhcjsDomSpace, MonadFix m, Ord k, Eq v)
=> Int
-> Dynamic t Int
-> Int
Expand Down
6 changes: 3 additions & 3 deletions reflex-dom/reflex-dom.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ library
hs-source-dirs: src-android
other-modules: Reflex.Dom.Android.MainWidget
build-depends:
aeson >= 1.4 && < 1.6,
aeson >= 1.4 && < 2.2,
android-activity == 0.1.*,
data-default == 0.7.*,
jsaddle >= 0.9.6 && < 0.10
Expand All @@ -73,8 +73,8 @@ library
build-depends:
base >= 4.7 && < 4.15,
bytestring == 0.10.*,
reflex >= 0.8 && < 0.9,
reflex-dom-core >= 0.6.1.0 && <0.8,
reflex >= 0.8 && < 1,
reflex-dom-core >= 0.6.1.0 && <0.9,
text == 1.2.*
if !impl(ghcjs)
if flag(use-warp)
Expand Down
9 changes: 4 additions & 5 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ let
"ghcjs"
] ++ lib.optionals (reflex-platform.androidSupport) [
"ghcAndroidAarch64"
"ghcAndroidAarch32"
] ++ lib.optionals (reflex-platform.iosSupport) [
"ghcIosAarch64"
];
Expand All @@ -31,13 +30,13 @@ let
} {};
reflex = self.callHackageDirect {
pkg = "reflex";
ver = "0.8.2.1";
sha256 = "10d1qkqwaqp9zaswmziaqgz60ifg5383d2i2ml2cqccn8943h26b";
ver = "0.9.0.1";
sha256 = "sha256-HhBBElxwfzGt1tOMCtYLT9Ody9mvaDb2ppuy3qFWLPs=";
} {};
patch = self.callHackageDirect {
pkg = "patch";
ver = "0.0.7.0";
sha256 = "0yr2hk3fpwjxi1z0n384k3aq9b3z00c02bbwqybcj3n20l4k17l6";
ver = "0.0.8.2";
sha256 = "sha256-7+dwuBNo33XPsBo5DhFD4oyKBWrOvTHUyA6RJyHGH5g=";
} {};
})
# Use this package's source for reflex
Expand Down
8 changes: 7 additions & 1 deletion test/reflex-dom-reexports.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Main where

import Control.Monad (when)
import Data.List (intercalate)
import qualified Data.List.NonEmpty as NE
import Data.Maybe (fromMaybe, isNothing, mapMaybe)
import qualified Data.Set as Set
import Distribution.Compiler (CompilerFlavor(GHC))
Expand All @@ -14,7 +15,12 @@ import Distribution.PackageDescription.Parsec (runParseResult)
import qualified Distribution.System as Dist
import Distribution.Types.BuildInfo (buildable, defaultExtensions, defaultLanguage, hsSourceDirs, options)
import Distribution.Types.CondTree (simplifyCondTree)
#if MIN_VERSION_Cabal(3,2,0)
import Distribution.Types.ConfVar (ConfVar(Arch, Impl, OS))
import Distribution.Types.GenericPackageDescription (condLibrary)
#else
import Distribution.Types.GenericPackageDescription (ConfVar(Arch, Impl, OS), condLibrary)
#endif
import Distribution.Types.Library (exposedModules, libBuildInfo, reexportedModules)
import Distribution.Types.ModuleReexport (ModuleReexport, moduleReexportOriginalName, moduleReexportOriginalPackage)
import Distribution.Types.PackageName (mkPackageName)
Expand Down Expand Up @@ -70,4 +76,4 @@ parseCabalExports file = do
let (_, lib) = simplifyCondTree evalConfVar condLib
in (exposedModules lib, reexportedModules lib)
Right Nothing -> error $ "Haskell package has no library component: " <> file
Left (_, errors) -> error $ "Failed to parse " <> file <> ":\n" <> unlines (map show errors)
Left (_, errors) -> error $ "Failed to parse " <> file <> ":\n" <> unlines (map show (NE.toList errors))

0 comments on commit a9338c2

Please sign in to comment.