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

feat: remove content loading and refine scroll behavior #1117

Merged
merged 5 commits into from
Dec 18, 2018

Conversation

ulivz
Copy link
Member

@ulivz ulivz commented Dec 18, 2018

Summary

contentLoading looks like a nice feature:

vuepress-contentloading

But it introduced some problems:

  1. Due to the asynchronous loading of Content, VuePress won't get the current anchor links after the page is loaded, so we are forced to create an event: "contentMounted", especially after combining vue-router's scrollBehavior, it greatly increases the complexity of our code and would take some weird behaviors.

    See: Plugins bottom of page do not seem to be working (noticable on https://vuepress.vuejs.org) #1113Inconsistent behavior when browsing pages #1016🐛 Fix #1011 anchor links not updating current URL #1014Regression in content rendering #895 etc.

  2. Since VuePress already has a good PWA experience and offline optimization, contentLoading is an unnecessary requirement in the case of faster network speeds or when it is already available offline.

  3. There are two strategies to handle route switching:

    1. When the user click a route link, we stay on the current page, and wait for the assets of the next page to be loaded before switching routes.
    2. contentLoading means you will be in the loading state right away.

    The two needs are fully inconsistent in themselves. Following the principle of simplicity, we still choose the former.

With this PR, we will eliminate the main potential issue of alpha and start thinking about entering the beta phase.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@ulivz ulivz changed the title feat: remove content loading feat: remove content loading and refine scroll behavior Dec 18, 2018
@ulivz ulivz merged commit 0a7d85b into master Dec 18, 2018
@ulivz ulivz deleted the remove-content-loading branch February 3, 2019 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant