Skip to content

fix(v2): use fswatch instead of timeout polling to wait for client manifest#1389

Merged
yangshun merged 3 commits intofacebook:masterfrom
endiliey:webpack-wait
Apr 24, 2019
Merged

fix(v2): use fswatch instead of timeout polling to wait for client manifest#1389
yangshun merged 3 commits intofacebook:masterfrom
endiliey:webpack-wait

Conversation

@endiliey
Copy link
Contributor

Motivation

Optimize implementation of WaitPlugin. It is better to use fs event system to wait for a file rather than using hacky polling timeout implementation with a timeout. Also, no need to wait for chunk-map.json because it is 100% guaranteed that client-manifest.json will be generated after chunk-map.json in client. So if manifest exist, chunk map will exist.

This is an attempt to fix error due to timeout like below

> docs@ build ROOT/uniforms-2/website
> docusaurus build

Creating an optimized production build...

Compiling

● Client █████████████████████████ chunk asset optimization (92%) TerserPlugin 
 

● Server █████████████████████████ building (70%) 107/107 modules 0 active
 

ROOT/uniforms-2/website/node_modules/@docusaurus/core/lib/webpack/plugins/WaitPlugin.js:34
          throw Error("Maybe it just wasn't meant to be.");
          ^

Error: Maybe it just wasn't meant to be.
    at Timeout.poll [as _onTimeout] (ROOT/uniforms-2/website/node_modules/@docusaurus/core/lib/webpack/plugins/WaitPlugin.js:34:17)
    at listOnTimeout (timers.js:327:15)
    at processTimers (timers.js:271:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! docs@ build: `docusaurus build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the docs@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     HOME/.npm/_logs/2019-04-24T07_07_05_219Z-debug.log

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Production build still works
success

@endiliey endiliey requested a review from yangshun as a code owner April 24, 2019 14:35
@endiliey
Copy link
Contributor Author

endiliey commented Apr 24, 2019

Deploy preview for docusaurus-preview ready!

Built with commit 2dc7d6b

https://deploy-preview-1389--docusaurus-preview.netlify.com

@endiliey
Copy link
Contributor Author

endiliey commented Apr 24, 2019

Deploy preview for docusaurus-2 failed.

Built with commit 2dc7d6b

https://app.netlify.com/sites/docusaurus-2/deploys/5cc07df18c4c1a000825989f

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 24, 2019
@endiliey
Copy link
Contributor Author

It seems that the netlify fails due to netlify problem

People ranting on twitter
image

@endiliey endiliey added the status: don't merge yet This PR is completed, but we are still waiting for other things to be ready. label Apr 24, 2019
@endiliey endiliey changed the title fix(v2): use fswatch instead of timeout polling to wait for client manifest WIP - fix(v2): use fswatch instead of timeout polling to wait for client manifest Apr 24, 2019
@endiliey endiliey changed the title WIP - fix(v2): use fswatch instead of timeout polling to wait for client manifest fix(v2): use fswatch instead of timeout polling to wait for client manifest Apr 24, 2019
@endiliey endiliey removed the status: don't merge yet This PR is completed, but we are still waiting for other things to be ready. label Apr 24, 2019
@yangshun yangshun merged commit d2181e3 into facebook:master Apr 24, 2019
yangshun pushed a commit that referenced this pull request Apr 24, 2019
* fix(v2): fix hash-link css

* fix(v2): use fswatch instead of timeout polling to wait for client manifest (#1389)

* fix(v2): use chokidar/fswatch instead of polling w timeout to wait client-manifest

* refactor -> less code

* DRY code

* Update styles.css

* fix(v2): toggle hash-link opacity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants