Skip to content

Conversation

@MGREMY
Copy link
Collaborator

@MGREMY MGREMY commented Dec 19, 2025

Waiting for ng-doc to update

PR Checklist

Please check if your PR fulfills the following requirements:

  • Docs have been added/updated (for bug fixes/features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • CI-related changes
  • Documentation content changes
  • Other... Please describe:

Issue Number

Issue Number: #142

Does this PR introduce a breaking change?

  • Yes
  • No

Migration to angular 21

Other information

Summary by CodeRabbit

  • Chores
    • Upgraded Angular framework from v20 to v21 alongside related development dependencies and tooling.
    • Updated TypeScript compiler configuration with new module resolution and preservation settings.
    • Enhanced bootstrap and Storybook configuration for improved initialization flow.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
flowbite-angular Error Error Dec 19, 2025 2:02pm
flowbite-angular-storybook Error Error Dec 19, 2025 2:02pm

Waiting for ng-doc to update
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

Walkthrough

This pull request performs a major version upgrade across the monorepo, updating Angular from 20.x to 21.x, Nx dependencies, and related tooling. It introduces zone change detection providers to bootstrap configurations, updates TypeScript compiler options for module preservation and bundler-style resolution, adjusts peer dependencies, and modifies project and release configurations.

Changes

Cohort / File(s) Summary
Bootstrap Configuration Updates
apps/docs/src/main.server.ts, apps/docs/src/main.ts
Added BootstrapContext type import and modified bootstrap function signature to accept context parameter. Injected provideZoneChangeDetection() provider into bootstrap configuration, merging it with existing providers array.
TypeScript Module Resolution
apps/docs/tsconfig.json, libs/flowbite-angular/tsconfig.json
Added "module": "preserve" and "moduleResolution": "bundler" compiler options to support updated module emission and bundler-style resolution strategy.
Storybook Framework Configuration
apps/storybook/.storybook/main.ts
Replaced static framework.name string literal with dynamic path resolution using getAbsolutePath('@storybook/angular').
Peer Dependency Updates
libs/flowbite-angular/package.json
Updated Angular peer dependencies from >=20.0.0 to >=21.0.0, upgraded @ng-icons/core from ^31.3.0 to >=33.0.0, and ng-primitives-related packages from >=0.57.0 to >=0.90.0.
Build and Project Configuration
libs/flowbite-angular/project.json
Added explicit tsConfig reference in build options and modified development configuration tsConfig entry.
Nx Tooling Upgrade
libs/tools/package.json
Updated @nx/angular and @nx/devkit from 21.2.2 to 22.3.1.
Release Configuration
nx.json
Restructured releaseTagPattern into nested releaseTag object with pattern property.
Global Dependency Upgrade
package.json
Comprehensive version bumps across Angular (20→21), Nx, Storybook, zone.js, ng-packagr, TypeScript, and related tooling packages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Dependency compatibility verification: Ensure Angular 21 compatibility across all packages, particularly the ng-icons, ng-primitives, and Flowbite libraries
  • Zone change detection implications: Verify that the new provideZoneChangeDetection() provider integration doesn't introduce unintended side effects or performance regressions
  • Nx version jump: The substantial jump from 21.2.2 to 22.3.1 in @nx/angular and @nx/devkit may introduce breaking changes requiring careful validation
  • Module resolution changes: Confirm that "preserve" and "bundler" settings across tsconfigs don't break existing build or module resolution patterns
  • TypeScript and build tooling compatibility: Validate that new TypeScript version and ng-packagr versions work harmoniously with the rest of the stack

Poem

🐰 Dependencies dance, versions ascend,
Angular twenty-one, a grand new trend!
Zone changes glimmer, bundlers resolve,
Config and bootstrap together evolve,
Hop, hop, upgrade complete! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides issue linkage (#142), breaking change declaration, and PR type selection, but lacks detailed explanation of migration changes, impact analysis, and comprehensive migration guidance expected for a breaking change release. Expand the description to include: detailed migration steps, breaking changes summary, dependency update rationale, and testing/validation status. Consider using the Release template for more structured guidance.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore(release): update to angular 21' accurately describes the main change—upgrading the project to Angular 21 across multiple configuration files, dependencies, and framework integrations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/angular_21

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4cc74de and d1071a8.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • apps/docs/src/main.server.ts (1 hunks)
  • apps/docs/src/main.ts (1 hunks)
  • apps/docs/tsconfig.json (1 hunks)
  • apps/storybook/.storybook/main.ts (2 hunks)
  • libs/flowbite-angular/package.json (1 hunks)
  • libs/flowbite-angular/project.json (1 hunks)
  • libs/flowbite-angular/tsconfig.json (1 hunks)
  • libs/tools/package.json (1 hunks)
  • nx.json (1 hunks)
  • package.json (2 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: MGREMY
Repo: themesberg/flowbite-angular PR: 79
File: libs/flowbite-angular/README.md:87-92
Timestamp: 2024-11-15T08:18:09.828Z
Learning: In `libs/flowbite-angular/README.md`, components that are not yet built should retain their old documentation links and construction emojis until they are completed.
📚 Learning: 2024-11-15T08:18:09.828Z
Learnt from: MGREMY
Repo: themesberg/flowbite-angular PR: 79
File: libs/flowbite-angular/README.md:87-92
Timestamp: 2024-11-15T08:18:09.828Z
Learning: In `libs/flowbite-angular/README.md`, components that are not yet built should retain their old documentation links and construction emojis until they are completed.

Applied to files:

  • libs/flowbite-angular/package.json
  • libs/flowbite-angular/project.json
  • libs/flowbite-angular/tsconfig.json
📚 Learning: 2024-12-11T09:25:50.819Z
Learnt from: MGREMY
Repo: themesberg/flowbite-angular PR: 88
File: libs/flowbite-angular/navbar/navbar.component.ts:99-99
Timestamp: 2024-12-11T09:25:50.819Z
Learning: In `libs/flowbite-angular/navbar/navbar.component.ts`, the `NavbarContentComponent` was already required because the `verify` function threw an error if `navbarContentChild` was undefined or null. Therefore, changing `contentChild` to `contentChild.required` does not introduce a breaking change.

Applied to files:

  • libs/flowbite-angular/package.json
  • libs/flowbite-angular/project.json
  • libs/flowbite-angular/tsconfig.json
📚 Learning: 2025-08-17T20:04:24.034Z
Learnt from: MGREMY
Repo: themesberg/flowbite-angular PR: 137
File: libs/flowbite-angular/table/src/table-body/table-body.directive.ts:1-3
Timestamp: 2025-08-17T20:04:24.034Z
Learning: In the flowbite-angular table module, the table state file is located at `libs/flowbite-angular/table/src/table/table-state.ts`, not at the root src level. Import paths like `../table/table-state` from subdirectories like table-body are correct.

Applied to files:

  • libs/flowbite-angular/package.json
  • libs/flowbite-angular/project.json
  • libs/flowbite-angular/tsconfig.json
📚 Learning: 2025-08-17T20:04:15.230Z
Learnt from: MGREMY
Repo: themesberg/flowbite-angular PR: 137
File: libs/flowbite-angular/table/src/table-head/table-head.directive.ts:2-2
Timestamp: 2025-08-17T20:04:15.230Z
Learning: In the flowbite-angular table component structure, the table-state.ts file is located at src/table/table-state.ts, not at src/table-state.ts. Import paths from other subdirectories like table-head should use '../table/table-state' to reference it.

Applied to files:

  • libs/flowbite-angular/tsconfig.json
📚 Learning: 2024-12-19T10:29:39.292Z
Learnt from: MGREMY
Repo: themesberg/flowbite-angular PR: 100
File: apps/docs/docs/components/badge/_bordered.component.ts:5-12
Timestamp: 2024-12-19T10:29:39.292Z
Learning: In Angular 19, the standalone property is the default behavior, making the explicit declaration of "standalone: true" unnecessary.

Applied to files:

  • libs/flowbite-angular/tsconfig.json
🧬 Code graph analysis (2)
apps/docs/src/main.server.ts (1)
apps/docs/src/app/app.config.server.ts (1)
  • config (11-11)
apps/docs/src/main.ts (3)
apps/docs/src/environments/environment.ts (1)
  • environment (5-7)
apps/docs/src/environments/environment.prod.ts (1)
  • environment (1-3)
apps/docs/src/app/app.config.ts (1)
  • appConfig (23-55)
🔇 Additional comments (10)
libs/flowbite-angular/project.json (2)

13-14: LGTM: Build configuration updated correctly.

Adding the tsConfig reference at the build options level alongside the project path is appropriate for Nx/Angular library builds.


20-20: LGTM: Development configuration simplified.

The empty development configuration will inherit from the base build options, which is a standard pattern.

apps/storybook/.storybook/main.ts (1)

1-1: LGTM: Storybook ESM migration applied correctly.

The automatic migration to use getAbsolutePath for the framework name is consistent with the existing addon configuration pattern. This ensures proper path resolution in ESM context.

Also applies to: 14-14

apps/docs/tsconfig.json (1)

22-24: LGTM: TypeScript configuration updated for Angular 21.

The addition of "module": "preserve" and "moduleResolution": "bundler" aligns with Angular 21's requirements and modern TypeScript practices. This configuration is consistent across the monorepo.

nx.json (1)

108-110: The releaseTag configuration format is correct for Nx 22.x.

Options previously prefixed with releaseTag* are now nested under a releaseTag object with unprefixed properties in Nx 22.x. The change from releaseTagPattern (flat string) to releaseTag (object with pattern property) is the required format for this version.

libs/flowbite-angular/tsconfig.json (1)

20-22: Configuration is correct for Angular 21 library builds.

The addition of "module": "preserve" and "moduleResolution": "bundler" aligns with Angular 21 build standards and is automatically set by Nx Angular migrations. This configuration is appropriate for library builds with ng-packagr, which handles the transformation pipeline and final module format transpilation.

libs/tools/package.json (1)

9-10: Verify Angular 21 compatibility before upgrading to Nx 22.3.1.

Nx 22.3.1 contains beta-level Angular 21 support. The official compatibility matrix currently lists support only through Angular 20, so confirm that Angular 21 integration is production-ready in your environment. The S1ngularity supply-chain incident (August 2025) affected earlier Nx versions (21.5.0-21.8.0), not 22.3.1.

package.json (2)

59-113: Dependency versions are well-aligned and compatible.

The devDependencies are appropriately versioned:

  • Angular devkit packages: 21.0.4 / 0.2100.4
  • Angular ESLint: 21.1.0
  • Nx packages: 22.3.1 (consistent)
  • Storybook: 10.1.10 (consistent)
  • ng-packagr: 21.0.1 (matches Angular 21)
  • TypeScript: 5.9.3 (compatible with Angular 21)

30-56: Note on zone.js inclusion: Zone.js is no longer included by default in Angular applications in v21, which suggests this dependency may not be necessary. If the application is configured for zoneless change detection (the new default), zone.js can be removed. Verify the angular.json configuration to determine whether zone.js is actually needed for your project. If your application intentionally retains zone-based change detection for backward compatibility, zone.js 0.16.0 is compatible.

Also note that ng-doc packages remain at 20.1.0, which aligns with the PR description.

apps/docs/src/main.ts (1)

5-15: The provideZoneChangeDetection() pattern is correct for Angular 21.

Angular 21 requires adding provideZoneChangeDetection to your bootstrapApplication providers to restore Zone.js-based change detection. The code correctly spreads the existing appConfig and prepends the provider, which is the standard approach shown in Angular's migration guidance. Optional configuration parameters like eventCoalescing are available if performance tuning is needed, but the basic usage without additional options is sufficient.

Comment on lines +7 to +12
const bootstrap = (context: BootstrapContext) =>
bootstrapApplication(
AppComponent,
{ ...config, providers: [provideZoneChangeDetection(), ...config.providers] },
context
);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Missing import for provideZoneChangeDetection.

The bootstrap function uses provideZoneChangeDetection() on Line 10, but this function is not imported. This will cause a runtime error.

🔎 Proposed fix
 import { AppComponent } from './app/app.component';
 import { config } from './app/app.config.server';
 
 import type { BootstrapContext } from '@angular/platform-browser';
-import { bootstrapApplication } from '@angular/platform-browser';
+import { bootstrapApplication } from '@angular/platform-browser';
+import { provideZoneChangeDetection } from '@angular/core';
 
 const bootstrap = (context: BootstrapContext) =>
   bootstrapApplication(
     AppComponent,
     { ...config, providers: [provideZoneChangeDetection(), ...config.providers] },
     context
   );

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In apps/docs/src/main.server.ts around lines 7-12, the bootstrap function calls
provideZoneChangeDetection() but that symbol is not imported; add an import for
provideZoneChangeDetection from the Angular core package at the top of the file
(e.g. include provideZoneChangeDetection in the existing import list from
'@angular/core') so the function is available at runtime.

Comment on lines +34 to 40
"@angular/cdk": ">=21.0.0 < 22.0.0",
"@angular/core": ">=21.0.0 < 22.0.0",
"@ng-icons/core": ">=33.0.0",
"@ng-primitives/state": ">=0.90.0",
"@tailwindcss/postcss": "^4.0.0",
"ng-primitives": ">=0.57.0",
"ng-primitives": ">=0.90.0",
"rxjs": "^7.4.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify peer dependency versions exist and check compatibility

echo "=== Checking @ng-icons/core versions ==="
npm view @ng-icons/core versions --json | jq -r '.[] | select(test("^33\\."))'

echo -e "\n=== Checking @ng-icons/core peerDependencies ==="
npm view @ng-icons/core@33.0.0 peerDependencies --json

echo -e "\n=== Checking ng-primitives versions ==="
npm view ng-primitives versions --json | jq -r '.[] | select(test("^0\\.9[0-9]\\."))'

echo -e "\n=== Checking ng-primitives peerDependencies ==="
npm view ng-primitives@0.90.0 peerDependencies --json 2>/dev/null || echo "Version 0.90.0 not found"

echo -e "\n=== Checking @ng-primitives/state versions ==="
npm view @ng-primitives/state versions --json | jq -r '.[] | select(test("^0\\.9[0-9]\\."))'

echo -e "\n=== Checking @ng-primitives/state peerDependencies ==="
npm view @ng-primitives/state@0.90.0 peerDependencies --json 2>/dev/null || echo "Version 0.90.0 not found"

Repository: themesberg/flowbite-angular

Length of output: 781


Add missing peer dependency: @angular/forms.

The versions of @ng-icons/core (33.x), @ng-primitives/state (0.90.0), and ng-primitives (0.90.0) are all available and compatible with Angular 21. However, ng-primitives 0.90.0 requires @angular/forms as a peer dependency, which is currently missing from package.json and must be added.

🤖 Prompt for AI Agents
In libs/flowbite-angular/package.json around lines 34 to 40, the package.json is
missing the required peer dependency @angular/forms; add "@angular/forms":
">=21.0.0 <22.0.0" to the peerDependencies (or dependencies if appropriate for
this package) so it matches the Angular 21 version range used for @angular/core
and other Angular peers, ensuring ng-primitives 0.90.0 has its required peer
satisfied.

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