import Types without linking against all the yesod-core dependencies #113

Closed
gregwebs opened this Issue Aug 20, 2011 · 4 comments

Projects

None yet

2 participants

@gregwebs
Member

I have a test suite for a portion of a Yesod app that just uses the models. I want to be able to develop, re-run, and execute these tests as quickly as possible. Some of the models need some Yesod types, in particular:

import Yesod.Request (FileInfo(..))
import Yesod.Content (ContentType)

Depending on yesod-core means pulling in hamlet and a bunch of other stuff.

@snoyberg
Member

ContentType is just a type synonym for ByteString, so you don't need it for anything. For FileInfo, what did you have in mind? I don't really like the idea of creating a separate package to house a datatype to reduce testing dependencies.

@gregwebs
Member

well, only thing I thought of is separate packages :).

Besides testing, there is the concept of a Yesod app that would want to use
a different template language and/or has really simple needs.

I think I am wondering if the core package can be divided based on Widgets.
So there could be a separate package yesod-base/yesod-wai with Request,
Content, maybe Dispatch, (I expect the Logger module to disappear when the
new logging stuff comes out).

The other possibility is to have a separate yesod-types/yesod-core-types
package.

Not sure if I like either of these possibilities much. Although with the new
code arrangement breaking out a package is not as much of a pain.

On Sat, Aug 20, 2011 at 1:19 PM, snoyberg <
reply@reply.github.com>wrote:

ContentType is just a type synonym for ByteString, so you don't need it for
anything. For FileInfo, what did you have in mind? I don't really like the
idea of creating a separate package to house a datatype to reduce testing
dependencies.

Reply to this email directly or view it on GitHub:
#113 (comment)

@snoyberg
Member

Is the problem depending on the Shakespeare languages? Maybe that
implies splitting out into so many different packages wasn't a good
idea. But anyway, I don't like the direction this takes us in. We have
the concept of Widgets baked in pretty deeply, and Widgets depend on
the Html, Css and Javascript datatypes. I don't think there's a good
way to separate that stuff out.

@gregwebs
Member

Well I think I just outlined 2 ways to separate things- so it can be done. But I agree that it seems like a lot of trouble to make some tests faster.

I will try just copying the definition and doing a #define.

@gregwebs gregwebs closed this Aug 20, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment