angular/packages/compiler/src
Kristiyan Kostadinov 4e9244990a fix(compiler-cli): more accurate diagnostics for host binding parser errors (#58870)
Currently host bindings are in a bit of a weird state, because their source spans all point to the root object literal, rather than the individual expression. This is tricky to handle at the moment, because the object is being passed around as a `Record<string, string>` since the compiler needs to support both JIT and non-JIT environments, and because the AOT compiler evaluates the entire literal rather than doing it expression-by-expression. As a result, when we report errors in one of the host bindings, we end up highlighting the entire expression which can be very noisy in an IDE.

These changes aim to report a more accurate error for the most common case where the `host` object is initialized to a `string -> string` object literal by matching the failing expression to one of the property initializers. Note that this isn't 100% reliable, because we can't map cases like `host: SOME_CONST`, but it's still better than the current setup.

PR Close #58870
2024-11-25 15:25:48 +00:00
..
expression_parser fix(compiler): handle typeof expressions in serializer (#58217) 2024-10-16 09:47:10 +00:00
i18n refactor(compiler): remove preservePlaceholders (#58176) 2024-10-16 06:42:37 +00:00
ml_parser refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
output refactor(compiler): remove unused field from output AST (#58444) 2024-11-01 14:32:57 +00:00
render3 refactor(compiler): trigger hmr load on initialization (#58465) 2024-11-01 19:14:16 +00:00
schema refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
template/pipeline fix(compiler): control flow nodes with root at the end projected incorrectly (#58607) 2024-11-12 18:05:00 +00:00
template_parser fix(compiler-cli): more accurate diagnostics for host binding parser errors (#58870) 2024-11-25 15:25:48 +00:00
assertions.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
chars.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
compiler.ts refactor(compiler): generate HMR update function (#58205) 2024-10-16 07:22:45 +00:00
compiler_facade_interface.ts refactor(compiler): dynamic default for the partial compiler. (#58169) 2024-10-15 16:05:14 +00:00
config.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
constant_pool.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
core.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
injectable_compiler_2.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
jit_compiler_facade.ts refactor(compiler): dynamic default for the partial compiler. (#58169) 2024-10-15 16:05:14 +00:00
parse_util.ts fix(compiler-cli): more accurate diagnostics for host binding parser errors (#58870) 2024-11-25 15:25:48 +00:00
resource_loader.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
selector.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
shadow_css.ts fix(compiler): fix multiline selectors (#58681) 2024-11-15 11:30:27 +01:00
style_url_resolver.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
util.ts refactor(compiler): dynamic default for the partial compiler. (#58169) 2024-10-15 16:05:14 +00:00
version.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00