From 032a05daa1f6cb2f1eb8256545f540780901357c Mon Sep 17 00:00:00 2001 From: ADNY <66500121+ErKeLost@users.noreply.github.com> Date: Mon, 6 Nov 2023 11:03:14 +0800 Subject: [PATCH] refactor: websocket and devserver (#700) * feat: websocket class * chore: update code * chore: update grade demo * chore: update test server * chore: init ws server migrate devserver * chore: update test websocket success * chore: update code * chore: optimize server with ws code * chore: optimize server with ws code * chore: remove unless code * chore: update code * chore: update code * chore: update code * chore: update code * chore: update lock --- examples/qrcode/index.html | 20 +- examples/qrcode/index.mjs | 10 +- examples/react-antd/farm.config.ts | 18 +- examples/react-antd/package.json | 2 +- examples/react/farm.config.ts | 45 +- examples/react/package.json | 1 + packages/core/src/server/hmr-engine.ts | 5 +- packages/core/src/server/index.ts | 149 +- packages/core/src/server/middlewares/cors.ts | 4 +- .../core/src/server/middlewares/headers.ts | 4 +- packages/core/src/server/middlewares/hmr.ts | 59 +- .../server/middlewares/lazy-compilation.ts | 10 +- packages/core/src/server/middlewares/proxy.ts | 4 +- .../core/src/server/middlewares/records.ts | 4 +- .../core/src/server/middlewares/resources.ts | 18 +- packages/core/src/server/ws.ts | 270 + packages/core/src/utils/logger.ts | 3 + pnpm-lock.yaml | 5162 ++++++++--------- 18 files changed, 2787 insertions(+), 3001 deletions(-) create mode 100644 packages/core/src/server/ws.ts diff --git a/examples/qrcode/index.html b/examples/qrcode/index.html index 8e9907113..8c1ed56d8 100644 --- a/examples/qrcode/index.html +++ b/examples/qrcode/index.html @@ -1,12 +1,12 @@ -
- - -