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:

  1. Abstract Puppet Class need to be imported by every puppet implementations, and it should to be a solo npm module, with good version management.
  2. 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 PuppetPuppeteer
Beta padchat PuppetPadchat iPad Protocol PuppetPadchat
Alpha wechat4u PuppetWechat4u Web API via HTTP PuppetWechat4u
Alpha ioscat PuppetIoscat (WIP) iPhone App Hooking PuppetIoscat
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 Puppet
Release mock PuppetMock Mocking PuppetMock

If we count the other npm modules that split out from Wechaty before, we can also list them as the following:

  1. cloneClass: Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.
  2. hotImport: Hot Module Replacement(HMR) for Node.js
  3. Brolog: Brolog is Logger for Angular in Browser like Npmlog.
  4. FileBox: Pack a File into Box for easy move/transfer between servers no matter of where it is.(local, remote url, or cloud storage)
  5. MemoryCard: Memory Card is an Easy to Use Key/Value Store Implements ES6 Map with Async API, with Swagger & Serialization Support.
  6. RxQueue: Easy to Use RxJS Queue for Throttle/Debounce/Delay/DelayExecute
  7. StateSwitch: State Switch is a Monitor/Guard for Managing Your Async Operations.
  8. 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)

Full Changelog

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 of ContactPayload 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:

项目简介

Conversational SDK for Chatbot Makers

发行版本 22

Wechaty 0.56 Released!

全部发行版

贡献者 37

全部贡献者

开发语言

  • TypeScript 92.2 %
  • Shell 5.0 %
  • JavaScript 1.7 %
  • Dockerfile 1.2 %