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 Pipeline #16

Open
Michael-F-Bryan opened this issue Jun 9, 2017 · 1 comment
Open

Asset Pipeline #16

Michael-F-Bryan opened this issue Jun 9, 2017 · 1 comment

Comments

@Michael-F-Bryan
Copy link

I noticed on #7 that you mention being able to dynamically load templates and assets, and that got me wondering about how you imagine cargonauts users will handle assets.

I recently released a crate for embedding entire directory trees in your binary, so kinda like include_str, but on steroids. Would something like that be useful for when people want to deploy their apps to production?

On the dynamic reloading side of things, it sounds like you want something which can watch a directory, caching resources which you've served in the past, and reloading them when they are changed (presumably with notify). Have you started work on any of the asset pipeline stuff yet? I'd be keen to help out.

@withoutboats
Copy link
Collaborator

cargonauts currently has only one mode regarding this: it builds all assets and templates into the compiled binary, so you just have to ship that file to the server and turn it on (modulo env vars).

There's a library in this repo called asset_pipeline which enables users to hook in any precompiler for their assets (such as if they're in a language that compiles to JS, or they want to minify them, so on).

However I want to also have a feature which will read the files off disk when requested, instead of pre-building them. The goal here is to let users avoid recompiling their projects every time they change an asset.

How to make this compatible with the user defined asset pipeline step is unclear. I wasn't even thinking about automatically reloading them when they change; that seems like overshooting the goal right now.

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

2 participants