Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions napi/angular-compiler/vite-plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,13 @@ export function angular(options: PluginOptions = {}): Plugin[] {
include: ['rxjs/operators', 'rxjs'],
exclude: ['@angular/platform-server'],
},
// Note: We dynamically unwatch template/style files when discovered during transform
// using server.watcher.unwatch(). This is more precise than static glob patterns.
...(options.tsconfig && {
build: {
rolldownOptions: {
tsconfig: options.tsconfig,
},
},
}),
}
},
configResolved(config) {
Expand Down
4 changes: 3 additions & 1 deletion napi/playground/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Routes } from '@angular/router'

export const routes: Routes = []
import { CasesComponent } from './cases.component'

export const routes: Routes = [{ path: 'cases', component: CasesComponent }]
30 changes: 30 additions & 0 deletions napi/playground/src/app/cases.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Component, Injectable, inject, signal } from '@angular/core'
import { Observable, of, delay } from 'rxjs'

@Injectable({ providedIn: 'root' })
export class CifaPanelService {
onClose: Observable<boolean> = of(true)
}

@Component({
selector: 'app-cases',
template: '<div>Cases: {{ view() }}</div>',
standalone: true,
})
export class CasesComponent {
// Field using inject()
private cifaPanelService = inject(CifaPanelService)

// Field referencing the inject() field above - CRASHES with native class fields
// because cifaPanelService may not be initialized yet
private casesDrawerCloseChangeEvent$ = this.cifaPanelService.onClose.pipe(delay(0))

// Private field with signal
#view = signal<string>('home')
view = this.#view.asReadonly()

constructor() {
this.casesDrawerCloseChangeEvent$.subscribe()
console.log('CasesComponent view:', this.#view())
}
}
23 changes: 23 additions & 0 deletions napi/playground/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"isolatedModules": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "ES2022",
"useDefineForClassFields": false,
"module": "preserve",
"moduleResolution": "bundler"
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
21 changes: 1 addition & 20 deletions napi/playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
{
"compilerOptions": {
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"isolatedModules": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "ES2022",
"module": "preserve",
"moduleResolution": "bundler"
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
},
"extends": "./tsconfig.base.json",
"references": [
{
"path": "../angular-compiler"
Expand Down
Loading
Loading