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

Move templates in a separate file ? #133

Open
saimn opened this issue May 20, 2016 · 2 comments
Open

Move templates in a separate file ? #133

saimn opened this issue May 20, 2016 · 2 comments

Comments

@saimn
Copy link
Contributor

saimn commented May 20, 2016

It would be easier to work with if templates were loaded from a separate (JSON ?) file. My templates are a few dozen of Mb, so I would prefer to not have them in the git history.
I tried to make a JSON file and use an ajax request, but first it is not clear to me how to adapt the code to use an asynchronous ajax request, and second how it could work also with the node cli interface.
Any idea on a good way to do this ?

@Samreay
Copy link
Owner

Samreay commented May 20, 2016

This is definitely an interesting problem. If you want to use ajax, you'd want the master template manager to request the templates, and then pass them down to the workers so that you don't pull down the same file multiple times.

Notice that in the file workerMethods, we transmit template information, but only data.inactiveTemplates. One could also - in the first request, transmit the actual templates themselves, and have the template manager then process the templates.

Or better than that, create a third message type which the templatesService uses to pass templates to the workers. That is, in templatesService (services.js file, line 946), use the angular request library to request the templates. You could then set the templates in the templateManager and invoke setOriginalTemplates.

I'll give it some more thought and see if there is a more elegant way, but I think the above method should work.

@saimn
Copy link
Contributor Author

saimn commented May 20, 2016

Interesting, I didn't think about the workers as I am not familiar with this Javascript feature ;), but I see what you mean. This is not a high priority but it would be more convenient to handle templates.

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