Skip to content
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

Turbolinks 加速导航 #203

Open
LiuuY opened this issue May 7, 2020 · 1 comment
Open

Turbolinks 加速导航 #203

LiuuY opened this issue May 7, 2020 · 1 comment
Assignees
Labels
RFC Request for Comments

Comments

@LiuuY
Copy link
Collaborator

LiuuY commented May 7, 2020

现在顶部导航点击之后有点点缓慢,某种程度是因为点击之后 Angular Router 加载新的组件(包括 Lazy Import),但是由于网站已经使用了 SSG 来渲染了所有的导航页面,这就导致 Angular Router 重新加载的意义不大。

所以使用 <a> 标签直接跳转例如: <a href="/manual" />,但是这又导致重洗加载所有的库。

这里尝试使用 Turbolinks,来加载 <a>标签跳转的内容。

还有若干问题要解决,如:

  1. 虽然不需要重新加载库,但是 Angular 要重新 bootstrapModule,这也导致在 bootstrapModule 之前无法交互(由于 Angular 没有初始化),这反而又降低了速度😅。
  2. 导航选中颜色(似乎很简单解决)。
  3. development 时效果不好(由于没有 SSG)。

demo 在分支 turbolink-poc,需要 build SSG 后启动看效果。

yarn build; yarn scully;

归根结底好像没什么用🤦

@LiuuY LiuuY added the RFC Request for Comments label May 7, 2020
@LiuuY
Copy link
Collaborator Author

LiuuY commented May 16, 2020

TODO: use Quicklink, if it works.

@LiuuY LiuuY self-assigned this May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request for Comments
Projects
None yet
Development

No branches or pull requests

1 participant