共 11 句 · 中英对照 · 对应本级 10 个目标词
开始练这一级 →Our small web app loaded slowly, and the worst part was what users saw above the fold.我们的小型网页应用加载很慢,最糟糕的是用户在「首屏可见区域」看到的内容。 The homepage stayed blank for two seconds before any text appeared.首页会空白两秒,之后才出现文字。
We shortened the critical rendering path so the first screen could paint sooner.我们缩短了「关键渲染路径」,让首屏能更快绘制出来。 Tree shaking removed code we never used and cut our bundle size.「摇树优化」移除了我们从未用到的代码,也减小了打包体积。 Code splitting and lazy loading kept the rest out of the first request.代码分割和懒加载把其余内容挡在了首次请求之外。
An accessibility review then found unlabeled buttons and text with poor contrast.一次「可访问性」检查发现,有些按钮没有标签,还有些文字对比度不足。 We made the layout responsive, so one page works on a phone and a wide monitor.我们把布局做成了「响应式」,于是一个页面既能用在手机上,也能用在宽屏显示器上。 Our old menu library was deprecated, so we replaced it with a small component.我们旧的菜单库已经「废弃」,于是换成了一个很小的组件。
The rewrite changed hydration: we send less state from the server and keep the rest in reactive state management, which cut extra re-renders.这次重写还改变了「注水」方式:服务端只发送更少的状态,剩下的状态放在客户端的「响应式状态管理」里,这减少了很多额外的重渲染。 Careful serialization of that state stopped the page from breaking when data arrived late.对这些状态小心地做「序列化」,避免了数据晚到时页面崩溃。 The lesson was simple: fix the first screen first and treat speed and accessibility as one job.教训很简单:先修好首屏,并且把速度和「可访问性」当成同一件事。
数据来源:NGSL(CC BY-SA 4.0)· ECDICT(MIT License)。短文为本项目为练习编写的配套材料。