Anguar Package Format
See original GitHub issueI had opened a PR which was closed to address multiple issues with the Angular library namely using the ng
cli to create a package following the Angular Package Format. The ng
cli creates an output that contains a *.metadata.json
file which Angular uses for AOT compilation which is currently missing. It was a work in progress. It was a start at adding an actual Angular structure to the rum-angular
lerna package.
It was also meant to address multiple other issues. Like proper e2e tests, and protractor timeout issues which you can’t test because you don’t have an Angular app defined. The few apps we’ve tested adding the APM Angular library cause all our Protractor tests to timeout.
As well as fixing improper service usage/declaration. The current documentation has users define the ApmService
in the app module providers with a router dependency. This is not correct for an Angular library. While it works you should not have to define it like this since you’re using providedIn: 'root'
in the Injectable
. Which lead to odd issues like this.
This:
@NgModule({
...
providers: [{ provide: ApmService, useClass: ApmService,deps: [Router]}]
...
})
export class AppModule {
constructor(@Inject(ApmService) service: ApmService) {
// API is exposed through this apm instance
const apm = service.init({...})
}
}
becomes this
@NgModule({
...
imports: [ApmModule]
...
})
export class AppModule {
constructor(service: ApmService) {
// API is exposed through this apm instance
const apm = service.init({...})
}
}
I defined a task list of outstanding things that needed addressed, but it was a start to fix these things.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:18 (6 by maintainers)
Top GitHub Comments
Is there any update on this issue? Since angular abandoned JIT and only uses AOT for Ivy builds now the
rum-angular
package no longer works for angular 9, 10, 11.https://github.com/elastic/apm-agent-rum-js/issues/962 has been raised to update the RUM Agent to support newer versions of Angular