Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix(hybrid-output): no matched route when using
getStaticPaths
(#7150)
* `isPrenderDefault` ---> `isPrerenderDefault` * test: add test fixture * test: add hybrid getStaticPaths tests * try fix in ci * bring back edit lost on merge conflict fix * back static paths guard * move function to new file to avoid bundling issues * remove unsued import * debugging cleanup * chore: update fixture's package.json * cleanup test * small test refactoring * `status.ts` --> `metadata.ts` * smol refactor * chore: changeset * just return the prerender metadata * refactor tests * chore: update lock file
- Loading branch information
1 parent
0616ef2
commit 8f418d1
Showing
12 changed files
with
318 additions
and
120 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
fix no matched path when using `getStaticPaths` without `prerender` export. |
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
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,22 @@ | ||
import type { ModuleInfo, ModuleLoader } from '../core/module-loader'; | ||
import { viteID } from '../core/util.js'; | ||
|
||
type GetPrerenderStatusParams = { | ||
filePath: URL; | ||
loader: ModuleLoader; | ||
}; | ||
|
||
export function getPrerenderStatus({ | ||
filePath, | ||
loader, | ||
}: GetPrerenderStatusParams): boolean | undefined { | ||
const fileID = viteID(filePath); | ||
const moduleInfo = loader.getModuleInfo(fileID); | ||
if (!moduleInfo) return; | ||
const prerenderStatus = getPrerenderMetadata(moduleInfo); | ||
return prerenderStatus; | ||
} | ||
|
||
export function getPrerenderMetadata(moduleInfo: ModuleInfo) { | ||
return moduleInfo?.meta?.astro?.pageOptions?.prerender; | ||
} |
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
Oops, something went wrong.