-
Notifications
You must be signed in to change notification settings - Fork 421
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
docs(angular): updated instructions for angular modules vs. standalone #1284
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
bce6585
to
ad6c5d6
Compare
import { Component } from '@angular/core'; | ||
import { MyComponent } from 'component-library'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.css'], | ||
standalone: true, | ||
imports: [MyComponent], | ||
}) | ||
export class AppComponent {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this snippet, I ran into the following error message when trying to run hte local dev server for the app:
[ERROR] TS-992011: The component 'MyComponent' appears in 'imports', but is not standalone and cannot be imported directly. It must be imported via an NgModule. [plugin angular-compiler]
projects/my-app/src/app/app.component.ts:9:12:
9 │ imports: [MyComponent],
╵ ~~~~~~~~~~~
I ran through the instructions here from start to end to verify that I wasn't starting with a pre-existing reproduction locally that was in a bad state.
Do we need to call out to folks that when they need to use 'standalone' for the outputType when they're configuring the Stencil OT here? I think that'd lead to quite a few more changes, but I don't fully understand the error message above and wanted to double check before we went down that road
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh yes, we need to additionally reference each usage for the different outputType
configurations. I'll think on how we might split this up. I think separating consumer usage by type makes sense, but maybe another subsection within it for the different output types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me - @tanner-reits could you do a pass when you get a chance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and seems easy enough to follow
Updates the Framework Wrapper docs for Angular to separate usage instructions based on an Angular application using modules or standalone.
Additionally updates the markdown code block syntax to use
title
to clearly outline which files the code blocks refer to.Preview: https://stencil-docs-git-sp-fw-5678-ionic1.vercel.app/docs/next/angular#consumer-usage