Skip to content

Commit

Permalink
fix(v2): transpiling, window scroll and console error (facebook#1452)
Browse files Browse the repository at this point in the history
  • Loading branch information
endiliey authored and shakcho committed May 17, 2019
1 parent fb6c1fc commit 8c2b94e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
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>

0 comments on commit 8c2b94e

Please sign in to comment.