Skip to content

Commit

Permalink
refactor(ui/deps): remove abortcontroller-polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
qwqcode committed Jun 10, 2024
1 parent 2549052 commit e30d329
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export default defineConfig({
{ text: '前端 API', link: '/develop/fe-api.md' },
{ text: '前端 Event', link: '/develop/event.md' },
{ text: '插件开发', link: '/develop/plugin.md' },
{ text: '兼容性', link: '/develop/compatibility.md' },
{
text: 'HTTP API',
link: 'https://artalk.js.org/http-api.html',
Expand Down
18 changes: 18 additions & 0 deletions docs/docs/develop/compatibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 兼容性

## 浏览器兼容性

Artalk 客户端生产环境代码的构建通过 esbuild 执行,构建目标为 `es2015`。但请注意,构建仅会处理语法转义遵循 `es2015` 标准,不会处理 API 的兼容性(不包含任何 polyfill)。

如果你的项目需要支持较旧的浏览器和设备,请考虑在捆绑应用程序中包含全局 polyfill。我们推荐使用 [Polyfill.io](https://polyfill.io/) 服务,它会根据用户的 User-Agent 动态返回所需的 polyfill。另外,你也可以使用 [core-js](https://github.com/zloirock/core-js)[Babel](https://babeljs.io/) 来手动添加 polyfill。

以下是 Artalk 使用的现代功能的列表:

- [All ECMAScript 2015 (ES6) features](https://compat-table.github.io/compat-table/es6/)
- [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
- [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)
- [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)

## 服务器兼容性

Artalk 服务端程序基于 Golang 开发,支持 Linux、Windows 和 macOS 等操作系统。当前 Artalk 的 Golang 版本可通过 [go.mod](https://github.com/ArtalkJS/Artalk/blob/master/go.mod#L3) 查看。关于 Golang 的最低操作系统要求,可参考 [Go Wiki](https://go.dev/wiki/MinimumRequirements)
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export default eslintTs.config(
},
node: true,
},
polyfills: ['AbortController'],
},
},

Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ui/artalk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
"lint": "eslint ."
},
"dependencies": {
"abortcontroller-polyfill": "^1.7.5",
"hanabi": "^0.4.0",
"insane": "^2.6.2",
"marked": "^12.0.2"
Expand Down
2 changes: 0 additions & 2 deletions ui/artalk/src/api/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'

import { ApiOptions } from './options'
import { FetchError } from '@/types'

Expand Down

0 comments on commit e30d329

Please sign in to comment.