-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: not all pages are pre-rendered #5475
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
Merged
+251
−24
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
dd5f473
fix: pre-rendering all static pages
FatahChan 4037b04
fix: build test
FatahChan 19f4746
debugging
FatahChan 55f0a97
fix: update prerendering logic to use generator for static paths and …
FatahChan b6b4d04
fix: update prerenderPages to track prerendered pages instead of seen…
FatahChan 6fc92c9
feat: add dummy server scripts and update test commands for prerendering
FatahChan a38ed5c
docs: enhance static prerendering documentation with automatic route …
FatahChan 63b2305
ci: apply automated fixes
autofix-ci[bot] 08be4d7
fix: remove unnecessary logging of startConfig.pages in prerender fun…
FatahChan 1c50e2c
feat: implement prerenderRoutesPlugin
FatahChan 5be64ab
fix: rename redirectCount to maxRedirect and add warning
FatahChan d45f2df
ci: apply automated fixes
autofix-ci[bot] 3290ddd
chore: align naming maxRedirect
FatahChan 14c48ed
chore: Add fallback for empty discovery results.
FatahChan 779f9ad
ci: apply automated fixes
autofix-ci[bot] 32bda4a
feat: enhance prerendering configuration with automatic static paths …
FatahChan 6ac943c
ci: apply automated fixes
autofix-ci[bot] 76288e0
fix: handle undefined TSS_PRERENDABLE_PATHS in prerender function
FatahChan f6f1f12
ci: apply automated fixes
autofix-ci[bot] 9624ad1
fix: correct typo in prerendering error handling comment
FatahChan 969992c
fix: add missing comma in prerender configuration
FatahChan 9d691d3
fix: handle undefined headers in prerender options
FatahChan 9f8b48f
ci: apply automated fixes
autofix-ci[bot] 28c20fc
test: add test to e2e:basic instead of a new e2e
FatahChan aa3d962
ci: apply automated fixes
autofix-ci[bot] 1a47b76
fix: clarify automatic static route discovery and crawling links sect…
FatahChan 0617f8f
ci: apply automated fixes
autofix-ci[bot] 42a963c
fix: remove deprecated e2e/react-start/basic-prerendering dependencies
FatahChan c1ee33d
fix: restore lock file
FatahChan 616f4ff
fix: update static prerendering documentation for clarity and additio…
FatahChan 0ae2e67
fix: remove unnecessary --ui flag from prerender test command
FatahChan a3c8408
fix: clarify autoStaticPathsDiscovery behavior in static prerendering…
FatahChan 2653c87
fix: enable autoStaticPathsDiscovery and update Solid plugin imports …
FatahChan a9f3720
fix: improve clarity in static prerendering documentation regarding p…
FatahChan d5093c1
fix: add prerendering tests for static path discovery and content ver…
FatahChan 71334bc
fix: standardize maxRedirect option naming to maxRedirects across doc…
FatahChan 67888a6
fix: enforce minimum value for maxRedirects option in start plugin sc…
FatahChan 00a811c
fix tests
schiller-manuel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,53 @@ | ||
| import { existsSync, readFileSync } from 'node:fs' | ||
| import { join } from 'node:path' | ||
| import { expect } from '@playwright/test' | ||
| import { test } from '@tanstack/router-e2e-utils' | ||
| import { isPrerender } from './utils/isPrerender' | ||
|
|
||
| test.describe('Prerender Static Path Discovery', () => { | ||
| test.skip(!isPrerender, 'Skipping since not in prerender mode') | ||
| test.describe('Build Output Verification', () => { | ||
| test('should automatically discover and prerender static routes', () => { | ||
| // Check that static routes were automatically discovered and prerendered | ||
| const distDir = join(process.cwd(), 'dist', 'client') | ||
|
|
||
| // These static routes should be automatically discovered and prerendered | ||
| expect(existsSync(join(distDir, 'index.html'))).toBe(true) | ||
| expect(existsSync(join(distDir, 'posts/index.html'))).toBe(true) | ||
| expect(existsSync(join(distDir, 'users/index.html'))).toBe(true) | ||
| expect(existsSync(join(distDir, 'deferred/index.html'))).toBe(true) | ||
| expect(existsSync(join(distDir, 'scripts/index.html'))).toBe(true) | ||
| expect(existsSync(join(distDir, 'inline-scripts/index.html'))).toBe(true) | ||
| expect(existsSync(join(distDir, '대한민국/index.html'))).toBe(true) | ||
|
|
||
| // Pathless layouts should NOT be prerendered (they start with _) | ||
| expect(existsSync(join(distDir, '_layout', 'index.html'))).toBe(false) // /_layout | ||
|
|
||
| // API routes should NOT be prerendered | ||
|
|
||
| expect(existsSync(join(distDir, 'api', 'users', 'index.html'))).toBe( | ||
| false, | ||
| ) // /api/users | ||
| }) | ||
| }) | ||
|
|
||
| test.describe('Static Files Verification', () => { | ||
| test('should contain prerendered content in posts.html', () => { | ||
| const distDir = join(process.cwd(), 'dist', 'client') | ||
| expect(existsSync(join(distDir, 'posts/index.html'))).toBe(true) | ||
|
|
||
| // "Select a post." should be in the prerendered HTML | ||
| const html = readFileSync(join(distDir, 'posts/index.html'), 'utf-8') | ||
| expect(html).toContain('Select a post.') | ||
| }) | ||
|
|
||
| test('should contain prerendered content in users.html', () => { | ||
| const distDir = join(process.cwd(), 'dist', 'client') | ||
| expect(existsSync(join(distDir, 'users/index.html'))).toBe(true) | ||
|
|
||
| // "Select a user." should be in the prerendered HTML | ||
| const html = readFileSync(join(distDir, 'users/index.html'), 'utf-8') | ||
| expect(html).toContain('Select a user.') | ||
| }) | ||
| }) | ||
| }) |
This file contains hidden or 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 hidden or 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 isPrerender: boolean = process.env.MODE === 'prerender' |
This file contains hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.