on master help sign in
Merge branch 'develop' into aa/static-filepath
commit937a0d3354e7ebfdc050a27017439a5b2a78b5b9 authorAli Abrar <aliabrar@gmail.com> dateTue 29 Dec 2020, 10:36 (6 years ago) parent6f8d31771dd69a
3 files changed+6−3
ChangeLog.md+1−1 lib/command/src/Obelisk/Command/Project.hs+4−2 skeleton/.gitignore+1
ChangeLog.md+1−1
@@ -8,7 +8,7 @@ This project's release branch is `master`. This log is written from the perspect
88 * Migration: All uses of `static @"some/path"` become `$(static "some/path")`. Instead of requiring `TypeApplications` and `DataKinds`, modules calling `static` must now enable `TemplateHaskell`.
99 * Deprecation: Deprecate static asset modules generated via 'obelisk-asset-manifest-generate' in favor of modules generated via 'obelisk-asset-th-generate'. The new executable takes the same arguments as the old and should be a drop-in replacement. To preserve the old behavior, set `__deprecated.useObeliskAssetManifestGenerate = true;` in your obelisk project configuration.
1010 * Feature: Files added to the static directory while `ob run` is active no longer require `ob run` to be restarted
11−* Feature: When `staticFiles` is a derivation, as opposed to a regular directory, produce a symlink to the result of that derivation at `static.out` and have `ob run` serve static assets from that symlink. This makes is possible for the static asset derivation to be rebuilt and the new results served without restarting `ob run`.
11+* Feature: When `staticFiles` is a derivation, as opposed to a regular directory, produce a symlink to the result of that derivation at `static.out` and have `ob run` serve static assets from that symlink. This makes it possible for the static asset derivation to be rebuilt and the new results served without restarting `ob run`.
1212* Feature: Rebuild static asset derivations while `ob run` is active as long as the change to the derivation is within the project folder. `ob run` now displays a message ("Static assets rebuilt and symlinked to static.out") whenever static assets have been rebuilt and the new static assets are being served.
1313* Feature: Add `staticFilePath` to `Obelisk.Generated.Static`. Like `static`, this uses TH to generate a reference to a file. Unlike `static`, this `staticFilePath` generates a path on the filesystem instead of URL path.
1414
lib/command/src/Obelisk/Command/Project.hs+4−2
@@ -51,7 +51,8 @@ import System.Directory
5151import System.Environment (lookupEnv)
5252import System.Exit (ExitCode(..))
5353import System.FilePath
54−import System.FSNotify (defaultConfig, eventPath)
54+import System.FSNotify (defaultConfig, eventPath, WatchConfig(..))
55+import qualified System.Info as SysInfo
5556import System.IO.Temp
5657import System.IO.Unsafe (unsafePerformIO)
5758import System.PosixCompat.Files
@@ -409,7 +410,8 @@ watchStaticFilesDerivation root = do
409410 liftIO $ runHeadlessApp $ do
410411 pb <- getPostBuild
411412 checkForChanges <- batchOccurrences 0.25 =<< watchDirectoryTree
412− defaultConfig
413+ -- On macOS, use the polling backend due to https://github.com/luite/hfsevents/issues/13
414+ (defaultConfig { confUsePolling = SysInfo.os == "darwin", confPollInterval = 250000 })
413415 (root <$ pb)
414416 ((/="static.out") . takeFileName . eventPath)
415417 drv <- performEvent $ ffor checkForChanges $ \_ ->
skeleton/.gitignore+1
@@ -13,3 +13,4 @@ result
1313result-*
1414tags
1515TAGS
16+static.out