-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCHANGELOG
479 lines (348 loc) · 15.4 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
*** Version 0.2.0 - 2018-09-07
Functional (static/func.js):
- More isolation with private fields;
- Remove filtered items from array and return them in new array: `$.remove()`.
Events (emmiter.js):
- Multiple event handling stages (handler rank is identified by a numerical value);
- Event handler results are merged into one object and event is
treated as handled on current stage if this object is not empty;
- Any-handlers -- if not handled by some target handler, emit to any-handler.
MQ Discovery (mq/discovery.js):
- Ensure that list of instances will contain own instance ASAP.
Web (web/index.js):
- Ability to manually confirm on web server readiness for binding.
Main module (index.js; static/main.js):
- Immediately terminate application after graceful shutdown time elapsed;
- Immediately terminate application on double user-terminating signals (f.x. Ctrl+C).
*** Version 0.3.2 - 2018-11-01
MQ Mongo-based (mq/mongo/):
- Support queue priority (records with lower priorities are processed first);
- Support queue topic (only one from several records that have the same topic are guaranteed to be processed at a moment).
- Support important queue records (in case of clean exit, finalizer will wait within graceful shutdown period for such tasks to finish).
- Reduced default visibility timeout (from 3 minutes to 1 minute).
- Periodically wake up workers (in visibility timeout period) to check for records which had been possibly stalled after crash.
MQ Discovery (mq/discovery.js):
- Retry after unsuccessful attempt to signal instance up event for keep-alive (caused by connection loss etc.).
*** Version 0.3.3 - 2019-01-31
Main module / error logging (index.js):
- Static dollar support (circular): `ClasyncClass.$ = ClasyncClass`.
Main module / error logging (index.js; static/error.js):
- Logging wrappers: `$.log`, `$.logError`, `$.logFatal`, `$.logDebug`.
*** Version 0.3.8 - 2019-04-05
Cache (cache.js):
- Support unlimited values for maxCount and maxLifetime.
MQ Mongo-based (mq/mongo/):
- Delay before retrying sync on too big network latency detected;
- Fix topic race condition detection bug;
- Apply deprecations of `mongoose`.
Functional (static/func.js):
- Support multiple key grouping of `groupBy` if grouping function/map returns array.
*** Version 0.3.10 - 2019-04-15
Main module (index.js; static/main.js):
- Add `afterInit()` and `beforeFinal()`;
- Add `initFatal()`;
- Add `mainFatal()`.
Main module / error logging (index.js; static/error.js):
- Minor bugfixes.
Functional (static/func.js):
- Add `$.firstKey()`, `$.firstValue()`, `$.firstEntry()`;
- Add `$.regExpInput()`.
*** Version 0.3.11 - 2019-05-24
Functional (static/func.js):
- Make `$.makeObject()` use null-prototype object as a base.
MQ Dispatcher (mq/disp.js):
- Register inline workers in `$.afterInit()`.
MQ Mongo-based (mq/mongo/):
- Do not try to signal queue if queue item is lost;
- Set default remote to local time sync retries to 3.
Web (web/rest.js):
- Register inline routes in `afterInit()`.
*** Version 0.4.0 - 2019-06-19
Overall:
- Prefer `$.makeObject()` for creating dictionaries.
MQ Dispatcher (mq/disp.js):
- Support multiple handlers of the same inline worker as `N*TYPE name`, f.x. `4*WORKER processUsers`.
*** Version 0.5.1 - 2019-08-07
Overall:
- Add all classes to tree under base class, f.x. `require('clasync').Web` is same as `require('clasync/web')`.
Functional (static/func.js):
- Add mappings: `$.null`, `$.bound`;
- Add reducing: `$.min`, `$.max`.
Workers and Threads (worker/*; thread/*):
- Add own classes for `'cluster'` (`$.Worker`) and `'worker_threads'` (`$.Thread`).
*** Version 0.6.3 - 2019-08-17
MQ Mongo-based (mq/mongo/):
- Add `queue:sleep` pubsub event when queue runs out of active tasks;
- Add `at`, `in` options for `.push()`;
- Add `expires`, `ttl` options for `.push()`;
- Add `.push()` options support to `.rpc()`;
- Remove `queueEventName`. Add `queuePfx`, `newTaskEvent`, `sleepEvent`;
- Per-instance `visibilityMsec` value;
- Verbose `queue:newTask` pubsub events.
MQ Dispatcher (mq/disp.js):
- Add options support to `.push()` and `.rpc()` wrappers.
Main module (index.js; static/main.js):
- Add `$.App`;
- Add flexible `configure`;
- Fatal error if main module class is `Clasync` itself;
- Fix bug with `.exit()`.
Main module / error logging (index.js; static/error.js):
- Add support for DEBUG env var: `$.getDebug`, `$.logDebug`.
Functional (static/func.js):
- `$.all()` and `$.race()` now accept promises in multiple arguments (gets flattened).
*** Version 0.6.4 - 2019-08-21
MQ Mongo-based (mq/mongo/):
- Add options to `.worker()` and `.rpcworker()`.
MQ Dispatcher (mq/disp.js):
- Add `!` prefix for worker's `important` override option.
Functional (static/func.js):
- `$.all()` and `$.race()` no more accept flattened, only arrays (revert v.0.6.3).
*** Version 0.7.5 - 2019-10-04
Main module (index.js; static/main.js):
- Get rid of instance substitution in constructor by Promise. Introduce `this.$.ready` symbol.
MQ Mongo-based (mq/mongo/):
- Add alternative pubsub redis support.
*** Version 0.7.6 - 2019-11-08
Main module (index.js):
- Bugfix: `.beforeFinal()` runs before deps finalization and allows to change finaling reason;
- Class `App` is now extended from `Clasync.Emitter`.
Functional (static/func.js):
- Add `.interface()` method, allowing to add fields and methods from another class.
Workers and Threads (worker/*; thread/*):
- Add feedback `.rpc()` from worker to pool;
- Added class types;
- Default empty object `$.configure`.
MQ Mongo-based (mq/mongo/):
- Various bugfixes;
- Disable idle queue `.syncTime()`;
- Disable delayed messages support;
- Add ability to disable `topic` support to `.worker()`: `noTopic` boolean.
MQ Dispatcher (mq/disp.js):
- Add option flag `?` for `noTopic`.
Web (web/index.js; web/api.js):
- Moved automatic `.ready()` to `.afterInit()`;
- Customizable Web API headers and options: `allowedHeaders`, `exposedHeaders`, `origin`, `compression`, `trustProxy`.
*** Version 0.8.2 - 2019-11-29
Overall (db/; mq/; pay/; web/):
- Extend classes from `Clasync.Emitter` rather than from `Clasync`.
Crypt (crypt.js):
- Update to use IV-based cipher creation;
- Support custom boolean flags in token.
MQ Discovery (mq/discovery.js):
- Prefix redefine in constructor;
- Poll instances in `.afterInit()` to increase stability;
- Add events: 'beforeUp', 'up', 'down';
Functional (static/func.js):
- Add '$.objSort()`, `$make()` synonym of `$.makeObject()`, `$.accumulate()`;
- Date support in `$.clone()` and `$.cloneDeep()`;
- Support multiple groups for `$.inverts()` and `$.groupBy()`;
Promise utilities (static/promise.js):
- Support rest parameters in `$.promisify()`;
- Add `$.bind()`, `$.bindJob()`, `$.timeThrottle()`;
Web (web/index.js; web/api.js; web/rest.js):
- Move `.express()` to `Web`, alias it from `Web.Rest`;
- Add `.json()`, `.form()`, `.file()`, `.files()` middleware to `Web`;
- Append line break to `Web.Api` JSON response;
- `Web.Api`: make `.customError` code 500 by default;
- Return JSON error representation from `Web.Api` for `limitExceeded`;
- `Web.Rest`: add argument support as `req.mwArg` for middleware declaration in REST method;
- Support middleware from current `Web.Rest` instance, prepended with `.` in declaration;
- Deprecate `Web.Upload`.
*** Version 0.8.4 - 2019-11-30
Main module (index.js):
- Flexible `deps` in `.init()`.
Promise utilities (static/promise.js):
- Return result from `$.timeThrottle()` promise;
- Add `$.bindOnce`.
*** Version 0.8.5 - 2020-01-13
MQ Mongo-based (mq/mongo/):
- `.push()`: add `maxTries` and `failQueue` options; `triesLeft` field in DB;
- Add `queue:discard` pubsub event;
- Change order of per-queue pubsub events: `QUEUE_NAME:queue:EVENT`;
- Deprecate global `maxRequeuesOnError`, add global `maxTries` default.
*** Version 0.8.6 - 2020-02-13
Cache (cache.js):
- Events (expire, replace, remove, add).
*** Version 0.8.9 - 2020-03-11
DB Mongo (db/mongo/):
- Add `crashOnDisonnect` boolean property;
- Add `.on('disconnect')` event.
MQ Mongo-based (mq/mongo/):
- Add `failReason`, `requeueOnErrorMsec`;
- Default `failQueue` to 'unhandledExceptions';
- Default `maxTries` to 3;
- Default `requeueOnErrorMsec` to 21000;
- Fix `syncTime` flood bug;
- Worker `topic` option instead of `noTopic`. `?` modifier specifies that topic is used.
Promise utilities (static/promise.js):
- Add `$.callOnce()`.
*** Version 0.9.1 - 2020-04-09
Functional (static/func.js):
- Add: `$.int32()`, `$.int()`, `$.string()`, `$.funcSort()` moved out from `$.objSort()`, `$.objFuncSort()`;
- Add: `$.ensure()`, `$.setDef()`, `$.setPush()`, `$.setUnshift()`, `$.setExtend()`, `$.setDefaults()`;
- `$.accumulator` is suitable for `[].reduce()`.
Promise utilities (static/promise.js):
- Add `$.IoC()`.
*** Version 0.9.9 - 2020-06-10
Functional (static/func.js):
- Add `$.append()`;
- Ensured safe big array appending and big object assigning;
- Add `$.jsonString()`, `$.jsonParse()`;
- Add `Set` and `Map` support to `$.string`, `$.jsonString`, `$.clone`, `$.cloneDeep`, `$.setAdd`, `$.accumulate`;
- Add `$.merge`, `$.mergeDeep`, `$.unmerge`, `$.unmergeDeep`;
- Add `$.prod()`, `$.safeProd()`;
- Add `$.numKeys()`;
- Add `$.anyInstanceOf()`, `$.iterableTypes`.
Promise utilities (static/promise.js):
- Add `$.timeThrottleCached`;
- Add support of immediate (0) time to `$.timeThrottle`.
Main module (index.js):
- Add self autobound functions (declared with suffix '$').
*** Version 0.9.10 - 2020-06-15
Functional (static/func.js):
- Optimizations for big data with iterators and streams;
- Add `$.echoAsync`, `$.nullAsync`, `$.boundAsync`;
- Add `$.keys()`, `$.values()`, `$.entries()`, `$.keysValues()`;
- Add `$.flattenIter()`, `$.flattenAsync()`, `$.flattenDeepIter()`, `$.flattenDeepAsync()`;
- Add `$.makeAsync()`, `$.extendAsync()`, `$.defaultsAsync()`;
- Add `$.chunkIter()`, `$.chunkAsync()`;
- Add `$.partialIter()`, `$.partialAsync()`, `$.chunkIterIter()`, `$.chunkAsyncAsync()`;
- Add `$.mapIter()`, `$.mapAsync()`, `$.mapMultiIter()`, `$.mapMultiAsync()`;
- Add `$.filterIter()`, `$.filterAsync()`;
- Add `$.array()`, `$.arrayAsync()`;
- Add `$.sliceIter()`, `$.sliceAsync()`;
- Add `$.last()`, `$.lastAsync`, `$.cutLastIter()`, `$.cutLastAsync()`;
- Add `$.sliceRightIter()`, `$.sliceRightAsync()`;
- Add `$.forkIter()`, `$.forkAsync()`;
- Add `$.iterator()`, `$.iteratorAsync()`, `$.iteratorObj()`, `$.iteratorObjAsync()`;
- Add `$.array()`, `$.arrayAsync()`;
- Add `$.zipIter()`, `$.zipAsync()`, `$.collateIter()`, `$.collateAsync()`;
- Add `$.feedAsync()`;
- Add `$.nsecAsync()`;
- Add `$.execIter()`, `$.execAsync()`.
*** Version 0.9.13 - 2020-10-06
Main module (index.js):
- Static hub binding: `this.$dep.$ === this.$.$dep`.
MQ Mongo-based (mq/mongo/):
- Add index by `queue, topic`.
*** Version 0.9.14 - 2020-10-24
Packages (package.json)
- Update all to latest versions.
Functional (static/func.js):
- Add `limit` arg to `$.forkIter()` and `$.forkAsync()`.
*** Version 0.9.15 - 2020-11-12
Dependencies (package.json):
- Update module versions, except socket.io.
Functional (static/func.js):
- Add `$.stretch()`, `$.stretchIter()`, `$.stretchAsync()`;
- Add nullable result support to mapping function of `$.mapMultiIter()` and `$.mapMultiAsync()`;
- Add `$.repeatIter()`, `$.repeatAsync()`.
*** Version 0.9.16 - 2020-11-24
Functional (static/func.js):
- Change `$.nsecAsync` to return `{item, index, time}`, add `$.nsecMcSec`, `$.nsecMsec`, `$.nsecSec`, `$.nsecMin`;
- Add `$.feedback()` wrapper to send back `yield` return values;
- Add `$.pageAsync()` for paging of iterable.
Main module (index.js; static/main.js):
- Pass `process.argv` to `.main(argv)`.
*** Version 0.10.0 - 2020-11-27
Functional (static/func.js):
- Deprecate `$.array()` for `$.arrayIter()`;
- Change `$.flattenIter()`, `$.flattenAsync()` to skip nullable arguments;
- Add `$.sepIter()`, `$.sepAsync()`;
- Add `$.stringIter()`, `$.stringAsync()`;
- Change `$.mapKeys` value projection from object.
*** Version 0.10.1 - 2020-12-22
Overall:
- Improve `...$()` self-bind isolation and class inheritance.
Main module (index.js; static/main.js):
- Improve main module lifecycle;
- Add `$.mainFinal()`.
Functional (static/func.js):
- Add `$.fromEntries()` aliased by `$.fromPairs()`;
- Add `$.stopIter()`, `$.stopAsync()`.
*** Version 0.10.6 - 2021-03-11
DB Mongo (db/mongo/):
- Model grabs schema in `.afterInit()`.
- Static `Schema`, `Mixed`, `ObjectId`.
Main module (index.js; static/main.js):
- Support to explicitly define `$.mainModule`;
- Log main shutdown event;
- Add `.suppressCrash` option to main instance.
Functional (static/func.js):
- Add `$.not()`, `$.notAsync()`;
- Add `$.chunkByIter()`, `$.chunkByAsync()`, `$.chunkByTimeAsync()`;
- Refactor to `$.asyncIterator()`, `$.asyncIteratorObj()`;
- Add `$.generator()`, `$.asyncGenerator()`, `$.iterable()`, `$.asyncIterable()`;
- Add `$.prefetchAsync()`;
- Add `$.rangeIter()`, `$.reduceIter()`, `$.reduceAsync()`;
- Add `$.dimIter()`, `$.dimAsync()`;
- Add `$.pure()`, `$.pureAsync()`, `$.proto()`, `$.protoAsync()`;
Web (web/index.js; web/api.js; web/rest.js):
- Add default error 'apiNotFound' (404);
- Add support for iterative response;
- Add `.router` for endpoints;
- Add support for `.notFound()` method in Rest.
*** Version 0.10.8 - 2021-03-20
Main module (index.js; static/main.js):
- Reset `$.mainInstance` on main instance finalize;
- Add `$.mainClass`.
Functional (static/func.js):
- Add `$.walkInsort()', `$.insortEntries()`;
- Add `$.ensureEx()`.
*** Version 0.10.9 - 2021-04-27
Web API (web/api.js):
- Add CORS options `.corsOpts` and compression options `.compressOpts`.
Package (package.json):
- Fix dep versions. Disallow automatic updates.
*** Version 0.10.10 - 2021-05-21
Package (package.json):
- Upgraded versions to known latest stable, including `socket.io`.
MQ Discovery (mq/discovery.js):
- Improved stability;
- Add `.listIter()`;
- Made `.checkExpires()` and `.listInstances()` sync;
- Changed default `$.msecPingAlive` and `$.msecAliveExpires`.
MQ Mongo-based (mq/mongo/):
- Redis `.pub()` and `.sub()` are now async and awaiting acknowledge before return;
- Fix finalization bug.
Web (web/socket.js):
- Aligned to Socket.io version 4.
*** Version 0.11.1 - 2021-05-23
Async Classes (index.js):
- Assign config twice: 1 sync in constructor and 1 async before `.init()`.
Web Socket MQ Adapter (web/socket-mq.js):
- Update for `socket.io` v.4.
Web Socket (web/socket.js):
- Remove `.mq`, `.mqPrefix`;
- Add `.adapter: {mq, opts: {prefix}}`;
- Fix multiple socket finalization by a hack `io.httpServer = null`.
Functional (static/func.js):
- Add `$.xorIter()`, `$.xorAsync()`.
*** Version 0.11.3 - 2021-05-28
Event Emitter (emitter.js):
- Allow firing original events from object extensions.
Overall (mq/; web/):
- Default `Emitter` event handlers;
- Allow loadtime action handler methods in subclasses.
Functional (static/func.js):
- Add `.scanObject()`, `.scanObjectAll()`.
*** Version 0.11.6 - 2021-06-07
MQ Discovery (mq/discovery.js):
- Reduce defaults for crashed instances: `$.msecPingAlive`, `$.msecAliveExpires`;
- Correctly report crashed instances in `.onDown()`;
- Forcefully exit from lagged instances.
MQ Mongo-based (mq/mongo/):
- Fix concurrency on first DB initialization;
- Improve stability on finalization;
- Add Redis error handler.
Overall:
- Fix `...$()` self-bind isolation and class inheritance.
*** Version 0.11.11 - 2022-11-07
Overall:
- Update `dependencies` versions in `package.json`.
*** Version 0.11.12 - 2023-07-13
Web (web/index.js):
- Add `onAppCreated()` virtual method.
*** Version 0.11.13 - 2023-07-13
DB Mongo (db/mongo/):
- Ensure the DB connection for successful `init`.