Skip to content

Commit b986d97

Browse files
committed
chore: angular 19 stuffs (untracked and imports array)
1 parent 6d8bf06 commit b986d97

File tree

12 files changed

+24
-41
lines changed

12 files changed

+24
-41
lines changed

apps/astro-docs/src/components/soba/scene-graph.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
CUSTOM_ELEMENTS_SCHEMA,
77
DestroyRef,
88
inject,
9-
untracked,
109
viewChild,
1110
ViewContainerRef,
1211
} from '@angular/core';
@@ -50,10 +49,8 @@ export class SceneGraph {
5049
let ref: ComponentRef<unknown>;
5150

5251
afterNextRender(() => {
53-
untracked(() => {
54-
ref = this.anchor().createComponent(this.sobaContent());
55-
ref.changeDetectorRef.detectChanges();
56-
});
52+
ref = this.anchor().createComponent(this.sobaContent());
53+
ref.changeDetectorRef.detectChanges();
5754
});
5855

5956
inject(DestroyRef).onDestroy(() => {

apps/astro-docs/src/components/soba/wrapper.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,15 @@ export class SobaWrapper {
3636
performance = this.canvasOptionsStore.select('performance');
3737

3838
constructor() {
39-
effect(
40-
() => {
41-
const sceneKey = this.scene();
39+
effect(() => {
40+
const sceneKey = this.scene();
4241

43-
const { scene, canvasOptions } = sceneKey.split('.').reduce((acc, cur) => {
44-
return acc[cur];
45-
}, scenes) as SceneOptions;
42+
const { scene, canvasOptions } = sceneKey.split('.').reduce((acc, cur) => {
43+
return acc[cur];
44+
}, scenes) as SceneOptions;
4645

47-
this.sobaContent.set(scene);
48-
if (canvasOptions) this.canvasOptionsStore.update(canvasOptions);
49-
},
50-
{ allowSignalWrites: true },
51-
);
46+
this.sobaContent.set(scene);
47+
if (canvasOptions) this.canvasOptionsStore.update(canvasOptions);
48+
});
5249
}
5350
}

apps/kitchen-sink/src/app/cannon/chain/experience.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { NgtArgs, injectBeforeRender, injectStore } from 'angular-three';
2020
import { NgtcPhysics } from 'angular-three-cannon';
2121
import { injectBox, injectCylinder, injectSphere } from 'angular-three-cannon/body';
2222
import { injectConeTwist } from 'angular-three-cannon/constraint';
23-
import { NgtcDebug } from 'angular-three-cannon/debug';
2423
import { Color, ColorRepresentation, Mesh, Object3D } from 'three';
2524

2625
interface Handle {
@@ -201,7 +200,7 @@ export class StaticHandle {
201200
}
202201
</ngtc-physics>
203202
`,
204-
imports: [NgtcPhysics, NgtcDebug, NgtArgs, PointerHandle, Chain, StaticHandle],
203+
imports: [NgtcPhysics, NgtArgs, PointerHandle, Chain, StaticHandle],
205204
changeDetection: ChangeDetectionStrategy.OnPush,
206205
schemas: [CUSTOM_ELEMENTS_SCHEMA],
207206
host: { class: 'chain-experience' },

apps/kitchen-sink/src/app/cannon/kinematic-cube/experience.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { Triplet } from '@pmndrs/cannon-worker-api';
1111
import { NgtArgs, injectBeforeRender } from 'angular-three';
1212
import { NgtcPhysics } from 'angular-three-cannon';
1313
import { injectBox, injectPlane, injectSphere } from 'angular-three-cannon/body';
14-
import { NgtcDebug } from 'angular-three-cannon/debug';
1514
import { Color, InstancedMesh, Mesh } from 'three';
1615
import niceColors from '../../colors';
1716

@@ -141,7 +140,7 @@ export class InstancedSpheres {
141140
<app-instanced-spheres />
142141
</ngtc-physics>
143142
`,
144-
imports: [InstancedSpheres, Box, Plane, NgtcPhysics, NgtArgs, NgtcDebug],
143+
imports: [InstancedSpheres, Box, Plane, NgtcPhysics, NgtArgs],
145144
schemas: [CUSTOM_ELEMENTS_SCHEMA],
146145
changeDetection: ChangeDetectionStrategy.OnPush,
147146
host: { class: 'kimenatic-experience' },

apps/kitchen-sink/src/app/cannon/monday-morning/experience.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { NgTemplateOutlet } from '@angular/common';
21
import {
32
CUSTOM_ELEMENTS_SCHEMA,
43
ChangeDetectionStrategy,
@@ -72,7 +71,7 @@ function injectDragConstraint(ref: Signal<ElementRef<Object3D> | undefined>) {
7271
<ng-content />
7372
</ngts-rounded-box>
7473
`,
75-
imports: [NgtArgs, NgtsRoundedBox],
74+
imports: [NgtsRoundedBox],
7675
schemas: [CUSTOM_ELEMENTS_SCHEMA],
7776
changeDetection: ChangeDetectionStrategy.OnPush,
7877
})
@@ -126,7 +125,7 @@ function double([x, y, z]: Readonly<Triplet>): Triplet {
126125
127126
<ng-content />
128127
`,
129-
imports: [Box, NgTemplateOutlet],
128+
imports: [Box],
130129
schemas: [CUSTOM_ELEMENTS_SCHEMA],
131130
changeDetection: ChangeDetectionStrategy.OnPush,
132131
})
@@ -324,7 +323,6 @@ interface CupGLTF extends GLTF {
324323
</ngt-group>
325324
</ngt-group>
326325
`,
327-
imports: [NgtArgs],
328326
schemas: [CUSTOM_ELEMENTS_SCHEMA],
329327
changeDetection: ChangeDetectionStrategy.OnPush,
330328
})
@@ -352,7 +350,7 @@ export class Mug {
352350
<app-box #leg4 [scale]="[0.5, 4, 0.5]" />
353351
<app-mug />
354352
`,
355-
imports: [NgtArgs, Mug, Box],
353+
imports: [Mug, Box],
356354
schemas: [CUSTOM_ELEMENTS_SCHEMA],
357355
changeDetection: ChangeDetectionStrategy.OnPush,
358356
})

apps/kitchen-sink/src/app/misc/aviator/collectible/collectible-coin.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
inject,
77
viewChild,
88
} from '@angular/core';
9-
import { injectBeforeRender, NgtArgs } from 'angular-three';
9+
import { injectBeforeRender } from 'angular-three';
1010
import { CylinderGeometry, Mesh, MeshPhongMaterial } from 'three';
1111
import { COIN_DISTANCE_TOLERANCE, COLOR_COINS } from '../constants';
1212
import { GameStore } from '../game.store';
@@ -39,7 +39,6 @@ const coinMaterial = new MeshPhongMaterial({
3939
`,
4040
schemas: [CUSTOM_ELEMENTS_SCHEMA],
4141
changeDetection: ChangeDetectionStrategy.OnPush,
42-
imports: [NgtArgs],
4342
hostDirectives: [{ directive: Collectible, inputs: ['state'], outputs: ['stateChange'] }],
4443
providers: [
4544
{ provide: SPAWNABLE_DISTANCE_TOLERANCE, useValue: COIN_DISTANCE_TOLERANCE },

apps/kitchen-sink/src/app/misc/aviator/experience.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { CollectiblesStore } from './collectible/collectibles.store';
99
import { DISTANCE_FOR_COINS_SPAWN, PLANE_DEFAULT_HEIGHT, RATIO_SPEED_DISTANCE, SEA_RADIUS } from './constants';
1010
import { GameStore } from './game.store';
1111
import { Lights } from './lights/lights';
12-
import { Sea } from './sea/sea';
1312
import { Sky } from './sky/sky';
1413

1514
@Component({
@@ -60,7 +59,7 @@ import { Sky } from './sky/sky';
6059
`,
6160
schemas: [CUSTOM_ELEMENTS_SCHEMA],
6261
changeDetection: ChangeDetectionStrategy.OnPush,
63-
imports: [NgtArgs, Lights, Sea, NgtsOrbitControls, Sky, Airplane, CollectibleCoin, CollectiblePowerUp],
62+
imports: [NgtArgs, Lights, /* Sea, */ NgtsOrbitControls, Sky, Airplane, CollectibleCoin, CollectiblePowerUp],
6463
})
6564
export class Experience {
6665
private gameStore = inject(GameStore);

apps/kitchen-sink/src/app/misc/aviator/sky/cloud.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
viewChild,
88
viewChildren,
99
} from '@angular/core';
10-
import { injectBeforeRender, NgtArgs } from 'angular-three';
10+
import { injectBeforeRender } from 'angular-three';
1111
import { BoxGeometry, Mesh, MeshPhongMaterial, Object3D } from 'three';
1212
import { COLORS } from '../constants';
1313

@@ -22,7 +22,6 @@ import { COLORS } from '../constants';
2222
`,
2323
schemas: [CUSTOM_ELEMENTS_SCHEMA],
2424
changeDetection: ChangeDetectionStrategy.OnPush,
25-
imports: [NgtArgs],
2625
})
2726
export class Cloud {
2827
protected material = new MeshPhongMaterial({ color: COLORS.white });

apps/kitchen-sink/src/app/rapier/joints/joints.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
viewChild,
99
viewChildren,
1010
} from '@angular/core';
11-
import { injectBeforeRender, NgtArgs, NgtVector3, NON_ROOT } from 'angular-three';
11+
import { injectBeforeRender, NgtVector3, NON_ROOT } from 'angular-three';
1212
import { injectPrismaticJoint, injectSphericalJoint, NgtrRigidBody, NgtrRigidBodyType } from 'angular-three-rapier';
1313
import { Quaternion, Vector3 } from 'three';
1414

@@ -69,7 +69,7 @@ export class RopeJoint {
6969
`,
7070
schemas: [CUSTOM_ELEMENTS_SCHEMA],
7171
changeDetection: ChangeDetectionStrategy.OnPush,
72-
imports: [RopeSegment, NgtArgs, RopeJoint, NgtrRigidBody],
72+
imports: [RopeSegment, RopeJoint],
7373
})
7474
export class Rope {
7575
length = input.required<number>();

apps/kitchen-sink/src/app/soba/porsche/model.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { NgTemplateOutlet } from '@angular/common';
21
import { ChangeDetectionStrategy, Component, computed, CUSTOM_ELEMENTS_SCHEMA, effect, input } from '@angular/core';
32
import { applyProps, NgtArgs } from 'angular-three';
43
import { injectGLTF } from 'angular-three-soba/loaders';
@@ -12,7 +11,7 @@ import { color } from './color';
1211
`,
1312
schemas: [CUSTOM_ELEMENTS_SCHEMA],
1413
changeDetection: ChangeDetectionStrategy.OnPush,
15-
imports: [NgtArgs, NgTemplateOutlet],
14+
imports: [NgtArgs],
1615
})
1716
export class Model {
1817
position = input([0, 0, 0]);

apps/kitchen-sink/src/app/soba/portal-shapes/experience.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { ChangeDetectionStrategy, Component, CUSTOM_ELEMENTS_SCHEMA, inject } from '@angular/core';
22
import { NgtArgs } from 'angular-three';
33
import { NgtrCuboidCollider, NgtrPhysics } from 'angular-three-rapier';
4-
import { NgtsCameraControls, NgtsOrbitControls } from 'angular-three-soba/controls';
4+
import { NgtsCameraControls } from 'angular-three-soba/controls';
55
import { NgtsPreload } from 'angular-three-soba/misc';
6-
import { NgtsBounds, NgtsContactShadows, NgtsEnvironment, NgtsLightformer } from 'angular-three-soba/staging';
6+
import { NgtsContactShadows, NgtsEnvironment, NgtsLightformer } from 'angular-three-soba/staging';
77
import { Experience as BasicExperience } from '../basic/experience';
88
import { Experience as InstancedVertexColorsExperience } from '../instanced-vertex-colors/experience';
99
import { Experience as InstancesExperience } from '../instances/exprience';
@@ -158,8 +158,6 @@ import { Letter } from './letter';
158158
ShakyExperience,
159159
InvertedStencilBufferExperience,
160160
InstancesExperience,
161-
NgtsBounds,
162-
NgtsOrbitControls,
163161
],
164162
hostDirectives: [NgtsPreload],
165163
})

apps/kitchen-sink/src/app/soba/simple-sound-analyser/track.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
} from '@angular/core';
1212
import { injectBeforeRender, NgtArgs } from 'angular-three';
1313
import { NgtsText } from 'angular-three-soba/abstractions';
14-
import { NgtsPivotControls } from 'angular-three-soba/gizmos';
1514
import { InstancedMesh, MeshBasicMaterial, Object3D, PlaneGeometry } from 'three';
1615
import { AudioStore } from './audio.store';
1716

@@ -29,7 +28,7 @@ import { AudioStore } from './audio.store';
2928
`,
3029
schemas: [CUSTOM_ELEMENTS_SCHEMA],
3130
changeDetection: ChangeDetectionStrategy.OnPush,
32-
imports: [NgtArgs, NgtsText, NgtsPivotControls],
31+
imports: [NgtArgs, NgtsText],
3332
})
3433
export class Track {
3534
sound = input.required<'drums' | 'synth' | 'snare'>();

0 commit comments

Comments
 (0)