This page looks best with JavaScript enabled

Monthly Share, Issue 1

 ·  ☕ 2 min read

Sharing with you some of the tech news I have been following over the past month. There is also some interesting content here too: tools, learning resources, tips, and more.

Frontend

Webpack

Back in February this year, Webpack had already released version 4.0.0. Webpack 4 no longer supports Node.js 4, and it brings a big improvement in compilation speed. At the same time, Webpack 4 removed the commonchunk plugin and switched to the optimization property for more flexible configuration; this is probably the most complicated part of the upgrade.

Fastpack

Fastpack is a JavaScript application bundler, with the goal of bundling a medium-sized application (about 1,000 modules) in less than 1000 ms and incremental rebundling in under 100 ms.

The benchmark results are below:

Vue CLI 3.0

Evan You announced the official release of Vue CLI 3.0 on Medium.

The core goal of Vue CLI is to provide build setup as a pre-configuration built on Webpack 4. The goal is to minimize the number of times developers have to configure things.

Official documentation: https://cli.vuejs.org/zh/guide/

Backend

Python

Version updates: Python 3.7.0 & 3.6.6 have been released

Learning resources:

  1. RealPython: Socket Programming in Python (Guide): https://realpython.com/python-sockets/
  2. RealPython: Python Code Quality: Tools & Best Practices: https://realpython.com/python-code-quality/
  3. Python 101 : The subprocess module: https://python101.pythonlibrary.org/intro.html
  1. Jupyter Notebook opens as a web page, where you can write and run code directly in the page, and the results of running the code are displayed right below the code block. Jupyter Notebook 101 Preview Chapter: http://www.blog.pythonlibrary.org/
  2. PyCharm 2018.2 Out Now, related link: https://blog.jetbrains.com/pycharm/2018/07/pycharm-2018-2-out-now/
  3. Nice Vim trick for Python code: https://jugad2.blogspot.com/2018/08/nice-vim-trick-for-python-code.html
  4. Seaborn is a data visualization tool that wraps a higher-level API on top of matplotlib: https://seaborn.pydata.org/

celery

2018.07.18 version update: v4.2.1

Related link: http://docs.celeryproject.org/en/latest/whatsnew-4.2.html

The updated features are as follows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Result Backends
### New Redis Sentinel Results Backend(Sentinel:哨兵模式,高可用)
### Cassandra Results Backend(cassandra: Apache 分布式 NoSQL 数据库)
### DynamoDB Results Backend(DynamoDB:Amazon 完全托管、无缝扩展的 NoSQL 数据库)
### Python 2/3 Compatibility Fixes
## Canvas
## Tasks
### Bound Tasks as Error Callbacks
### Task Representation
### Custom Requests
### Retries with Exponential Backoff(Exponential Backoff:指数退避算法)
## Sphinx Extension(Sphinx:一种文档工具,它可以令人轻松的撰写出清晰且优美的文档,已成为Python项目首选的文档工具)

redis

Redis recently released version 5.0, which adds a new data structure called stream — a persistable message queue that supports multicast — and the author of Redis admitted that the design of stream borrowed heavily from Kafka.

Tools

Consoles on Windows

On Windows, using CMD and PowerShell usually cannot fully meet development needs. Here are a few console tools:

FeatureCygwinMinGW/MSYSMSYS2
GNU or notNoYesYes
Broader software supportSupports the vast majority of GNU softwareSupports common software; Git, Vim, and similar need separate supportSupports most GNU software
More Linux-likeCygwin on Windows is like Wine on LinuxImplements the main Linux programs such as BashNative 64/32-bit support
GCC compilationIncludes MinGW32 cross-compilation, supporting both compilation of programs that depend on cygwin.dll and standalone Windows programs; can compile Linux applications directlySupports compiling standalone Windows programsSupports compiling standalone Windows programs
Chinese language supportSupports Chinese display and input methods directlyRequires configuration to support Chinese display and input; deleting one Chinese character takes two deletesSupports Chinese display and input methods, Chinese help system, and Chinese prompts (for some software)
SpeedSlowFastFast

Package Manager on Windows: chocolatey

Official website: https://chocolatey.org/

How do you install chocolatey? Run the following command with administrator privileges:

1
 @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Interesting Stuff

How Chrome Renders an HTML Document into Pixels on the Page

Video: https://drive.google.com/file/d/1Ky59m-F79ULs4ydMbD4Mp1dBXvs_eDes/view

Document: https://docs.google.com/presentation/d/1boPxbgNrTU0ddsc144rcXayGA_WF53k96imRH8Mp34Y/edit#slide=id.g25ae9c179b_0_75

Tips

Solving Cross-Origin Issues in Webpack with a Proxy

During local development and debugging, you usually need to access online data, http://localhost:8008/api -> http://online.com/api. A proxy can effectively solve the cross-origin problem. By configuring a proxy, you can effectively avoid the security risks left behind by django-cors-headers.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
const proxyPath = [
    '/api'
]
const proxyRule = {}
proxyPath.forEach(item => {
    proxyRule[item] = {
        target: 'http://online.com',
        secure: false,
        changeOrigin: true
    }
})


devServer: {
     port: 8008,
     public: 'localhost',
     hot: true,
     proxy: proxyRule
}

WeChat Official Account
WRITTEN BY
WeChat Official Account