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

perf: skip file system and components parsing when template/resource is changed #949

Merged
merged 4 commits into from
May 18, 2021

Conversation

mihkeleidast
Copy link
Member

@mihkeleidast mihkeleidast commented Apr 2, 2021

Found a small but definite improvement for #843.

The component templates are cached by adapters/engines. Doing a full re-parse of file system and components tree is not necessary when an existing template is only changing. It's currently still necessary when a component template is added/removed since that needs to modify the components tree so the UI would update accordingly.

The context still needs to be re-resolved, in case the changed template has been used as fully rendered component in some other component's context. This is quite unfortunate, since resolving the context takes up a lot of time and might not even be used in some projects - for example, React projects with client-side hydrating are probably not using this feature because it's near impossible to know what to hydrate if it's rendered from context. So maybe we should additionally add a config flag to disable that feature if there is no need for it?

Additionally, I added a complete bypass of the parsing/resolving when a component resource is changed (think .spec.js test files or .css files that live in the component directory) since they are cached by nothing and do not modify the component/context at all.

@mihkeleidast mihkeleidast changed the title perf: skip file system and components parsing when component template is changed perf: skip file system and components parsing when template/resource is changed Apr 2, 2021
@mihkeleidast mihkeleidast merged commit 10c4420 into main May 18, 2021
@mihkeleidast mihkeleidast deleted the perf/skip-parse-on-template-change branch May 18, 2021 16:31
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

Successfully merging this pull request may close these issues.

1 participant