Skip to content

refactor(compiler): remove parsing support for quote expressions #44915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

JoostK
Copy link
Member

@JoostK JoostK commented Jan 31, 2022

So-called "Quote expressions" were added in b6ec238
to support foreign syntax to be used in Angular templates, requiring a custom
template transform to convert them somehow during compilation. Support for template
transforms was originally implemented in a43ed79 but
has since been dropped. Since the compiler is not public API the quote expressions
should not have any usages anymore. Removing support for them can improve error
reporting for expressions that contain a :, e.g. binding to a URL without quotes:

<a [href]="http://google.com">Click me</a>

Here, http would be parsed as foreign "http" quote expression with //google.com as
value, later reporting the error "Quotes are not supported for evaluation!" because
there was no template transform to convert that code.

Closes #40398

@JoostK JoostK added target: major This PR is targeted for the next major release area: compiler Issues related to `ngc`, Angular's template compiler labels Jan 31, 2022
@ngbot ngbot bot modified the milestone: Backlog Jan 31, 2022
So-called "Quote expressions" were added in b6ec238
to support foreign syntax to be used in Angular templates, requiring a custom
template transform to convert them somehow during compilation. Support for template
transforms was originally implemented in a43ed79 but
has since been dropped. Since the compiler is not public API the quote expressions
should not have any usages anymore. Removing support for them can improve error
reporting for expressions that contain a `:`, e.g. binding to a URL without quotes:

```html
<a [href]="http://google.com">Click me</a>
```

Here, `http` would be parsed as foreign "http" quote expression with `//google.com` as
value, later reporting the error "Quotes are not supported for evaluation!" because
there was no template transform to convert that code.

Closes angular#40398
@JoostK JoostK force-pushed the remove-template-quote branch from 768db48 to 1bde6af Compare January 31, 2022 20:11
@JoostK JoostK marked this pull request as ready for review January 31, 2022 20:34
@JoostK
Copy link
Member Author

JoostK commented Jan 31, 2022

I wouldn't classify this as breaking change that needs a deprecation, as I believe this is just dead code at this point in time.

@JoostK JoostK requested a review from atscott January 31, 2022 20:36
@JoostK JoostK added the action: merge The PR is ready for merge by the caretaker label Jan 31, 2022
@jessicajaniuk
Copy link
Contributor

This PR was merged into the repository by commit db05ae1.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 3, 2022
josmar-crwdstffng pushed a commit to josmar-crwdstffng/angular that referenced this pull request Apr 8, 2022
…ular#44915)

So-called "Quote expressions" were added in b6ec238
to support foreign syntax to be used in Angular templates, requiring a custom
template transform to convert them somehow during compilation. Support for template
transforms was originally implemented in a43ed79 but
has since been dropped. Since the compiler is not public API the quote expressions
should not have any usages anymore. Removing support for them can improve error
reporting for expressions that contain a `:`, e.g. binding to a URL without quotes:

```html
<a [href]="http://google.com">Click me</a>
```

Here, `http` would be parsed as foreign "http" quote expression with `//google.com` as
value, later reporting the error "Quotes are not supported for evaluation!" because
there was no template transform to convert that code.

Closes angular#40398

PR Close angular#44915
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing compiler error message for malformed expression
3 participants