Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions UPGRADE-TO-ANGULAR-18.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Upgrade to Angular 18 Migration Guide

## Changes Made

### Package Updates
- Updated Angular packages from v14.0.0 to v18.0.0
- Updated TypeScript from v4.7.2 to v5.4.2
- Updated RxJS from v7.5.0 to v7.8.1
- Updated zone.js to v0.14.3
- Updated testing dependencies (Jasmine, Karma) to latest compatible versions

### Configuration Changes
- Updated tsconfig.json:
- Changed target and module to ES2022
- Added useDefineForClassFields option
- Updated lib array to include ES2022

### Type Safety Improvements
- Enhanced TutorialService with stronger typing:
- Replaced `any` types with specific types (number, string)
- Added proper return types for HTTP methods
- Introduced Partial<Tutorial> for create and update payloads

## Breaking Changes and Considerations

### TypeScript Requirements
- Strict TypeScript version requirement: ^5.4.2
- ES2022 target required for Angular 18 features

### HTTP Client Changes
- More strict typing on HTTP methods
- Return types explicitly defined for all API calls

### Testing Considerations
- Test setup remains compatible with Angular 18
- No changes needed to existing test configurations
- Karma and Jasmine dependencies updated to latest versions

## Prerequisites
- Node.js 18.13.0 or later
- TypeScript 5.4.2 or later
- Angular CLI 18.x

## Development Tools
- @angular-devkit/build-angular: ^18.0.0
- @angular/cli: ~18.0.0
- @angular/compiler-cli: ^18.0.0

## Next Steps
1. Install dependencies: `npm install`
2. Install Angular CLI globally: `npm install -g @angular/cli@18`
3. Build the application: `ng build`
4. Run tests: `ng test`

## Note on Standalone Components
The application maintains its current module-based architecture as the small size and simple structure don't warrant migration to standalone components. This decision helps maintain simplicity and reduces migration complexity.
Loading