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

fix(v2): window scrolling behavior #1452

Merged
merged 1 commit into from
May 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/docusaurus/src/client/PendingNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class PendingNavigation extends React.Component {
const {routes, delay = 1000} = this.props;

if (navigated) {
window.scrollTo(0, 0);

this.startProgressBar(delay);
// save the location so we can render the old screen
this.setState({
Expand All @@ -45,6 +43,7 @@ class PendingNavigation extends React.Component {
},
this.stopProgressBar,
);
window.scrollTo(0, 0);
})
.catch(e => console.warn(e));
}
Expand Down
11 changes: 4 additions & 7 deletions packages/docusaurus/src/webpack/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,10 @@ module.exports = function createBaseConfig(props, isServer) {
{
test: /\.jsx?$/,
exclude(modulePath) {
// always transpile our own library
if (modulePath.startsWith(path.join(__dirname, '..'))) {
return false;
}

// Don't transpile node_modules
return /node_modules/.test(modulePath);
// Don't transpile node_modules except any docusaurus package
return (
/node_modules/.test(modulePath) && !/docusaurus/.test(modulePath)
);
},
use: [
cacheLoader && getCacheLoader(isServer),
Expand Down
3 changes: 1 addition & 2 deletions website-1.x/blog/2018-09-11-Towards-Docusaurus-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ There is a saying that the very best software is constantly evolving, and the ve

It all started with this [RFC issue](https://github.com/facebook/Docusaurus/issues/789) opened by [Yangshun](https://github.com/yangshun) towards the end of June 2018.

<blockquote class="embedly-card"><h4><a href="https://github.com/facebook/Docusaurus/issues/789">[RFC] Docusaurus v2 · Issue #789 · facebook/Docusaurus</a></h4><p>These are some of the problems I'm seeing in Docusaurus now and also how we can address them in v2. A number of the ideas here were inspired by VuePress and other static site generators. In the current static site generators ecosystem, t...</p></blockquote>
<blockquote><h4><a href="https://github.com/facebook/Docusaurus/issues/789">[RFC] Docusaurus v2 · Issue #789 · facebook/Docusaurus</a></h4><p>These are some of the problems I'm seeing in Docusaurus now and also how we can address them in v2. A number of the ideas here were inspired by VuePress and other static site generators. In the current static site generators ecosystem, t...</p></blockquote>

Most of the suggested improvements are mentioned in the issue; I will provide details on some of issues in Docusaurus 1 and how we are going to address them in Docusaurus 2.

Expand Down Expand Up @@ -132,4 +132,3 @@ If you are using Docusaurus, you are part of our community; keep letting us know

Lastly, if you haven't done so already, click the **star** and **watch** button on [GitHub](https://github.com/facebook/Docusaurus), and follow us on [Twitter](https://twitter.com/docusaurus).

<script async src="//cdn.embedly.com/widgets/platform.js" charset="UTF-8"></script>