`AuthEntity` is now a type family associated to the `YesodAuthPersist`
class, so its old type alias definition has now become its default type
instance, which allows recovering the old behavior with minimal
boilerplate: an empty instance declaration for `YesodAuthPersist` makes
a Yesod application written with Persistent work just like before.
Unfortunately, this requires enabling `UndecidableInstances` in the
`Yesod.Auth` module since there is now a nested type family application
(as `AuthEntity` is now itself a type family).
This was tested with the scaffolded application with PostgreSQL, and it
works (given another small change to make it work with Persistent 2 due
to how `SqlPersistT` is now defined).
`maybeAuth` and `requireAuth` have been reverted to their original
signatures, which assume a Persistent database. `maybeAuthPair` and
`requireAuthPair` are introduced, which do the same but without that
assumption.
This fixes the error:
[10 of 10] Compiling Main ( main.hs, dist/build/yesod/yesod-tmp/Main.o )
main.hs:192:35:
Not in scope: ‘reader’
Perhaps you meant one of these:
‘header’ (imported from Options.Applicative),
‘readIO’ (imported from Prelude), ‘readLn’ (imported from Prelude)
cabal: Error: some packages failed to install:
yesod-bin-1.2.12.5 failed during the building phase. The exception was:
ExitFailure 1
Pinging @gregwebs. I've backported the relevant tweaks on the yesod-1.4
branch, to allow master to compile against persistent2. Whenever you're
ready to release persistent2, we can:
1. Release persistent2.
2. Release new versions of yesod packages, which will work with
persistent 1.3 and 2.0.
3. Add an upper bound in Stackage to avoid using the new persistent
libraries until they're ready for primetime.
4. Release your blog post.
yesod-1.4 should then remove the CPP here and only work with
persistent2; the biggest "breaking change" in the 1.4 release will be
remove backwards compatibility hacks for persistent, conduit,
shakespeare, and wai.