Extract ihp-auto-refresh into its own package#2449
Extract ihp-auto-refresh into its own package#2449mpscholten wants to merge 6 commits intomasterfrom
Conversation
AutoRefresh (automatic diff-based view re-rendering via WebSocket + PostgreSQL LISTEN/NOTIFY) was bundled in the main ihp package. This extracts it into ihp-auto-refresh, making it an opt-in feature that reduces compilation for apps that don't use it, following the pattern of ihp-ssc, ihp-datasync, etc. Key changes: - Create ihp-auto-refresh/ package with cabal, nix, sources, and tests - Remove autoRefreshApp type parameter from frontControllerToWAIApp - Remove AutoRefresh imports from Server.hs, ControllerPrelude, ViewPrelude - Remove AutoRefresh from ToolServer (IDE doesn't need it) - Add ihp-auto-refresh to NixSupport/overlay.nix Apps using AutoRefresh need to: 1. Add ihp-auto-refresh to build-depends 2. Add explicit imports for IHP.AutoRefresh / IHP.AutoRefresh.View 3. Add webSocketApp @AutoRefreshWSApp to FrontController controllers list Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a37dbe51f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (!), | ||
| module Data.Data, | ||
| module Data.Aeson, | ||
| module IHP.AutoRefresh.View, | ||
| module IHP.View.Classes, |
There was a problem hiding this comment.
Restore autoRefreshMeta export for generated layouts
The app generator still emits View/Layout.hs with {autoRefreshMeta} while importing only IHP.ViewPrelude (see ihp-ide/IHP/IDE/CodeGen/ApplicationGenerator.hs in viewLayoutHs/metaTags), so removing this re-export makes freshly generated apps fail to compile with autoRefreshMeta out of scope unless users patch imports and dependencies by hand. This regresses the default project-generation workflow introduced by new-application scaffolding.
Useful? React with 👍 / 👎.
…tion
- Add ihp-auto-refresh dependency to ihp-job-dashboard (cabal + nix)
- Add explicit import of IHP.AutoRefresh in Dashboard.hs
- Remove {autoRefreshMeta} from generated app layouts (now opt-in)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ihp-auto-refresh will be a default dependency for new apps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AutoRefresh.hs imports Data.TMap which requires typerep-map. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The test-suite had hs-source-dirs: . which caused cabal to treat library source files as "home modules" of the test suite, leading to hidden package errors during nix build. Changed to hs-source-dirs: Test so tests get library modules from the ihp-auto-refresh dependency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Since IHP.ControllerPrelude no longer re-exports autoRefresh, the test needs to import it explicitly from IHP.AutoRefresh. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
ihppackage into a newihp-auto-refreshpackageihp-ssc,ihp-datasync, etc.AutoRefreshWSAppintegration fromfrontControllerToWAIApp, making the router signature simplerMigration for existing IHP apps
Apps using AutoRefresh will need to:
ihp-auto-refreshtobuild-dependsin their.cabalfileimport IHP.AutoRefreshin controllers usingautoRefreshimport IHP.AutoRefresh.Viewin views usingautoRefreshMetawebSocketApp @AutoRefreshWSAppto theirFrontControllerinstance'scontrollerslistTest plan
ihpcompiles without AutoRefresh modulesihp-auto-refreshcompiles as standalone packageihp-ideToolServer compiles without AutoRefresh🤖 Generated with Claude Code