Repository navigation
Conversation
7068aab to
36acea3
Compare
|
Things are mostly looking good here, but it seems that this breaks the components repository. Apparently it already has a hack to enable The fix is pretty straightforward, just delete the components patch and update My only other thought is to update
|
…te_diagnostics` to `ng_module()` rule Refs angular#42966. Fixes angular#33452. This allows `ng_module()` targets to be built with strict templates enabled, it mostly works the way we already do this internally. Also adds extended template diagnostics behind an experimental option so it can be used internally and for tests. `strict_templates` can only be used if `type_check` is also enabled and `experimental_extended_template_diagnostics` can only be used if `strict_templates` is enabled.
Refs angular#42966. Previously if _any_ diagnostics were emitted, regardless of their category, the manifest would not be generated. This means that if a target emits only warnings and no errors, it would still fail to build because it does not generate all the required output files (specifically the `.es5.MF` file). Now the manifest file is generated as long as there are no error diagnostics in the result. This makes `ng_module()` support compiler warnings as a user would expect. Added a test which uses extended template diagnostics to trigger the invalid banana in box diagnostic. This generates a warning and uses Skylib's `build_test()` to verify that it builds successfully. Unfortunately there is no easy way to verify that the warning diagnostic is emitted at all. `expected_diagnostics` should be able to do that, but it doesn't seem to have any effect on `ng_module()` and may not be integrated. Instead, testing that a target with warnings builds correctly is the best we can easily do here without a deeper investigation.
|
This PR should also close #33452 since it adds |
IgorMinar
left a comment
There was a problem hiding this comment.
LGTM! Thank you!
Reviewed-for: bazel, dev-infra
…43582) Refs #42966. Previously if _any_ diagnostics were emitted, regardless of their category, the manifest would not be generated. This means that if a target emits only warnings and no errors, it would still fail to build because it does not generate all the required output files (specifically the `.es5.MF` file). Now the manifest file is generated as long as there are no error diagnostics in the result. This makes `ng_module()` support compiler warnings as a user would expect. Added a test which uses extended template diagnostics to trigger the invalid banana in box diagnostic. This generates a warning and uses Skylib's `build_test()` to verify that it builds successfully. Unfortunately there is no easy way to verify that the warning diagnostic is emitted at all. `expected_diagnostics` should be able to do that, but it doesn't seem to have any effect on `ng_module()` and may not be integrated. Instead, testing that a target with warnings builds correctly is the best we can easily do here without a deeper investigation. PR Close #43582
…g_module()` and remove local workaround Refs: angular/angular#33452. This workaround is no longer necessary since `ng_module()` actually supports strict templates now (see angular/angular#43582).
|
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. |
ngc_wrappedcurrently fails when given a compilation that emits only warnings. It doesn't generate the output.es5.MFfile which Bazel interprets as a hard failure. This PR updatesngc_wrappedto emit the manifest as long as none of the diagnostics are errors. This allows it to support a compilation that emits some warnings but no errors and pass the build.I added
strict_templatestong_module(), mostly in line with how we do this internally. I also added a newexperimental_extended_template_diagnosticsattribute which enables_extendedTemplateDiagnosticsas well which gives a warning we can test with. For now, there is one target which enables this and contains an invalid banana in box, which is shown as a warning but most importantly does not fail the build. I wanted to add a secondng_module()target withexpected_diagnosticsto confirm that the banana in box warning is actually emitted, but it doesn't seem to have any effect and may not be supported. I left out that test for now.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
ngc_wrappedno longer fails on compilations with warnings).ng_module()now supportsstrict_templates)What is the current behavior?
ngc_wrappeddoes not generate an.es5.MFfile when the compilation returns warnings and no errors. This failsng_module()because Bazel requires that all output files are generated.Issue Number: b/199443160
What is the new behavior?
ngc_wrappednow generates the.es5.MFfile as long as no errors are emitted.ng_module()now builds successfully when warnings are emitted.Does this PR introduce a breaking change?
Other information
This PR is slightly awkward for versioning because it's really a bugfix for
ngc_wrappedbut also happens to implement a feature forng_module()in order to test it.ng_module()is publicly exported, sostrict_templatesis usable. Extended template diagnostics have theexperimentalprefix to be more clear that this is intended as an internal option and not publicly supported yet./cc @atscott