-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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): page engine #33067
feat(gatsby): page engine #33067
Conversation
@@ -0,0 +1,153 @@ | |||
import * as path from "path" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted to separate module from packages/gatsby/src/utils/worker/child/render-html.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify - we need to have it as a separate module because we re-use it later in bundle-webpack, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, possibly we could revert this split because we don't use it in engine itself. But it's still beneficial because we don't have to load more things from workers code than needed (child/render-html.ts
is not loaded by main process, just by html/pqr worker processes)
@@ -0,0 +1,50 @@ | |||
import { IGatsbyPage } from "../redux/types" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted to separate module from packages/gatsby/src/utils/page-data.ts
+ addition of getPagePathFromPageDataPath
to reverse /page-data/<page-path>/page-data.json
to <page-path>
@@ -0,0 +1,89 @@ | |||
import fs from "fs-extra" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted to separate module from packages/gatsby/src/utils/worker/child/render-html.ts
Co-authored-by: Vladimir Razuvaev <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Co-authored-by: Vladimir Razuvaev <[email protected]>
Co-authored-by: Vladimir Razuvaev <[email protected]>
* feat(gatsby): page engine * extract page-data helpers used in page engine to separate module, to not bundle unneeded pieces * fix develop * update page engine webpack config similarly as done in graphql engine * Update packages/gatsby/src/utils/page-ssr-module/bundle-webpack.ts Co-authored-by: Vladimir Razuvaev <[email protected]> * Update packages/gatsby/src/utils/page-data-helpers.ts Co-authored-by: Vladimir Razuvaev <[email protected]> * Update packages/gatsby/src/utils/page-data-helpers.ts Co-authored-by: Vladimir Razuvaev <[email protected]> Co-authored-by: Vladimir Razuvaev <[email protected]>
I suggest to use "Hide whitespace changes" in diff viewer - https://github.com/gatsbyjs/gatsby/pull/33067/files?diff=unified&w=1
Building on top of GraphQL Engine introduced in #33030
Description
This adds generation of "page engine" - importable standalone module that allows generation of page-data and html content. It uses "query engine" (introduced in #33030 ) under the hood.
Example usage (after initial
gatsby build
):[ch37670]
Fixes #32892