rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
542 stars 96 forks source link

try rackless serving, fixes #68 for js and css #118

Closed ujifgc closed 11 years ago

ujifgc commented 11 years ago

If a file exists and it's in supported format, it will be served without Rack::Test request.

j15e commented 11 years ago

Thanks, I will have a look at it asap but I think the problem doing so is that your assets won't be preprocessed at all (ex. sass files, coffee-script). Am I wrong?

Also, it seems like this change only apply to combined assets (package), not other routes, ideally I would change it for both cases.

ujifgc commented 11 years ago

Yes, it's a partial solution, serves only files that don't need preprocessing. I'm gonna try and figure out the rest on this weekend.

ujifgc commented 11 years ago

This solution is exactly for the problem where you get a combined file with number of \n equal to the number of individual asset files to be combined.

ujifgc commented 11 years ago

As for individual assets serving, I think it is unfixable by design, because before a request gets to sinatra-assetpack it must go through before filters of sinatra. Usually there comes authorization, simple or not, and the request is just failed. If we could only add a before filter before authorization, but this is too much tampering with routing, I think.

j15e commented 11 years ago

This is why I suggest in #68 that asset preprocessing should be split apart from routing, that would resolve the issues we are having, but this is indeed is a big design modification.