question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Anguar Package Format

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
deefactorialcommented, Dec 2, 2020

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.

3reactions
paulb-elasticcommented, Feb 8, 2021

https://github.com/elastic/apm-agent-rum-js/issues/962 has been raised to update the RUM Agent to support newer versions of Angular

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular package format
The Angular Package Format specifies that code be published in "flattened" ES module format. This significantly reduces the build time of Angular applications ......
Read more >
Angular Package Format v10 - Google Docs
The general rule in the Angular Package Format is to produce a FESM file for the smallest set of logically connected code. For...
Read more >
Learn The Main Benefits of Using The Angular Package Format
You must install peer dependencies yourself. npm WARN @angular/tsc-wrapped@4.4.7 requires a peer of typescript@^2.1.5 but none is installed. You must install ...
Read more >
Angular Package Format (APF) v6.0 · Issue #705 - GitHub
Description. With a new major Angular version comes a new package format. Some details can be found here though it's not fully updated: ......
Read more >
Igor Minar on Twitter: "Angular v13 will ship with the most ...
Angular v13 will ship with the most modern version of APF (Angular Package Format): ES Modules+ES2020 If you've ever maintained an npm library, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found