Skip to content

Commit a045704

Browse files
authored
chore(examples): update nextjs example with next version (dotCMS#32150)
This pull request introduces several updates to the Next.js example application, focusing on dependency upgrades, code refactoring, and new features. The most notable changes include updating dependencies, refactoring page handling logic, adding new components, and enhancing the Tailwind CSS setup. ### Dependency and Configuration Updates: * Updated `next` to version `15.3.2`, `react` and `react-dom` to `19.1.0`, and other related dependencies in `package.json`. Added `@tailwindcss/postcss` and updated Tailwind CSS to version `4.1.6` for improved styling capabilities. * Enabled `turbopack` in the development script by modifying the `dev` command in `package.json`. ### Page Handling Refactor: * Refactored the `[[...slug]]/page.js`, `blog/post/[[...slug]]/page.js`, and `blog/page.js` files to use a unified `getDotCMSPage` utility for fetching page data, replacing redundant logic and simplifying metadata generation. ([examples/nextjs/src/app/[[...slug]]/page.jsL1-R13](diffhunk://#diff-ae32fed6c8c541fd820d195111a8c016ec33ecd22c5785374a4cb48e295c479bL1-R13)R1, [examples/nextjs/src/app/blog/post/[[...slug]]/page.jsL1-R14](diffhunk://#diff-b407330cf92641b72b66d15e4c134e93224b6b10a9ededc2771705c259dab081L1-R14), [examples/nextjs/src/app/blog/page.jsR1-R49](diffhunk://#diff-12cedd615b055bae3e41ba562068aff97a8239be8e3afacbb50de4b386aa2c0bR1-R49)) * Removed the `campaigns/[[...slug]]/page.js` file, consolidating its functionality into the new page handling structure. ([examples/nextjs/src/app/campaigns/[[...slug]]/page.jsL1-L68](diffhunk://#diff-ab578cabb2e84be8de634e6781df0be7a59dc4cf13e7444672ecfe12f2faea8cL1-L68)) ### Tailwind CSS Enhancements: * Updated the Tailwind CSS setup in `globals.css` to use the `@import` syntax and added custom utilities, themes, and plugins for better styling flexibility. [[1]](diffhunk://#diff-d08633dc30063defca3dd159cde6dcbfa912ce29719ccdd3dffb1e05eccee392L1-L19) [[2]](diffhunk://#diff-d08633dc30063defca3dd159cde6dcbfa912ce29719ccdd3dffb1e05eccee392R45-R48) ### New Components: * Added a `Header` component with navigation and an edit mode toggle, improving the layout and user experience. * Introduced a `RecommendedCard` component for displaying recommended content with an edit button and improved styling. ### Codebase Simplification: * Renamed and refactored the `Activity` component to improve readability and styling consistency. Removed unused content type components and their references. [[1]](diffhunk://#diff-742e18d6505888f37e090e2737ec675ccae16978d0bb75bf7bc0702bf7a0064bL3-R15) [[2]](diffhunk://#diff-5912745dd6534531e269707b918724caf3562c2a7e17b935d46f78d9d72ea638L1-L14) * Removed legacy blog and activity content rendering logic from `content-types/blog.js` and `content-types/index.js`. [[1]](diffhunk://#diff-2092d48425507c2a8f3b5c781d2ef658167612d92673a999aaea88d09db46537L1-L34) [[2]](diffhunk://#diff-5912745dd6534531e269707b918724caf3562c2a7e17b935d46f78d9d72ea638L1-L14) These changes collectively modernize the application, streamline its codebase, and improve maintainability. ### Video ### UVE https://github.com/user-attachments/assets/6e15e610-0e55-4286-9f6b-3994e1c5fae4 ### Dev environment https://github.com/user-attachments/assets/3893a256-76a4-4b94-a313-f9812bd5bdee
1 parent 7e3edf1 commit a045704

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1838
-28492
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,9 @@ dotCMS/dependencies.gradle
184184

185185
# Vite config timestamp files
186186
**/*vite.config*.timestamp-*.mjs
187-
**/*vite.config*.timestamp-*.ts
187+
**/*vite.config*.timestamp-*.ts
188+
189+
# Examples package-lock.json
190+
examples/nextjs/package-lock.json
191+
examples/angular/package-lock.json
192+
examples/astro/package-lock.json

examples/angular/package-lock.json

Lines changed: 0 additions & 13663 deletions
This file was deleted.

0 commit comments

Comments
 (0)