Skip to content

Commit a8245fe

Browse files
committed
Bump miso to use 1.9.0.0.
This PR moves `miso` from `1.4` to `1.9` and introduces the Web Assembly backend, and the latest JS backend. All assets are pregenerated in `dist-bundle/`, but can also be built from scratch using nix flakes (`bun run build` invokes the flake commands). - [x] Drop `non-keyed` version of `miso` - [x] Create `miso-ghc-wasm` (uses the latest WASM backend of GHC) - [x] Create `miso-ghc-js` (uses the latest JS backend of GHC) - [x] Update `miso-js`(JS-only from [haskell-miso](https://www.npmjs.com/package/haskell-miso)) The benchmark suites are identical but the WASM backend currently relies on the `random` package, while the JS backend uses `Miso.Random`.
1 parent 6ae3563 commit a8245fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+164640
-2911
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,5 @@ chrome-mac-arm64-*
9292
log.txt
9393
build.zip
9494

95+
#haskell
96+
dist-newstyle/
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
dist
2+
dist-newstyle
23
result
4+
all.js
35

46
miso-latest.json
57
nixpkgs-latest.json
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.PHONY= update build
2+
3+
all: update build
4+
5+
update:
6+
cabal update --with-ghc=javascript-unknown-ghcjs-ghc --with-hc-pkg=javascript-unknown-ghcjs-ghc-pkg
7+
8+
build:
9+
cabal build --with-ghc=javascript-unknown-ghcjs-ghc --with-hc-pkg=javascript-unknown-ghcjs-ghc-pkg
10+
cp -v ./dist-newstyle/build/javascript-ghcjs/ghc-9.12.2/*/x/app/build/app/app.jsexe/all.js .
11+
rm -rf dist-bundle
12+
cp -rv static dist-bundle
13+
bunx --bun swc ./all.js -o dist-bundle/index.js
14+
15+
clean:
16+
rm -rf dist-newstyle dist-bundle
Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
1-
# miso-1.1.0.0-keyed
1+
# miso-ghc-js-1.9.0.0-keyed
22

3-
[Miso](https://haskell-miso.org) is a tasty [Haskell](https://www.haskell.org/) front-end framework.
3+
[miso](https://haskell-miso.org) is a tasty [Haskell](https://www.haskell.org/) front-end framework.
4+
5+
Benchmarks for [miso](https://haskell-miso.org) using the [GHC JS](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/js.html) backend.
6+
7+
## Build
8+
9+
```bash
10+
$ nix develop .#ghcjs --command bash -c 'make all'
11+
```
12+
13+
or
14+
15+
```bash
16+
$ bun run build
17+
```
418

519
## Installation
620

721
All needed `*.js` sources have already been generated in folder [`dist-bundle`](./dist-bundle) to avoid other dependencies of [`Haskell`](http://haskell.org/) and [`Nix`](https://nixos.org/nix/).
822

9-
However, to build everything by yourself you have to use [`Nix`](https://nixos.org/nix/) to run `nix-build` from [`root` of miso-1.1.0.0.-keyed](./).
10-
1123
After that just run `npm run cp-js` (or `yarn cp-js`) to copy generated `*.js` sources from local Nix store to `dist-bundle` folder. This folder is used by running benchmarks.
1224

1325
Now you can start benchmarks by running
1426
```
1527
cd webdriver-ts
16-
yarn selenium --count 3 --framework miso-1.1.0.0-keyed
28+
yarn selenium --count 3 --framework miso-ghc-js-1.9.0.0-keyed
1729
```
1830
(^ see [Running a single framework with the automated benchmark driver](../README#4-running-a-single-framework-with-the-automated-benchmark-driver))
1931

@@ -24,6 +36,3 @@ yarn interactive-results
2436
```
2537
(^ see [Optional 7. Building the interactive results table](../README#optional-7-building-the-interactive-results-table))
2638

27-
## Credit
28-
29-
Miso's benchmark application based mostly on [miso-non-official-v0.4.0.0-non-keyed](https://github.com/vacationlabs/js-framework-benchmark/tree/master/miso-non-official-v0.4.0.0-non-keyed) created by @vacationlabs .
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cabal-version: 3.0
2+
name: miso-benchmark-keyed-js
3+
version: 0.1.0.0
4+
synopsis: Benchmark of miso with the GHC JS backend
5+
category: Web
6+
build-type: Simple
7+
8+
common options
9+
if arch(javascript)
10+
ld-options:
11+
-sEXPORTED_RUNTIME_METHODS=HEAP8
12+
cpp-options:
13+
-DGHCJS_BROWSER
14+
-DJS
15+
16+
executable app
17+
import:
18+
options
19+
main-is:
20+
Main.hs
21+
hs-source-dirs:
22+
src
23+
ghc-options:
24+
-O2 -fspecialise-aggressively -fdicts-cheap -funbox-strict-fields
25+
build-depends:
26+
base < 5,
27+
containers,
28+
miso,
29+
vector
30+
default-language:
31+
Haskell2010
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
packages:
2+
.
3+
4+
allow-newer:
5+
all:base
6+
7+
source-repository-package
8+
type: git
9+
location: https://github.com/dmjio/miso
10+
tag: master
11+
12+
flags: +template-haskell

frameworks/keyed/miso/dist-bundle/index.html renamed to frameworks/keyed/miso-ghc-js/dist-bundle/index.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<title>Miso v1.4.0.0</title>
5+
<title>miso v1.9.0.0 - GHC JS</title>
66
<link href="/css/currentStyle.css" rel="stylesheet"/>
7-
<script>
8-
window.saveGCFromClosureOverwriting = window['gc'];
9-
</script>
107
</head>
118
<body>
12-
<script src="all.min.js"></script>
9+
<script src="index.js"></script>
1310
</body>
1411
</html>

0 commit comments

Comments
 (0)