fect-org / fect

Minimalist UI components built on Vue-next
https://www.fect-org.com
MIT License
362 stars 45 forks source link

feat(utils): add make func & clean code #231

Closed nonzzz closed 2 years ago

nonzzz commented 2 years ago

Checklist


Change information


For more performance. I decide add a make func. You can see it's very clean.

codecov[bot] commented 2 years ago

Codecov Report

Merging #231 (3b8f8e0) into master (e04ab63) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #231   +/-   ##
=======================================
  Coverage   96.67%   96.67%           
=======================================
  Files         190      190           
  Lines        2136     2136           
  Branches      373      373           
=======================================
  Hits         2065     2065           
  Misses         71       71           
Impacted Files Coverage Δ
packages/vue/src/loading/loading.tsx 100.00% <100.00%> (ø)
packages/vue/src/pagination/pagination-pages.tsx 100.00% <100.00%> (ø)
packages/vue/src/rating/rating.tsx 100.00% <100.00%> (ø)
packages/vue/src/spinner/spinner.tsx 100.00% <100.00%> (ø)
packages/vue/src/swipe/swipe.tsx 84.21% <100.00%> (ø)
zaunist commented 2 years ago

I don't think we need to bring the golang code style into typescript, it makes the code look a little strange.

zaunist commented 2 years ago

Of course, there's nothing wrong with coding it that way if you must.

nonzzz commented 2 years ago

@zaunist There is a reason for why i need a make func, you can view some component use [...Array],But is not a good way, form the benchmark.make is more fast

nonzzz commented 2 years ago

Spread syntax is easy cause stack overflow. We should avoid

zaunist commented 2 years ago

JS Benchmarks: https://perf.link/#eyJpZCI6ImQ4bnBoNTV0OHg1IiwidGl0bGUiOiJGaW5kaW5nIG51bWJlcnMgaW4gYW4gYXJyYXkgb2YgMTAwMCIsImJlZm9yZSI6ImNvbnN0IG1ha2UgPSAoY2FwKT0%2BbmV3IEFycmF5KGNhcCkuZmlsbCh1bmRlZmluZWQpO1xuY29uc3QgbWFrZXMgPShjYXApPT5bLi4ubmV3IEFycmF5KGNhcCldOyIsInRlc3RzIjpbeyJuYW1lIjoibm9ybWFsIiwiY29kZSI6Im1ha2UoMTAwMDAwMDApIiwicnVucyI6WzI5LDI5LDI5L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