Skip to content
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

Merged
merged 6 commits into from
Jan 2, 2024

Conversation

sean-perkins
Copy link
Contributor

@sean-perkins sean-perkins commented Dec 4, 2023

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

Copy link

vercel bot commented Dec 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stencil-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2024 9:59pm

@sean-perkins sean-perkins marked this pull request as ready for review December 4, 2023 23:20
@sean-perkins sean-perkins requested a review from a team as a code owner December 4, 2023 23:20
@sean-perkins sean-perkins requested review from rwaskiewicz and alicewriteswrongs and removed request for a team December 4, 2023 23:20
Comment on lines 339 to 349
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 {}
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

@rwaskiewicz rwaskiewicz left a 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?

Copy link
Member

@tanner-reits tanner-reits left a 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 :shipit:

@sean-perkins sean-perkins merged commit 0d08147 into main Jan 2, 2024
4 checks passed
@sean-perkins sean-perkins deleted the sp/FW-5678 branch January 2, 2024 22:24
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.

3 participants