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.

@angular/localize should have @babel/core as a devDependency

See original GitHub issue

🐞 bug report

Affected Package

@angular/localize

Is this a regression?

not sure

Description

@angular/localize has @babel/core as a dependency, and not a devDependency.

We use BlackDuck for all the license attributions for the code we ship, but because @babel/core is include here, all the @babel/* and dependencies show up for BlackDuck to generate a report on, and include in our distributed license file even though none of that is browser code that will be shipped to users.

🔬 Minimal Reproduction

  • Create a new project: ng create new-project
  • Add @angular/localize: ng add @angular/localize

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JoostKcommented, Aug 3, 2020

@JoostK Thanks for clearing this up! Maybe long-term it makes sense to split @angular/localize into different packages? Given that the default way to install it is via schematic, both could be installed (in their appropriate category) anyway.

@Airblader Yeah, the way to go about it needs some discussion. Splitting could be one option, although I think it makes more sense to move the tooling part of @angular/localize into @angular/compiler-cli (which is already a peer dependency of @angular/localize). But there’s possibly more alternatives, such as optionalDependencies (I’m not sure whether that could work, nor how e.g. license extraction tooling deal with optional deps).

1reaction
JoostKcommented, Aug 3, 2020

This is an interesting one. The proposed solution of listing @babel/core only as a dev dependency would not work, unfortunately. Doing it like that may result in @babel/core being unavailable, as dev dependencies are not installed in consuming projects.

This situation occurs because @angular/localize includes multiple targets: the localize runtime and the localize tooling. The latter needs the @babel/core dependency, whereas the former does not. Tooling dependencies typically go into a project’s dev dependencies, such that the license extraction tool works correctly. In this case, however, it’s typically a dependency of the project because of the runtime part.

I think you could workaround by changing @angular/localize into a dev dependency of your project. When building the project, the runtime parts of @angular/localize will be included in the build output so it should be okay not to list @angular/localize as a real dependency. The only potential issue with this could be with libraries when its consuming application does not depend on @angular/localize, as then the true dependency on @angular/localize will get lost.

Read more comments on GitHub >

github_iconTop Results From Across the Web

While upgrading to Angular 13, installing @angular/localize ...
npm - While upgrading to Angular 13, installing @angular/localize@13.0.0 gives babel dependency error - Stack Overflow. Stack Overflow for ...
Read more >
@angular/localize - npm
Angular - library for localizing messages. Latest version: 15.0.3, last published: 3 days ago. Start using @angular/localize in your project ...
Read more >
A guide to building a React component with webpack 4 ...
To locally demo our component, we obviously need React, so let's install it as a dev dependency. Later we will see how to...
Read more >
@angular/compiler-cli | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Integrating from source - CKEditor 5 Documentation
The dependencies (or devDependencies ) section of package.json should look more or less like this: ... Finally, to localize the editor you need...
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