-
Notifications
You must be signed in to change notification settings - Fork 5
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
[metal-tools-soy] Add compilation cache for Soy files #22
Comments
Hey @eduardolundgren, that's definitely doable. We were actually discussing something along those lines for a prototype of a webpack loader that @p2kmgcl is working on... One question, though, have you experienced a project where We can easily instrument the tooling and start getting some answers. |
@jbalsas On WeDeploy Console it's taking 10-15s to build the soy files, and most of the time only one file has been changed. |
I'll take a look over the week, then. We can also tackle #9 (comment) |
Hey @eduardolundgren I took a look into it, and it appears that the bundling is what's taking up most of that time. Which is consistent with what I've seen on Electric projects. > [email protected] build /Users/rframpton/Projects/wedeploy/console
> magnet build -C config && gulp build
> info Config magnet.development.config.js
> info Building plugins…
buildSoy: 1768.503ms
buildClient: 10243.093ms
> info Building assets…
[10:25:31] Using gulpfile ~/Projects/wedeploy/console/gulpfile.js
[10:25:31] Starting 'marble'...
[10:25:31] Starting 'fonts'...
[10:25:31] Starting 'senna'...
[10:25:31] Finished 'senna' after 49 ms
[10:25:31] Finished 'fonts' after 77 ms
[10:25:31] Finished 'marble' after 283 ms
[10:25:31] Starting 'build'...
[10:25:31] Finished 'build' after 27 μs From what I've seen in other webpack builds, one of the largest factors of increased build time is adding more entry points. It looks like the wedeploy console is currently passing However, we definitely should still add a caching layer to the soy tools. It's just not going to address most the slowness you're experiencing. |
Ugh, I didn't notice the build client was the most time-consuming.
We can totally live with The focus now changes, would be cool to analyze on |
I think that integrating https://webpack.js.org/configuration/dev-server/ into magnet is going to be your best bet for improving the developer experience. They also have middleware that might be compatible with the magnet server. |
@Robert-Frampton That sounds like a possibility, the only open question is how to plug soy compilation into the Webpack flow for this dev server. A good shot might be https://github.com/p2kmgcl/metal-soy-loader. |
I was wondering if make sense to cache compiled files to bump compilation performance.
One rough idea could be to write a cache file that contains the hashes of the files.
.cache
In the next build, before compiling all files, check the cache file and remove from the compilation file list the ones that the hash is still the same, then update the
.cache
file.Dependencies
In case
a.soy
hasn't changed but it importsb.soy
, ifb.soy
has changeda.soy
also need to be recompiled. For that, we might use @mthadley tool to parse the files and calculate the dependencies.Do you guys think it is doable?
The text was updated successfully, but these errors were encountered: