generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for experimental WHS (#394)
* feat: Add support for experimental WHS Starting from [email protected], you can turn on the experimental `windowHistorySupport` flag to solve issues with prefetch links. There may be some optimisations to do since Next.js now also patches the history methods (and do so after nuqs), so it looks like there isn't a need for external sync anymore, but this first draft seems to work. Adding a few more CI cases to test for non-regression. * chore: Fix CI workflow * chore: Fix workflow name * chore: Only specify experimental when needed Helps with debugging * test: Fix compat for Next.js 14.0.1 and lower * chore: Shorter job names * chore: Fix basePath display * chore: Display next.js config * test: Test on raw canary but allow failures * test: Don't fail fast * chore: Allow all canaries to fail * chore: Add canary with basePath * chore: Actually test all with basePath * chore: De-flake repro-388 test It almost always passes in CI, but fails consistently locally. IT SHOULD FAIL!! * chore: Save Cypress artifacts on failure
- Loading branch information
Showing
12 changed files
with
216 additions
and
21 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 |
---|---|---|
@@ -1,6 +1,22 @@ | ||
const experimental = | ||
process.env.WINDOW_HISTORY_SUPPORT === 'true' | ||
? { | ||
windowHistorySupport: true | ||
} | ||
: undefined | ||
|
||
const basePath = | ||
process.env.BASE_PATH === '/' ? undefined : process.env.BASE_PATH | ||
|
||
/** @type {import('next').NextConfig } */ | ||
const config = { | ||
basePath: process.env.BASE_PATH === '/' ? undefined : process.env.BASE_PATH | ||
basePath, | ||
experimental | ||
} | ||
|
||
console.info(`Next.js config: | ||
basePath: ${basePath} | ||
windowHistorySupport: ${experimental?.windowHistorySupport ?? false} | ||
`) | ||
|
||
export default config |
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
Oops, something went wrong.