Skip to content

Commit 73008ab

Browse files
authored
Merge pull request #697 from GetStream/on-push
make all components use OnPush change detection
2 parents 3758f0b + 5e322b3 commit 73008ab

File tree

71 files changed

+814
-272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+814
-272
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"rules": {
1919
"@angular-eslint/sort-ngmodule-metadata-arrays": "off",
20-
"@angular-eslint/prefer-on-push-component-change-detection": "off",
20+
"@angular-eslint/prefer-on-push-component-change-detection": 2,
2121
"unused-imports/no-unused-imports": "error",
2222
"no-console": [
2323
"error",

.github/workflows/workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ on:
33
push:
44
branches:
55
- master
6-
- 6.x.x-rc
6+
- 7.x.x-beta
77
pull_request:
88
branches:
99
- master
10-
- 6.x.x-rc
10+
- 7.x.x-beta
1111
jobs:
1212
workflow:
1313
runs-on: ubuntu-latest

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"channel": "rc"
5656
}
5757
],
58-
"dryRun": false,
58+
"dryRun": true,
5959
"plugins": [
6060
[
6161
"@semantic-release/commit-analyzer",
@@ -79,7 +79,7 @@
7979
"@semantic-release/npm",
8080
{
8181
"pkgRoot": "./dist/stream-chat-angular",
82-
"npmPublish": true
82+
"npmPublish": false
8383
}
8484
],
8585
[

projects/customizations-example/.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"prefix": "app",
2828
"style": "kebab-case"
2929
}
30-
]
30+
],
31+
"@angular-eslint/prefer-on-push-component-change-detection": "off"
3132
}
3233
},
3334
{

projects/customizations-example/src/app/icon/icon.component.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { ChangeDetectionStrategy } from '@angular/core';
23

34
import { IconComponent } from './icon.component';
45

@@ -9,7 +10,11 @@ describe('IconComponent', () => {
910
beforeEach(async () => {
1011
await TestBed.configureTestingModule({
1112
declarations: [IconComponent],
12-
}).compileComponents();
13+
})
14+
.overrideComponent(IconComponent, {
15+
set: { changeDetection: ChangeDetectionStrategy.Default },
16+
})
17+
.compileComponents();
1318
});
1419

1520
beforeEach(() => {

projects/customizations-example/src/app/message-action/message-action.component.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { ChangeDetectionStrategy } from '@angular/core';
23

34
import { MessageActionComponent } from './message-action.component';
45

@@ -9,7 +10,11 @@ describe('MessageActionComponent', () => {
910
beforeEach(async () => {
1011
await TestBed.configureTestingModule({
1112
declarations: [MessageActionComponent],
12-
}).compileComponents();
13+
})
14+
.overrideComponent(MessageActionComponent, {
15+
set: { changeDetection: ChangeDetectionStrategy.Default },
16+
})
17+
.compileComponents();
1318
});
1419

1520
beforeEach(() => {

projects/customizations-example/src/app/thread-header/thread-header.component.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { ChangeDetectionStrategy } from '@angular/core';
23

34
import { ThreadHeaderComponent } from './thread-header.component';
45

@@ -9,7 +10,11 @@ describe('ThreadHeaderComponent', () => {
910
beforeEach(async () => {
1011
await TestBed.configureTestingModule({
1112
declarations: [ThreadHeaderComponent],
12-
}).compileComponents();
13+
})
14+
.overrideComponent(ThreadHeaderComponent, {
15+
set: { changeDetection: ChangeDetectionStrategy.Default },
16+
})
17+
.compileComponents();
1318
});
1419

1520
beforeEach(() => {

projects/sample-app/.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
{
3434
"patterns": ["dist/*", "public-api"]
3535
}
36-
]
36+
],
37+
"@angular-eslint/prefer-on-push-component-change-detection": "off"
3738
}
3839
},
3940
{

projects/sample-app/src/styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ body {
6161

6262
.channel-list.thread-close {
6363
width: 30%;
64+
min-width: 30%;
6465
max-width: 420px;
6566
position: initial;
6667
z-index: auto;

projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { CustomAttachmentListContext, GalleryAttachment } from '../types';
1515
import { AttachmentConfigurationService } from '../attachment-configuration.service';
1616
import {
1717
AfterViewInit,
18+
ChangeDetectionStrategy,
1819
Component,
1920
SimpleChange,
2021
TemplateRef,
@@ -63,7 +64,11 @@ describe('AttachmentListComponent', () => {
6364
MessageService,
6465
],
6566
imports: [TranslateModule.forRoot()],
66-
}).compileComponents();
67+
})
68+
.overrideComponent(AttachmentListComponent, {
69+
set: { changeDetection: ChangeDetectionStrategy.Default },
70+
})
71+
.compileComponents();
6772
TestBed.inject(StreamI18nService).setTranslation();
6873
});
6974

0 commit comments

Comments
 (0)