Try to help incremental compilation be faster#97
Merged
Conversation
The code that is made available in the templates module of projects using ructe is not moved into the templates module of ructe. Also, the files containg that code is now handled as proper submodules, both ructe and in generated code.
When generating source code, write to an internal buffer first, and then write it to file only if the file does not alreay exist or the contents differ. I hope this can help cargo and rustc not to bother with unmodified sources, making incremental compilation of projects that use ructe faster.
kaj
added a commit
that referenced
this pull request
Nov 15, 2020
* Try to improve incremental compile times of projects using ructe by only writing fils if their contents actually changed. Also some code cleanup. PR #97. * Update ructe itself to use edition 2018 (it is still useable for projects using both editios). PR #98. * Fix `StaticFiles::add_files_as` for empty `to` argument and add some more documentation for it. Fixes issue #96. * Update optional rsass dependency to 0.16.0. * Add optional support for tide 0.14 and 0.15. * Update gotham to 0.5 and axtix-web to 3.2 in examples. Tested with rustc 1.47.0 (18bf6b4f0 2020-10-07), 1.42.0 (b8cedc004 2020-03-09), 1.40.0 (73528e339 2019-12-16), 1.48.0-beta.8 (121901459 2020-11-08), and 1.50.0-nightly (98d66340d 2020-11-14)
kaj
added a commit
that referenced
this pull request
Nov 15, 2020
* Try to improve incremental compile times of projects using ructe by only writing fils if their contents actually changed. Also some code cleanup. PR #97. * Update ructe itself to use edition 2018 (it is still useable for projects using both editios). PR #98. * Fix `StaticFiles::add_files_as` for empty `to` argument and add some more documentation for it. Fixes issue #96. * Update optional rsass dependency to 0.16.0. * Add optional support for tide 0.14 and 0.15. * Update gotham to 0.5 and axtix-web to 3.2 in examples. Tested with rustc 1.47.0 (18bf6b4f0 2020-10-07), 1.42.0 (b8cedc004 2020-03-09), 1.40.0 (73528e339 2019-12-16), 1.48.0-beta.8 (121901459 2020-11-08), and 1.50.0-nightly (98d66340d 2020-11-14)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Try to make incremental compilation faster by writing generated source files only when their contents actually changes.
The code that is made available in the templates module of projects using ructe is moved into the templates module of ructe. Also, the files containing that code is now handled as proper submodules, both in ructe itself and in generated code.