Skip to content

Commit fe37de6

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/vite-7.1.5
2 parents 59d8d34 + 4bf3be7 commit fe37de6

File tree

162 files changed

+2212
-4077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+2212
-4077
lines changed

packages/@lwc/errors/src/compiler/error-info/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
77
/**
8-
* Next error code: 1207
8+
* Next error code: 1209
99
*/
1010

1111
export * from './compiler';

packages/@lwc/errors/src/compiler/error-info/template-transform.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,4 +979,20 @@ export const ParserDiagnostics = {
979979
level: DiagnosticLevel.Error,
980980
url: '',
981981
},
982+
983+
COMPUTED_PROPERTY_ACCESS_NOT_ALLOWED_COMPLEX: {
984+
code: 1207,
985+
message:
986+
'Template expression doesn\'t allow computed property access unless the expression is surrounded by quotes: "{0}"',
987+
level: DiagnosticLevel.Error,
988+
url: '',
989+
},
990+
991+
INVALID_NODE_COMPLEX: {
992+
code: 1208,
993+
message:
994+
'Template expression doesn\'t allow {0} unless the expression is surrounded by quotes: "{1}"',
995+
level: DiagnosticLevel.Error,
996+
url: '',
997+
},
982998
};

packages/@lwc/perf-benchmarks-components/src/benchmark/expression/expression.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
-->
77
<template>
8-
<div data-foo={expr1()}></div>
9-
<p class={expr2.expr21.expr22}></p>
8+
<div data-foo="{expr1()}"></div>
9+
<p class="{expr2.expr21.expr22}"></p>
1010
<p>{expr3[0]['expr3' + '3']}</p>
1111
</template>

packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/ast.json

Lines changed: 38 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -112,78 +112,66 @@
112112
"raw": "{foo}",
113113
"value": {
114114
"type": "Identifier",
115-
"start": 80,
116-
"end": 83,
117-
"loc": {
118-
"start": {
119-
"line": 4,
120-
"column": 13
121-
},
122-
"end": {
123-
"line": 4,
124-
"column": 16
125-
}
126-
},
127-
"range": [
128-
80,
129-
83
130-
],
115+
"start": 1,
116+
"end": 4,
131117
"name": "foo",
132118
"location": {
133-
"startLine": 4,
134-
"startColumn": 13,
135-
"endLine": 5,
136-
"endColumn": 13,
137-
"start": 79,
138-
"end": 97
119+
"startLine": 3,
120+
"startColumn": 42,
121+
"endLine": 6,
122+
"endColumn": 9,
123+
"start": 66,
124+
"end": 111
139125
}
140126
},
141127
"location": {
142-
"startLine": 4,
143-
"startColumn": 13,
144-
"endLine": 5,
145-
"endColumn": 13,
146-
"start": 79,
147-
"end": 97
128+
"startLine": 3,
129+
"startColumn": 42,
130+
"endLine": 6,
131+
"endColumn": 9,
132+
"start": 66,
133+
"end": 111
134+
}
135+
},
136+
{
137+
"type": "Text",
138+
"raw": " ",
139+
"value": {
140+
"type": "Literal",
141+
"value": " "
142+
},
143+
"location": {
144+
"startLine": 3,
145+
"startColumn": 42,
146+
"endLine": 6,
147+
"endColumn": 9,
148+
"start": 66,
149+
"end": 111
148150
}
149151
},
150152
{
151153
"type": "Text",
152154
"raw": "{bar}",
153155
"value": {
154156
"type": "Identifier",
155-
"start": 98,
156-
"end": 101,
157-
"loc": {
158-
"start": {
159-
"line": 5,
160-
"column": 13
161-
},
162-
"end": {
163-
"line": 5,
164-
"column": 16
165-
}
166-
},
167-
"range": [
168-
98,
169-
101
170-
],
157+
"start": 7,
158+
"end": 10,
171159
"name": "bar",
172160
"location": {
173-
"startLine": 5,
174-
"startColumn": 13,
161+
"startLine": 3,
162+
"startColumn": 42,
175163
"endLine": 6,
176164
"endColumn": 9,
177-
"start": 97,
165+
"start": 66,
178166
"end": 111
179167
}
180168
},
181169
"location": {
182-
"startLine": 5,
183-
"startColumn": 13,
170+
"startLine": 3,
171+
"startColumn": 42,
184172
"endLine": 6,
185173
"endColumn": 9,
186-
"start": 97,
174+
"start": 66,
187175
"end": 111
188176
}
189177
}

packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/compatibility/directive-if/template-expression/expected.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ function tmpl($api, $cmp, $slotset, $ctx) {
99
return [
1010
api_element("section", stc0, [
1111
$cmp.state.isTrue
12-
? api_text(api_dynamic_text($cmp.foo) + api_dynamic_text($cmp.bar))
12+
? api_text(
13+
api_dynamic_text($cmp.foo) + " " + api_dynamic_text($cmp.bar)
14+
)
1315
: null,
1416
]),
1517
];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
22
<section>
3-
<button onclick={async () => doSomething()}></button>
3+
<button onclick="{async () => doSomething()}"></button>
44
</section>
55
</template>

packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-async/metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"level": 1,
77
"location": {
88
"line": 3,
9-
"column": 25,
10-
"start": 50,
11-
"length": 25
9+
"column": 17,
10+
"start": 41,
11+
"length": 37
1212
}
1313
}
1414
]
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
22
<section>
3-
<button onblick={() => { doSomething(); }}></button>
3+
<button onblick="{() => { doSomething(); }}"></button>
44
</section>
55
</template>

packages/@lwc/template-compiler/src/__tests__/fixtures/expression-complex/invalid/arrow-function-block-body/metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"level": 1,
77
"location": {
88
"line": 3,
9-
"column": 25,
10-
"start": 50,
11-
"length": 24
9+
"column": 17,
10+
"start": 41,
11+
"length": 36
1212
}
1313
}
1414
]
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
22
<section>
3-
<button onclick={myField = 'foo'}></button>
3+
<button onclick="{myField = 'foo'}"></button>
44
</section>
55
</template>

0 commit comments

Comments
 (0)