Skip to content
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

Upgrade Next.js and Enhance Development Infrastructure #654

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

svemat01
Copy link
Collaborator

⚠️ Note: This PR is stacked on top of PR #653 (Blog Migration) and requires it to be merged first.

This PR implements several technical improvements to enhance our development workflow and type safety.

Key Changes:

  • Upgraded Next.js from v14 to v15
  • Enabled Turbopack for improved development performance
  • Enhanced TypeScript configuration with strict mode

Development Improvements:

  • Updated ESLint configuration
    • Extended linting coverage to scripts directory
    • Standardized plugin configurations
    • Updated to latest versions
  • Improved TypeScript safety
    • Added null safety checks
    • Enhanced type definitions
    • Added typecheck script
  • Refactored MDX plugin system
    • Separated plugins into individual files
    • Improved modularity
    • Enhanced Turbopack compatibility

Code Standards:

  • Standardized code formatting
    • Converted to 2-space indentation
    • Removed unnecessary semicolons
    • Cleaned up whitespace

…ocessing

- Introduced `authors.ts` to manage author data and avatars, replacing the previous `avatars.ts`.
- Implemented functions to resolve ENS data, fetch avatars, and process images for authors.
- Updated `index.ts` to call `handleAuthors` instead of `handleAvatarImages`.
- Added new `posts.ts` for processing cover images, enhancing asset management.
- Removed the now redundant `avatars.ts` file.

This refactor improves the organization of asset processing and reduces code duplication.
- Removed the `NavbarFade` component and integrated its functionality into the `Navbar` using a new custom hook `useScrollAttr`.
- Added a gradient background effect to the Navbar that becomes opaque on scroll.
- Updated the Navbar to use a `ref` for scroll detection, improving performance and code organization.
- Cleaned up the Navbar links by removing the blog link and adjusting the filter logic for displayed links.

This refactor simplifies the Navbar's structure and enhances its visual behavior during scrolling.
- Added utility functions for date formatting (`formatDate`) and string manipulation (`titleCase`).
- Introduced new array utilities: `joinArray` for joining elements with a separator and `splitArray` for splitting arrays into chunks.
- Created `metadata.ts` for managing metadata creation and merging, utilizing `deepmerge-ts` for enhanced functionality.
- Added new utilities for managing blog post metadata, including `metadata.ts` and `posts.ts`, to handle post data and metadata validation using Zod.
- Introduced a JSON schema for blog post metadata in `schema.json` to enforce structure and validation.
- Implemented search functionality in `search.ts` to fetch and process search results from an external API.
- Updated `utils.ts` to define the posts directory and asset retrieval functions.
- Enhanced package dependencies in `package.json` to support new features.

This update improves the blog's content management and search capabilities, providing a more structured approach to handling blog posts.
- Updated `next.config.mjs` to include MDX support with custom plugins for remark and rehype processing.
- Added new MDX components: `Link`, `Heading`, `Image`, and `YoutubeEmbed` for improved content rendering.
- Introduced styles for MDX components to ensure consistent presentation.
- Created utility functions for handling MDX annotations and slug generation.
- Enhanced package dependencies in `package.json` to support MDX features.
- Added a new layout for the blog section, integrating a QueryClientProvider for React Query support.
- Created a dedicated CSS module for blog UI styling, ensuring consistent padding across different screen sizes.
- Updated metadata generation for the blog, including a new title template and description for improved SEO.
- Introduced a new utility file for managing React Query client setup.
- Introduced a new blog post page component with dynamic metadata generation based on the post's slug.
- Created a CSS module for styling the blog post layout, ensuring responsive design and consistent spacing.
- Implemented asset retrieval for post cover images and author avatars, enhancing the visual presentation of posts.
- Added structured data support for SEO through schema.org integration.
- Introduced a new RSS feed generation for the blog, providing a structured XML format for blog posts.
- Implemented a search endpoint that retrieves and processes blog post metadata and content, enhancing search capabilities.
- Updated translation files to include new blog-related strings for improved localization support.
- Modified `.vscode/settings.json` to enhance editor configurations adding JSON schema validation for blog metadata.
- Added smooth scrolling behavior in `global.css` for a better user experience.
- Modified SearchIcon to accept an optional opacity prop for dynamic styling.
- Added CSS styles for the search icon positioning within the Searchbar component.
- Integrated SearchIcon into Searchbar, adjusting its opacity based on the search input length.
- Removed console.log statements from various blog-related files to clean up the codebase.
- Updated CSS files to ensure proper formatting and consistency, including adding missing newlines.
- Adjusted metadata schema comments for clarity and accuracy.
- Cleaned up imports in blog author and tag pages by removing commented-out code.
- Enhanced the layout component by removing unnecessary exports and improving metadata generation.
- Created a reusable GitHub Actions workflow to install tools and dependencies
- Implemented a deployment workflow for search functionality using Meilisearch
- Configured Node.js v22, PNPM, and dependency installation steps
- Set up search data import process with environment-specific configurations
- Consolidated MDX plugin imports into a single index file
- Separated MDX plugins into individual files for better modularity
- Updated Next.js and React type dependencies
- Simplified package configuration
- Enabled Turbopack for development
- Converted CSS files to use 2-space indentation for consistent styling
- Removed semicolons and adjusted formatting in TypeScript files
- Updated various component CSS modules to improve readability
- Simplified some component prop types and function signatures
- Cleaned up unnecessary comments and whitespace
- Upgraded ESLint, TypeScript, and related plugin dependencies to latest versions
- Updated lint script to include scripts directory for broader linting coverage
- Adjusted ESLint plugin configurations for React and TypeScript
- Standardized code formatting across various utility and component files
- Added `typecheck` script to package.json for TypeScript type checking
- Enabled strict mode in tsconfig.json
- Updated components and utilities to handle potential undefined values
- Added null checks and optional chaining in blog-related components
- Improved type safety across various files
…tions

- Cleaned up next.config.mjs by removing commented-out MDX plugin configurations
- Utilized imported plugin arrays from mdx/index.mjs for cleaner configuration
Copy link

cloudflare-workers-and-pages bot commented Jan 29, 2025

Deploying ensdomains-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 79f44ac
Status: ✅  Deploy successful!
Preview URL: https://a1b51820.ensdomains-v2.pages.dev
Branch Preview URL: https://chore-nextjs-upgrade.ensdomains-v2.pages.dev

View logs

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.

2 participants