-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gatsby): enable SSR mode in develop & serve (#32896)
* feat(gatsby): page engine * add remove-api babel plugin * extract page-data helpers used in page engine to separate module, to not bundle unneeded pieces * enable mode SSR and getServerdata on develop and serve * fix yarn.lock * fix double build * fix develop * update page engine webpack config similarly as done in graphql engine * initial * re-add some packages * remove unused file * revert some renderHTML changes * regen yarn.lock * fixup missing non webpack require type * fixup types Co-authored-by: Michal Piechowiak <[email protected]> Co-authored-by: LekoArts <[email protected]>
- Loading branch information
1 parent
7461c7a
commit bdf42c9
Showing
27 changed files
with
587 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const ROUTES_DIRECTORY = `.cache/page-ssr/routes` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/arrow-fn/input.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
export default function () { | ||
return "test" | ||
} | ||
|
||
export const getServerData = () => { | ||
return { | ||
props: {} | ||
|
||
} | ||
} | ||
|
||
export const config = async () => { | ||
return { | ||
pageContext: { | ||
env: 'test' | ||
}, | ||
} | ||
} | ||
|
||
|
||
export const anotherFunction = () => { | ||
return "test" | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/arrow-fn/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default function () { | ||
return "test"; | ||
} | ||
export const anotherFunction = () => { | ||
return "test"; | ||
}; |
30 changes: 30 additions & 0 deletions
30
packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/combined-export/input.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
export default function () { | ||
return "test" | ||
} | ||
|
||
function getServerData() { | ||
return { | ||
props: {} | ||
|
||
} | ||
} | ||
|
||
|
||
async function pageConfig() { | ||
return { | ||
pageContext: { | ||
env: 'test' | ||
}, | ||
} | ||
} | ||
|
||
function anotherFunction() { | ||
return "test" | ||
} | ||
|
||
export { | ||
getServerData, | ||
pageConfig as config, | ||
anotherFunction | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/combined-export/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default function () { | ||
return "test"; | ||
} | ||
|
||
function anotherFunction() { | ||
return "test"; | ||
} | ||
|
||
export { anotherFunction }; |
23 changes: 23 additions & 0 deletions
23
packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/function/input.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
export default function () { | ||
return "test" | ||
} | ||
|
||
export function getServerData() { | ||
return { | ||
props: {} | ||
|
||
} | ||
} | ||
|
||
export async function config() { | ||
return { | ||
pageContext: { | ||
env: 'test' | ||
}, | ||
} | ||
} | ||
|
||
export function anotherFunction() { | ||
return "test" | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/function/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default function () { | ||
return "test"; | ||
} | ||
export function anotherFunction() { | ||
return "test"; | ||
} |
Oops, something went wrong.