Skip to content

deprecate(inject-lazy): deprecate injectLazy in favor of Angular v22 injectAsync#691

Open
eneajaho wants to merge 3 commits into
mainfrom
deprecate-inject-lazy
Open

deprecate(inject-lazy): deprecate injectLazy in favor of Angular v22 injectAsync#691
eneajaho wants to merge 3 commits into
mainfrom
deprecate-inject-lazy

Conversation

@eneajaho

Copy link
Copy Markdown
Collaborator

Summary

  • Adds @deprecated JSDoc to injectLazy pointing users to Angular's built-in injectAsync (available in Angular v22, see feat(core): Add an injectAsync helper function angular/angular#68248)
  • Adds @deprecated JSDoc to the companion mockLazyProvider test helper
  • Also fixes a copy-paste typo in mockLazyProvider's existing JSDoc (was incorrectly referencing injectAsync instead of injectLazy)

Closes #685

Test plan

  • pnpm exec nx run ngxtension/inject-lazy:test — all 5 tests pass
  • No runtime changes; deprecation is documentation-only via JSDoc @deprecated tag

🤖 Generated with Claude Code

…favor of Angular v22 injectAsync

Closes #685

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nx-cloud

nx-cloud Bot commented May 12, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit e9b6347

Command Status Duration Result
nx affected --target=build --parallel=3 --exclu... ✅ Succeeded 3s View ↗
nx affected --target=test --parallel=3 --exclud... ✅ Succeeded 16s View ↗
nx affected --target=lint --parallel=3 ✅ Succeeded 40s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-12 23:21:13 UTC

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request deprecates the injectLazy utility in favor of Angular's native injectAsync and introduces a local configuration file for Claude. Review feedback highlights factual inaccuracies in the deprecation documentation regarding the Angular version and PR link, and suggests that the local settings file should be added to .gitignore instead of being committed to the repository.

I am having trouble creating individual review comments. Click here to see my feedback.

libs/ngxtension/inject-lazy/src/inject-lazy-impl.ts (79-80)

high

The JSDoc references Angular v22 and PR #68248. However, Angular v19 is the current major version, and injectAsync is expected to be available in v19.x. Additionally, the PR number #68248 appears to be outside the current range of the Angular repository. These details are likely inaccuracies from the AI tool used to generate this PR and should be corrected to avoid misleading users.

libs/ngxtension/inject-lazy/src/inject-lazy.ts (14-15)

high

The JSDoc references Angular v22 and PR #68248. However, Angular v19 is the current major version, and injectAsync is expected to be available in v19.x. Additionally, the PR number #68248 appears to be outside the current range of the Angular repository. These details are likely inaccuracies from the AI tool used to generate this PR and should be corrected to avoid misleading users.

.claude/settings.local.json (1-5)

medium

This file appears to be a local configuration for the Claude Code tool. Local settings files, especially those with .local in the name, should typically be added to .gitignore rather than committed to the repository. This prevents environment-specific configurations from being shared and potentially overriding other contributors' settings.

…lar v22 injectAsync

- Adds ts-morph-based migration that rewrites the import from
  'ngxtension/inject-lazy' to '@angular/core', renames injectLazy
  to injectAsync at every call site, merges into existing @angular/core
  imports where present, and removes the unsupported explicit injector
  argument (printing a warning for affected files)
- Registers the migration in migrations.json at version 8.0.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JeanMeche

Copy link
Copy Markdown
Contributor

Ship it :D

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

Successfully merging this pull request may close these issues.

Deprecate injectLazy in favor of the v22 injectAsync.

2 participants