Skip to content

Fix layout #454

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
merged 8 commits into from
Feb 11, 2025
Merged

Fix layout #454

merged 8 commits into from
Feb 11, 2025

Conversation

karelhala
Copy link
Contributor

@karelhala karelhala commented Feb 7, 2025

Description

Since we moved to Next.js we have to adjust the loading of navigation and footer. We can utilize HTML partials on developers site to load both content and JS files.

@karelhala karelhala requested a review from a team February 7, 2025 16:46
useEffect(() => {
const fetchPartials = async () => {
const headerResponse = await fetch(`/api/chrome/rh-universal-nav-header`);
const footerResponse = await fetch(`/api/chrome/rh-unified-footer`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you fetch the header and footer in parallel instead of sequentially ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing

@@ -32,7 +32,8 @@
})();
</script>
<script>
(function (env) {
(function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we still using this file? for development perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is loaded before the javascript kicks in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is not used. The JS does not have to kick in, the site is statically generated. Next.js creates ints own index file unless the server ins misconfigured.


location /remote {
rewrite ^/remote/(.*)$ /$1 break;
proxy_pass https://developers.redhat.com;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is any of this still required?
It looks like we moved away from nginx loading to loading it from the frontend

Copy link
Contributor

@Hyperkid123 Hyperkid123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good as a hotfix. But has to be properly fixed in a follow up.

@@ -32,7 +32,8 @@
})();
</script>
<script>
(function (env) {
(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is not used. The JS does not have to kick in, the site is statically generated. Next.js creates ints own index file unless the server ins misconfigured.


export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const [header, setHeader] = useState<string | undefined>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to fix this using actual web components. This is bad. Unless the header and footer are not web components but ESI. In which case we are done for.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK they are ESI tags. There's webcomponent for these partials, but they are missing the content.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😿

@karelhala karelhala merged commit 15419ee into RedHatInsights:main Feb 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants