-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2514fa
commit 49c0252
Showing
10 changed files
with
378 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...iler/src/__tests__/fixtures/events/multiple-same-element/non-static-optimized/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> | ||
<button onclick={onClick} ontouchstart={onTouchStart} ontouchend={onTouchEnd}></button> | ||
</template> |
145 changes: 145 additions & 0 deletions
145
...ompiler/src/__tests__/fixtures/events/multiple-same-element/non-static-optimized/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,145 @@ | ||
{ | ||
"root": { | ||
"type": "Root", | ||
"location": { | ||
"startLine": 1, | ||
"startColumn": 1, | ||
"endLine": 3, | ||
"endColumn": 12, | ||
"start": 0, | ||
"end": 114, | ||
"startTag": { | ||
"startLine": 1, | ||
"startColumn": 1, | ||
"endLine": 1, | ||
"endColumn": 11, | ||
"start": 0, | ||
"end": 10 | ||
}, | ||
"endTag": { | ||
"startLine": 3, | ||
"startColumn": 1, | ||
"endLine": 3, | ||
"endColumn": 12, | ||
"start": 103, | ||
"end": 114 | ||
} | ||
}, | ||
"directives": [], | ||
"children": [ | ||
{ | ||
"type": "Element", | ||
"name": "button", | ||
"namespace": "http://www.w3.org/1999/xhtml", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 5, | ||
"endLine": 2, | ||
"endColumn": 92, | ||
"start": 15, | ||
"end": 102, | ||
"startTag": { | ||
"startLine": 2, | ||
"startColumn": 5, | ||
"endLine": 2, | ||
"endColumn": 83, | ||
"start": 15, | ||
"end": 93 | ||
}, | ||
"endTag": { | ||
"startLine": 2, | ||
"startColumn": 83, | ||
"endLine": 2, | ||
"endColumn": 92, | ||
"start": 93, | ||
"end": 102 | ||
} | ||
}, | ||
"attributes": [], | ||
"properties": [], | ||
"directives": [], | ||
"listeners": [ | ||
{ | ||
"type": "EventListener", | ||
"name": "click", | ||
"handler": { | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 8, | ||
"name": "onClick", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 13, | ||
"endLine": 2, | ||
"endColumn": 30, | ||
"start": 23, | ||
"end": 40 | ||
} | ||
}, | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 13, | ||
"endLine": 2, | ||
"endColumn": 30, | ||
"start": 23, | ||
"end": 40 | ||
} | ||
}, | ||
{ | ||
"type": "EventListener", | ||
"name": "touchstart", | ||
"handler": { | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 13, | ||
"name": "onTouchStart", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 31, | ||
"endLine": 2, | ||
"endColumn": 58, | ||
"start": 41, | ||
"end": 68 | ||
} | ||
}, | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 31, | ||
"endLine": 2, | ||
"endColumn": 58, | ||
"start": 41, | ||
"end": 68 | ||
} | ||
}, | ||
{ | ||
"type": "EventListener", | ||
"name": "touchend", | ||
"handler": { | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 11, | ||
"name": "onTouchEnd", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 59, | ||
"endLine": 2, | ||
"endColumn": 82, | ||
"start": 69, | ||
"end": 92 | ||
} | ||
}, | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 59, | ||
"endLine": 2, | ||
"endColumn": 82, | ||
"start": 69, | ||
"end": 92 | ||
} | ||
} | ||
], | ||
"children": [] | ||
} | ||
] | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...iler/src/__tests__/fixtures/events/multiple-same-element/non-static-optimized/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,3 @@ | ||
{ | ||
"enableStaticContentOptimization": false | ||
} |
32 changes: 32 additions & 0 deletions
32
...iler/src/__tests__/fixtures/events/multiple-same-element/non-static-optimized/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,32 @@ | ||
import _implicitStylesheets from "./multiple-non-static-optimized.css"; | ||
import _implicitScopedStylesheets from "./multiple-non-static-optimized.scoped.css?scoped=true"; | ||
import { freezeTemplate, registerTemplate } from "lwc"; | ||
function tmpl($api, $cmp, $slotset, $ctx) { | ||
const { b: api_bind, h: api_element } = $api; | ||
const { _m0 } = $ctx; | ||
return [ | ||
api_element("button", { | ||
key: 0, | ||
on: | ||
_m0 || | ||
($ctx._m0 = { | ||
click: api_bind($cmp.onClick), | ||
touchstart: api_bind($cmp.onTouchStart), | ||
touchend: api_bind($cmp.onTouchEnd), | ||
}), | ||
}), | ||
]; | ||
/*LWC compiler vX.X.X*/ | ||
} | ||
export default registerTemplate(tmpl); | ||
tmpl.stylesheets = []; | ||
tmpl.stylesheetToken = "lwc-3c8br5010o7"; | ||
tmpl.legacyStylesheetToken = | ||
"x-multiple-non-static-optimized_multiple-non-static-optimized"; | ||
if (_implicitStylesheets) { | ||
tmpl.stylesheets.push.apply(tmpl.stylesheets, _implicitStylesheets); | ||
} | ||
if (_implicitScopedStylesheets) { | ||
tmpl.stylesheets.push.apply(tmpl.stylesheets, _implicitScopedStylesheets); | ||
} | ||
freezeTemplate(tmpl); |
3 changes: 3 additions & 0 deletions
3
...er/src/__tests__/fixtures/events/multiple-same-element/non-static-optimized/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
...compiler/src/__tests__/fixtures/events/multiple-same-element/static-optimized/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> | ||
<button onclick={onClick} ontouchstart={onTouchStart} ontouchend={onTouchEnd}></button> | ||
</template> |
145 changes: 145 additions & 0 deletions
145
...te-compiler/src/__tests__/fixtures/events/multiple-same-element/static-optimized/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,145 @@ | ||
{ | ||
"root": { | ||
"type": "Root", | ||
"location": { | ||
"startLine": 1, | ||
"startColumn": 1, | ||
"endLine": 3, | ||
"endColumn": 12, | ||
"start": 0, | ||
"end": 114, | ||
"startTag": { | ||
"startLine": 1, | ||
"startColumn": 1, | ||
"endLine": 1, | ||
"endColumn": 11, | ||
"start": 0, | ||
"end": 10 | ||
}, | ||
"endTag": { | ||
"startLine": 3, | ||
"startColumn": 1, | ||
"endLine": 3, | ||
"endColumn": 12, | ||
"start": 103, | ||
"end": 114 | ||
} | ||
}, | ||
"directives": [], | ||
"children": [ | ||
{ | ||
"type": "Element", | ||
"name": "button", | ||
"namespace": "http://www.w3.org/1999/xhtml", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 5, | ||
"endLine": 2, | ||
"endColumn": 92, | ||
"start": 15, | ||
"end": 102, | ||
"startTag": { | ||
"startLine": 2, | ||
"startColumn": 5, | ||
"endLine": 2, | ||
"endColumn": 83, | ||
"start": 15, | ||
"end": 93 | ||
}, | ||
"endTag": { | ||
"startLine": 2, | ||
"startColumn": 83, | ||
"endLine": 2, | ||
"endColumn": 92, | ||
"start": 93, | ||
"end": 102 | ||
} | ||
}, | ||
"attributes": [], | ||
"properties": [], | ||
"directives": [], | ||
"listeners": [ | ||
{ | ||
"type": "EventListener", | ||
"name": "click", | ||
"handler": { | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 8, | ||
"name": "onClick", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 13, | ||
"endLine": 2, | ||
"endColumn": 30, | ||
"start": 23, | ||
"end": 40 | ||
} | ||
}, | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 13, | ||
"endLine": 2, | ||
"endColumn": 30, | ||
"start": 23, | ||
"end": 40 | ||
} | ||
}, | ||
{ | ||
"type": "EventListener", | ||
"name": "touchstart", | ||
"handler": { | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 13, | ||
"name": "onTouchStart", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 31, | ||
"endLine": 2, | ||
"endColumn": 58, | ||
"start": 41, | ||
"end": 68 | ||
} | ||
}, | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 31, | ||
"endLine": 2, | ||
"endColumn": 58, | ||
"start": 41, | ||
"end": 68 | ||
} | ||
}, | ||
{ | ||
"type": "EventListener", | ||
"name": "touchend", | ||
"handler": { | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 11, | ||
"name": "onTouchEnd", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 59, | ||
"endLine": 2, | ||
"endColumn": 82, | ||
"start": 69, | ||
"end": 92 | ||
} | ||
}, | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 59, | ||
"endLine": 2, | ||
"endColumn": 82, | ||
"start": 69, | ||
"end": 92 | ||
} | ||
} | ||
], | ||
"children": [] | ||
} | ||
] | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...compiler/src/__tests__/fixtures/events/multiple-same-element/static-optimized/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,3 @@ | ||
{ | ||
"enableStaticContentOptimization": true | ||
} |
38 changes: 38 additions & 0 deletions
38
...compiler/src/__tests__/fixtures/events/multiple-same-element/static-optimized/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,38 @@ | ||
import _implicitStylesheets from "./multiple-static-optimized.css"; | ||
import _implicitScopedStylesheets from "./multiple-static-optimized.scoped.css?scoped=true"; | ||
import { freezeTemplate, parseFragment, registerTemplate } from "lwc"; | ||
const $fragment1 = parseFragment`<button${3}></button>`; | ||
function tmpl($api, $cmp, $slotset, $ctx) { | ||
const { b: api_bind, sp: api_static_part, st: api_static_fragment } = $api; | ||
const { _m0, _m1 } = $ctx; | ||
return [ | ||
api_static_fragment($fragment1, 1, [ | ||
api_static_part( | ||
0, | ||
{ | ||
on: | ||
_m1 || | ||
($ctx._m1 = { | ||
click: api_bind($cmp.onClick), | ||
touchstart: api_bind($cmp.onTouchStart), | ||
touchend: api_bind($cmp.onTouchEnd), | ||
}), | ||
}, | ||
null | ||
), | ||
]), | ||
]; | ||
/*LWC compiler vX.X.X*/ | ||
} | ||
export default registerTemplate(tmpl); | ||
tmpl.stylesheets = []; | ||
tmpl.stylesheetToken = "lwc-7ppqi31636p"; | ||
tmpl.legacyStylesheetToken = | ||
"x-multiple-static-optimized_multiple-static-optimized"; | ||
if (_implicitStylesheets) { | ||
tmpl.stylesheets.push.apply(tmpl.stylesheets, _implicitStylesheets); | ||
} | ||
if (_implicitScopedStylesheets) { | ||
tmpl.stylesheets.push.apply(tmpl.stylesheets, _implicitScopedStylesheets); | ||
} | ||
freezeTemplate(tmpl); |
3 changes: 3 additions & 0 deletions
3
...mpiler/src/__tests__/fixtures/events/multiple-same-element/static-optimized/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": [] | ||
} |