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

Partial rebuild of component tree #843

Open
mihkeleidast opened this issue Jan 31, 2021 · 0 comments
Open

Partial rebuild of component tree #843

mihkeleidast opened this issue Jan 31, 2021 · 0 comments

Comments

@mihkeleidast
Copy link
Member

What problem would this feature solve?

Currently, Fractal rebuilds the entire component tree when anything changes in the component directory. This is quite an expensive operation memory and CPU usage wise, especially when project get larger.

I have a project where the build of the component tree takes up the following time:

getTree for components: 759.457ms
parse for components: 1346.296ms
resolveTreeContext for components: 8718.640ms
build for components: 10825.268ms

And when I simply re-save an existing file (not even changing anything in it):

getTree for components: 542.875ms
parse for components: 1175.335ms
resolveTreeContext for components: 10659.719ms
build for components: 12378.684ms

Since this rebuild has to complete before anything else can happen (browsersync reload, for example), this is a bit slow :)

What the feature should look like?

This rebuild/refresh logic should be improved so only the part of the file tree that changed would be rebuilt. Maybe do some smart diffing between old/new after the file system parsing (since that's pretty quick) to save time on the parse/resolveTreeContext parts of the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant