docs(angular): document standalone and lazy import path changes#4576
docs(angular): document standalone and lazy import path changes#4576OS-jacobbell wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| import { bootstrapApplication } from '@angular/platform-browser'; | ||
| import { RouteReuseStrategy, provideRouter, withPreloading, PreloadAllModules } from '@angular/router'; | ||
| import { IonicRouteStrategy, provideIonicAngular } from '@ionic/angular'; | ||
| import { IonicRouteStrategy, provideIonicAngular } from '@ionic/angular/lazy'; |
There was a problem hiding this comment.
| import { IonicRouteStrategy, provideIonicAngular } from '@ionic/angular/lazy'; | |
| import { IonicRouteStrategy, provideIonicAngular } from '@ionic/angular'; |
This tutorial is a standalone app (bootstrapApplication + provideIonicAngular()), so this import should stay on @ionic/angular under the new default. provideIonicAngular is standalone-only and isn't exported from @ionic/angular/lazy, so following this verbatim gives a broken import. I'd want this fixed before approving.
There was a problem hiding this comment.
These docs got updated to match the tutorial app when it was updated here: #4569
| /* example.component.ts */ | ||
| import { Component, ViewChild } from '@angular/core'; | ||
| import { IonInput } from '@ionic/angular'; | ||
| import { IonInput } from '@ionic/angular/lazy'; |
There was a problem hiding this comment.
This doc only has a single "Angular" tab, so it's the canonical example, and pointing IonInput at @ionic/angular/lazy steers standalone users (the new default) toward the lazy submodule. That also works against the treeshaking warning you're adding in build-options.md. I think this should be @ionic/angular, or split into angular/angular-standalone tabs like the other developing docs. Same thing on line 170. What do you think?
There was a problem hiding this comment.
These docs got updated to match the tutorial app when it was updated here: #4569
|
|
||
| #### Component Imports | ||
|
|
||
| Ionic 9 makes standalone components the default import path. Change Lazy-loaded component imports from `@ionic/angular` to `@ionic/angular/lazy`. Change Standalone component imports from `@ionic/angular/standalone` to `@ionic/angular`. |
There was a problem hiding this comment.
| Ionic 9 makes standalone components the default import path. Change Lazy-loaded component imports from `@ionic/angular` to `@ionic/angular/lazy`. Change Standalone component imports from `@ionic/angular/standalone` to `@ionic/angular`. | |
| Ionic 9 makes standalone components the default import path. Change lazy-loaded component imports from `@ionic/angular` to `@ionic/angular/lazy`. Change standalone component imports from `@ionic/angular/standalone` to `@ionic/angular`. |
Nit: Lazy-loaded and Standalone are capitalized mid-sentence. Lowercased them here. No worries if you'd rather leave it.
Description
Documentation for ionic-team/ionic-framework#31217
Ionic 9 changes import paths for lazy and standalone Angular components to make standalone the default. This PR updates references to these paths and documents migration.
Change Type
Platforms Affected