-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix static content optimization
- Loading branch information
1 parent
42ab135
commit 8c32821
Showing
24 changed files
with
298 additions
and
43 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...c/__tests__/fixtures/attributes/class-dynamic-deoptimized-with-object-binding/actual.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<div class={computed}></div> | ||
</template> |
93 changes: 93 additions & 0 deletions
93
.../src/__tests__/fixtures/attributes/class-dynamic-deoptimized-with-object-binding/ast.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
"root": { | ||
"type": "Root", | ||
"location": { | ||
"startLine": 1, | ||
"startColumn": 1, | ||
"endLine": 3, | ||
"endColumn": 12, | ||
"start": 0, | ||
"end": 55, | ||
"startTag": { | ||
"startLine": 1, | ||
"startColumn": 1, | ||
"endLine": 1, | ||
"endColumn": 11, | ||
"start": 0, | ||
"end": 10 | ||
}, | ||
"endTag": { | ||
"startLine": 3, | ||
"startColumn": 1, | ||
"endLine": 3, | ||
"endColumn": 12, | ||
"start": 44, | ||
"end": 55 | ||
} | ||
}, | ||
"directives": [], | ||
"children": [ | ||
{ | ||
"type": "Element", | ||
"name": "div", | ||
"namespace": "http://www.w3.org/1999/xhtml", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 5, | ||
"endLine": 2, | ||
"endColumn": 33, | ||
"start": 15, | ||
"end": 43, | ||
"startTag": { | ||
"startLine": 2, | ||
"startColumn": 5, | ||
"endLine": 2, | ||
"endColumn": 27, | ||
"start": 15, | ||
"end": 37 | ||
}, | ||
"endTag": { | ||
"startLine": 2, | ||
"startColumn": 27, | ||
"endLine": 2, | ||
"endColumn": 33, | ||
"start": 37, | ||
"end": 43 | ||
} | ||
}, | ||
"attributes": [ | ||
{ | ||
"type": "Attribute", | ||
"name": "class", | ||
"value": { | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 9, | ||
"name": "computed", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 10, | ||
"endLine": 2, | ||
"endColumn": 26, | ||
"start": 20, | ||
"end": 36 | ||
} | ||
}, | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 10, | ||
"endLine": 2, | ||
"endColumn": 26, | ||
"start": 20, | ||
"end": 36 | ||
} | ||
} | ||
], | ||
"properties": [], | ||
"directives": [], | ||
"listeners": [], | ||
"children": [] | ||
} | ||
] | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...c/__tests__/fixtures/attributes/class-dynamic-deoptimized-with-object-binding/config.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"apiVersion": 62, | ||
"enableStaticContentOptimization": false | ||
} |
13 changes: 13 additions & 0 deletions
13
...c/__tests__/fixtures/attributes/class-dynamic-deoptimized-with-object-binding/expected.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { registerTemplate } from "lwc"; | ||
function tmpl($api, $cmp, $slotset, $ctx) { | ||
const { ncls: api_normalize_class_name, h: api_element } = $api; | ||
return [ | ||
api_element("div", { | ||
className: api_normalize_class_name($cmp.computed), | ||
key: 0, | ||
}), | ||
]; | ||
/*LWC compiler vX.X.X*/ | ||
} | ||
export default registerTemplate(tmpl); | ||
tmpl.stylesheets = []; |
3 changes: 3 additions & 0 deletions
3
...__tests__/fixtures/attributes/class-dynamic-deoptimized-with-object-binding/metadata.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"warnings": [] | ||
} |
3 changes: 3 additions & 0 deletions
3
..._tests__/fixtures/attributes/class-dynamic-deoptimized-without-object-binding/actual.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<div class={computed}></div> | ||
</template> |
93 changes: 93 additions & 0 deletions
93
...c/__tests__/fixtures/attributes/class-dynamic-deoptimized-without-object-binding/ast.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
"root": { | ||
"type": "Root", | ||
"location": { | ||
"startLine": 1, | ||
"startColumn": 1, | ||
"endLine": 3, | ||
"endColumn": 12, | ||
"start": 0, | ||
"end": 55, | ||
"startTag": { | ||
"startLine": 1, | ||
"startColumn": 1, | ||
"endLine": 1, | ||
"endColumn": 11, | ||
"start": 0, | ||
"end": 10 | ||
}, | ||
"endTag": { | ||
"startLine": 3, | ||
"startColumn": 1, | ||
"endLine": 3, | ||
"endColumn": 12, | ||
"start": 44, | ||
"end": 55 | ||
} | ||
}, | ||
"directives": [], | ||
"children": [ | ||
{ | ||
"type": "Element", | ||
"name": "div", | ||
"namespace": "http://www.w3.org/1999/xhtml", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 5, | ||
"endLine": 2, | ||
"endColumn": 33, | ||
"start": 15, | ||
"end": 43, | ||
"startTag": { | ||
"startLine": 2, | ||
"startColumn": 5, | ||
"endLine": 2, | ||
"endColumn": 27, | ||
"start": 15, | ||
"end": 37 | ||
}, | ||
"endTag": { | ||
"startLine": 2, | ||
"startColumn": 27, | ||
"endLine": 2, | ||
"endColumn": 33, | ||
"start": 37, | ||
"end": 43 | ||
} | ||
}, | ||
"attributes": [ | ||
{ | ||
"type": "Attribute", | ||
"name": "class", | ||
"value": { | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 9, | ||
"name": "computed", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 10, | ||
"endLine": 2, | ||
"endColumn": 26, | ||
"start": 20, | ||
"end": 36 | ||
} | ||
}, | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 10, | ||
"endLine": 2, | ||
"endColumn": 26, | ||
"start": 20, | ||
"end": 36 | ||
} | ||
} | ||
], | ||
"properties": [], | ||
"directives": [], | ||
"listeners": [], | ||
"children": [] | ||
} | ||
] | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
..._tests__/fixtures/attributes/class-dynamic-deoptimized-without-object-binding/config.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"apiVersion": 61, | ||
"enableStaticContentOptimization": false | ||
} |
13 changes: 13 additions & 0 deletions
13
..._tests__/fixtures/attributes/class-dynamic-deoptimized-without-object-binding/expected.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { registerTemplate } from "lwc"; | ||
function tmpl($api, $cmp, $slotset, $ctx) { | ||
const { h: api_element } = $api; | ||
return [ | ||
api_element("div", { | ||
className: $cmp.computed, | ||
key: 0, | ||
}), | ||
]; | ||
/*LWC compiler vX.X.X*/ | ||
} | ||
export default registerTemplate(tmpl); | ||
tmpl.stylesheets = []; |
3 changes: 3 additions & 0 deletions
3
...ests__/fixtures/attributes/class-dynamic-deoptimized-without-object-binding/metadata.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"warnings": [] | ||
} |
This file contains 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
4 changes: 2 additions & 2 deletions
4
...mpiler/src/__tests__/fixtures/attributes/class-dynamic-without-object-binding/config.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"apiVersion": 60 | ||
} | ||
"apiVersion": 61 | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
8 changes: 6 additions & 2 deletions
8
packages/@lwc/template-compiler/src/__tests__/fixtures/expression/attribute-deep/expected.js
This file contains 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
This file contains 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
Oops, something went wrong.