Conversation
| import Yesod.Auth | ||
| import Yesod.Auth.Email | ||
|
|
||
| share [mkPersist sqlSettings { mpsGeneric = False }, mkMigrate "migrateAll"] [persistLowerCase| |
There was a problem hiding this comment.
mpsGeneric is deprecated and the default value is False anyway.
Cf. yesodweb/persistent#1348
| ---- | ||
|
|
||
| We use widgets to compose together HTML, CSS and Javascript. At the end of the | ||
| We use widgets to compose together HTML, CSS and JavaScript. At the end of the |
There was a problem hiding this comment.
The transition from "Javascript" to "JavaScript" was started in #284.
| So how exactly do we create a streaming response? Yesod provides a helper | ||
| function for this case: +responseSourceDB+. This function takes two arguments: | ||
| a content type, and a conduit +Source+ providing a stream of blaze-builder | ||
| function for this case: +respondSourceDB+. This function takes two arguments: |
There was a problem hiding this comment.
This was probably a mixup between Yesod's respondSource and responseSource in wai-conduit.
| which will automatically restart your application in case it crashes. There are | ||
| many great options out there, such as angel or daemontools. | ||
|
|
||
| To give a concrete example, here is an Upstart config file. The file must be |
There was a problem hiding this comment.
Upstart is discontinued so I guess it doesn't make much sense to keep this example.
| === Synopsis | ||
|
|
||
| The required dependencies for the below are: persistent, persistent-sqlite and persistent-template. | ||
| The required dependencies for the below are: persistent and persistent-sqlite. |
There was a problem hiding this comment.
persistent-template has been absorbed into persistent.
| But if you want to, you can wrap up the call to +runInputGet+ above using | ||
| +handlerToWidget+, and everything will work the same. | ||
|
|
||
| === Performance and error messages |
There was a problem hiding this comment.
Since HandlerT and WidgetT have been replaced with HandlerFor and WidgetFor, this section is not really applicable anymore. It could be replaced with a section about the design motivations behind the current implementation.
| [source, errormsg] | ||
| ---- | ||
| No instance for (MonadCRandom e0 (HandlerT App IO)) | ||
| No instance for 'MonadCRandom e0 (HandlerFor App)' |
There was a problem hiding this comment.
This seems to have changed in recent GHC versions.
| +DocId+ into a +Text+ value. Next, we need to be able to convert a stream of | ||
| these entities into a stream of events. For this, we can use the built-in | ||
| +concatMap+ function from +Data.Conduit.List+: +CL.concatMap entityToEvents+. | ||
| +concatMapC+ function from +Conduit+: +concatMapC entityToEvents+. |
There was a problem hiding this comment.
I switched to functions from the Conduit module since the use of Data.Conduit.List seems to be discouraged these days.
| ---- | ||
|
|
||
| +YesodRunnerEnv+ provides three values: a +Logger+ value for outputting log | ||
| +YesodRunnerEnv+ provides several values: a +Logger+ value for outputting log |
There was a problem hiding this comment.
yreGen was added in yesodweb/yesod@972e117 and yreGetMaxExpires in yesodweb/yesod@5b4d5ce.
| those functionalities. | ||
| +HandlerFor+ monad, it's not surprising that there are quite a few functions | ||
| that work in that context. +HandlerFor+ is an instance of many common | ||
| typeclasses, including +MonadIO+, +MonadUnliftIO+, +MonadLogger+ and |
While working through the book, I noticed some outdated content, typos and inconsistencies.
This PR addresses the issues I found. The easiest way to review the changes is probably commit by commit.