Skip to content
Open
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: 1 addition & 1 deletion deps/obelisk-oauth
1 change: 1 addition & 0 deletions lib/jenga-backend-servant/jenga-backend-servant.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ library
, bytestring
, containers
, data-default
, jenga-asset-serve-snap
, jenga-route-servant
, reflex-effectful
, servant
Expand Down
17 changes: 13 additions & 4 deletions lib/jenga-backend-servant/src/Jenga/Backend/Servant.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import GHC.Generics (Generic)
import Snap.Core
import Snap.Http.Server (quickHttpServe)
import qualified Snap.Util.FileServe as Snap
import qualified Jenga.Asset.Serve.Snap as JengaAsset

import Jenga.Route (HasRoute(..), PageName, urlToSegments)
import Jenga.Frontend (Frontend(..), renderFrontendHtml)
Expand Down Expand Up @@ -223,12 +224,20 @@ serveFrontendRoute cfg configs backend = do

-- ─── Static file serving ───────────────────────────────────────

-- | Serve files from a StaticAssets directory.
-- Tries processed (hashed) first, falls back to unprocessed.
-- | Serve files from a StaticAssets directory using the obelisk-style
-- hashed-asset protocol (reads type/target metadata, emits redirects to
-- the hashed asset, serves it with proper caching + encoding negotiation).
--
-- Previously used @Snap.serveDirectory@, which does trailing-slash
-- canonicalization for the asset directories (each hashed asset is
-- structured as a dir with @type@/@target@/@encodings@ files), so every
-- request for @/ghcjs\/all.js@ got 302'd to @/ghcjs\/all.js\/@ and fell
-- through to the SPA HTML. Matches obelisk-v1's @serveStaticAssets@.
serveStaticDir :: StaticAssets -> Snap ()
serveStaticDir assets =
Snap.serveDirectory (_staticAssets_processed assets)
<|> Snap.serveDirectory (_staticAssets_unprocessed assets)
JengaAsset.serveAssets
(_staticAssets_processed assets)
(_staticAssets_unprocessed assets)

-- | Serve static assets (compatibility alias).
serveStaticAssets :: StaticAssets -> [Text] -> Snap ()
Expand Down
4 changes: 2 additions & 2 deletions skeleton/cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ if !(arch(javascript) || arch(wasm32))
--optional-packages:
-- deps/jenga/deps/reflex-dom/*

-- multi-repl: True
-- Disabled: GHC 9.14 multi-unit GHCi panics with "LinkInMemory".
multi-repl: True
-- Re-enabled to investigate the LinkInMemory panic prior turns noted.



Expand Down
6 changes: 6 additions & 0 deletions skeleton/frontend/js/frontend-js.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,18 @@ custom-setup
jenga-setup

library
hs-source-dirs: src
build-depends: base
--
, frontend

reexported-modules: Frontend

-- Placeholder module: workaround for GHC #25366 / #26073.
-- cabal repl --enable-multi-repl panics ("LinkInMemory") on units
-- with no exposed-modules of their own.
exposed-modules: FrontendJs.Placeholder

default-language: Haskell2010

if (arch(javascript) || arch(wasm32))
Expand Down
1 change: 1 addition & 0 deletions skeleton/frontend/js/src/FrontendJs/Placeholder.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module FrontendJs.Placeholder where
8 changes: 8 additions & 0 deletions skeleton/frontend/wasm/frontend-wasm.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@ custom-setup
jenga-setup

library
hs-source-dirs: src
build-depends: base
--
, frontend

reexported-modules: Frontend

-- Placeholder module: workaround for GHC #25366 / #26073.
-- cabal repl --enable-multi-repl panics ("LinkInMemory") on units
-- with no exposed-modules of their own. See:
-- https://gitlab.haskell.org/ghc/ghc/-/issues/25366
-- https://gitlab.haskell.org/ghc/ghc/-/issues/26073
exposed-modules: FrontendWasm.Placeholder

default-language: Haskell2010

if (arch(javascript) || arch(wasm32))
Expand Down
1 change: 1 addition & 0 deletions skeleton/frontend/wasm/src/FrontendWasm/Placeholder.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module FrontendWasm.Placeholder where
Loading