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

misc(v2): better dx: yarn clear, yarn watch, yarn serve #2922

Merged
merged 7 commits into from
Jun 16, 2020

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Jun 11, 2020

  • yarn clean: cleanup of useful folders (ts incremental build, babel cache, /lib...)

  • yarn watch: start incremental TS compiltation in --watch mode over the whole project

  • yarn serve: use serve to serve a production build of the project

I tried to create a watchPlugin on the website, because I don't like constantly restarting the site, but I don't think it's possible to live-update the plugins' code at runtime :(


The watch mode, even without hot code reload, could be useful. We could watch all packages, and only need to run yarn start:v2 to restart the site, instead of yarn start that will recompile each package. The developer feedback would be faster.

@slorber slorber requested a review from yangshun as a code owner June 11, 2020 15:51
@slorber slorber requested a review from lex111 June 11, 2020 15:51
@slorber slorber changed the title Better dx: yarn clear, yarn watch Better dx: yarn clear, yarn watch, yarn serve Jun 11, 2020
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 11, 2020
@slorber
Copy link
Collaborator Author

slorber commented Jun 11, 2020

@yangshun @lex111 what do you think of including docusaurus clear and docusaurus serve commands?

I think it could be useful for other users as well.

package.json Show resolved Hide resolved
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Jun 11, 2020

Deploy preview for docusaurus-2 ready!

Built with commit 5df2fbf

https://deploy-preview-2922--docusaurus-2.netlify.app

website/watchPlugin.js Outdated Show resolved Hide resolved
website/watchPlugin.js Outdated Show resolved Hide resolved
website/watchPlugin.js Outdated Show resolved Hide resolved
website/watchPlugin.js Outdated Show resolved Hide resolved
@yangshun yangshun changed the title Better dx: yarn clear, yarn watch, yarn serve misc(v2): better dx: yarn clear, yarn watch, yarn serve Jun 12, 2020
@slorber
Copy link
Collaborator Author

slorber commented Jun 12, 2020

@yangshun I think it's complicated to hot reload the D2 code, tried to hack a bit with nodejs child processes / spawn etc but it's not easy.

Found a solution to automatically restart the server. It's probably not the fastest DX we could get as each restart takes a few seconds, but it's still better than current DX and is a tiny change so could do the job for now:

    "start:v2:watch": "nodemon --watch \"./packages/*/lib/**/*.*\" --exec \"yarn start:v2\"",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants