-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #931 from 3YOURMIND/fix-ssr-hiccup
fix(SSR): explicitly load KtNavbar as a component
- Loading branch information
Showing
4 changed files
with
38 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# What happened to make this test necessary? | ||
# | ||
# Beginning of June 2024 the documentation page had a peculiar bug: The main Navbar did not render. | ||
# | ||
# What was the cause of that bug? | ||
# | ||
# The bug was traced down to a change (that seemed entirely unrelated) in documentation/components/NavBar.vue | ||
# Closer investigation yielded that this change had an unintended effect on how nuxt is resolving imports | ||
# when it is rendering/hydrating components. | ||
# | ||
# How was this solved | ||
# | ||
# The fix was to make nuxt explictly resolve the component during SSR. This causes the following change to | ||
# index.html that is generated by `nuxt generate`: | ||
# | ||
# - <ktnavbar class="kt-navbar">...</ktnavbar> <!-- Will be hydrated client side --> | ||
# | ||
# + <nav class="kt-navbar">...</nav> <!-- pre-rendered server-side --> | ||
# | ||
# Why this test? | ||
# | ||
# Since this was impossible to foresee and would likely slip through a code review in a possible future scenario | ||
# this is a very basic sanity test to at least catch the very same scenario. | ||
|
||
if grep '</ktnavbar>' ./dist/index.html; | ||
then echo "The output of nuxt contains a 'ktnavbar' tag, this might be the result of a strange SSR bug" && false; | ||
else true; | ||
fi |
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