Split copy-res into two phases during yarn start #26593
Merged
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.
Requires: #26591
copy-res.ts -w
currently runs in parallel with the Webpack build which causes the following problems:yarn start
ing afteryarn clean
the language file is usually not generated in time for Webpack to process it which breaks the buildThis pull request rearranges
copy-res.ts -w
so that it only writes files after actual changes being triggered on the watches. This makes it necessary to call the script once without the-w
flag before to perform the initial copying which is what's used to perform the initial copying before starting the Webpack build onyarn start
. Additionally the initial copy-res is ran in parallel with the module system build and the Jitsi download to gain some more slight performance.With this change a clean
yarn start
takes ~21s on my machine. Before, a cleanyarn start
failed and subsequent yarn start took about the same time.Unfortunately, even with this change, I'm still often seeing a secondary Webpack build after
yarn start
ing.There doesn't seem to be any other file generation after the first phase. So I'm unsure what triggers this. It might be similar to what's mentioned in https://github.com/vector-im/element-web/blob/develop/scripts/copy-res.ts#L169 but
sleep
ing doesn't feel like a great solution.This change is marked as an internal change (Task), so will not be included in the changelog.