Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Puppet] Puppeteer #790

Closed
huan opened this issue Sep 8, 2017 · 4 comments
Closed

[New Puppet] Puppeteer #790

huan opened this issue Sep 8, 2017 · 4 comments

Comments

@huan
Copy link
Member

huan commented Sep 8, 2017

I'm planning to create a new puppet: PuppetChrome, which will use puppeteer instead of Selenium WebDriver.

Puppeteer is a Node library which provides a high-level API to control headless Chrome over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome.

The reason to do this is that we have lots of issues about the headless settings, and the webdriver bugs.

I believe the following issues will not exist anymore after we switched to Puppeteer: #788 #756 #739 #674

There's also have other plans for the new puppet, like: #69, and maybe we will also need to support PuppetPad later.

@huan
Copy link
Member Author

huan commented Oct 4, 2017

Currently, I'm planning to work on this issue.

I'm going to replace the WebDriver by the Puppeteer.

huan added a commit that referenced this issue Oct 5, 2017
huan added a commit that referenced this issue Oct 5, 2017
huan added a commit that referenced this issue Oct 6, 2017
@huan huan changed the title [New Puppet] PuppetChrome [New Puppet] Puppeteer Oct 6, 2017
@huan
Copy link
Member Author

huan commented Oct 8, 2017

Almost done.

This will fix #756 #86 #2 #195 #237 #329

huan added a commit that referenced this issue Oct 8, 2017
REFACTOR
----------------

### 1. Use Chrome Puppeteer to control WebWechat.

All codes related with WebDriver/Selenium had been removed.

1. This makes the logic simple: no server, no https endpoint, no WebSocket anymore;
1. Removed lots of Classes, like `PuppetWebServer`, `PuppetWebBrowser`,  `PuppetWebBrowserDriver`, `ssl-pem` and `PUppetWebBrowserCookie` ;
1. Removed all the `Xvfb` packages and settings;

### 2. Upgrade CircleCI from v1 to v2.

Nothing changed except all the YAML syntax of the CircleCI configuration file.

Workflows look very good, maybe set it up later.

### 3. Dockerfile switch from `alpine` to `node:7` image

The size increased hugely. However, this will let us feel better if we want to add more and more packages into our Docker Image: Debian has better support to the packaging ecosystem.

### 4. Drop Node.js v6 support

No special reasons, it's just tooold.

### 5. Use `blue-tape` to do unit testing, with Typing support.

Do not use AVA anymore, do not wait for TAP anymore. They all support TypeScript not well.

### 6. Separate source code related with `watchdog` to a new NPM module.

It's modulized very well and can be used as needed everywhere: https://github.com/zixia/watchdog

### 7. Created a new module `RxQueue` for `throttle` / `debounce` / `delay` tasks.

Consider publishing a solo NPM module in the future.

### 8. Arrange all the WEB JSON data structure

Save them into a single file: `schema.ts`

### 9. A new Class for manage Wechaty Profile

Use it to `new Profile('botName')` and `save()`/`load()`/`get()`/`set` etc.
@huan
Copy link
Member Author

huan commented Oct 8, 2017

REFACTOR

1. Use Chrome Puppeteer to control WebWechat.

All codes related with WebDriver/Selenium had been removed.

  1. This makes the logic simple: no server, no https endpoint, no WebSocket anymore;
  2. Removed lots of Classes, like PuppetWebServer, PuppetWebBrowser, PuppetWebBrowserDriver, ssl-pem and PUppetWebBrowserCookie ;
  3. Removed all the Xvfb packages and settings;
  4. Never need to wait for 28s anymore.

2. Upgrade CircleCI from v1 to v2.

Nothing changed except all the YAML syntax of the CircleCI configuration file.

Workflows look very good, maybe set it up later.

3. Dockerfile switch from alpine to node:7 image

The size increased hugely. However, this will let us feel better if we want to add more and more packages into our Docker Image: Debian has better support to the packaging ecosystem.

4. Drop Node.js v6 support

No special reasons, it's just tooold.

5. Use blue-tape to do unit testing, with Typing support.

Do not use AVA anymore, do not wait for TAP anymore. They all support TypeScript not well.

6. Separate source code related with watchdog to a new NPM module.

It's modulized very well and can be used as needed everywhere: https://github.com/zixia/watchdog

7. Created a new module RxQueue for throttle / debounce / delay tasks.

Consider publishing a solo NPM module in the future.

8. Arrange all the WEB JSON data structure

Save them into a single file: schema.ts

9. A new Class for manage Wechaty Profile

Use it to new Profile('botName') and save()/load()/get()/set etc.

@huan
Copy link
Member Author

huan commented Nov 5, 2017

Stable at v0.12 or above.

@huan huan closed this as completed Nov 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant