研发与码农
- dai-shi
use-context-selector - bvaughn
react-window - pmndrs
zustand、@react-three/fiber - storybookjs
storybook
计算机网络
HTTP/2 服务器推送
服务器推送(server push)指的是,还没有收到浏览器的请求,服务器就把各种资源推送给浏览器。
比如,浏览器只请求了index.html,但是服务器把index.html、style.css、example.png全部发送给浏览器。这样的话,只需要一轮 HTTP 通信,浏览器就得到了全部资源,提高了性能。
Nginx 实现
location / {
root /usr/share/nginx/html;
index index.html index.htm;
http2_push /style.css;
http2_push /example.png;
}
Node 实现
const http2 = require('http2')
const server = http2.createSecureServer(
{ cert, key },
onRequest
)
function push (stream, filePath) {
const { file, headers } = getFile(filePath)
const pushHeaders = { [HTTP2_HEADER_PATH]: filePath }
stream.pushStream(pushHeaders, (pushStream) => {
pushStream.respondWithFD(file, headers)
})
}
function onRequest (req, res) {
// Push files with index.html
if (reqPath === '/index.html') {
push(res.stream, 'bundle1.js')
push(res.stream, 'bundle2.js')
}
// Serve file
res.stream.respondWithFD(file.fileDescriptor, file.headers)
}
看一下其他的实现:
G
Recoil
S2
acorn
babel-config
bun-demo
code-edit
formik
immer
import-html-entry
jotai
memoize-one
mobx
module-federation-examples
my-rollup-project
my-turborepo
nest-server
node-demo
operational-transformation.github.com
ot.js
prettier
prettier-demo
qiankun
qiankun-main
qk-main
qk-react
qk-vue3
react
react-error-boundary
react-like
react-three-fiber
react-three-flex
react-virtualized
react-window
react18-demo
react_source_demo
rematch // Rematch is Redux best practices without the boilerplate
rspack
rust
server-components-demo
single-spa
tapable
turbo
valtio
verification
vite
vite-project
vue-demo
vue-pure-admin
waku-example
webgl-demo
webpack
webpack-loader-demo
yup
zustand
zustand-demo