ktsn / vue-designer

Vue component design tool
https://marketplace.visualstudio.com/items?itemName=ktsn.vue-designer
MIT License
368 stars 22 forks source link

perf: minimize edited content in a file #77

Closed ktsn closed 5 years ago

ktsn commented 5 years ago

The current implementation rewrite entire Vue SFC when it is edited from the preview pane. It is a bit expensive and occurs blinks of syntax highlight.

To minimize the updating range, I've let vue-repository module pass Modifiers object to external modifyFile function directly and the function update the document by using the modifiers information.

codecov[bot] commented 5 years ago

Codecov Report

Merging #77 into master will decrease coverage by 0.13%. The diff coverage is 11.11%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #77      +/-   ##
=========================================
- Coverage   67.93%   67.8%   -0.14%     
=========================================
  Files          66      67       +1     
  Lines        2283    2292       +9     
  Branches      461     468       +7     
=========================================
+ Hits         1551    1554       +3     
- Misses        712     718       +6     
  Partials       20      20
Impacted Files Coverage Δ
src/vscode/modifier.ts 0% <0%> (ø)
src/repositories/vue-file-repository.ts 0% <0%> (ø) :arrow_up:
src/vue-designer.ts 0% <0%> (ø) :arrow_up:
src/parser/modifier.ts 91.89% <100%> (+0.71%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1d5b376...9db9aaa. Read the comment docs.