Repository navigation
fix(core/schematics): skip migration for non-type-safe tokens in inject-migration and log warnings - #61999
fix(core/schematics): skip migration for non-type-safe tokens in inject-migration and log warnings#61999aliabodaraa wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@aliabodaraa You need to follow the contribution guidelines. specially Contributor License Agreement (CLA) |
92516ab to
90c0d8d
Compare
|
This won't fix the reported issue, as it didn't use a string literal but rather a reference to a variable/import declaration. |
@JoostK |
|
@aliabodaraa As I know, you should be do it under a single commit. You can achieve this by rebase, squash, etc. |
d04d709 to
686da94
Compare
686da94 to
a3e743f
Compare
|
I don't think this is a desirable approach either, as identifiers are commonly used to refer to Practically speaking this means that the reported issue cannot be detected using the current migration setup, and I think that is fine; using |
|
Per Joost, I've also closed #61982 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Summary
This PR updates the inject migration logic to skip non-type-safe tokens (like string literals and variable/import references) and instead insert inline warning comments to guide developers to replace them with InjectionToken instances. This avoids invalid automatic transformations that could lead to compile-time errors.
Issue
Fixes #61982
Details
// WARNING: String token 'myToken' found. Skipping migration. Please replace with InjectionToken.// WARNING: Variable token 'myToken' found. Skipping migration. Please replace with InjectionToken.Tests
No new tests were added, but manual testing confirms the comment is correctly inserted in migrated code.
Please review and let me know if any changes are needed.