Pull Request Number: 4229
Title: fix: fix for next15 support
Base Branch: canary
Head Branch: fix/next15-using-react-create-element
Author: macci001
URL: https://github.com/nextui-org/nextui/pull/4229
State: CLOSED
Created At: 2024-12-05T18:47:27Z
Merged At: None
Participants: macci001, jrgarciadev
Description:
Closes #
📝 Description
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information
Commits:
- feat: nextjs 15 migration in progress\n- fix: fix for next15 support\n
Labels:
Comments:
- vercel: [vc]: #buCSiKeyvMUgkDHF4QMBGzzKwRzdq4LfeUiLMvom3aM=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJuZXh0dWktZG9jcy12MiIsInJvb3REaXJlY3RvcnkiOiJhcHBzL2RvY3MiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoiIn0sImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9uZXh0dWktb3JnL25leHR1aS1kb2NzLXYyL0hya3ZwN2E3U1lrckxRczdlaFNFcXM3NkY3SG8iLCJwcmV2aWV3VXJsIjoiIiwibmV4dENvbW1pdFN0YXR1cyI6IkZBSUxFRCJ9LHsibmFtZSI6Im5leHR1aS1zdG9yeWJvb2stdjIiLCJyb290RGlyZWN0b3J5IjoicGFja2FnZXMvc3Rvcnlib29rIiwibGl2ZUZlZWRiYWNrIjp7InJlc29sdmVkIjowLCJ1bnJlc29sdmVkIjowLCJ0b3RhbCI6MCwibGluayI6IiJ9LCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vbmV4dHVpLW9yZy9uZXh0dWktc3Rvcnlib29rLXYyL0FCWW1Tc2VkcXU1R2F0NGpRNEFwZThTVHAzNVUiLCJwcmV2aWV3VXJsIjoiIiwibmV4dENvbW1pdFN0YXR1cyI6IkZBSUxFRCJ9XX0=
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)
| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **nextui-docs-v2** | ❌ Failed ([Inspect](https://vercel.com/nextui-org/nextui-docs-v2/Hrkvp7a7SYkrLQs7ehSEqs76F7Ho)) | | | Dec 5, 2024 6:47pm |
| **nextui-storybook-v2** | ❌ Failed ([Inspect](https://vercel.com/nextui-org/nextui-storybook-v2/ABYmSsedqu5Gat4jQ4Ape8STp35U)) | | | Dec 5, 2024 6:47pm |
\n- changeset-bot: ### ⚠️ No Changeset found
Latest commit: 743e30e0847510d08f22e31e7944f0e6502664b2
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. **If these changes should result in a version bump, you need to add a changeset.**
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
[Click here if you're a maintainer who wants to add a changeset to this PR](https://github.com/nextui-org/nextui/new/fix/next15-using-react-create-element?filename=.changeset/new-bananas-trade.md&value=---%0A%22%40nextui-org%2Fautocomplete%22%3A%20patch%0A%22%40nextui-org%2Fdate-picker%22%3A%20patch%0A%22%40nextui-org%2Fnavbar%22%3A%20patch%0A%22%40nextui-org%2Fpopover%22%3A%20patch%0A%22%40nextui-org%2Fselect%22%3A%20patch%0A---%0A%0Afix%3A%20fix%20for%20next15%20support%0A)
\n- coderabbitai:
> [!IMPORTANT]
> ## Review skipped
>
> Draft detected.
>
> Please check the settings in the CodeRabbit UI or the `.coderabbit.yaml` file in this repository. To trigger a single review, invoke the `@coderabbitai review` command.
>
> You can disable this status message by setting the `reviews.review_status` to `false` in the CodeRabbit configuration file.
---
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
❤️ Share
- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
🪧 Tips
### Chat
There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai):
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
- `I pushed a fix in commit , please review it.`
- `Generate unit testing code for this file.`
- `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
- `@coderabbitai generate unit testing code for this file.`
- `@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
- `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
- `@coderabbitai read src/utils.ts and generate unit testing code.`
- `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
- `@coderabbitai help me debug CodeRabbit configuration file.`
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
### CodeRabbit Commands (Invoked using PR comments)
- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.
### Other keywords and placeholders
- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.
### Documentation and Community
- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
\n
Files Changed:
- apps/docs/app/blog/[slug]/page.tsx (modified, 10 changes)\n Patch: @@ -14,9 +14,9 @@ import {Route} from "@/libs/docs/page";
import {ChevronRightLinearIcon} from "@/components/icons";
interface BlogPostProps {
- params: {
+ params: Promise<{
slug: string;
- };
+ }>;
}
const isDraftVisible = __DEV__ || __PREVIEW__;
@@ -38,7 +38,8 @@ async function getBlogPostFromParams({params}: BlogPostProps) {
return {post, currentRoute};
}
-export async function generateMetadata({params}: BlogPostProps): Promise {
+export async function generateMetadata(props: BlogPostProps): Promise {
+ const params = await props.params;
const {post} = await getBlogPostFromParams({params});
if (!post) {
@@ -78,7 +79,8 @@ export async function generateStaticParams(): Promise
}));
}
-export default async function DocPage({params}: BlogPostProps) {
+export default async function DocPage(props: BlogPostProps) {
+ const params = await props.params;
const {post} = await getBlogPostFromParams({params});
if (!post || (post.draft && !isDraftVisible)) {\n- apps/docs/app/docs/[[...slug]]/page.tsx (modified, 10 changes)\n Patch: @@ -13,9 +13,9 @@ import {CONTENT_PATH, TAG} from "@/libs/docs/config";
import {getHeadings} from "@/libs/docs/utils";
interface DocPageProps {
- params: {
+ params: Promise<{
slug: string[];
- };
+ }>;
}
async function getDocFromParams({params}: DocPageProps) {
@@ -37,7 +37,8 @@ async function getDocFromParams({params}: DocPageProps) {
return {doc, headings, currentRoute};
}
-export async function generateMetadata({params}: DocPageProps): Promise {
+export async function generateMetadata(props: DocPageProps): Promise {
+ const params = await props.params;
const {doc} = await getDocFromParams({params});
if (!doc) {
@@ -77,7 +78,8 @@ export async function generateStaticParams(): Promise
}));
}
-export default async function DocPage({params}: DocPageProps) {
+export default async function DocPage(props: DocPageProps) {
+ const params = await props.params;
const {doc, headings, currentRoute} = await getDocFromParams({params});
if (!doc) {\n- apps/docs/app/layout.tsx (modified, 19 changes)\n Patch: @@ -1,6 +1,6 @@
import "@/styles/globals.css";
import "@/styles/sandpack.css";
-import {Metadata} from "next";
+import {Metadata, Viewport} from "next";
import {clsx} from "@nextui-org/shared-utils";
import {Providers} from "./providers";
@@ -33,10 +33,6 @@ export const metadata: Metadata = {
"UI Framework",
"UI Design System",
],
- themeColor: [
- {media: "(prefers-color-scheme: light)", color: "white"},
- {media: "(prefers-color-scheme: dark)", color: "black"},
- ],
icons: {
icon: "/favicon.ico",
shortcut: "/favicon-32x32.png",
@@ -58,8 +54,17 @@ export const metadata: Metadata = {
"application/rss+xml": [{url: "https://nextui.org/feed.xml", title: "NextUI RSS Feed"}],
},
},
- viewport:
- "viewport-fit=cover, width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0",
+};
+
+export const viewport: Viewport = {
+ initialScale: 1,
+ themeColor: [
+ {color: "#f4f4f5", media: "(prefers-color-scheme: light)"},
+ {color: "#111111", media: "(prefers-color-scheme: dark)"},
+ ],
+ userScalable: true,
+ viewportFit: "cover",
+ width: "device-width",
};
export default function RootLayout({children}: {children: React.ReactNode}) {\n- apps/docs/app/page.tsx (modified, 22 changes)\n Patch: @@ -1,4 +1,5 @@
import {Spacer} from "@nextui-org/spacer";
+import {Suspense} from "react";
import {Hero} from "@/components/marketing/hero";
import {FeaturesGrid} from "@/components/marketing/features-grid";
@@ -9,26 +10,11 @@ import {Customization} from "@/components/marketing/customization";
import {LastButNotLeast} from "@/components/marketing/last-but-not-least";
import {InstallBanner} from "@/components/marketing/install-banner";
import {Community} from "@/components/marketing/community";
-import {Support} from "@/components/marketing/support";
+import Support from "@/components/marketing/support";
import landingContent from "@/content/landing";
-import {getAllSponsors} from "@/utils/get-all-sponsors";
import {Sponsors} from "@/components/marketing/sponsors";
-async function getData() {
- try {
- const sponsors = await getAllSponsors();
-
- return {
- sponsors,
- };
- } catch (error) {
- throw new Error("Failed to fetch data");
- }
-}
-
export default async function Home() {
- const data = await getData();
-
return (
@@ -40,7 +26,9 @@ export default async function Home() {
-
+ Loading...}>
+
+ \n- apps/docs/app/providers.tsx (modified, 4 changes)\n Patch: @@ -5,7 +5,7 @@ import type {ReactNode} from "react";
import * as React from "react";
import {NextUIProvider} from "@nextui-org/react";
import {ThemeProvider as NextThemesProvider} from "next-themes";
-import {ThemeProviderProps} from "next-themes/dist/types";
+import {ThemeProviderProps} from "next-themes";
import {useRouter} from "next/navigation";
import {useEffect} from "react";
import posthog from "posthog-js";
@@ -23,7 +23,7 @@ export function Providers({children, themeProps}: ProvidersProps) {
const ProviderWrapper = ({children}: {children: ReactNode}) => {
useEffect(() => {
- if (typeof window !== "undefined") {
+ if (typeof window !== "undefined" && __PROD__) {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
api_host: "/ingest",
person_profiles: "identified_only",\n- apps/docs/components/demos/user-twitter-card.tsx (modified, 6 changes)\n Patch: @@ -1,15 +1,14 @@
"use client";
-import {useState, FC} from "react";
+import {useState} from "react";
import {Card, CardHeader, Button, Avatar, CardBody, CardFooter} from "@nextui-org/react";
import {clsx} from "@nextui-org/shared-utils";
-import NextImage from "next/image";
interface UserTwitterCardProps {
className?: string;
}
-export const UserTwitterCard: FC = ({className}) => {
+export const UserTwitterCard = ({className}: UserTwitterCardProps) => {
const [isFollowed, setIsFollowed] = useState(false);
return (
@@ -18,7 +17,6 @@ export const UserTwitterCard: FC = ({className}) => {