Commit Graph

4928 Commits

Author SHA1 Message Date
d86leader
e3528ad85d Add test for regression of mkYesod 2020-09-22 15:41:45 +07:00
d86leader
4c4584fde8 Fix incorrect code generation for polymorphic datatypes 2020-09-22 15:33:43 +07:00
d86leader
62b418a801 Add tests for mkYesod with polymorphic datatypes 2020-09-22 15:33:34 +07:00
Michael Snoyman
84ca72e1d0
Merge pull request #1695 from yesodweb/removeGHandlerFromDocs
Remove GHandler from handlerToIO docs
2020-09-21 05:29:19 +03:00
Maximilian Tagher
6e5fa23dc2 .. 2020-09-20 16:57:01 -04:00
Maximilian Tagher
f0db028ec0 .. 2020-09-20 16:54:44 -04:00
Maximilian Tagher
30f189a48c Remove GHandler from handlerToIO docs 2020-09-20 16:50:16 -04:00
Michael Snoyman
eb5f7a95cd
Merge pull request #1691 from dten/absolute-templates-path
Absolute templates path
2020-08-09 17:48:45 +03:00
David Hewson
8585893b1d bump yesod version 2020-08-09 13:45:16 +01:00
David Hewson
8069d42d90 use globFilePackage in widgetFileReload and widgetFileNoReload
this will mean that files can be build from another directory whilst still finding the package's templates
2020-08-07 13:23:17 +01:00
David Hewson
b73a95c8b6 globFilePackage which provides absolute globFile paths within package 2020-08-07 13:23:17 +01:00
Michael Snoyman
8845483c20
Merge pull request #1689 from felixonmars/skip-semigroups-for-ghc8
Drop dependency on semigroups
2020-08-02 13:28:11 +03:00
Felix Yan
672b82d510
Drop dependency on semigroups
They are not needed on GHC we support.
2020-08-02 17:30:19 +08:00
Michael Snoyman
b2c154b358
Merge pull request #1688 from yesodweb/fixAddHandler
Fix add-handler for new routes file path
2020-08-02 12:19:06 +03:00
Maximilian Tagher
9f1387968f .. 2020-07-30 14:30:08 -04:00
Maximilian Tagher
7cfda1d650 Fix add-handler for new routes file path
https://github.com/yesodweb/yesod/pull/1686 recommended `.yesodroutes` as the file extension for the routes file, and https://github.com/yesodweb/yesod-scaffold/pull/203 added that to the scaffolding. But yesod-bin assumes the file is just named `routes`.

This PR will check if the old path exists and use that, and if not use the new path.

I tested this on the yesod-scaffold repo with both the old and new filename
2020-07-30 14:26:22 -04:00
Maximilian Tagher
77e6c3e7c2
Recommend .yesodroutes file extension (#1686)
* Recommend .yesodroutes file extension

Closes https://github.com/yesodweb/yesod/issues/1685

* ..
2020-07-26 17:08:39 +03:00
Michael Snoyman
7964967ba8
One more sort for #1684 2020-07-04 19:09:50 +03:00
Michael Snoyman
084a3cefb5
Sort directory contents #1684 2020-07-02 19:20:03 +03:00
Michael Snoyman
f5a6ccb363
Appease Hackage 2020-06-29 05:36:16 +03:00
Michael Snoyman
4bfca1bd86
Changelog entry for #1683 2020-06-29 04:47:51 +03:00
Michael Snoyman
c5a56f74fd
Merge pull request #1683 from ncaq/fix-yesod-bin-terminal-kill
fixed: yesod-bin: when C-c, kill yesod-bin and children process
2020-06-30 08:41:51 +03:00
ncaq
b3ed4613e7 fixed: yesod-bin: when C-c, kill yesod-bin and children process
* deleted: `setDelegateCtlc True`
* added: `setCreateGroup True`

When you use a group,
the child process will be terminated when the parent process is terminated.
2020-06-29 17:14:52 +09:00
Maximilian Tagher
a1c6bc553c Update yesod cabal file for distribution
Hackage is now requiring a higher cabal file version, and with that comes a requirement to specify the language of each module
2020-06-26 13:01:43 -04:00
Maximilian Tagher
5cbcebf4db Bump yesod to 1.6.0.2 2020-06-26 12:55:43 -04:00
Maximilian Tagher
51b4bde6d9
Merge pull request #1658 from v0d1ch/1655_Replace-decodeFile-with-decodeFileEither
Replace decodeFile with decodeFileEither
2020-06-26 12:52:32 -04:00
Michael Snoyman
98afc13e92
Allow random 1.2 2020-06-24 10:34:43 +03:00
Michael Snoyman
d4a60baf77
Merge pull request #1680 from yesodweb/printBodyPreview
When statusIs fails, print a preview of the body
2020-06-22 08:59:32 +03:00
Maximilian Tagher
1d67e3a359 1.6.10 2020-06-21 20:27:35 -04:00
Maximilian Tagher
28e5b606b2 attempt to fix 8.2 2020-06-20 17:27:13 -04:00
Maximilian Tagher
4ddff42847 .. 2020-06-20 15:01:51 -04:00
Maximilian Tagher
f50d23ce49 .. 2020-06-20 15:01:26 -04:00
Maximilian Tagher
8f00e76257 .. 2020-06-20 14:56:19 -04:00
Maximilian Tagher
34927e3401 .. 2020-06-20 14:54:31 -04:00
Maximilian Tagher
2ddc63e66a When statusIs fails, print a preview of the body
My team makes frequent use of `statusIs`, but in virtually all cases where `statusIs` fails, we need to add a call to `printBody` to do further debugging.

Following in the footsteps of `requireJSONResponse`, this PR automatically prints a portion of the body when `statusIs` fails, assuming the body looks like a text-based response (e.g. not a JPEG).

I've found that a status code alone is often very misleading and leads people on a wild good chase, because e.g. a 403 could be triggered for many different reasons.

I'm opening this PR as a draft to confirm people like the idea of doing this. If so I'll do a closer review of the code (this is my first draft basically), and also write some tests + test the code works in all cases.
2020-06-17 17:31:00 -04:00
Maximilian Tagher
e7cf662af7 Update yesod-test cabal file for distribution
Hackage is now requiring a higher cabal file version, and with that comes a requirement to specify the language of each module
2020-06-01 14:54:39 -04:00
Maximilian Tagher
d03c095b63 Add bumped GHC dependency in yesod-test changelog 2020-06-01 11:53:03 -04:00
Maximilian Tagher
b94da055c0
Merge pull request #1676 from yesodweb/documentYesodTest
Add more documentation to yesod-test
2020-06-01 11:29:12 -04:00
Maximilian Tagher
5c33dcb518 .. 2020-05-31 16:56:09 -04:00
Maximilian Tagher
8e89ec0e40 .. 2020-05-31 16:38:48 -04:00
Maximilian Tagher
ab8a994a34 .. 2020-05-31 16:38:09 -04:00
Maximilian Tagher
c3fa2adddd Add more documentation to yesod-test
This adds high-level documentation to yesod-test, plus some function documentation
2020-05-31 16:35:27 -04:00
Michael Snoyman
074865bca9
Merge pull request #1674 from ericdeansanchez/fix-typo
Fix small typo in documentation
2020-05-23 21:37:16 +03:00
eric
d382d67769
Fix small typo in documentation
This PR seeks to correct a small typo in the word _continuously_.
2020-05-23 11:29:06 -07:00
Michael Snoyman
2b5bf7b9b9
Merge pull request #1672 from amkhlv/master
increase the size of CSRF token
2020-05-01 13:35:16 +03:00
Andrei Mikhailov
c39b165ff3 increase the size of CSRF token 2020-05-01 00:40:11 -03:00
Michael Snoyman
7f37d2b6fa
Merge pull request #1664 from RyanGlScott/master
Use DeriveLift to generate yesod-core's Lift instances
2020-03-31 16:21:23 +03:00
Ryan Scott
29a08425e9 Use DeriveLift to generate yesod-core's Lift instances
GHC 8.0 and later come with the `DeriveLift` extension for deriving
instances of `Language.Haskell.TH.Syntax.Lift`. `yesod-core` supports
GHC 8.2 and up, so it is able to make use of this. Not only does
`DeriveLift` make for much shorter code, but it also fixes warnings
that you get when compiling `yesod-core` with GHC 8.10 or later:

```
[20 of 31] Compiling Yesod.Routes.TH.Types ( src/Yesod/Routes/TH/Types.hs, interpreted )

src/Yesod/Routes/TH/Types.hs:34:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘liftTyped’
    • In the instance declaration for ‘Lift (ResourceTree t)’
   |
34 | instance Lift t => Lift (ResourceTree t) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Yesod/Routes/TH/Types.hs:49:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘liftTyped’
    • In the instance declaration for ‘Lift (Resource t)’
   |
49 | instance Lift t => Lift (Resource t) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Yesod/Routes/TH/Types.hs:59:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘liftTyped’
    • In the instance declaration for ‘Lift (Piece t)’
   |
59 | instance Lift t => Lift (Piece t) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^

src/Yesod/Routes/TH/Types.hs:78:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘liftTyped’
    • In the instance declaration for ‘Lift (Dispatch t)’
   |
78 | instance Lift t => Lift (Dispatch t) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

This is because `DeriveLift` fills in implementations of `liftTyped`,
a method that was introduced to `Lift` in `template-haskell-2.16.0.0`
(bundled with GHC 8.10).
2020-03-31 08:41:00 -04:00
Jezen Thomas
59f601a34c
Add functions for setting description and OG meta (#1663)
* Add functions for setting description and OG meta

It's common that a website author will want to add a specific
description and Open Graph image to a given page in their website. These
functions are simple conveniences to add these meta tags to the document
head.

I decided against simply adding all possible meta tags, because not all
of them are useful, and even in the case of Open Graph tags, many of
them should be set only once and they should use the same value for the
entire website. In those cases, it's probably better for the website
author to add those tags in their layout template.

Closes https://github.com/yesodweb/yesod/issues/1659
2020-03-30 19:00:24 +07:00
Michael Snoyman
4a4dd06df8
Azure matrix/stack.yaml update 2020-03-24 12:20:19 +02:00