Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: add support for the new @angular/build:karma package #3472

Open
hamfastgamgee opened this issue Feb 27, 2025 · 5 comments
Open
Assignees

Comments

@hamfastgamgee
Copy link

With the release of Angular 19.2, there is a new builder @angular/build:karma available for the esbuild apparatus that in the medium term will fully replace @angular-devkit/build-angular:karma which is based on webpack. In the short term, applications can opt in to the new builder and avoid installing all the webpack dependencies that are no longer necessary.

If I migrate over to the new builder, auto-configuration fails because it is expecting a builder named one of the following:

@angular-devkit/build-angular:karma, @angular-builders/custom-webpack:karma, @ngx-env/builder:karma, @angular-builders/jest:run, @nrwl/jest:jest or @nx/jest:jest

@angular/build:karma functions identically to @angular-devkit/build-angular:karma with builderMode set to "application", which works in Wallaby today, so I assume the change to support the new builder type would be minimal.

Thanks!

@smcenlly
Copy link
Member

Thanks for the feature request and providing the context.

We've added support for @angular/build:karma to the latest version of Wallaby as you suggested (simply adding @angular/build:karma as another whitelist option).

Please update to Wallaby core v1.0.1716, it should work for you.

@hamfastgamgee
Copy link
Author

hamfastgamgee commented Feb 28, 2025

I absolutely love the prompt action! Thanks so much! It looks like there may be some additional work needed beyond the whitelisting, though. I'm getting the following error:

  Automatic Angular CLI configuration error: Cannot find module '@angular-devkit/build-angular/src/utils/webpack-browser-config'
  Require stack:
  - <rootDir>\node_modules\@angular\cli\src\commands\test\cli.js\wallaby.js
  Automatic Jest configuration error: Module jest-cli is not found in '<rootDir>'.
  Automatic Vitest configuration error: Vitest dependency not found.
  Automatic node:test configuration error: node:test use not found.

I'm assuming wallaby must be checking specifically for the @angular-devkit/build-angular versions of any dependencies (and possibly implicitly requiring webpack?), but in this mode they don't exist at all.

I can confirm that if I install the (now otherwise unnecessary) @angular-devkit/build-angular package that things do work with the updated whitelist (basically just ignoring the actual build configuration). I'm hoping that whatever changes would be necessary to support both the new config style and the old webpack one won't be huge, but I realize that's likely a much less quick fix because it'll probably need new parsing code.

Thanks again for everything you guys do. A company that picks up new requests the same day they are made is amazing and deserving of every dollar I make my corporation toss your way.

@smcenlly smcenlly reopened this Mar 3, 2025
@smcenlly smcenlly self-assigned this Mar 3, 2025
@smcenlly smcenlly changed the title Support new @angular/build:karma package Feature Request: add support for the new @angular/build:karma package Mar 3, 2025
@smcenlly
Copy link
Member

smcenlly commented Mar 3, 2025

Sorry for the mis-step. When testing, we had not removed @angular-devkit/build-angular and so everything appeared to be working for us when it wasn't.

We had mistakenly figured that adding an additional dependency was all that was required to support @angular/build:karma, but there's a fair bit more work involved unfortunately. Unlike @angular-devkit/build-angular:karma, which uses webpack, @angular/build:karma is compiling with vite. We don't have a mechanism in place within Wallaby to support this right now.

I've re-opened this issue and have added this to our backlog. We're hoping to schedule for the next month or so.

@hamfastgamgee
Copy link
Author

Thanks again for your consideration and assistance on this. Just dropping in an FYI to say that Angular 20's first beta package just dropped and changes the default for new projects to only install @angular/build, so there will likely start being a lot more impacted apps (only @angular/build and no @angular-devkit/build-angular) soon after May's launch of the new version. I know your tentative timeframe would be before that, but figured you might appreciate a heads-up on the new direction.

@smcenlly
Copy link
Member

smcenlly commented Mar 5, 2025

@hamfastgamgee - thanks for the note. We appreciate the heads up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants