Api version limit for complex template expressions#5520
Merged
jhefferman-sfdc merged 13 commits intomasterfrom Sep 29, 2025
Merged
Api version limit for complex template expressions#5520jhefferman-sfdc merged 13 commits intomasterfrom
jhefferman-sfdc merged 13 commits intomasterfrom
Conversation
jhefferman-sfdc
commented
Sep 29, 2025
| const sourceLocation = ast.sourceLocation(location); | ||
|
|
||
| return ctx.config.experimentalComplexExpressions | ||
| return isComplexTemplateExpressionEnabled(ctx) |
Contributor
Author
There was a problem hiding this comment.
In contrast to the ctx.config.experimentalComplexExpressions property, isComplexTemplateExpressionEnabled additionally checks that the context api version is sufficient for complex template expressions.
wjhsf
approved these changes
Sep 29, 2025
| (directive) => directive.name === 'PreserveComments' | ||
| )?.value?.value; | ||
| const experimentalComplexExpressions = Boolean(options.experimentalComplexExpressions); | ||
| const apiVersion = Number(options.apiVersion); |
Contributor
There was a problem hiding this comment.
Is it not already a number? 🤔
Contributor
Author
There was a problem hiding this comment.
It can be undefined (goes to NaN)
Comment on lines
60
to
+64
| experimentalComplexExpressions, | ||
| }: { | ||
| entry: string; | ||
| dirname: string; | ||
| experimentalComplexExpressions: boolean; | ||
| experimentalComplexExpressions: boolean | undefined; |
Contributor
There was a problem hiding this comment.
Suggested change
| experimentalComplexExpressions: boolean | undefined; | |
| experimentalComplexExpressions = false, | |
| }: { | |
| entry: string; | |
| dirname: string; | |
| experimentalComplexExpressions: boolean; |
just cuz
Contributor
Author
There was a problem hiding this comment.
A default value isn't enough, still considered boolean | undefined and results in a type error. Gonna keep it as-is
| if (!isEscaped && isExpression(value)) { | ||
| if (isQuoted && !isComplexTemplateExpressionEnabled(ctx)) { | ||
| // Don't test for the API version here, just check if CTE is enabled. | ||
| // We can provide more specific errors WRT API versions after the expression has been parsed and we know what it is. |
Contributor
There was a problem hiding this comment.
Suggested change
| // We can provide more specific errors WRT API versions after the expression has been parsed and we know what it is. | |
| // We can provide more specific errors w.r.t API versions after the expression has been parsed and we know what it is. |
Otherwise I might think that MRT fell over.
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.
Details
Complex template expressions should only be allowed for components that have an API version greater than 260 (60).
If CTEs are used on components with a prior version, a suitable error message should be displayed.
Does this pull request introduce a breaking change?
Does this pull request introduce an observable change?
GUS work item
W-17386900