-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Move index to app router #2224
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
base: source
Are you sure you want to change the base?
Move index to app router #2224
Changes from all commits
f617321
2500832
4199c7d
5452719
40e63a0
43a75c4
80101db
45b28a8
bdef66b
9fc5cca
a93a6cf
ea469ac
2e875e2
ded9a28
8991a7f
311c9e1
cac7ed5
9de72c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,19 @@ | ||
| // @ts-expect-error: we want to import the same version as Nextra for the main page | ||
| import { ThemeProvider } from "next-themes" | ||
| import { ReactElement, ReactNode } from "react" | ||
|
|
||
| import { Footer } from "../../components/footer" | ||
| import { NewFontsStyleTag } from "../fonts" | ||
| import { Navbar } from "../../components/navbar/navbar" | ||
| import { topLevelNavbarItems } from "../../components/navbar/top-level-items" | ||
| import { MenuProvider } from "./menu-provider" | ||
| import { Footer } from "@/components/footer" | ||
| import { Navbar } from "@/components/navbar/navbar" | ||
| import { topLevelNavbarItems } from "@/components/navbar/top-level-items" | ||
|
|
||
| export default function MainLayout({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode | ||
| }) { | ||
| children: ReactNode | ||
| }): ReactElement { | ||
| return ( | ||
| <> | ||
| <NewFontsStyleTag /> | ||
| <ThemeProvider attribute="class"> | ||
| <MenuProvider> | ||
| <Navbar items={topLevelNavbarItems} /> | ||
| <div className="isolate bg-neu-0 text-neu-900 antialiased"> | ||
| {children} | ||
| </div> | ||
| <Footer /> | ||
| </MenuProvider> | ||
| </ThemeProvider> | ||
| <Navbar items={topLevelNavbarItems} /> | ||
| {children} | ||
| <Footer /> | ||
| </> | ||
| ) | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||||
| import type { Metadata } from "next" | ||||||||
| import { IndexPage } from "../../components/index-page" | ||||||||
|
|
||||||||
| export const metadata: Metadata = { | ||||||||
| title: "GraphQL | A query language for your API", | ||||||||
jonathanawesome marked this conversation as resolved.
Show resolved
Hide resolved
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh I just noticed you already removed it from the index page, nice here it is
Suggested change
|
||||||||
| } | ||||||||
|
|
||||||||
| export default function Page() { | ||||||||
| return <IndexPage /> | ||||||||
hasparus marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,8 +115,7 @@ export function TestimonialAuthor({ | |
| width={128} | ||
| height={128} | ||
| className="size-16 saturate-[.1] dark:opacity-90 xl:size-32" | ||
| // @ts-expect-error React doesn't know it exists yet, but @types/react do | ||
| fetchpriority="low" | ||
| fetchPriority="low" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you bump the React version? so... if it's not lowercase and React doesn't know about it, will it still get passed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| loading="lazy" | ||
| /> | ||
| <div className="absolute inset-0 z-[1] bg-pri-darker opacity-80 mix-blend-plus-lighter dark:mix-blend-color" /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,13 +2,13 @@ import { ReactElement, ReactNode } from "react" | |
| import { Metadata } from "next" | ||
|
|
||
| import { NewFontsStyleTag } from "../../fonts" | ||
| import "../../colors.css" | ||
|
|
||
| import "@/app/colors.css" | ||
| import "./conf.css" | ||
|
|
||
| import { Navbar } from "./components/navbar" | ||
| import { Footer } from "./components/footer" | ||
|
|
||
| // @ts-expect-error: we want to import the same version as Nextra for the main page | ||
| import { ThemeProvider } from "next-themes" | ||
| import { GraphQLConfLogoLink } from "./components/graphql-conf-logo-link" | ||
| import { GALLERY_LINK } from "./links" | ||
|
|
||
|
|
@@ -52,9 +52,7 @@ export default function Layout({ | |
| { children: "FAQ", href: "/conf/2025/#faq" }, | ||
| ]} | ||
| /> | ||
| <ThemeProvider attribute="class"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This means the old conference websites are now inside of We should look through them. I don't think they relied on
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, i certainly seem to have bungled this bit...I had a feeling there was something about these different theme strategies I was missing. That said, take a look at the live conf/2024...this is broken already. |
||
| <div className="bg-neu-0 text-neu-900 antialiased">{children}</div> | ||
| </ThemeProvider> | ||
| <div className="bg-neu-0 text-neu-900 antialiased">{children}</div> | ||
| <Footer | ||
| logo={<GraphQLConfLogoLink year={2025} />} | ||
| links={[ | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,15 @@ | ||||||||||
| import { ReactElement, ReactNode } from "react" | ||||||||||
| import { Metadata } from "next" | ||||||||||
| import type { Metadata } from "next" | ||||||||||
| import GoogleAnalytics from "@/app/ga" | ||||||||||
|
|
||||||||||
| import "../conf.css" | ||||||||||
| import "../globals.css" | ||||||||||
| // @ts-expect-error: we want to import the same version as Nextra for the main page | ||||||||||
| import { ThemeProvider } from "next-themes" | ||||||||||
|
|
||||||||||
| import { NewFontsStyleTag } from "./fonts" | ||||||||||
| import { MenuProvider } from "./(main)/menu-provider" | ||||||||||
|
|
||||||||||
| import "@/globals.css" | ||||||||||
| import "@/app/colors.css" | ||||||||||
|
|
||||||||||
| export const metadata: Metadata = { | ||||||||||
| twitter: { | ||||||||||
|
|
@@ -36,7 +42,14 @@ export default function RootLayout({ | |||||||||
| </head> | ||||||||||
| <body className="bg-neu-0"> | ||||||||||
| <GoogleAnalytics /> | ||||||||||
| {children} | ||||||||||
| <NewFontsStyleTag /> | ||||||||||
| <ThemeProvider attribute="class"> | ||||||||||
| <MenuProvider> | ||||||||||
| <div className="isolate bg-neu-0 text-neu-900 antialiased"> | ||||||||||
| {children} | ||||||||||
| </div> | ||||||||||
|
Comment on lines
+48
to
+50
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's move it back to where it was as a sibling of footer and navbar.
Suggested change
|
||||||||||
| </MenuProvider> | ||||||||||
| </ThemeProvider> | ||||||||||
| </body> | ||||||||||
| </html> | ||||||||||
| ) | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,14 +3,14 @@ | |
| import { usePathname } from "next/navigation" | ||
| import { useMounted } from "nextra/hooks" | ||
|
|
||
| import { Footer } from "@/components/footer" | ||
| import { Navbar } from "@/components/navbar/navbar" | ||
| import { topLevelNavbarItems } from "@/components/navbar/top-level-items" | ||
|
|
||
| import { StripesDecoration } from "@/app/conf/_design-system/stripes-decoration" | ||
| import stripesMask from "@/components/404-page/image.webp" | ||
|
|
||
| import { Button } from "./conf/_design-system/button" | ||
| import MainLayout from "./(main)/layout" | ||
|
|
||
| import "@/globals.css" | ||
| import "@/app/colors.css" | ||
|
|
||
| export default function NotFoundPage() { | ||
| const pathname = usePathname() | ||
|
|
@@ -31,7 +31,16 @@ export default function NotFoundPage() { | |
| }/issues/new?title=${encodeURIComponent(title)}&labels=${labels}` | ||
|
|
||
| return ( | ||
| <MainLayout> | ||
| <> | ||
| {/* | ||
| No support for metadata in not-found.tsx yet | ||
| https://github.com/vercel/next.js/pull/47328#issuecomment-1488891093 | ||
| */} | ||
| <title> | ||
| Not Found | Please click the button to file a broken-link issue if this | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| should be a valid route. | ||
| </title> | ||
| <Navbar items={topLevelNavbarItems} /> | ||
| <style>{".nextra-nav-container.sticky { position: fixed }"}</style> | ||
| <div className="relative"> | ||
| <Stripes /> | ||
|
|
@@ -48,7 +57,8 @@ export default function NotFoundPage() { | |
| </div> | ||
| </div> | ||
| </div> | ||
| </MainLayout> | ||
| <Footer /> | ||
| </> | ||
| ) | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,7 +25,12 @@ export function BlogTags({ | |||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| const tagElement = ( | ||||||||||||||||||||||||
| <Tag className={opaque ? "bg-neu-0" : ""} color={color}> | ||||||||||||||||||||||||
| // conditionally add a key here to avoid react list key errors | ||||||||||||||||||||||||
| <Tag | ||||||||||||||||||||||||
| key={!links ? tag : undefined} | ||||||||||||||||||||||||
| className={opaque ? "bg-neu-0" : ""} | ||||||||||||||||||||||||
| color={color} | ||||||||||||||||||||||||
| > | ||||||||||||||||||||||||
|
Comment on lines
+28
to
+33
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh I can't believe I missed that mby we could shorten it and add the tag unconditionally it's the only child so even if it was a long string React won't spend a lot of time comparing it
Suggested change
|
||||||||||||||||||||||||
| {tag.replaceAll("-", " ")} | ||||||||||||||||||||||||
| </Tag> | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| "use client" | ||
|
|
||
| import { useEffect, useRef } from "react" | ||
| import { Code } from "nextra/components" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| import Head from "next/head" | ||
|
|
||
| import { Hero } from "./hero" | ||
| import { TrustedBy } from "./trusted-by" | ||
| import { HowItWorks } from "./how-it-works" | ||
|
|
@@ -16,13 +14,6 @@ import { UseCases } from "./use-cases" | |
| export function IndexPage() { | ||
| return ( | ||
| <div className="gql-all-anchors-focusable bg-neu-0"> | ||
| <Head> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh nice, I see you removed it already, lemme write a suggestion to add it to |
||
| <meta | ||
| name="description" | ||
| content="GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data." | ||
| /> | ||
| </Head> | ||
|
|
||
| <Hero /> | ||
| <TrustedBy /> | ||
| <WhatIsGraphQL /> | ||
|
|
@@ -35,7 +26,6 @@ export function IndexPage() { | |
| <UseCases /> | ||
| <QuotesFromTheIndustry /> | ||
| <JoinTheCommunity /> | ||
| <style>{".nextra-nav-container.sticky { position: fixed }"}</style> | ||
| </div> | ||
| ) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| "use client" | ||
|
|
||
| import clsx from "clsx" | ||
| import { | ||
| ComponentPropsWithoutRef, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| description: How to apply to be a GraphQL Ambassador | ||
| --- | ||
|
|
||
| import { Button } from "../../../app/conf/_components/button" | ||
| import { Button } from "@/app/conf/_components/button" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WDYT about adding https://github.com/dword-design/eslint-plugin-import-alias... or actually https://github.com/steelsojka/eslint-import-alias because it's configurable but we'd have to fix the Windows bug. Ideally I'd like it to match |
||
| import { Steps } from 'nextra/components' | ||
|
|
||
| # Become a GraphQL Ambassador | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ import "leaflet/dist/leaflet.css" | |
| import { meetups } from "../../components/meetups" | ||
| import { events, EventCard } from "../../components/events" | ||
| import pinkCircle from "./pink-circle.svg" | ||
| import { Button } from '../../app/conf/_design-system/button' | ||
| import { Button } from '@/app/conf/_design-system/button' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I postponed doing this, but in a separate PR we should lift It's like this because I did the conf website first, so I worked only in the |
||
|
|
||
|
|
||
| export const { pastEvents, upcomingEvents } = events.reduce( | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems you lifted
.isolateby accident.We can try to remove
bg-neu-0 text-neu-900classes if add them to body styles and test the old conference pages, butisolatewas there to avoid fighting the z-index (we portal modals outside).