Skip to content

Commit 402568f

Browse files
committed
[add] a new Development post
[optimize] several Post details
1 parent e52c6d4 commit 402568f

File tree

4 files changed

+176
-23
lines changed

4 files changed

+176
-23
lines changed

source/_posts/Community/Open-Source-core-Community.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: 水歌:开源之“道”的三股势力丨COSCon'20 专访
3+
date: 2020-10-23 21:51:00
34
categories:
45
- Community
56
tags:

source/_posts/Development/headless-CMS-Strapi.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ git push
6969
```shell
7070
# 更新包管理器数据库
7171
apt update
72-
# 安装 Git、Python PIP
73-
apt install git python-pip
72+
# 安装 Python PIP
73+
apt install python-pip
7474
# 安装 Docker
7575
curl -fsSL https://get.docker.com | sh
7676
# 安装 Docker Compose
@@ -94,14 +94,6 @@ ssh-add id_rsa
9494
cat id_rsa.pub > authorized_keys
9595
```
9696

97-
并将上述公钥添加到 `https://github.com/my-id/my-project/settings/keys` 页面。
98-
99-
如此,便可无需用户名、密码,直接克隆代码库:
100-
101-
```shell
102-
git clone git@github.com:my-id/my-project.git ~/www
103-
```
104-
10597
### 部署配置文件
10698

10799
将以下两个文件放在代码库相应路径中,并提交:
@@ -144,27 +136,36 @@ jobs:
144136
steps:
145137
- name: Checkout
146138
uses: actions/checkout@master
139+
- name: Transport
140+
uses: garygrossgarten/github-action-scp@release
141+
with:
142+
local: ./
143+
remote: ${{ secrets.PATH }}
144+
host: ${{ secrets.HOST }}
145+
username: ${{ secrets.USER }}
146+
privateKey: ${{ secrets.SSH_KEY }}
147147
- name: Deploy
148-
uses: appleboy/ssh-action@master
148+
uses: garygrossgarten/github-action-ssh@release
149149
with:
150150
host: ${{ secrets.HOST }}
151-
username: root
152-
key: ${{ secrets.SSH_KEY }}
153-
script: |
154-
cd ~/www
155-
git fetch --all
156-
git reset --hard
157-
git pull
151+
username: ${{ secrets.USER }}
152+
privateKey: ${{ secrets.SSH_KEY }}
153+
command: |
154+
cd ${{ secrets.PATH }}
155+
echo BASE_URL=${{ secrets.BASE_URL }} > .env
158156
docker-compose down
159157
docker-compose up -d
160158
```
161159

162160
【注意】在推送代码前,务必去 `https://github.com/my-id/my-project/settings/secrets` 页面创建好上述配置中的变量:
163161

164-
| 名称 | 内容 |
165-
| :-------: | :-------------------------------------------------------: |
166-
| `HOST` | 服务器 **IP 地址** |
167-
| `SSH_KEY` | `ssh-keygen` 命令生成的**私钥**,通常存在 `~/.ssh/id_rsa` |
162+
| 名称 | 内容 |
163+
| :--------: | :-------------------------------------------------------: |
164+
| `PATH` | 服务器**代码目录** |
165+
| `HOST` | 服务器 **IP 地址**或**域名** |
166+
| `USER` | 服务器**用户名** |
167+
| `SSH_KEY` | `ssh-keygen` 命令生成的**私钥**,通常存在 `~/.ssh/id_rsa` |
168+
| `BASE_URL` | 服务器 HTTP 访问根地址 |
168169

169170
### HTTPS 一键搞定
170171

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: 让 Web 打包器再次简单!
3+
date: 2021-02-28 00:11:35
4+
categories:
5+
- Development
6+
tags:
7+
- Web
8+
- bundle
9+
- easy
10+
slidehtml: true
11+
---
12+
13+
> 华为云开发者社区<br>
14+
> 2021 年 3 月 27 日演讲
15+
16+
---
17+
18+
## Web 最初很简单
19+
20+
- HTTP
21+
- HTML
22+
- CSS
23+
- JavaScript
24+
25+
---
26+
27+
<iframe
28+
style="width: 100%; height: 90vh"
29+
scrolling="no" frameborder="no" loading="lazy"
30+
allowtransparency="true" allowfullscreen="true"
31+
title="Web standard - Resource import"
32+
src="https://codepen.io/tech_query/embed/MWbVwWv?height=265&theme-id=dark&default-tab=html,result"
33+
></iframe>
34+
35+
---
36+
37+
## Web 后来很强大
38+
39+
- BOM、DOM
40+
- LESS、SASS、Stylus
41+
- ECMAScript 6+、TypeScript
42+
- WebAssembly
43+
- Canvas、WebGL
44+
- WebSocket
45+
- IndexedDB
46+
- Web Worker、PWA
47+
- WebUSB、WebAuthn
48+
- ……
49+
50+
---
51+
52+
### Web 打包器变得很复杂
53+
54+
---
55+
56+
#### JavaScript 库打包器
57+
58+
| <small>名称及官网</small> | <small>简介</small> | <small>备注</small> |
59+
| :-----------------------------------------------------: | :------------------------------------------: | :-----------------------------------------: |
60+
| [AMD-bundle.js](https://tech-query.me/AMD_bundle.js/) | <small>AMD、CJS 和 ES 通用模块打包器</small> | <small>本人开发 jQuery 仿制版时自研</small> |
61+
| [rollup.js](https://rollupjs.org/) | <small>ES 模块打包器</small> | <small>全球首个知名的 ES 模块打包器</small> |
62+
| [MicroBundle](https://github.com/developit/microbundle) | <small>基于 rollup 的 JS 打包器</small> | <small>Preact 等知名库的打包器</small> |
63+
| [ESBuild](https://esbuild.github.io/) | <small>用 Go 语言开发的 ES/TS 打包器</small> | <small>全球性能最强</small> |
64+
65+
---
66+
67+
#### Web 应用打包器
68+
69+
| <small>名称及官网</small> | <small>简介</small> | <small>备注</small> |
70+
| :------------------------------------: | :--------------------------------------------------------: | :-------------------------------------------: |
71+
| [DevCLI](https://web-cell.dev/DevCLI/) | <small>HTML 5、CSS 3、ECMAScript 6+ 原生资源打包器</small> | <small>本人开发 WebCell 1.0 时自研</small> |
72+
| [webpack](https://webpack.js.org/) | <small>插件化 Web 资源打包器</small> | <small>全球最著名、最复杂的打包器</small> |
73+
| [Parcel](https://parceljs.org/) | <small>零配置 Web 原生资源打包器</small> | <small>全球次著名、最易用的打包器</small> |
74+
| [Snowpack](https://www.snowpack.dev/) | <small>基于 ESBuild 的 Web 资源打包器</small> | <small>全球首个知名 ES 模块应用打包器</small> |
75+
| [Vite](http://vitejs.dev/) | <small>基于 rollup 和 ESBuild 的 Web 资源打包器</small> | <small>尤雨溪开发 Vue 3.0 时自研</small> |
76+
77+
---
78+
79+
#### 痛点:配置复杂!!!
80+
81+
1. 标准滞后
82+
2. 实现繁多
83+
3. 配置复杂
84+
4. 迁移困难
85+
86+
---
87+
88+
代码还没写,环境配一天……
89+
90+
---
91+
92+
## 我理想中的打包器
93+
94+
| 本人自研(已废弃) | 社区同款 | 社区现状 |
95+
| :----------------: | :------: | :------------------------------------: |
96+
| AMD-bundle.js | ESBuild | CSS modules 官方尚未支持,但有社区插件 |
97+
| DevCLI | Parcel | v1 bug 无人修复,v2 变复杂且难产 |
98+
99+
---
100+
101+
### 设计原则
102+
103+
- **资源文件引入机制**只依赖 **HTML、CSS、JavaScript 原生语法**
104+
- **资源文件扩展名**支持:
105+
- MarkDown、LESS、SASS、TypeScript 等**高级编译语言**
106+
- JSON、YAML、CSV 等**文本数据格式**
107+
- 图片、音视频等**二进制文件的 URI**
108+
109+
---
110+
111+
- 根据依赖树的需要,自动安装**资源编译器**
112+
- 自动读取项目现有的各种**编译器配置文件**
113+
- **打包配置**按社区习惯设置**最优默认值**
114+
- 配置文件支持 [JSON schema](https://json-schema.org/)**ES 模块****TypeScript 类型定义**
115+
116+
---
117+
118+
### 架构概略
119+
120+
1. 编译器转换各类代码文件
121+
2. 编译器生成**抽象语法树**,并查找**资源引用语句**
122+
3. 构造依赖树
123+
4. 基于观察者模型**增量更新依赖**
124+
125+
---
126+
127+
## 我有一个梦想
128+
129+
---
130+
131+
Web standard first!
132+
133+
---
134+
135+
Make the Web bundler easy again!

source/_posts/Other/Hanfu-Revival-and-National-Confidence.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: 汉服复兴与民族自信
33
date: 2020-11-18 20:13:18
4+
updated: 2021-02-21 14:38:29
45
categories:
56
- Other
67
tags:
@@ -47,12 +48,19 @@ slidehtml: true
4748

4849
<iframe
4950
style="width: 100%; height: 90vh"
50-
src="https://www.youtube.com/embed/JD856-RsOwQ"
51+
src="https://www.youtube.com/embed/J8IHCGLKFV8"
5152
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen
5253
></iframe>
5354
5455
---
5556

57+
<iframe
58+
style="width: 100%; height: 90vh"
59+
src="//player.bilibili.com/player.html?aid=373047685&bvid=BV1gZ4y1g7sp&cid=264477950&page=1" frameborder="no" framespacing="0" scrolling="no" allowfullscreen
60+
></iframe>
61+
62+
---
63+
5664
##### 烧汉服事件始末
5765

5866
- [维基百科](https://zh.wikipedia.org/zh-hans/2010%E5%B9%B4%E6%88%90%E9%83%BD%E6%BC%A2%E6%9C%8D%E4%BA%8B%E4%BB%B6)
@@ -97,6 +105,14 @@ slidehtml: true
97105
98106
---
99107

108+
<iframe
109+
style="width: 100%; height: 90vh"
110+
src="https://www.youtube.com/embed/VdimXc9eX7o"
111+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen
112+
></iframe>
113+
114+
---
115+
100116
### 清代服装:旗袍、马褂
101117

102118
<img style="height: 90vh" src="./QiPao.jpg" />

0 commit comments

Comments
 (0)