Skip to content

Commit

Permalink
merge release-8.2.0 (#29534)
Browse files Browse the repository at this point in the history
Release 8.2.0
  • Loading branch information
brandyscarney committed May 22, 2024
2 parents 665a24d + 9bfbd98 commit 5cdfa1a
Show file tree
Hide file tree
Showing 36 changed files with 243 additions and 117 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [8.2.0](https://github.com/ionic-team/ionic-framework/compare/v8.1.3...v8.2.0) (2024-05-22)


### Features

* **angular:** setting props on a signal works ([#29453](https://github.com/ionic-team/ionic-framework/issues/29453)) ([4640e04](https://github.com/ionic-team/ionic-framework/commit/4640e046ebbd35bf92737368c6262f79a8803a59)), closes [#28876](https://github.com/ionic-team/ionic-framework/issues/28876)





## [8.1.3](https://github.com/ionic-team/ionic-framework/compare/v8.1.2...v8.1.3) (2024-05-22)


Expand Down
8 changes: 8 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [8.2.0](https://github.com/ionic-team/ionic-framework/compare/v8.1.3...v8.2.0) (2024-05-22)

**Note:** Version bump only for package @ionic/core





## [8.1.3](https://github.com/ionic-team/ionic-framework/compare/v8.1.2...v8.1.3) (2024-05-22)


Expand Down
4 changes: 2 additions & 2 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ionic/core",
"version": "8.1.3",
"version": "8.2.0",
"description": "Base components for Ionic",
"keywords": [
"ionic",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"core",
"packages/*"
],
"version": "8.1.3"
"version": "8.2.0"
}
8 changes: 8 additions & 0 deletions packages/angular-server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [8.2.0](https://github.com/ionic-team/ionic-framework/compare/v8.1.3...v8.2.0) (2024-05-22)

**Note:** Version bump only for package @ionic/angular-server





## [8.1.3](https://github.com/ionic-team/ionic-framework/compare/v8.1.2...v8.1.3) (2024-05-22)

**Note:** Version bump only for package @ionic/angular-server
Expand Down
18 changes: 9 additions & 9 deletions packages/angular-server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/angular-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ionic/angular-server",
"version": "8.1.3",
"version": "8.2.0",
"description": "Angular SSR Module for Ionic",
"keywords": [
"ionic",
Expand Down Expand Up @@ -62,6 +62,6 @@
},
"prettier": "@ionic/prettier-config",
"dependencies": {
"@ionic/core": "^8.1.3"
"@ionic/core": "^8.2.0"
}
}
11 changes: 11 additions & 0 deletions packages/angular/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [8.2.0](https://github.com/ionic-team/ionic-framework/compare/v8.1.3...v8.2.0) (2024-05-22)


### Features

* **angular:** setting props on a signal works ([#29453](https://github.com/ionic-team/ionic-framework/issues/29453)) ([4640e04](https://github.com/ionic-team/ionic-framework/commit/4640e046ebbd35bf92737368c6262f79a8803a59)), closes [#28876](https://github.com/ionic-team/ionic-framework/issues/28876)





## [8.1.3](https://github.com/ionic-team/ionic-framework/compare/v8.1.2...v8.1.3) (2024-05-22)

**Note:** Version bump only for package @ionic/angular
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
* ```
*/
export class NavParams {
constructor(public data: { [key: string]: any } = {}) {}
constructor(public data: { [key: string]: any } = {}) {
console.warn(
`[Ionic Warning]: NavParams has been deprecated in favor of using Angular's input API. Developers should migrate to either the @Input decorator or the Signals-based input API.`
);
}

/**
* Get the value of a nav-parameter for the current view
Expand Down
48 changes: 43 additions & 5 deletions packages/angular/common/src/providers/angular-delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ import {

import { NavParams } from '../directives/navigation/nav-params';

import { ConfigToken } from './config';

// TODO(FW-2827): types

@Injectable()
export class AngularDelegate {
private zone = inject(NgZone);
private applicationRef = inject(ApplicationRef);
private config = inject(ConfigToken);

create(
environmentInjector: EnvironmentInjector,
Expand All @@ -37,7 +40,8 @@ export class AngularDelegate {
injector,
this.applicationRef,
this.zone,
elementReferenceKey
elementReferenceKey,
this.config.useSetInputAPI ?? false
);
}
}
Expand All @@ -51,7 +55,8 @@ export class AngularFrameworkDelegate implements FrameworkDelegate {
private injector: Injector,
private applicationRef: ApplicationRef,
private zone: NgZone,
private elementReferenceKey?: string
private elementReferenceKey?: string,
private enableSignalsSupport?: boolean
) {}

attachViewToDom(container: any, component: any, params?: any, cssClasses?: string[]): Promise<any> {
Expand Down Expand Up @@ -84,7 +89,8 @@ export class AngularFrameworkDelegate implements FrameworkDelegate {
component,
componentProps,
cssClasses,
this.elementReferenceKey
this.elementReferenceKey,
this.enableSignalsSupport
);
resolve(el);
});
Expand Down Expand Up @@ -121,7 +127,8 @@ export const attachView = (
component: any,
params: any,
cssClasses: string[] | undefined,
elementReferenceKey: string | undefined
elementReferenceKey: string | undefined,
enableSignalsSupport: boolean | undefined
): any => {
/**
* Wraps the injector with a custom injector that
Expand Down Expand Up @@ -164,7 +171,38 @@ export const attachView = (
);
}

Object.assign(instance, params);
/**
* Angular 14.1 added support for setInput
* so we need to fall back to Object.assign
* for Angular 14.0.
*/
if (enableSignalsSupport === true && componentRef.setInput !== undefined) {
const { modal, popover, ...otherParams } = params;
/**
* Any key/value pairs set in componentProps
* must be set as inputs on the component instance.
*/
for (const key in otherParams) {
componentRef.setInput(key, otherParams[key]);
}

/**
* Using setInput will cause an error when
* setting modal/popover on a component that
* does not define them as an input. For backwards
* compatibility purposes we fall back to using
* Object.assign for these properties.
*/
if (modal !== undefined) {
Object.assign(instance, { modal });
}

if (popover !== undefined) {
Object.assign(instance, { popover });
}
} else {
Object.assign(instance, params);
}
}
if (cssClasses) {
for (const cssClass of cssClasses) {
Expand Down
18 changes: 9 additions & 9 deletions packages/angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ionic/angular",
"version": "8.1.3",
"version": "8.2.0",
"description": "Angular specific wrappers for @ionic/core",
"keywords": [
"ionic",
Expand Down Expand Up @@ -47,7 +47,7 @@
}
},
"dependencies": {
"@ionic/core": "^8.1.3",
"@ionic/core": "^8.2.0",
"ionicons": "^7.0.0",
"jsonc-parser": "^3.0.0",
"tslib": "^2.3.0"
Expand Down
9 changes: 7 additions & 2 deletions packages/angular/src/ionic-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,18 @@ const DECLARATIONS = [
IonMaxValidator,
];

type OptInAngularFeatures = {
useSetInputAPI?: boolean;
};

@NgModule({
declarations: DECLARATIONS,
exports: DECLARATIONS,
providers: [AngularDelegate, ModalController, PopoverController],
providers: [ModalController, PopoverController],
imports: [CommonModule],
})
export class IonicModule {
static forRoot(config?: IonicConfig): ModuleWithProviders<IonicModule> {
static forRoot(config: IonicConfig & OptInAngularFeatures = {}): ModuleWithProviders<IonicModule> {
return {
ngModule: IonicModule,
providers: [
Expand All @@ -73,6 +77,7 @@ export class IonicModule {
multi: true,
deps: [ConfigToken, DOCUMENT, NgZone],
},
AngularDelegate,
provideComponentInputBinding(),
],
};
Expand Down
6 changes: 5 additions & 1 deletion packages/angular/standalone/src/providers/ionic-angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import type { IonicConfig } from '@ionic/core/components';
import { ModalController } from './modal-controller';
import { PopoverController } from './popover-controller';

export const provideIonicAngular = (config?: IonicConfig): EnvironmentProviders => {
type OptInAngularFeatures = {
useSetInputAPI?: boolean;
};

export const provideIonicAngular = (config: IonicConfig & OptInAngularFeatures = {}): EnvironmentProviders => {
return makeEnvironmentProviders([
{
provide: ConfigToken,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { JsonPipe } from "@angular/common";
import { Component } from "@angular/core";
import { Component, Input } from "@angular/core";

import { IonicModule } from "@ionic/angular";

Expand All @@ -23,7 +23,7 @@ let rootParamsException = false;
})
export class NavRootComponent {

params: any;
@Input() params: any = {};

ngOnInit() {
if (this.params === undefined) {
Expand Down
Loading

0 comments on commit 5cdfa1a

Please sign in to comment.