Skip to content

Tags: yesodweb/yesod

Tags

yesod-form-1.7.10

Toggle yesod-form-1.7.10's commit message
Add runFormPRG for Post/Redirect/Get form handling

yesod-form has no support for the Post/Redirect/Get pattern: a
handler that redirects after a failed POST loses the user's input
and the validation errors, so applications either re-render on the
POST (breaking refresh and back-button behaviour) or hand-roll
session stashing around the library's private form internals.

runFormPRG is a drop-in sibling of runFormPost, called from both
the GET and POST handlers of a route. On a POST it behaves exactly
like runFormPost, and additionally stashes the submitted parameters
in the user session when the result is FormFailure, so the handler
can simply redirect back to the GET route. On a GET it pops any
stashed parameters and replays them through the form, re-rendering
the user's input and the validation errors; with nothing stashed it
is equivalent to generateFormPost.

The replay renders a fresh CSRF token and skips the token check,
since it is a re-render rather than a submission. The stash is read
through the per-request cache so that several calls in one handler
(multiple identifyForm-wrapped forms on a page) all see it, and a
FormMissing result on a POST leaves the stash alone so that the
non-submitted forms on a page cannot resurrect it after a
successful submission has cleared it. Stashes are keyed by request
path and serialised with aeson, which is already a dependency.
Uploaded files are not stashed, and an undecodable stash is treated
as absent.

A new yesod-test integration suite exercises the full cycle:
replay after the redirect, one-shot consumption of the stash,
clearing on success, CSRF enforcement, two identified forms on one
page, resilience to an undecodable stash, and per-path keying.
yesod-test's library depends only on yesod-core, so this introduces
no dependency cycle. The test application generates a random
client-session key at startup, so no key file is written to disk.

yesod-core-1.6.27.1

Toggle yesod-core-1.6.27.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Removing and fixing imports and other warnings (#1877)

* lots of CPP and cleanup of 'Data.Monoid/Semigroup' stuff

Mostly found all the imports of 'Data.Monoid' and 'Data.Semigroup'
and removed as much as I can without breaking it.
Used CPP for backwards compatibility where needed.

Thought about using CPP to avoid deprecation warning of 'parseMonad',
but defining a helper function seemed way more straightforward.

* yesod-core: found a better solution with 'defaultRequest'

* removed a bunch of pragmas that weren't used

* removal of Semigroup stuff outside of libraries

* bump to 'base >= 4.11' on libraries that had Semigroup imports (and remove the imports)

* lots of CPP and cleanup of 'Data.Monoid/Semigroup' stuff

Mostly found all the imports of 'Data.Monoid' and 'Data.Semigroup'
and removed as much as I can without breaking it.
Used CPP for backwards compatibility where needed.

Thought about using CPP to avoid deprecation warning of 'parseMonad',
but defining a helper function seemed way more straightforward.

* yesod-bin: got rid of other warnings

* yesod-core: remove warnings

- removed useless imports
- tried to avoid incomplete-uni-patterns with explicit 'error'
  calls for better error messages
- suppress warnings in tests
- add 'TypeOperator' pragma for type equality (~) usage
- few other things

* yesod-persistent: added 'TypeOperators' pragma and shuffled CPP to be more obvious

* yesod-form: added 'TypeOperators' pragma and simplified 'Monoid' instances of 'FormResult' and 'AForm', while staying compatible with 'base >= 4.10'

* removed a few unnecessary 'Control.Applicative' imports

* yesod-auth: equivalent refactors without warnings, extra pragmas and less shadowing

* yesod-form-multi: small cleanup

* yesod-test: fixed 'Control.Applicative' imports and fixed a uni-pattern warning

* yesod-auth*: more 'Control.Applicative' imports removed

* yesod-static: lots of import removal and a few better case expressions

* yesod: small refactor

* removing unused CPP pragmas and unnecessary 'MIN_VERSION_base(4,11,0)' parts

* yesod-auth: accidentally removed a pragma

* yesod-bin: removed unused libraries, added space around operator sections

* yesod-core: spaces around operator sections, use 'ifndef' instead of 'if !' in CPP

* yesod-form/-auth: add spaces around operators

* yesod-test: add spaces around operators

yesod-test-1.6.16

Toggle yesod-test-1.6.16's commit message

Verified

This tag was signed with the committer’s verified signature. The key has expired.
snoyberg Michael Snoyman
Release: yesod-test-1.6.16

yesod-core-1.6.24.5

Toggle yesod-core-1.6.24.5's commit message

Verified

This tag was signed with the committer’s verified signature. The key has expired.
snoyberg Michael Snoyman
Release: yesod-core-1.6.24.5

yesod-auth-1.6.11.2

Toggle yesod-auth-1.6.11.2's commit message

Verified

This tag was signed with the committer’s verified signature. The key has expired.
snoyberg Michael Snoyman
Release: yesod-auth-1.6.11.2

yesod-form-1.7.6

Toggle yesod-form-1.7.6's commit message

Verified

This tag was signed with the committer’s verified signature. The key has expired.
snoyberg Michael Snoyman
Release: yesod-form-1.7.6