-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
替换使用纯静态方案实现 #46
Comments
gpt 写的文案么 |
elrrrrrrr
added a commit
that referenced
this issue
Oct 16, 2023
> close #46 * 调整版本列表页同步说明 * 更新 build 配置 * 去除 /api/info 及 /api/spec 相关接口实现
Merged
Merged
fengmk2
pushed a commit
that referenced
this issue
Jun 7, 2024
> 目前已请求全量 manifest 元信息 #46,可以直接使用 readme 字段 * 优先读取 package.json 中的 readme 信息 * 针对 cnpm/cnpmcore#695 添加报错信息展示 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced `ReadmeContent` component to accept and display custom content. - Improved `useReadme` hook to fetch README content more flexibly with an additional `content` parameter. - Added error handling in directory fetching for better reliability. - **Bug Fixes** - Ensured proper error handling in the `useDirs` function to prevent crashes. - **Refactor** - Updated `PackageManifest` type to include a `readme` field for better data consistency. - **UI Improvements** - Added conditional error messages in the file directory view to inform users of issues. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题报告与改动方案
🖼️ 背景
最初,我们计划使用 Next.js 的 Server Side Rendering (SSR) 和 React Server Components (RSC) 来提高我们网站首页的首屏渲染性能。
然而,在实际应用过程中,我们面临了一些挑战。在国内,使用 Vercel 托管的访问速度不尽如人意. 🐌 同时,在使用 阿里云函数计算(Function Compute,FC) 时,我们注意到 Time to First Byte (TTFB) 较高,需要数秒的延时. ⏳ 更进一步,通过 阿里云 Elastic Compute Service (ECS) 进行独立部署,使用 PM2 进行进程托管,但在实际应用过程中,我们多次遇到进程异常退出的问题. 🚧 由于 nextjs 默认没有导出清晰的日志和错误信息,很难进行排查。
改动方案
为了解决这些问题, 我们决定采用 Next.js 提供的
export
模式 并使用 Nginx 进行纯静态托管. 📦 这个改动方案有以下主要特点:📌 首页预渲染:我们会对首页进行预渲染, 以确保仍然能够提供出色的访问性能. 🏁
🛡️ 稳定性:通过纯静态托管和首页预渲染,在生产环境将不再启动 nextjs 提供接口服务,不再担心进程异常退出
影响:
a. ❌ 版本列表页校验功能:由于 NPM Registry 接口未提供跨域能力, 因此我们将无法实现版本列表页的自动校验功能.
b. 🌀 前端拉取完整清单:为了解决部分版本号较多的情况下的性能问题, 前端将需要提前拉取完整的清单. 这可能导致列表页在渲染之前出现轻微的卡顿. 🚦
nginx 配置实例
The text was updated successfully, but these errors were encountered: