Skip to content

feat: drop support for Angular <=16#1825

Merged
brandonroberts merged 1 commit intoanalogjs:alphafrom
benpsnyder:feat/drop-ng16
Aug 16, 2025
Merged

feat: drop support for Angular <=16#1825
brandonroberts merged 1 commit intoanalogjs:alphafrom
benpsnyder:feat/drop-ng16

Conversation

@benpsnyder
Copy link
Contributor

@benpsnyder benpsnyder commented Aug 3, 2025

Summary of Changes Made

I have successfully fixed issue #1512 by removing official support for Angular <= v16. Here are the key changes made:

1. Removed Angular v16 Template

  • Deleted packages/create-analog/template-angular-v16/ directory
  • Updated packages/create-analog/package.json to remove the v16 template from the files list

2. Updated Compatibility Documentation

  • Removed Angular v16 entries from the compatibility matrix in apps/docs-app/docs/guides/compatibility.md
  • Updated both Angular Version Support and Nx Version Support tables to exclude v16

3. Removed v16 Version Constants and Logic

  • Removed all v16-specific version constants from packages/nx-plugin/src/generators/app/versions.ts
  • Deleted v16 version directories:
    • packages/nx-plugin/src/generators/app/versions/nx_16_X/
    • packages/nx-plugin/src/utils/versions/ng_16_X/
    • packages/nx-plugin/src/generators/app/files/template-angular-v16/

4. Updated Version Logic

  • Modified dependency resolution logic in multiple files to skip v16 support:
    • packages/nx-plugin/src/generators/app/versions/dev-dependencies.ts
    • packages/nx-plugin/src/generators/app/versions/dependencies.ts
    • packages/nx-plugin/src/generators/app/versions/trpc-dependencies.ts
    • packages/nx-plugin/src/generators/app/versions/nx-dependencies.ts
    • packages/nx-plugin/src/utils/versions/dependencies.ts
    • packages/nx-plugin/src/utils/versions/dev-dependencies.ts

5. Updated Minimum Version Requirements

  • Changed minimum supported Angular version from 15.0.0 to 17.0.0
  • Updated minimum supported Nx version from 15.2.0 to 17.0.0
  • Updated error messages to reflect new minimum requirements

6. Removed v16-Specific Workarounds

  • Updated packages/vitest-angular/src/lib/builders/build/devkit.ts to require Angular v17+ instead of v16.2+
  • Updated packages/vite-plugin-angular/src/lib/utils/devkit.ts to remove v16 compatibility logic
  • Simplified version checking logic to skip v16 entirely

7. Fixed TypeScript Issues

  • Added missing version constants to v15 versions file to maintain compatibility
  • Updated type definitions to work with the new version structure

Current Supported Versions

After these changes, Analog now officially supports:

  • Angular: v17.0.0 and newer
  • Nx: v17.0.0 and newer
  • Vite: v5.0.0 and newer (for Angular 17-18), v6.0.0 and newer (for Angular 19+)

Testing

All builds are now successful:

  • nx-plugin builds successfully
  • vite-plugin-angular builds successfully
  • vitest-angular builds successfully
  • ✅ No TypeScript compilation errors
  • ✅ All version resolution logic works correctly

The changes ensure that:

  1. No new projects can be created with Angular v16 or lower
  2. Existing v16-specific workarounds have been removed
  3. The codebase is cleaner and more maintainable
  4. Users are guided to use supported versions with clear error messages

This implementation fully addresses the requirements outlined in the issue to drop official support for Angular <= v16.

BREAKING CHANGES

This PR removes official support for Angular versions 16 and below. Users with Angular 16 or lower projects will need to upgrade to Angular 17+ to continue using Analog.

BEFORE

# This would work before the changes
npx create-analog@latest my-app --template=angular-v16
// package.json - Angular 16 project
{
  "dependencies": {
    "@angular/core": "^16.0.0",
    "@angular/common": "^16.0.0"
  },
  "devDependencies": {
    "@nx/workspace": "^15.2.0"
  }
}

AFTER

# This will now fail with a clear error message
npx create-analog@latest my-app --template=angular-v16
# Error: Angular v16 is no longer supported. Please use Angular v17.0.0 or newer.
// package.json - Angular 17+ project required
{
  "dependencies": {
    "@angular/core": "^17.0.0",
    "@angular/common": "^17.0.0"
  },
  "devDependencies": {
    "@nx/workspace": "^17.0.0"
  }
}

Migration Guide

To migrate existing Angular 16 projects:

  1. Upgrade Angular: Follow the Angular upgrade guide to upgrade from v16 to v17
  2. Upgrade Nx: Update Nx to v17.0.0 or newer
  3. Update Dependencies: Ensure all @analogjs/* packages are updated to the latest version
  4. Test Application: Run your test suite to ensure compatibility

Users who cannot upgrade to Angular 17+ should continue using the last version of Analog that supported Angular 16.

@netlify
Copy link

netlify bot commented Aug 3, 2025

Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit 2aa07e6
🔍 Latest deploy log https://app.netlify.com/projects/analog-blog/deploys/689fb47bad309c0008c4ba9d
😎 Deploy Preview https://deploy-preview-1825--analog-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Aug 3, 2025

Deploy Preview for analog-docs ready!

Name Link
🔨 Latest commit abdaa0b
🔍 Latest deploy log https://app.netlify.com/projects/analog-docs/deploys/688ed5fe95cdea0008cdc1ce
😎 Deploy Preview https://deploy-preview-1825--analog-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Aug 3, 2025

Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit abdaa0b
🔍 Latest deploy log https://app.netlify.com/projects/analog-app/deploys/688ed5feb2e7c40008090fbc
😎 Deploy Preview https://deploy-preview-1825--analog-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Aug 3, 2025

Deploy Preview for analog-ng-app ready!

Name Link
🔨 Latest commit abdaa0b
🔍 Latest deploy log https://app.netlify.com/projects/analog-ng-app/deploys/688ed5fea7469b000805b0f5
😎 Deploy Preview https://deploy-preview-1825--analog-ng-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@brandonroberts
Copy link
Member

brandonroberts commented Aug 3, 2025

Breaking changes should go against the alpha branch for 2.0.x and include breaking changes in the description in the correct format from the contributing guide.

@benpsnyder
Copy link
Contributor Author

benpsnyder commented Aug 4, 2025

Breaking changes should go against the alpha branch for 2.0.x and include breaking changes in the description in the correct format from the contributing guide.

Breaking changes info has been added to PR description
Branch has been updated to target alpha

@benpsnyder
Copy link
Contributor Author

@brandonroberts I cleaned this up and it should be ready to merge; please conduct a review

@brandonroberts brandonroberts merged commit 9d7176a into analogjs:alpha Aug 16, 2025
10 checks passed
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.

Drop official support for Angular <= v16

2 participants