feat(config): enable watch for all layer configs and load in parallel #2929
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.
π Linked issue
β Type of change
π Description
Another small PR inspired from my reading of the implementation for v3..
A few bits I had noticed:
After #2829, we would have enabled
.config/
directory (or even config in different extensions) - but I realised that the fsStat before loading the config would not allow us for this. So it started with that, then I went ahead to parallelise the call toloadContentConfig
, and then resolvecollectionMap
. I realised that callingresolveCollections
and iterating over collections was not necessary (as the key is thecollection.name
), so instead we use a reducer to override any low-level layer collections (ideally we would have wanted to usedefu
, but that is deep-default and may have side-effects for collection schemas). In addition to that, I also ensured that the configurations would work with a watcher, so thanks forwatchConfig
, all of this is possible.Let me know what you think - I had to spend some time scratching my head on updating this code, so would love feedback! π
π Checklist