[PATCH] refactor: add explicit types for exports relying on inferred call return type#61316
Closed
josephperrott wants to merge 1 commit intoangular:19.2.xfrom
Closed
[PATCH] refactor: add explicit types for exports relying on inferred call return type#61316josephperrott wants to merge 1 commit intoangular:19.2.xfrom
josephperrott wants to merge 1 commit intoangular:19.2.xfrom
Conversation
…urn type As part of the Bazel toolchain migration we noticed that implicit types generated by the TypeScript compiler sometimes end up referencing types from other packages (i.e. cross-package imports). These imports currently work just because the Bazel `ts_library` and `ng_module` rules automatically inserted a `<amd-module name="@angular/x" />` into `.d.ts` of packages. This helped TS figure out how to import a given file. Notably this is custom logic that is not occuring in vanilla TS or Angular compilations—so we will drop this magic as part of the toolchain cleanup! To improve code quality and keep the existing behavior working, we are doing the following: - adding a lint rule that reduces the risk of such imports breaking. The failure scenario without the rule is that API goldens show unexpected diffs, and types might be duplicated in a different package! - keeping the `<amd-module` headers, but we manually insert them into the package entry-points. This should ensure we don't regress anywhere; while we also improved general safety around this above. Long-term, isolated declarations or a lint rule from eslint-typescript can make this even more robust.
devversion
approved these changes
May 13, 2025
Member
Author
|
This PR was merged into the repository by commit 899cb4a. The changes were merged into the following branches: 19.2.x |
josephperrott
pushed a commit
that referenced
this pull request
May 13, 2025
…urn type (#61316) As part of the Bazel toolchain migration we noticed that implicit types generated by the TypeScript compiler sometimes end up referencing types from other packages (i.e. cross-package imports). These imports currently work just because the Bazel `ts_library` and `ng_module` rules automatically inserted a `<amd-module name="@angular/x" />` into `.d.ts` of packages. This helped TS figure out how to import a given file. Notably this is custom logic that is not occuring in vanilla TS or Angular compilations—so we will drop this magic as part of the toolchain cleanup! To improve code quality and keep the existing behavior working, we are doing the following: - adding a lint rule that reduces the risk of such imports breaking. The failure scenario without the rule is that API goldens show unexpected diffs, and types might be duplicated in a different package! - keeping the `<amd-module` headers, but we manually insert them into the package entry-points. This should ensure we don't regress anywhere; while we also improved general safety around this above. Long-term, isolated declarations or a lint rule from eslint-typescript can make this even more robust. PR Close #61316
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.