Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reflex-todomvc #18

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module App (start) where

import GHC.Wasm.Prim
import Language.Javascript.JSaddle (JSM)
import Reflex.TodoMVC qualified
import SimpleCounter qualified
import Snake qualified
import TodoMVC qualified
Expand All @@ -16,4 +17,5 @@ start e =
"todomvc" -> TodoMVC.start
"xhr" -> XHR.start
"2048" -> TwoZeroFourEight.start
"reflex-todomvc" -> Reflex.TodoMVC.main
_ -> fail "unknown example"
34 changes: 33 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
packages: . hs2048
packages: . hs2048 reflex-todomvc

index-state: 2024-09-29T15:37:55Z

Expand All @@ -22,3 +22,35 @@ if arch(wasm32)

package aeson
flags: -ordered-keymap

-- for reflex-frp

-- remove TemplateHaskell
source-repository-package
type: git
location: https://github.com/amesgen/patch
tag: 1b5410686a28271f3d4b4d8fda877c5218df1d6f

-- GHC 9.10 compat
source-repository-package
type: git
location: https://github.com/amesgen/reflex
tag: c2dac0eddc18c230db2e5c9cf1edbe19d7e65922

-- GHC 9.10 compat
source-repository-package
type: git
location: https://github.com/amesgen/reflex-dom
tag: e43e0525d643f656a0a5b0f10e13e2a04712cd4e
subdir: reflex-dom-core

allow-newer:
, template-haskell
, reflex-dom-core:*
, reflex:*
constraints: witherable <0.5

package reflex
flags: -use-template-haskell
package reflex-dom-core
flags: -use-template-haskell
12 changes: 12 additions & 0 deletions frontend/reflex-todomvc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TodoMVC | Reflex FRP example via GHC WASM</title>
</head>
<body>
<script>globalThis.example = "reflex-todomvc";</script>
<script src="index.js" type="module"></script>
</body>
</html>
1 change: 1 addition & 0 deletions ghc-wasm-miso-examples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ executable ghc-wasm-miso-examples
, miso
, mtl
, random
, reflex-todomvc
, text
hs-source-dirs: app
default-language: GHC2021
Expand Down
25 changes: 25 additions & 0 deletions reflex-todomvc/reflex-todomvc.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Cabal-version: 3.0
Name: reflex-todomvc
Version: 0.1
Synopsis: Functional Reactive TodoMVC
Description: An implementation of the TodoMVC specification using the Reflex-DOM functional reactive DOM library
License: BSD-3-Clause
License-file: LICENSE
Author: Ryan Trinkle
Maintainer: [email protected]
Stability: Experimental
Category: FRP

library
hs-source-dirs: src
build-depends:
base,
reflex,
ghcjs-dom == 0.9.*,
reflex-dom-core,
containers,
text,
mtl
exposed-modules:
Reflex.TodoMVC
ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
Loading