Make sure all generated code compiles#67680
Open
crisbeto wants to merge 10 commits intoangular:mainfrom
Open
Conversation
1cf3d5c to
f373858
Compare
mattrbeck
reviewed
Mar 13, 2026
| const testFiles = loadStandardTestFiles(); | ||
|
|
||
| function cleanNewLines(contents: string) { | ||
| return contents.replace(/\n/g, ' ').replace(/\s+/g, ' '); |
Member
There was a problem hiding this comment.
The .replace(/\s+/g, ' ') probably works for our case, but if we're just trying to replace newlines then maybe .replace(/\s*\n\s*/g, ' ') is a little safer?
Updates the signatures of generated code to match what the compiler actually generates.
Fixes that the compiler was generating an `attrs` field on the definition which isn't used anywhere.
Fixes that the Ivy transform was dropping the `exclamationToken` from properties.
Updates the output AST to allow leading comments to be attached to expression nodes.
…e tests Updates the compliance tests to check if the generated code compiles.
Adds explicit type annotations to the generated code so it's able to compile.
Adds `@ts-ignore` comments to same places in the pipeline where we can't produce code that passes all type checks.
In some cases the `debugName` transform generates a spread into the signal function parameters. This can cause compiler errors, because the functions don't have rest parameters. These changes work around it by adding a `@ts-ignore` above it.
Renames the test target so it's a bit clearer what it's targeting.
Updates the compliance tests to account for the recent changes.
f373858 to
a24918b
Compare
atscott
approved these changes
Mar 13, 2026
Contributor
atscott
left a comment
There was a problem hiding this comment.
personal preference/consider nit: I feel like it would have been nice to regenerate the compliance goldens in the commits that affected the outputs. That way it would have been really easy to see what the outcome of each individual change was (and would make each individual commit continue to pass the tests)
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These changes ensure that all generated instructions and definitions compile when passed back through TypeScript. The changes are roughly in the following categories:
@ts-ignorecomments on some expressions that we can't easily annotate to be valid.any) on generated variables and function parameters.Along the way I also found a couple of issues: