Skip to content

Conversation

@codeSTACKr
Copy link
Contributor

Upgraded to tailwind 4 and updated react version and dependencies.

@ijjk ijjk added the examples Issue was opened via the examples template. label Aug 29, 2025
@ijjk
Copy link
Member

ijjk commented Aug 29, 2025

Allow CI Workflow Run

  • approve CI run for commit: 2d24f08

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@ijjk
Copy link
Member

ijjk commented Aug 29, 2025

Allow CI Workflow Run

  • approve CI run for commit: f792ee0

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@icyJoseph
Copy link
Collaborator

Hi, I think we can also remove the tailwind config file? AFAIK TW4 doesn't use such a file anymore.

@codeSTACKr
Copy link
Contributor Author

Hi, I think we can also remove the tailwind config file? AFAIK TW4 doesn't use such a file anymore.

It is no longer required but can still be used. In this case we still need it as there were some definitions we didn't move over.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR upgrades the with-mongodb example to use Tailwind CSS 4.x and updates various dependencies including React 19, Next.js 15, and related type definitions.

  • Migrated from Tailwind CSS 3.x to 4.x with new PostCSS plugin configuration
  • Updated React ecosystem from v18 to v19 including React, React DOM, and type definitions
  • Upgraded Next.js to v15.5.2 and various other dependencies to their latest versions

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
postcss.config.js Updated PostCSS configuration to use new Tailwind CSS 4 plugin format
package.json Upgraded all dependencies including Tailwind CSS 4, React 19, Next.js 15, and supporting packages

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@marguin-vercel marguin-vercel left a comment

Choose a reason for hiding this comment

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

These changes were run past the Next.js team and was informed "it is probably ok to merge this"

Copilot suggested a couple of minor changes. Will approve and merge after those are completed.

codeSTACKr and others added 3 commits September 2, 2025 11:28
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
"@tailwindcss/postcss": "^4.1.12",
Copy link
Member

Choose a reason for hiding this comment

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

Looks like missing "tailwindcss"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like copilot thought it should be removed above. Added back.

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Comments:

examples/with-mongodb/styles/globals.css (lines 1-3):

The Tailwind CSS imports in globals.css are using the old Tailwind 3 syntax and need to be updated for Tailwind 4 compatibility.

View Details
📝 Patch Details
diff --git a/examples/with-mongodb/styles/globals.css b/examples/with-mongodb/styles/globals.css
index fd81e88583..0cfb742826 100644
--- a/examples/with-mongodb/styles/globals.css
+++ b/examples/with-mongodb/styles/globals.css
@@ -1,6 +1,4 @@
-@tailwind base;
-@tailwind components;
-@tailwind utilities;
+@import "tailwindcss";
 
 :root {
   --foreground-rgb: 0, 0, 0;

Analysis

With the upgrade to Tailwind CSS v4, the CSS import syntax has changed significantly. The current imports:

@tailwind base;
@tailwind components;
@tailwind utilities;

Are the old Tailwind 3 syntax. In Tailwind CSS v4, these should be replaced with:

@import "tailwindcss";

This single import replaces all three separate imports and is the new standard way to include Tailwind CSS in v4. Using the old syntax with Tailwind 4 will likely cause the build to fail or styles not to load properly. The migration to v4 requires this CSS import syntax change along with the package.json and PostCSS configuration changes that were already made.

Copy link
Contributor

@marguin-vercel marguin-vercel left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@devjiwonchoi
Copy link
Member

Additional Comments:

examples/with-mongodb/styles/globals.css (lines 1-3):

The Tailwind CSS imports in globals.css are using the old Tailwind 3 syntax and need to be updated for Tailwind 4 compatibility.

View Details

This looks valid https://tailwindcss.com/docs/upgrade-guide#removed-tailwind-directives

@devjiwonchoi devjiwonchoi added the CI approved Approve running CI for fork label Sep 2, 2025
@icyJoseph
Copy link
Collaborator

Applied this diff to a npx create-next-app --example with-mongodb with-mongodb-app - and it looks like this:

Screenshot 2025-09-02 at 19 13 29

We just need to change styles/global.css

@import "tailwindcss";

:root {
/* rest of file */

@codeSTACKr
Copy link
Contributor Author

Applied this diff to a npx create-next-app --example with-mongodb with-mongodb-app - and it looks like this:

Screenshot 2025-09-02 at 19 13 29 We just need to change `styles/global.css`
@import "tailwindcss";

:root {
/* rest of file */

Updates global.css - looks good on my side. Please confirm.

@devjiwonchoi devjiwonchoi changed the title upgrade to tailwind 4 and various other packages examples(with-mongodb): upgrade to tailwind v4 Sep 3, 2025
@devjiwonchoi devjiwonchoi merged commit cce01ba into vercel:canary Sep 3, 2025
64 checks passed
@devjiwonchoi
Copy link
Member

Thank you for the PR!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CI approved Approve running CI for fork examples Issue was opened via the examples template. locked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants