DevCloudFE / ng-devui

Angular UI Component Library based on DevUI Design
https://devui.design
MIT License
1.75k stars 210 forks source link

perf(radio): do not run change detection when the radio group is clicked #200

Closed arturovt closed 2 years ago

kagol commented 2 years ago

@arturovt Thank you very much for your contribution to devui. I noticed that you have recently optimized the performance of multiple components of devui. The main idea is to wrap events such as click in runOutsideAngular, which I think is great. I have the following considerations:

  1. The first is whether all unit tests have passed(npm run test:lib)
  2. and the second is whether there are some potential risks

Thanks again, best wishes for you!

arturovt commented 2 years ago

Hey @kagol . I'm running unit tests for each component where I make changes. Tests that are failing for me are date related, this is because I'm located in another timezone. I'll show you what's failing:

Chrome Headless 99.0.4844.51 (Mac OS 10.15.7) Date Pipe transform yMd HHmmss zzzz FAILED
    Error: Expected '2014/2/11 13:01:22 GMT+02:00' to be '2014/2/11 13:01:22 GMT+08:00'.
        at <Jasmine>
        at UserContext.<anonymous> (devui/common/common.spec.ts:188:57)

Chrome Headless 99.0.4844.51 (Mac OS 10.15.7) gantt basic should drag bar ok FAILED
    Error: Expected 1589576400000 to be 1589558400000.
        at <Jasmine>
        at UserContext.apply (devui/gantt/gantt.spec.ts:235:51)

Chrome Headless 99.0.4844.51 (Mac OS 10.15.7) gantt basic should resize bar ok FAILED
    Error: Expected 1589144400000 to be 1589126400000.
        at <Jasmine>
        at UserContext.apply (devui/gantt/gantt.spec.ts:257:49)