|
Ran
|
Jobs
1
|
Files
70
|
Run time
1min
|
Badge
README BADGES
|
push
github
feat: add compression middleware and optimize serial port loading (#4501) It is currently taking 1 second plus to load the serial ports for me. (Docker container) Adding compression only sped it up a little, but the payload is much smaller now (compressed). Moved pulling serial to the settings page where it's only used. If you don't want a breaking change on the api, could add a param to the api to exclude pulling serial. This pull request improves the performance and maintainability of the API and frontend by introducing response compression and refactoring how serial port information is loaded. The serial ports are now fetched via a separate API endpoint, allowing the settings page to load faster without waiting for potentially slow serial port enumeration. Additionally, response compression is enabled to reduce bandwidth usage. **API Improvements:** * Added the `compression` middleware to the Express app to compress all HTTP responses larger than 1KB, improving network efficiency. (`api/app.ts`, `package.json`) [[1]](diffhunk://#diff-<a class=hub.com/zwave-js/zwave-js-ui/commit/<a class="double-link" href="https://git"><a class=hub.com/zwave-js/zwave-js-ui/commit/<a class="double-link" href="https://git"><a class=hub.com/zwave-js/zwave-js-ui/commit/fe6a6140f19ab1b0dd1e7eac27de4a8366de9b7c">fe6a6140f<a href="https://github.com/zwave-js/zwave-js-ui/commit/9ad02f7ed1ffe0625c4d81533d9c9fdbf8c17df5">0da27d292f99ba219e5a3e97R6) [[2]](diffhunk://#diff-fe6a6140f19ab1b0dd1e7eac27de4a8366de9b7c0da27d292f99ba219e5a3e97R536-R542) [[3]](diffhunk://#diff-<a class="double-link" href="https://github.com/zwave-js/zwave-js-ui/commit/7ae45ad102eab3b6d7e7896acd08c427a9b25b34">7ae45ad10</a>6470d7bc6507b6481575d519R87) * Refactored the `/api/settings` endpoint to remove serial port enumeration, making it faster and more reliable. (`api/app.ts`) [[1]](diffhunk://#diff-fe6a6140f19ab1b0dd1e7eac27de4a8366de9b7c0da27d292f99ba219e5a3e97L1072-R1080) [[2]](diffhunk://#diff-fe6a6140f19ab1b0dd1e7eac27de4a8366de9b7c0da27d292f99ba219e5a3e97L1112-R1146) * Introduced a new `/api/serial-ports` endpoint that asynchronously enumerates serial ports, returning results separately from settings. (`api/app.ts`) **Frontend Improvements:** * Updated the `ConfigApis` module to add a `getSerialPorts` method for fetching serial port data from the new endpoint. (`src/apis/ConfigApis.js`) * Changed t... (continued)
334 of 444 branches covered (75.23%)
Branch coverage included in aggregate %.
0 of 76 new or added lines in 3 files covered. (0.0%)
4052 of 22316 relevant lines covered (18.16%)
1.13 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 4 |
0.0 |
0.0% | src/apis/ConfigApis.js |
| 4 |
0.0 |
0.0% | src/stores/base.js |
| 68 |
0.0 |
0.0% | api/app.ts |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 22176677289.1 | 70 |
19.27 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|