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

chore(dev-ssr): don't dispatch CREATE_SERVER_VISITED_PAGE if component is already tracked #28725

Merged
merged 1 commit into from
Dec 21, 2020

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Dec 21, 2020

if (process.env.GATSBY_EXPERIMENTAL_DEV_SSR) {
/**
* Start listening to CREATE_SERVER_VISITED_PAGE events so we can rewrite
* files as required
*/
emitter.on(`CREATE_SERVER_VISITED_PAGE`, (): void => {
reporter.pendingActivity({ id: `requires-writer` })
debouncedWriteAll()
})
}
will uncodindionally run requires-writer on CREATE_SERVER_VISITED_PAGE actions. Let's skip emitting those actions that will be functionally no-ops (but still cause some extra work)

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 21, 2020
@pieh pieh added topic: ssr and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Dec 21, 2020
Copy link
Contributor

@vladar vladar left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Contributor

@KyleAMathews KyleAMathews left a comment

Choose a reason for hiding this comment

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

👍

@pieh pieh merged commit 76a3b57 into master Dec 21, 2020
@pieh pieh deleted the dev-ssr/skip-running-requires-writer-on-every-request branch December 21, 2020 14:55
@LekoArts LekoArts added the topic: DX Developer Experience (e.g. Fast Refresh, i18n, SSR, page creation, starters) label May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: DX Developer Experience (e.g. Fast Refresh, i18n, SSR, page creation, starters)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants