Skip to content

Commit 71bba0a

Browse files
committed
Update documentation for v2 architecture
Rewrite README.md, FAQ.md, and ChangeLog.md to reflect the new nix-haskell module system, vanilla cabal builds, WASM/GHCJS frontend targets, and NixOS/OCI deployment.
1 parent 93b5732 commit 71bba0a

File tree

3 files changed

+395
-478
lines changed

3 files changed

+395
-478
lines changed

ChangeLog.md

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,91 @@
22

33
This project's release branch is `master`. This log is written from the perspective of the release branch: when changes hit `master`, they are considered released.
44

5-
## Unreleased
5+
## Unreleased v2.0.0.0
6+
7+
Complete rewrite of the nix build system around nix-haskell and a NixOS-style
8+
module system. Replaces reflex-platform with direct haskell.nix integration.
9+
Adds WASM frontend target alongside GHCJS. Adds GHC 9.14 support.
10+
11+
### Vanilla cabal builds
12+
13+
* Projects can now be built with plain `cabal build` / `cabal run` without any
14+
nix wrapper. The `ob` CLI tool is no longer required for development.
15+
* `ob-run` development script uses `cabal run backend` directly with inotifywait
16+
for file watching, forwarding optimization flags to cross-compilation builds.
17+
* `ob-repl` starts `cabal repl` with optimizations disabled for fast iteration.
18+
* Custom Setup.hs hooks (`obelisk-setup`) handle cross-compilation of the
19+
frontend (WASM or GHCJS) and static asset generation transparently during
20+
a normal `cabal build`, with no nix involvement at build time.
21+
22+
### Nix module system
23+
24+
* New `nix/module.nix` module with declarative options:
25+
* `obelisk.static.path` / `obelisk.static.compress` / `obelisk.static.compressed` — static asset pipeline with cache-busting hashes, brotli + gzip compression
26+
* `obelisk.frontend.target` — select `"js"` (GHCJS) or `"wasm"` (default) frontend compilation target
27+
* `obelisk.frontend.js.{package,optimization,optimized,compress,compressed}` — GHCJS pipeline with closure-compiler (ADVANCED mode by default)
28+
* `obelisk.frontend.wasm.{package,optimization,optimized,compress,compressed}` — WASM pipeline with wasm-opt + wasm-tools strip
29+
* New `nix/lib.nix` with composable haskell.nix overrides: `buildTypeOverride`, `staticManifestOverride`, `frontendDataOverride`, `backendDataOverride`, `jsexeOverride`
30+
* All overrides use `mkOptionalPackages` to safely skip absent packages in cross-compilation projects
31+
* Default compiler: GHC 9.14 (`compiler-nix-name = "ghc914"`)
32+
* `nix/assets.nix` asset compression pipeline with brotli (quality 11) + gzip via `mkAssets` / `unionEncodings`
33+
34+
### WASM frontend
35+
36+
* Complete wasm32-wasi frontend compilation target producing a `frontend.jsexe` directory the backend serves unchanged
37+
* Browser bootstrap shim (`nix/wasm/shim.js`) using async IIFE with dynamic `import()`, resolving assets relative to script URL
38+
* Vendored `@bjorn3/browser_wasi_shim` for WASI browser support
39+
* `wasm-opt` optimization and `wasm-tools strip` for production builds
40+
* GHC JSFFI extraction via `post-link.mjs`
41+
42+
### obelisk-setup
43+
44+
* New `obelisk-setup` package with reusable Setup.hs hooks:
45+
* `Obelisk.Setup.Backend` — symlinks frontend assets into backend data dir
46+
* `Obelisk.Setup.Frontend.Js` — GHCJS cross-compilation with optimization forwarding
47+
* `Obelisk.Setup.Frontend.Wasm` — WASM cross-compilation with jsexe assembly, JSFFI extraction, optional wasm-opt/wasm-tools
48+
* `Obelisk.Setup.Static` — static manifest generation via `obelisk-asset-manifest-generate`
49+
* `Obelisk.Setup.Utils` — shared utilities (project root discovery, symlinks, cabal-level optimization flags)
50+
51+
### Static asset generation
52+
53+
* Replace hackage overlay approach with `obelisk-generated-static` / `obelisk-generated-static-custom` package pair:
54+
* `obelisk-generated-static` (`build-type: Simple`) builds on all platforms including JS/WASM
55+
* `obelisk-generated-static-custom` (`build-type: Custom`) runs Setup.hs to generate `Obelisk.Generated.Static` module, `buildable: False` on JS/WASM
56+
* `obelisk-asset-manifest-generate --module-only` generates only the Haskell module without overwriting the `.cabal` file
57+
* Fix GHC 9.14 `Symbol` name resolution (`GHC.Types.Symbol` vs `GHC.Internal.Types.Symbol`)
58+
59+
### Backend
60+
61+
* Add `_backendConfig_frontendGhcjsAssets` field to `BackendConfig` for separate frontend asset paths
62+
63+
### Development tools
64+
65+
* `ob-run` — watch-and-rebuild development server with inotifywait, forwards optimization level to cross-builds via `OBELISK_CROSS_CABAL_ARGS`, proper cleanup of all child processes on exit
66+
* `ob-repl` — optimizations-disabled REPL, defaults to loading backend + common + frontend
67+
* `ob-hoogle` — local Hoogle documentation server with start/stop/restart, automatic cleanup on shell exit
68+
69+
### Deployment
70+
71+
* `nix/server.nix` — NixOS module (`services.obelisk`) with nginx reverse proxy (WebSocket support), ACME/HTTPS, systemd service, firewall rules, domain redirects
72+
* `mkServerExe` — assembles flat deployment directory (backend binary + compressed assets)
73+
* `mkContainerImage` — OCI container image via `dockerTools.buildLayeredImage` for podman/docker
74+
75+
### Project skeleton
76+
77+
* `skeleton/` — minimal obelisk project template with complete directory structure:
78+
* backend, frontend, common, static packages
79+
* frontend-js and frontend-wasm cross-compilation wrappers
80+
* `project.nix` with `source-repository-packages` from obelisk, cross-platform shell (ghcjs + wasi32), hoogle
81+
* `cabal.project` with arch conditionals excluding native-only packages from cross-builds
82+
83+
### Other
84+
85+
* `flake.nix` exposing lib and docs packages
86+
* Generated module option documentation (`nix/docs.nix`)
87+
* Broadened CPP guards from `ghcjs_HOST_OS` to `defined(ghcjs_HOST_OS) || defined(wasm32_HOST_ARCH)` throughout frontend code
88+
89+
## Unreleased (pre-v2)
690

791
* [#1038](https://github.com/obsidiansystems/obelisk/pull/1038): `Obelisk.Route`: Add `pathQueryEncoder` and `generalizeIdentity`
892
* [#1071](https://github.com/obsidiansystems/obelisk/pull/1071): Support deployment information repository sub-directories
@@ -12,7 +96,7 @@ This project's release branch is `master`. This log is written from the perspect
1296

1397
## v1.3.0.0
1498
* [#1047](https://github.com/obsidiansystems/obelisk/pull/1047): Update default ios sdk to 15
15-
* [#1048](https://github.com/obsidiansystems/obelisk/pull/1048): Expose ghcIosAarch64 to projects
99+
* [#1048](https://github.com/obsidiansystems/obelisk/pull/1048): Expose ghcIosAarch64 to projects
16100
* [#1046](https://github.com/obsidiansystems/obelisk/pull/1046): Add support for aarch64-darwin and aarch64-linux (see [supported platforms](https://github.com/reflex-frp/reflex-platform/blob/release/1.2.0.0/docs/platform-support.md)).
17101

18102
## v1.2.0.0

0 commit comments

Comments
 (0)