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

[Question] Improving development workflow and client cache misses #452

Open
pjanuario opened this issue Mar 15, 2015 · 3 comments
Open

[Question] Improving development workflow and client cache misses #452

pjanuario opened this issue Mar 15, 2015 · 3 comments

Comments

@pjanuario
Copy link

I am starting with rendr and I am trying to improve the performance of the code reload in development and also improve client side cache. My starting point were the codebase existent on the examples/06.

So my goal are:

  • Split the bundle in two (at least):
    • vendor bundle: with rendr and rendr dependencies (backbone, underscore...);
    • application bundle: with the application logic (router, views, ...)
  • update grunt-browserify used from the examples (to use cache existent on the plugin)

Bundling: Since our application code is in a different bundle the reload should be faster since it contains less dependencies to bundle. Would also be nice to have a bundle with the handlebar templates and other with server side logic, this would probably improve the reload time also and specially useful for designers workflow.

Grunt Browserify plugin: From what I had read, the last builds of grunt-browserify would allow us to use the native browserify cache that make bundle faster after the first bundle. But until now I was unable to package the app (even with a single bundle) with the last version of grunt-browserify, since alias mapping have been removed and alternatives seems not be working properly.

Anyone with nice recipes for this kind of stuff?
@saponifi3d :)

@saponifi3d
Copy link
Contributor

@pjanuario I'm actually working with gulp + browserify, not grunt. I'm starting work on how to split up application code and get it to work the way you're describing now. I'm going to be doing a similar approach as this https://github.com/sogko/gulp-recipes/tree/master/browserify-separating-app-and-vendor-bundles to split the vendor files from the app specific.

Once I get this stuff done, I'm going to build out an example app in https://github.com/rendrjs/rendr-examples for gulp and for bundle splitting

@pjanuario
Copy link
Author

@saponifi3d Thanks for the feedack. I will post here if I have news about it. For now, I am still doing the application bootstrap and this is not my main focus yet, but I will have to deal with in close future.

@pjanuario
Copy link
Author

@saponifi3d by the way, can you talk a little bit about the stack you are using. I am building stuff in node in the last year but is my first website using node, my previous project were mainly api's and microservice components in plain node/js.

So I am still researching for appropriate tools. Such as tools/recipes to:

  • manage assets versions and full urls, since I will be using a cookie free domain with cdn for all the assets, I was thinking in building some handlebars + express + bundle helpers for this, something similar to rails asset bundle that prefix asset-md5 to ensure asset refresh;
  • user sessions (but i known this express middleware and fairly straight);

Would be nice to have some place where people could share there tools and workflows, probably a lot people have custom scripts that could be reused and who knows we could create and rendr example that could be used to bootstrap an application for people that is starting with rendr.

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