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

feat(angular-output-target): generate standalone components #367

Merged
merged 12 commits into from
Aug 10, 2023

Conversation

sean-perkins
Copy link
Collaborator

@sean-perkins sean-perkins commented Jul 31, 2023

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally for affected output targets
  • Tests (npm test) were run locally and passed
  • Prettier (npm run prettier) was run locally and passed

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue URL: N/A

What is the new behavior?

Developers can generate standalone Angular component wrappers for their Stencil web components 🎉

  • Adds new outputType option to the Angular output target for specifying the desired type of generated output. Defaults to component.
  • Removes includeSingleComponentAngularModules option in favor of outputType: "scam".
  • Removes includeImportCustomElements option in favor of outputType: "scam" or outputType: "standalone".
  • Updates the dev-build Github action to use the locally installed version of Lerna.

Does this introduce a breaking change?

  • Yes
  • No
  • includeSingleComponentAngularModules is removed, use outputType: "scam" instead.
  • includeImportCustomElements option is removed, either use outputType: "scam" or outputType: "standalone".

Other information

Dev-build: @stencil/angular-output-target@0.7.2-dev.11691677969.1304fff5

Docs PR: ionic-team/stencil-site#1183

@sean-perkins sean-perkins changed the title feat(angular-output-target): outputType configuration (#365) feat(angular-output-target): generate standalone angular components Jul 31, 2023
@sean-perkins sean-perkins changed the title feat(angular-output-target): generate standalone angular components feat(angular-output-target): generate standalone components Jul 31, 2023
@sean-perkins
Copy link
Collaborator Author

When updating Ionic Framework, this is the expected change to the Stencil config:

angularOutputTarget({
      componentCorePackage: '@ionic/core',
      outputType: 'component',
      directivesProxyFile: '../packages/angular/src/directives/proxies.ts',
      directivesArrayFile: '../packages/angular/src/directives/proxies-list.ts',
      excludeComponents: [
        // overlays that accept user components
        'ion-modal',
        'ion-popover',

        // navigation
        'ion-router',
        'ion-route',
        'ion-route-redirect',
        'ion-router-link',
        'ion-router-outlet',

        // tabs
        'ion-tabs',
        'ion-tab',

        // auxiliar
        'ion-picker-column',
      ],
    }),
    angularOutputTarget({
      componentCorePackage: '@ionic/core',
      outputType: 'standalone',
      directivesProxyFile: '../packages/angular/src/directives/standalone.ts',
      customElementsDir: 'components',
      excludeComponents: [
        // overlays that accept user components
        'ion-modal',
        'ion-popover',

        // navigation
        'ion-router',
        'ion-route',
        'ion-route-redirect',
        'ion-router-link',
        'ion-router-outlet',

        // tabs
        'ion-tabs',
        'ion-tab',

        // auxiliar
        'ion-picker-column',
      ],
    }),

@sean-perkins sean-perkins marked this pull request as ready for review July 31, 2023 18:11
@sean-perkins sean-perkins requested review from a team as code owners July 31, 2023 18:11
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.

One non-blocking merge-related ask

.github/workflows/dev-build.yml Outdated Show resolved Hide resolved
…scam (#368)

* fix(angular-output-target): CE build only works with standalone and scam

* chore: use util

* refactor: use enum for output type

* chore: prettier formatting

* fix: weird vscode auto import
@sean-perkins sean-perkins merged commit 481cd05 into main Aug 10, 2023
3 checks passed
@sean-perkins sean-perkins deleted the sp/FW-4756 branch August 10, 2023 15:27
sean-perkins added a commit to ionic-team/ionic-framework that referenced this pull request Aug 18, 2023
Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Ionic Framework currently only generates the lazy/hydrated Angular
component wrappers for the web components.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Generates Angular standalone component wrappers for the web
components, using the CE build.
  - Adds manual component wrapper for `ion-icon` with the CE build.
- Migrates the `ion-back-button` and `ion-nav` to be manual component
wrappers
- Continues to generate the lazy/hydrated Angular component wrappers.
- Refactors "NavDelegate" etc. language to `IonNav` to avoid exporting
as and simplify navigating the code.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Related output targets PR:
ionic-team/stencil-ds-output-targets#367
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.

None yet

3 participants