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

feat(gatsby): decouple html activities #28648

Merged
merged 1 commit into from
Dec 16, 2020

Conversation

wardpeet
Copy link
Contributor

Description

Decouple html ssr bundling from rendering pages to get better metrics on where html rendering is slow.
image

Documentation

Related Issues

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 16, 2020
if (stage !== `develop-html`) {
await deleteRenderer(rendererPath)
}
await deleteRenderer(rendererPath)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now done inside start-server

@wardpeet wardpeet added topic: SSG* type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Dec 16, 2020
@@ -495,7 +495,7 @@ module.exports = {
// Let renderDevHTML figure it out.
page: undefined,
store,
htmlComponentRendererPath: `${program.directory}/public/render-page.js`,
htmlComponentRendererPath: pageRenderer,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think pageRenderer will be undefined here for the else codepath on lines 147-153:

 let pageRenderer: string
  if (process.env.GATSBY_EXPERIMENTAL_DEV_SSR) {
    // ...
    pageRenderer = await buildRenderer(program, Stage.DevelopHTML)
    // ...
  } else {
    // we don't set `pageRenderer` value in this codepath

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be in the same process.env.GATSBY_EXPERIMENTAL_DEV_SSR, right? I've tested it and didn't have an issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, true. Didn't see the this if. Still surprised TS doesn't complain about this. But it's probably because renderDevHTML is not fully typed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point 😂

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.

Looks good to me, thanks! 👍

@wardpeet wardpeet merged commit 140d123 into gatsbyjs:master Dec 16, 2020
@wardpeet wardpeet deleted the feat/decouple-html-activities branch December 16, 2020 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants