Skip to content
Open
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3a04d56
Disable backend-only packages for wasm32 target
ymeister Mar 20, 2026
b111fa4
Undeprecate `obelisk-asset-manifest-generate`
ymeister Mar 20, 2026
abdcd15
Consolidate cabal.project and support GHC 9.14
ymeister Mar 21, 2026
d919d64
Extract non-packages cabal config into cabal.project.config
ymeister Mar 21, 2026
b0b16ee
Add separate frontendGhcjsAssets field to BackendConfig
ymeister Mar 21, 2026
2f42104
Molt
ymeister Mar 22, 2026
f24e0c9
Add nix module system with project helper and reflex-dom dep
ymeister Mar 22, 2026
2e5f3e6
Update nix-haskell pin, add splitmix import to module.nix
ymeister Mar 22, 2026
f845683
Update nix-haskell: pre-build source-repository-packages in shell
ymeister Mar 22, 2026
5f12e1f
Add obelisk-setup package with reusable Setup.hs hooks
ymeister Mar 22, 2026
5e420b7
Disable source-repository-packages, fix ScopedTypeVariables in obelis…
ymeister Mar 22, 2026
dcf0b7c
Fix obelisk-setup build: add BangPatterns, remove bogus imports
ymeister Mar 22, 2026
6dd9d45
Replace hackage overlay with preBuild static module generation
ymeister Mar 22, 2026
096e2ad
Add obelisk-generated-static-custom package and fix static asset paths
ymeister Mar 22, 2026
99042ed
Wire asset compression pipeline into obelisk module system
ymeister Mar 22, 2026
087e82b
Add brotli compression and composable encoding functions
ymeister Mar 22, 2026
78097a9
Compress GHCJS frontend output with mkAssets
ymeister Mar 22, 2026
e248e70
Add closure-compiler optimization and per-option compress/optimize flags
ymeister Mar 22, 2026
c0280ce
Add closure-compiler optimization pipeline for GHCJS frontend
ymeister Mar 22, 2026
dd28c0a
Add WASM frontend compilation target alongside GHCJS
ymeister Mar 22, 2026
585f447
Add WASM frontend Setup.hs hook and skip cross-builds in nix-shell
ymeister Mar 22, 2026
237c6bc
Remove debug trace from IFD asset hash import in mkAsset
ymeister Mar 22, 2026
b756510
Add obelisk module docs and reorganize doc structure
ymeister Mar 22, 2026
5da8f08
Add flake.nix, export assets and docs from lib
ymeister Mar 22, 2026
c2702ca
Enable all GHC optimization flags by default
ymeister Mar 22, 2026
b6bd301
Remove optimizations.all default from obelisk module
ymeister Mar 22, 2026
b01cc4c
Update nix-haskell: fix `withHoogle`
ymeister Mar 22, 2026
45b5745
Add exe.{wasm,js} to project for building backend per frontend target
ymeister Mar 22, 2026
a9e474f
Update nix-haskell: default hoogle 5.0.19.0 with GHC 9.14 support
ymeister Mar 22, 2026
84bdd22
ob-run dev script & Setup.hs optimization forwarding
ymeister Mar 22, 2026
8a3bc4c
Add ob-repl development REPL script
ymeister Mar 22, 2026
e68dd0a
Print ob-run and ob-repl --help output in shellHook instead of inline…
ymeister Mar 22, 2026
e7bcf72
Add ob-hoogle script for managing a local Hoogle documentation server
ymeister Mar 22, 2026
542aa6f
Add NixOS deployment server module and serverExe builder
ymeister Mar 22, 2026
da7888c
Add OCI container image outputs for podman/docker deployment
ymeister Mar 22, 2026
d22dbf8
Add project skeleton and default compiler-nix-name
ymeister Mar 22, 2026
7b47a17
Add missing license
ymeister Mar 22, 2026
4758882
Fix cross-compilation compatibility and ob-run reliability
ymeister Mar 22, 2026
0022ab2
Add commented-out optimizations.all option to skeleton/project.nix.
ymeister Mar 22, 2026
93b5732
Add release.nix to build skeleton with all targets
ymeister Mar 22, 2026
12c4a1d
Update documentation for v2 architecture
ymeister Mar 22, 2026
012a4a3
Fix `obelisk-route` test
ymeister Mar 22, 2026
2866676
Update github CI
ymeister Mar 22, 2026
3809531
Update `reflex-dom` pin
ymeister Mar 22, 2026
1bcfc9e
Use `https` instead `ssh` for `nix-haskell` submodule
ymeister Mar 22, 2026
4d25aa0
Add `skeleton.shell` to `release.nix`
ymeister Mar 23, 2026
d94f422
Add skeleton/shell.nix
ymeister Mar 23, 2026
e92e328
Default skeleton shell to wasi32 only, comment out ghcjs
ymeister Mar 23, 2026
e9b2b35
Update nix-haskell
ymeister Mar 24, 2026
771ac51
Update `nix-haskell`:
ymeister Mar 25, 2026
25cbec1
Update `nix-haskell`:
ymeister Mar 25, 2026
f17ebab
Override pins from flake inputs, default to legacy pins
ymeister Mar 25, 2026
08a1813
Add `inputs.nix` via `flake-compat` for legacy Nix input access
ymeister Mar 25, 2026
f4abe36
Update `nix-haskell`, `reflex-dom`:
ymeister Mar 25, 2026
684c083
Update pins
ymeister May 5, 2026
a3306f2
Add patch for undeclared initialSyncDepth in jsaddle-wasm
ymeister May 6, 2026
8bd221f
Fixup flake submodules
ymeister May 15, 2026
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
3 changes: 0 additions & 3 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ jobs:
brew update
brew install libsodium

- name: Set up cabal project file for CI
run: cd lib && cp cabal.project.ci cabal.project

- name: Install dependencies
run: |
cabal update
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "deps/nix-haskell"]
path = deps/nix-haskell
url = git@github.com:reflex-frp/nix-haskell.git
Comment thread
ymeister marked this conversation as resolved.
Outdated
[submodule "deps/reflex-dom"]
path = deps/reflex-dom
url = https://github.com/ymeister/reflex-dom.git
65 changes: 0 additions & 65 deletions .hlint.yaml

This file was deleted.

74 changes: 26 additions & 48 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ Contributions and issue reports are encouraged and appreciated!
- [In the Changelog](#in-the-changelog)
- [In the Readme](#in-the-readme)
- [Development Environment](#development-environment)
- [Building `ob` for testing](#building-ob-for-testing)
- [Testing features from an unmerged branch](#testing-features-from-an-unmerged-branch)
- [Hacking on Obelisk from within an Obelisk project](#hacking-on-obelisk-from-within-an-obelisk-project)
- [Working on obelisk libraries](#working-on-obelisk-libraries)
- [Testing with the skeleton](#testing-with-the-skeleton)

## Opening Issues

Expand Down Expand Up @@ -62,18 +61,17 @@ Your pull request should add no new warnings to the project. It should also gene

Make sure the project builds and that the tests pass! This will generally also be checked by CI before merge, but trying it yourself first means you'll catch problems earlier and your contribution can be merged that much sooner!

You can run the tests like this:
Build the skeleton with both frontend targets:
```bash
$(nix-build -A selftest --no-out-link)
nix-build release.nix
```

To test that your changes build across platforms, you can also try to build release.nix, like this:
Or build individual targets:
```bash
nix-build release.nix
nix-build release.nix -A serverExe.wasm
nix-build release.nix -A serverExe.js
```

Note, however, that to build release.nix you must accept the android license agreement and your machine must be configured to build both ios and android executables (usually via remote builders).


### Documentation

Expand All @@ -92,61 +90,41 @@ The readme is the first place a lot of people look for information about the rep

## Development Environment

There are two ways to get live compiler feedback while developing Obelisk libraries. For libraries that are dependencies of the `skeleton` application, the easiest way to get feedback is to

```bash
cd skeleton
ob run
```

This `ob run` session only loads modules that are dependencies of the skeleton and `obelisk-run`. For example, `obelisk-asset` and `obelisk-route` are used by the skeleton.

For other libraries like `obelisk-command` you can use `ghcid`. To launch `ghcid` for `lib/command` you can run

```bash
nix-shell -A obeliskEnvs.obelisk-command --run "cd lib/command && ghcid"
```

[Haskell-Language-Server](https://haskell-language-server.readthedocs.io/en/latest/)(HLS) can be used on the Haskell libraries in `lib`. Simply launch your lsp-client of choice in the `lib` subdirectory. Set up the appropriate environment by running `./lib/setupHls.sh up` and tear it down again with `./lib/setupHls.sh down`
### Working on obelisk libraries

### Building `ob` for testing

To re-install `ob` from source globally you can do
Enter the skeleton's nix shell to get a development environment with all obelisk libraries available:

```bash
nix-env -f /path/to/obelisk -iA command
cd skeleton
nix-shell # or: nix develop 'git+file:.?submodules=1'
```

You can also open a shell with the local version of `ob` available on your `$PATH`:
From within the shell, uncomment the obelisk `optional-packages` stanzas in `cabal.project` to develop obelisk libraries alongside the skeleton:

```bash
nix run -f /path/to/obelisk command
```cabal
optional-packages:
deps/obelisk/lib/*
deps/obelisk/lib/*/*
```

### Testing features from an unmerged branch

If you'd like to use a branch of Obelisk that hasn't been merged into `develop` or `master` (usually to investigate an open PR):
Then use `ob-run` for live feedback, or `ob-repl` for a REPL:

```bash
cd /your/project/root
ob thunk update --branch <target-branch> .obelisk/impl
ob-run # watch-and-rebuild development server
ob-repl # REPL with optimizations disabled
```

### Hacking on Obelisk from within an Obelisk project
### Testing with the skeleton

`ob` will defer to the version found in your project's `.obelisk/impl` directory. To work on that version specifically:
The skeleton serves as the integration test for obelisk. To verify your changes work end-to-end:

```bash
ob thunk unpack ./.obelisk/impl
cd ./.obelisk/impl
# apply your changes
cd skeleton
nix-shell
ob-run # test development workflow
```

If you want to commit your changes, first push them to your fork of obelisk and then

For a full production build test:
```bash
cd /your/project/root
ob thunk pack .obelisk/impl
git add .obelisk/impl
git commit -m "Bump obelisk"
nix-build release.nix
```
88 changes: 86 additions & 2 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,91 @@

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.

## Unreleased
## Unreleased v2.0.0.0

Complete rewrite of the nix build system around nix-haskell and a NixOS-style
module system. Replaces reflex-platform with direct haskell.nix integration.
Adds WASM frontend target alongside GHCJS. Adds GHC 9.14 support.

### Vanilla cabal builds

* Projects can now be built with plain `cabal build` / `cabal run` without any
nix wrapper. The `ob` CLI tool is no longer required for development.
* `ob-run` development script uses `cabal run backend` directly with inotifywait
for file watching, forwarding optimization flags to cross-compilation builds.
* `ob-repl` starts `cabal repl` with optimizations disabled for fast iteration.
* Custom Setup.hs hooks (`obelisk-setup`) handle cross-compilation of the
frontend (WASM or GHCJS) and static asset generation transparently during
a normal `cabal build`, with no nix involvement at build time.

### Nix module system

* New `nix/module.nix` module with declarative options:
* `obelisk.static.path` / `obelisk.static.compress` / `obelisk.static.compressed`: static asset pipeline with cache-busting hashes, brotli + gzip compression
* `obelisk.frontend.target`: select `"js"` (GHCJS) or `"wasm"` (default) frontend compilation target
* `obelisk.frontend.js.{package,optimization,optimized,compress,compressed}`: GHCJS pipeline with closure-compiler (ADVANCED mode by default)
* `obelisk.frontend.wasm.{package,optimization,optimized,compress,compressed}`: WASM pipeline with wasm-opt + wasm-tools strip
* New `nix/lib.nix` with composable haskell.nix overrides: `buildTypeOverride`, `staticManifestOverride`, `frontendDataOverride`, `backendDataOverride`, `jsexeOverride`
* All overrides use `mkOptionalPackages` to safely skip absent packages in cross-compilation projects
* Default compiler: GHC 9.14 (`compiler-nix-name = "ghc914"`)
* `nix/assets.nix` asset compression pipeline with brotli (quality 11) + gzip via `mkAssets` / `unionEncodings`

### WASM frontend

* Complete wasm32-wasi frontend compilation target producing a `frontend.jsexe` directory the backend serves unchanged
* Browser bootstrap shim (`nix/wasm/shim.js`) using async IIFE with dynamic `import()`, resolving assets relative to script URL
* Vendored `@bjorn3/browser_wasi_shim` for WASI browser support
* `wasm-opt` optimization and `wasm-tools strip` for production builds
* GHC JSFFI extraction via `post-link.mjs`

### obelisk-setup

* New `obelisk-setup` package with reusable Setup.hs hooks:
* `Obelisk.Setup.Backend`: symlinks frontend assets into backend data dir
* `Obelisk.Setup.Frontend.Js`: GHCJS cross-compilation with optimization forwarding
* `Obelisk.Setup.Frontend.Wasm`: WASM cross-compilation with jsexe assembly, JSFFI extraction, optional wasm-opt/wasm-tools
* `Obelisk.Setup.Static`: static manifest generation via `obelisk-asset-manifest-generate`
* `Obelisk.Setup.Utils`: shared utilities (project root discovery, symlinks, cabal-level optimization flags)

### Static asset generation

* Replace hackage overlay approach with `obelisk-generated-static` / `obelisk-generated-static-custom` package pair:
* `obelisk-generated-static` (`build-type: Simple`) builds on all platforms including JS/WASM
* `obelisk-generated-static-custom` (`build-type: Custom`) runs Setup.hs to generate `Obelisk.Generated.Static` module, `buildable: False` on JS/WASM
* `obelisk-asset-manifest-generate --module-only` generates only the Haskell module without overwriting the `.cabal` file
* Fix GHC 9.14 `Symbol` name resolution (`GHC.Types.Symbol` vs `GHC.Internal.Types.Symbol`)

### Backend

* Add `_backendConfig_frontendGhcjsAssets` field to `BackendConfig` for separate frontend asset paths

### Development tools

* `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
* `ob-repl`: optimizations-disabled REPL, defaults to loading backend + common + frontend
* `ob-hoogle`: local Hoogle documentation server with start/stop/restart, automatic cleanup on shell exit

### Deployment

* `nix/server.nix`: NixOS module (`services.obelisk`) with nginx reverse proxy (WebSocket support), ACME/HTTPS, systemd service, firewall rules, domain redirects
* `mkServerExe`: assembles flat deployment directory (backend binary + compressed assets)
* `mkContainerImage`: OCI container image via `dockerTools.buildLayeredImage` for podman/docker

### Project skeleton

* `skeleton/`: minimal obelisk project template with complete directory structure:
* backend, frontend, common, static packages
* frontend-js and frontend-wasm cross-compilation wrappers
* `project.nix` with `source-repository-packages` from obelisk, cross-platform shell (ghcjs + wasi32), hoogle
* `cabal.project` with arch conditionals excluding native-only packages from cross-builds

### Other

* `flake.nix` exposing lib and docs packages
* Generated module option documentation (`nix/docs.nix`)
* Broadened CPP guards from `ghcjs_HOST_OS` to `defined(ghcjs_HOST_OS) || defined(wasm32_HOST_ARCH)` throughout frontend code

## Unreleased (pre-v2)

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

## v1.3.0.0
* [#1047](https://github.com/obsidiansystems/obelisk/pull/1047): Update default ios sdk to 15
* [#1048](https://github.com/obsidiansystems/obelisk/pull/1048): Expose ghcIosAarch64 to projects
* [#1048](https://github.com/obsidiansystems/obelisk/pull/1048): Expose ghcIosAarch64 to projects
* [#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)).

## v1.2.0.0
Expand Down
Loading
Loading