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: reload siteConfig.js automatically when locally served page is refreshed #1509

Merged
merged 3 commits into from May 22, 2019

Conversation

endiliey
Copy link
Contributor

@endiliey endiliey commented May 22, 2019

Motivation

An attempt to reduce number of siteconfig require calls on Docusaurus 1. In effect, this made siteConfig.js become reloaded automatically. (Finally we can live reload siteconfig)

Others:

  • The typescript migration unintentionally disabled the v1 test running on CI

This should Fix #267 #1508

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

See the gif below, we can reload siteconfig now for pages, docs and blog
reload siteconfig

@endiliey endiliey requested a review from yangshun as a code owner May 22, 2019 15:18
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 22, 2019
@endiliey endiliey changed the title fix: livereload siteConfig fix: reload siteConfig.js automatically when locally served page is refreshed May 22, 2019
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented May 22, 2019

Deploy preview for docusaurus-2 ready!

Built with commit ef84f36

https://deploy-preview-1509--docusaurus-2.netlify.com

@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-preview ready!

Built with commit 535fe04

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

1 similar comment
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-preview ready!

Built with commit 535fe04

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

@@ -15,7 +15,8 @@ module.exports = {
testPathIgnorePatterns: [
'/node_modules/',
'__fixtures__',
'/packages/.*/lib',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise it is ignoring the tests on v1. My bad !!

@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-preview ready!

Built with commit 6d7818c

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

const React = require('react');
const path = require('path');
const fs = require('fs-extra');
const metadataUtils = require('./metadataUtils');
const {replaceAssetsLink} = require('./utils.js');
const {renderToStaticMarkupWithDoctype} = require('./renderUtils');
const loadConfig = require('./config');

const siteConfig = loadConfig(`${CWD}/siteConfig.js`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

less CWD calls >.<


const siteConfig = loadConfig(`${CWD}/siteConfig.js`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more cwd calls

@endiliey endiliey merged commit 166816a into master May 22, 2019
@endiliey endiliey deleted the reload-siteconfig branch May 22, 2019 15:31
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-preview ready!

Built with commit ef84f36

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

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.

Reload siteConfig.js automatically when locally served page is refreshed
3 participants