v0.18.0
版本发布时间: 2018-07-12 20:24:21
wechaty/wechaty最新发布版本:v0.56(2021-01-25 16:29:30)
WECHATY v0.18: REDUCE WEIGHT
The only purpose for Wechaty v0.18 is to: Reduce Weight!
But, why do we need to reduce weight?
Let's back to May 2016, when the first version of Wechaty was published, it only contains thousands of lines of the code, and at the end of the year 2016, we have about 10,000 lines of the code. (you can read our blog at this time)
As the time passed by in 2017 & 2018, we added more features to Wechaty, like send attachment files, support WeChat protocol other than web like ipad, which means we write more and more codes in Wechaty repository... at last we get almost 30,000 lines of the code, and to be precise: 27,630. (with 377 unit tests, you can check it out at here if you are interested)
Is that fat? 30,000 lines of the code, is not too much, but it is not a small number too. After we finished abstracting the puppet base class after v0.16, it seems we have very good reason to begin reducing weight:
- Abstract Puppet Class need to be imported by every puppet implementations, and it should to be a solo npm module, with good version management.
- Every Puppet Implentation Class is better to be a solo npm module, becasue we can only install the required source code that we needed.
So at this version (v0.18), we have the follow npm modules that splited out from Wechaty:
WECHATY PUPPET LIST
1. For Puppet User
Stage | Name | Wechaty Puppet | Backend | Version |
---|---|---|---|---|
Release | puppeteer | PuppetPuppeteer | Web API via Browser Hooking | |
Beta | padchat | PuppetPadchat | iPad Protocol | |
Alpha | wechat4u | PuppetWechat4u | Web API via HTTP | |
Alpha | ioscat | PuppetIoscat (WIP) | iPhone App Hooking | |
TBW | Android | Android Hook | 0.0.0 | |
TBW | Win32 | Win32 Hook | 0.0.0 |
2. For Puppet Builder
Stage | Name | Wechaty Puppet | Backend | Version |
---|---|---|---|---|
Release | N/A | Puppet | Abstract Base Class | |
Release | mock | PuppetMock | Mocking |
If we count the other npm modules that split out from Wechaty before, we can also list them as the following:
- cloneClass: Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.
- hotImport: Hot Module Replacement(HMR) for Node.js
- Brolog: Brolog is Logger for Angular in Browser like Npmlog.
- FileBox: Pack a File into Box for easy move/transfer between servers no matter of where it is.(local, remote url, or cloud storage)
- MemoryCard: Memory Card is an Easy to Use Key/Value Store Implements ES6 Map with Async API, with Swagger & Serialization Support.
- RxQueue: Easy to Use RxJS Queue for Throttle/Debounce/Delay/DelayExecute
- StateSwitch: State Switch is a Monitor/Guard for Managing Your Async Operations.
- Watchdog: An Timer used to Detect and Recover from Malfunctions
Hmm... lots of them aha? So how can we keep all of them in one repository and manage them easily? It must be a nightmare!
So at last, as we published the v0.18, we only left 5,465 source lines of the code in Wechaty repository(11,006 physical lines). We can see a timeline from the history:
Source Lines of Code for Wechaty
Date | SLOC |
---|---|
2016.5 | 3,000 |
2017.1 | 10,000 |
2018.1 | 20,000 |
2018.6 | 27,630 |
2018.7 | 11,006 |
From 27,630 to 11,006, we almost get the half size than before, cheers!
Change Log
v0.18.0 (2018-07-11)
Implemented enhancements:
- PuppetPadchat Upgrade TODO Lists #1442
- Dynamic install puppet implementations instead of pre-install #1437
- Split PuppetWechat4u as a NPM module #1419
- PuppetPadchat: The contact.star() doesn't work #1413
- Promote PuppetPuppeteer to SOLO NPM Module wechaty-puppet-puppeteer #1371
- Promote Puppet to SOLO NPM Module wechaty-puppet #1370
- New Puppet: PuppetMock for Testing & Starter #1177
Fixed bugs:
- Cannot detect the the environment WECHATY_PUPPET v0.17.118 #1456
- PuppetPadchat Server logout and login cycle average 3-5mins #1446
- WARN PuppetPuppeteer initWatchdogForPuppet() dog.on(reset) last food:inited, timeout:120000 #1439
- ts-node 7.0 breaking change: Skip
files
by default #1383 - Can not find room after add member to the room #1380
- PuppetPadchat:
friend
value ofContactPayload
is undefined #1359 - WXGetContact cannot get user_name #1358
- leveldown::Database::Close: Program terminated with signal SIGSEGV, Segmentation fault. #1355
Closed issues:
- QR Code problem under screen/xterm #1455
- How to get the room title in v0.17 wechaty? #1454
- should not download chromium by default #1451
- PuppetPadChat:Send media file. #1436
- PuppetPadchat:My wechat accou can not login. #1416
- It reports errors when the room delete one member. #1415
-
cannot get user\_name from raw payload: {} \[object Promise\]
Error #1399 - Where can I see the complete API documentation of puppet-padchat, such as createRoom and Moment #1391
- still restart #1378
- WARN PuppetPuppeteer #1376
- m.say() repeat many many times #1216
- room.say mention is not work #1185
- 获取所有群 #1020
- Any way to keep login for days? #988
Merged pull requests:
- update version of puppet-padchat #1457 (windmemory)
- catch error when get undifined user_name in room #1408 (lijiarui)
- add a more suitable time to sync Contact and Room #1407 (lijiarui)
- mock self bot when WXGetContact() return null user_name #1405 (lijiarui)
- sync contact and room per hour #1402 (lijiarui)
- add
friend
in ContactPayload #1401 (lijiarui) - fix Contact.findaAll() cannot get contact when user_name return undifined #1389 (lijiarui)
- fix bug that after a room add, the room id get removed from cache #1384 (windmemory)