web 专栏 - 提案

2020-11-23

web

后台框架性能对比 benchmark

前端框架性能对比 benchmark

已完成提案

https://github.com/tc39/proposals/blob/main/finished-proposals.md 3

常用派发

elem.addEventListener('myEvent', function (e) {
  console.log(e.detail)
})

var event = new CustomEvent('myEvent', { detail: { username: 123 } })

不兼容提醒

SharedWorker 在移动端基本不被支持

工程量巨大警示

在现代构建工具中, 在使用各种新特性的语法和多种文件 loader 处理转换至 ES5 的工作已经变得困难.

备注

合作 code ide

重复表单处理办法

There are different ways to avoid double submits, which can be combined:

Use JavaScript to disable the button a few ms after click. This will avoid multiple submits being caused by impatient users clicking multiple times on the button.

Send a redirect after submit, this is known as Post-Redirect-Get (PRG) pattern. This will avoid multiple submits being caused by users pressing F5 on the result page and ignoring the browser warning that the data will be resend, or navigating back and forth by browser back/forward buttons and ignoring the same warning.

Generate an unique token when the page is requested and put in both the session scope and as hidden field of the form. During processing, check if the token is there and then remove it immediately from the session and continue processing. If the token is not there, then block processing. This will avoid the aforementioned kinds of problems.

In Spring you can use RedirectView as implementation of the PRG pattern (as described in point 2). The other two points needs to be implemented yourself.

游戏开发框架

UI

微软 fast

copyright ©2019-2024 shenzhen
粤ICP备20041170号-1