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

Clickable #22

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
91b75ee
WIP: Wasm Backend
lagunoff Mar 13, 2024
7894016
Text to JSString conversion
lagunoff Mar 13, 2024
912f68f
WIP: Wasm Backend
lagunoff Mar 15, 2024
ba63efc
Upstream changes from htmlt-wasm
lagunoff Mar 15, 2024
a9a5ff8
Rename
lagunoff Mar 16, 2024
962f726
evalRawJavaScript
lagunoff Mar 18, 2024
63c0296
evalJavaScriptN
lagunoff Mar 20, 2024
48a133d
WIP
lagunoff Mar 21, 2024
2baeb49
WIP
lagunoff Mar 21, 2024
0e9a834
WIP
lagunoff Mar 21, 2024
9e65e31
WIP
lagunoff Mar 22, 2024
4da4941
WIP
lagunoff Mar 24, 2024
4942a07
Split code into more modules
lagunoff Mar 25, 2024
6f25736
Cleanup
lagunoff Mar 26, 2024
7b37849
Clickable.Protocol
lagunoff Mar 27, 2024
ccfae95
WIP
lagunoff Mar 27, 2024
5c23cf8
Save progress
lagunoff Mar 28, 2024
7840a8c
Hot reloading
lagunoff Mar 29, 2024
90bd431
Hot reloading
lagunoff Mar 31, 2024
c807dfa
simpleList-v1
lagunoff Apr 2, 2024
e26e7f8
Recover TodoMVC example
lagunoff Apr 3, 2024
a26a5e2
TodoMVC popstate
lagunoff Apr 4, 2024
d77a892
WASM message exchange mechanism
lagunoff Apr 4, 2024
366aa47
Renaming
lagunoff Apr 4, 2024
fc5e02a
Input focus on double-click
lagunoff Apr 4, 2024
db28bd5
MapHoldVal
lagunoff Apr 5, 2024
b2de9b6
WIP
lagunoff Apr 8, 2024
5dc5388
dynClassList
lagunoff Apr 10, 2024
88ff159
IEEE-754 format for floating point numbers
lagunoff Apr 11, 2024
7ea7ddf
Int32Le
lagunoff Apr 13, 2024
c6e7722
Fix a leak in WebSocket handler
lagunoff Apr 13, 2024
664b50b
Recover broken TodoMVC
lagunoff Apr 14, 2024
3fa2fb4
subscribeAccum
lagunoff Apr 14, 2024
b9338c6
Change remaining 64 to 32 bit integer
lagunoff Apr 15, 2024
a232778
Use tryPutMvar to resolve a memory leak
lagunoff Apr 23, 2024
966d653
MonadCatch, MonadMask, MonadThrow
lagunoff May 5, 2024
4ffd643
DevServer concurency improvements
lagunoff May 8, 2024
3c99fee
unsafeHtml
lagunoff Jun 7, 2024
578959a
portal
lagunoff Jun 19, 2024
7803144
Remove broken examples
lagunoff Jul 7, 2024
22474e7
forDyn
lagunoff Jul 16, 2024
f3bdaad
Split examples into separate package
lagunoff Jul 30, 2024
d421e6b
A few changes to DevServer
lagunoff Aug 2, 2024
e34ee27
Better typed EventId
lagunoff Aug 6, 2024
36e808d
Rename EventId -> Event
lagunoff Aug 6, 2024
d9a91e9
Polymorphic newCallback
lagunoff Aug 6, 2024
afba6e3
Improve generic deriving
lagunoff Aug 12, 2024
41c212c
Introduce more primitives into the protocol
lagunoff Aug 12, 2024
3169ce2
Rename a few definitions
lagunoff Aug 12, 2024
7a43b21
Refactor DOM builder mechanism and some more changes
lagunoff Aug 15, 2024
1d049df
Reload the tab once WebSocket connection is re-established
lagunoff Sep 22, 2024
f3f2f8b
WIP
lagunoff Oct 4, 2024
ad89c9c
WIP: new version
lagunoff Oct 8, 2024
669bff5
WIP: upstream changes
lagunoff Oct 14, 2024
1f269eb
Element.hs and Property.hs
lagunoff Oct 15, 2024
70a7844
First usable version
lagunoff Nov 11, 2024
a37bec3
Improve WebSocket Server
lagunoff Nov 12, 2024
6bb3644
Renaming
lagunoff Nov 15, 2024
93de34f
More renaming
lagunoff Nov 17, 2024
8a5f747
Fix a bug in encodeValue
lagunoff Nov 19, 2024
fa87752
MoveScope
lagunoff Nov 21, 2024
4a454a3
TodoMVC
lagunoff Dec 7, 2024
43b388b
Finish TodoMVC, add a new example
lagunoff Dec 10, 2024
e6ba6a5
WIP
lagunoff Dec 17, 2024
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
13 changes: 13 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
((haskell-mode
(haskell-process-type . ghci)
(haskell-process-args-ghci . ("-ferror-spans" "-fdiagnostics-color=never"))
(eval .
(let ((cwd (locate-dominating-file default-directory ".dir-locals.el")))
(setq
haskell-process-path-ghci (concat cwd "bin/ghci")
haskell-hoogle-server-command
(lambda (port)
(list (concat cwd "bin/hoogle") "server"
"--local" "-p" (number-to-string port)))
lsp-haskell-server-path (concat cwd "/bin/haskell-language-server"))
))))
31 changes: 6 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
**/tags
**/TAGS
**/.#*
**/dist-newstyle
/examples/dist-newstyle
**/*~
**/*.kate-swp
**/.directory
**/.dir-locals.el
**/.envrc
**/.envrc-ghcjs
/dist
/tmp
**/.stack-work
**/.cabal-sandbox
**/*.db
**/.ghc.environment*
/.*-env
result
dist
bin
out
bin/**
!bin/nix-bins
!bin/README.md
shell.nix
doc
locals.nix
dist-newstyle
node_modules
package.json
yarn.lock
build
26 changes: 26 additions & 0 deletions 9.6.5.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
let
sources = {
nixpkgs = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/24.05.tar.gz";
};
ghc-wasm-meta = "gitlab:ghc/ghc-wasm-meta?host=gitlab.haskell.org&ref=455a759195e71c572e73b56d868e544176d32897";
};

pkgs = import sources.nixpkgs {};

haskellPackages = pkgs.haskellPackages.override {
overrides = final: prev: {
clickable = final.callCabal2nix "clickable" ./. {};
};
};

ghc-wasm-meta = builtins.getFlake sources.ghc-wasm-meta;
in
pkgs.mkShell {
inputsFrom = [
haskellPackages.clickable.env
];
nativeBuildInputs = [
ghc-wasm-meta.packages.x86_64-linux.default
];
}
10 changes: 10 additions & 0 deletions Clickable.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{-| Fast and Lightweight Frontend library for WASM, JavaScript and
Native GHC -}
module Clickable (module Exports) where

import Clickable.HTML as Exports
import Clickable.DOM as Exports
import Clickable.Element as Exports
import Clickable.Property as Exports
import Clickable.Internal as Exports
import Clickable.Types as Exports
31 changes: 31 additions & 0 deletions Clickable/Binary.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{-# LANGUAGE GHC2021 #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE OverloadedRecordDot #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE DerivingStrategies #-}
{-| Override `Data.Binary.Binary` instances for floating-point numbers
-}
module Clickable.Binary where

import Data.Binary
import Data.Binary.Get
import Data.Binary.Put


newtype Float64 = Float64 {unFloat64 :: Double}
deriving newtype (Show, Ord, Eq)

instance Binary Float64 where
put = putDoublele . unFloat64
get = fmap Float64 getDoublele


newtype Float32 = Float32 {unFloat32 :: Float}
deriving newtype (Show, Ord, Eq)

instance Binary Float32 where
put = putFloatle . unFloat32
get = fmap Float32 getFloatle
Loading