Skip to content

Partial rebuild of component tree #843

@mihkeleidast

Description

@mihkeleidast

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions