Skip to content

Commit 74d1037

Browse files
authored
Merge pull request #64 from cmushroom/dev
3.0.0
2 parents 477713e + f4e2fd3 commit 74d1037

File tree

91 files changed

+4751
-4409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+4751
-4409
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.version

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"latestVersionNum": 22,
3-
"latestVersion": "2.5.2",
2+
"latestVersionNum": 30,
3+
"latestVersion": "3.0.0",
44
"updateType": "hint",
5-
"releaseNotes": "1. 增加字符串长度查询设置,对于超长字符通守getrange改善性能。\n2. 优化线程池关闭方式。"
5+
"releaseNotes": "1. 升级TCA,使用Reducer重写store 部分。\n2. 增加快速分页模式, 在查询结果数据量较大情况时,优化查询性能。"
66
}

Q&A.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# 问题记录
22

3-
1. tca 监听不存在的属值时, 会造成编译卡死, swift-frontend 内存泄漏
4-
3+
## TCA
4+
1. tca 监听不存在的属性值时, 会造成编译卡死, swift-frontend 内存泄漏
5+
2. 同一个reducer被注入多次时, action方法会被多次调用,例如:
6+
```
7+
Scope(state: \.redisKeysState, action: /Action.redisKeysAction) {
8+
RedisKeysStore(redisInstanceModel: redisInstanceModel)
9+
}
10+
Scope(state: \.redisKeysState, action: /Action.redisKeysAction) {
11+
RedisKeysStore(redisInstanceModel: redisInstanceModel)
12+
}
13+
```

Tests/RedisBaseTests/RedisClientBaseTest.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import Logging
1313
open class RedisClientBaseTest: RedisBaseTest {
1414
let logger = Logger(label: "redis-client-test")
1515

16+
var redisModel: RedisModel!
1617
var redisClient: RediStackClient!
1718

1819
open override func setUp() {
1920
logger.info("redis client base test setUp...")
20-
redisClient = .init(RedisModel(host: redisHostname, port: redisPort, username: redisUsername, password: redisPassword))
21+
self.redisModel = RedisModel(host: redisHostname, port: redisPort, username: redisUsername, password: redisPassword)
22+
redisClient = .init(redisModel)
2123
// let conn = try await redisClient.initConn(host: redisHostname, port: redisPort, username: redisUsername ?? "", pass: redisPassword ?? "", database: 0)
2224
}
2325

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// AppContextStoreTests.swift
3+
// Tests
4+
//
5+
// Created by chengpan on 2023/8/5.
6+
//
7+
8+
@testable import redis_pro
9+
import Foundation
10+
import XCTest
11+
import ComposableArchitecture
12+
13+
@MainActor
14+
class AppContextStoreTests: StoreBaseTests {
15+
func testShow() async {
16+
let store = TestStore(initialState: AppContextStore.State()) {
17+
AppContextStore()
18+
} withDependencies: {
19+
$0.redisInstance = redisInstance
20+
$0.redisClient = redisClient
21+
}
22+
23+
await store.send(.show) {
24+
$0.loading = true
25+
$0.loadingCount = 1
26+
}
27+
}
28+
}

Tests/Store/KeysDelStoreTests.swift

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// AppStoreTest.swift
3+
// Tests
4+
//
5+
// Created by chengpan on 2023/8/5.
6+
//
7+
8+
@testable import redis_pro
9+
import Foundation
10+
import XCTest
11+
import ComposableArchitecture
12+
13+
@MainActor
14+
class KeysDelStoreTests: StoreBaseTests {
15+
func testBasics() async {
16+
let store = TestStore(initialState: KeysDelStore.State()) {
17+
KeysDelStore()
18+
} withDependencies: {
19+
$0.redisInstance = redisInstance
20+
$0.redisClient = redisClient
21+
}
22+
23+
// await store.send(.favoriteAction(.connectSuccess(self.redisModel))) {
24+
// $0.isConnect = true
25+
// }
26+
}
27+
}

Tests/Store/StoreBaseTests.swift

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// StoreBaseTests.swift
3+
// Tests
4+
//
5+
// Created by chengpan on 2023/8/5.
6+
//
7+
8+
@testable import redis_pro
9+
import Foundation
10+
import Logging
11+
import XCTest
12+
import ComposableArchitecture
13+
14+
15+
class StoreBaseTests: RedisClientBaseTest {
16+
var redisInstance: RedisInstanceModel!
17+
18+
override func setUp() {
19+
super.setUp()
20+
self.redisInstance = RedisInstanceModel(redisModel: redisModel)
21+
logger.info("StoreBaseTests setup...")
22+
}
23+
24+
25+
func testExample() {
26+
logger.info("test example ...")
27+
}
28+
}

redis-pro.xcodeproj/project.pbxproj

+93-63
Large diffs are not rendered by default.

redis-pro.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

+60-24
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
"kind" : "remoteSourceControl",
66
"location" : "https://github.com/microsoft/appcenter-sdk-apple.git",
77
"state" : {
8-
"revision" : "88e65475ffd3a7cf2bbde07df9e62159a1fd60a8",
9-
"version" : "5.0.0"
8+
"revision" : "5756ddb0f09041e91bdb3b73c17296ac005ad11a",
9+
"version" : "5.0.3"
1010
}
1111
},
1212
{
1313
"identity" : "combine-schedulers",
1414
"kind" : "remoteSourceControl",
1515
"location" : "https://github.com/pointfreeco/combine-schedulers",
1616
"state" : {
17-
"revision" : "4cf088c29a20f52be0f2ca54992b492c54e0076b",
18-
"version" : "0.5.3"
17+
"revision" : "9dc9cbe4bc45c65164fa653a563d8d8db61b09bb",
18+
"version" : "1.0.0"
1919
}
2020
},
2121
{
@@ -50,17 +50,26 @@
5050
"kind" : "remoteSourceControl",
5151
"location" : "https://github.com/apple/swift-atomics",
5252
"state" : {
53-
"revision" : "919eb1d83e02121cdb434c7bfc1f0c66ef17febe",
54-
"version" : "1.0.2"
53+
"revision" : "6c89474e62719ddcc1e9614989fff2f68208fe10",
54+
"version" : "1.1.0"
5555
}
5656
},
5757
{
5858
"identity" : "swift-case-paths",
5959
"kind" : "remoteSourceControl",
6060
"location" : "https://github.com/pointfreeco/swift-case-paths",
6161
"state" : {
62-
"revision" : "ce9c0d897db8a840c39de64caaa9b60119cf4be8",
63-
"version" : "0.8.1"
62+
"revision" : "5da6989aae464f324eef5c5b52bdb7974725ab81",
63+
"version" : "1.0.0"
64+
}
65+
},
66+
{
67+
"identity" : "swift-clocks",
68+
"kind" : "remoteSourceControl",
69+
"location" : "https://github.com/pointfreeco/swift-clocks",
70+
"state" : {
71+
"revision" : "d1fd837326aa719bee979bdde1f53cd5797443eb",
72+
"version" : "1.0.0"
6473
}
6574
},
6675
{
@@ -77,8 +86,17 @@
7786
"kind" : "remoteSourceControl",
7887
"location" : "https://github.com/pointfreeco/swift-composable-architecture",
7988
"state" : {
80-
"branch" : "main",
81-
"revision" : "007c857bde0410b9d214d7f1e7659551553e337a"
89+
"revision" : "a7c1f799b55ecb418f85094b142565834f7ee7c7",
90+
"version" : "1.2.0"
91+
}
92+
},
93+
{
94+
"identity" : "swift-concurrency-extras",
95+
"kind" : "remoteSourceControl",
96+
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
97+
"state" : {
98+
"revision" : "ea631ce892687f5432a833312292b80db238186a",
99+
"version" : "1.0.0"
82100
}
83101
},
84102
{
@@ -95,17 +113,26 @@
95113
"kind" : "remoteSourceControl",
96114
"location" : "https://github.com/pointfreeco/swift-custom-dump",
97115
"state" : {
98-
"revision" : "51698ece74ecf31959d3fa81733f0a5363ef1b4e",
99-
"version" : "0.3.0"
116+
"revision" : "edd66cace818e1b1c6f1b3349bb1d8e00d6f8b01",
117+
"version" : "1.0.0"
118+
}
119+
},
120+
{
121+
"identity" : "swift-dependencies",
122+
"kind" : "remoteSourceControl",
123+
"location" : "https://github.com/pointfreeco/swift-dependencies",
124+
"state" : {
125+
"revision" : "4e1eb6e28afe723286d8cc60611237ffbddba7c5",
126+
"version" : "1.0.0"
100127
}
101128
},
102129
{
103130
"identity" : "swift-identified-collections",
104131
"kind" : "remoteSourceControl",
105132
"location" : "https://github.com/pointfreeco/swift-identified-collections",
106133
"state" : {
107-
"revision" : "680bf440178a78a627b1c2c64c0855f6523ad5b9",
108-
"version" : "0.3.2"
134+
"revision" : "d1e45f3e1eee2c9193f5369fa9d70a6ddad635e8",
135+
"version" : "1.0.0"
109136
}
110137
},
111138
{
@@ -122,35 +149,44 @@
122149
"kind" : "remoteSourceControl",
123150
"location" : "https://github.com/apple/swift-metrics.git",
124151
"state" : {
125-
"revision" : "53be78637ecd165d1ddedc4e20de69b8f43ec3b7",
126-
"version" : "2.3.2"
152+
"revision" : "971ba26378ab69c43737ee7ba967a896cb74c0d1",
153+
"version" : "2.4.1"
127154
}
128155
},
129156
{
130157
"identity" : "swift-nio",
131158
"kind" : "remoteSourceControl",
132159
"location" : "https://github.com/apple/swift-nio.git",
133160
"state" : {
134-
"revision" : "e855380cb5234e96b760d93e0bfdc403e381e928",
135-
"version" : "2.45.0"
161+
"revision" : "a2e487b77f17edbce9a65f2b7415f2f479dc8e48",
162+
"version" : "2.57.0"
136163
}
137164
},
138165
{
139166
"identity" : "swift-nio-ssh",
140167
"kind" : "remoteSourceControl",
141168
"location" : "https://github.com/apple/swift-nio-ssh",
142169
"state" : {
143-
"revision" : "baa05dc6ff3de89c589a9d582659f0f6699f62ab",
144-
"version" : "0.6.1"
170+
"revision" : "ded5e5ce4ef1b2c29933088651fa66c89e2175d2",
171+
"version" : "0.8.0"
145172
}
146173
},
147174
{
148175
"identity" : "swift-service-discovery",
149176
"kind" : "remoteSourceControl",
150177
"location" : "https://github.com/apple/swift-service-discovery",
151178
"state" : {
152-
"revision" : "c83afedb1c95ef0111907cd6e2fd03d7175cc0d0",
153-
"version" : "1.2.0"
179+
"revision" : "5c88b88dd40446740e86ba809453bc39f7904fa7",
180+
"version" : "1.2.1"
181+
}
182+
},
183+
{
184+
"identity" : "swiftui-navigation",
185+
"kind" : "remoteSourceControl",
186+
"location" : "https://github.com/pointfreeco/swiftui-navigation",
187+
"state" : {
188+
"revision" : "905274b2bd98be556d2cfcf31b94d5979b924755",
189+
"version" : "1.0.1"
154190
}
155191
},
156192
{
@@ -167,8 +203,8 @@
167203
"kind" : "remoteSourceControl",
168204
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
169205
"state" : {
170-
"revision" : "50a70a9d3583fe228ce672e8923010c8df2deddd",
171-
"version" : "0.2.1"
206+
"revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631",
207+
"version" : "1.0.2"
172208
}
173209
}
174210
],

0 commit comments

Comments
 (0)