Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset Management? #116

Open
xmikew opened this issue Aug 30, 2015 · 3 comments
Open

Asset Management? #116

xmikew opened this issue Aug 30, 2015 · 3 comments

Comments

@xmikew
Copy link

xmikew commented Aug 30, 2015

What is Catalyst view on static asset management? This is something I always struggled with what to do with a Catalyst app. I do a typical make / make test/ make install for the app and my assets actually get installed in the PERL5LIB directory, which was I was a bit weirded out by at first but now I like that all my assets for my app get packaged up too and it's one cohesive unit. I've heard others just copy the app directory around instead of doing a real "install"

Is this why asset management isn't supported at all? There are packages such as File::Assets and Controller::Combine but assets should be munged at build time. It seems it would be nice if catalyst has some built-in something that would at least concat / uglify / fingerprint js and css. File::Assets gets close but it happens at runtime (and looks like might be abandoned).

I was thinking perhaps Module::Install::Catalyst should be enhanced to support the features of File::Assets plus concat as a good first start but I saw Ether was trying to nudge away from Module::Install so maybe something for whatever the new thing is (i can't remember what it was).

Seems might be good for people that don't also run a nodejs environment and have all the task-runners that handle a lot of this stuff (which is what my plan is).

  • Mike
@jjn1056
Copy link
Member

jjn1056 commented Sep 4, 2015

Hi @xmikew and sorry for the slow reply, just a lot going on in you personal life.

Honestly this is something I've thought about a lot, particularly since the clear tread is toward more front end work for websites and these type of sites tend to have more complex asset requirements. There'sa bunch of prior art on CPAN (Even I have Catalyst::Controller::Public which I am recommending over the old static plugin). At this moment I don't think any of this stuff belongs in Catalyst core. The things I think we can do:

  1. Some documentation and/or blogs (possibly for advent 2015 coming up fast) with general recommendations and comparisons amongst the available tools and options.

  2. I've been pondering a new project "Catalyst::Stack" which tries to bring some of this stuff together, a sort of opinionated Catalyst project on top of the Core.

  3. Is there anything we can do with core to make all the above easier?

Right now I think answering those questions is the best thing to do since the common approach today is going to change in no time at all and core is not the place for that kind of thing.

As a side note all the bits in Catalyst::Devel, all the helper scripts etc are terribly behind and there's noone interested in adopting. I was thinking to just leverages one of the popular project scaffolding tools in another language to fit the bill but again I haven't had time to review. if you are interested in picking that up, that would be great!

@vanstyn
Copy link
Member

vanstyn commented Sep 4, 2015

@xmikew -- you might also want to take a look at Catalyst::Controller::AutoAssets -- this is my solution to the question of asset management (and is RapidApp's, too) and it has worked quite well for our needs

@xmikew
Copy link
Author

xmikew commented Sep 6, 2015

@jjn1056 Thanks for the insight. The Catalyst::Stack or FullStack or whatever it might be called sounds like a good idea to me! I don't tend to use the scaffolding things so I'm not sure what I might be missing or what is languishing. Catalyst::Helper::* ?

@vanstyn I missed your controller on metacpan because I had stopped looking in the controller space since I currently serve all my assets from apache. I see you mention the webserver frontend in the AutoAssets docs. It is very tempting to move asset management into a controller when I see AutoAssets!

I was looking around some more to see if I had missed other things and saw that Plack::Middleware::Asset::RubyLike has a preprocessor but doesn't look fully featured. Seems like the perl world might be missing a utility to handle this stuff at build time vs runtime, of I've yet to find it.

Thanks for the replies, it seems the suggested path at this time is to do it at runtime and use a Controller (Pubic, AutoAssets etc). I think this is why I was originally looking at File::Assets.

- Mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants