Skip to content

Commit

Permalink
perf(template-compiler): revert logical or assignment back to short-c…
Browse files Browse the repository at this point in the history
…ircuit
  • Loading branch information
cardoso committed Aug 20, 2024
1 parent db92d72 commit c11f811
Show file tree
Hide file tree
Showing 18 changed files with 143 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
classMap: stc0,
slotAssignment: "slotName",
key: 0,
on: ($ctx._m0 ||= {
click: api_bind($cmp.handleClick),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind($cmp.handleClick),
}),
}),
];
/*LWC compiler vX.X.X*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
classMap: stc0,
props: stc1,
key: 0,
on: ($ctx._m0 ||= {
click: api_bind($cmp.handleOuterClick),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind($cmp.handleOuterClick),
}),
},
[
api_static_fragment($fragment1, 2),
Expand All @@ -35,9 +37,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
classMap: stc0,
props: stc1,
key: 3,
on: ($ctx._m1 ||= {
click: api_bind($cmp.handleOuterClick),
}),
on:
_m1 ||
($ctx._m1 = {
click: api_bind($cmp.handleOuterClick),
}),
},
[api_static_fragment($fragment2, 5)]
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_element("section", stc0, [
api_custom_element("ns-foo", _nsFoo, {
key: 1,
on: ($ctx._m0 ||= {
foo: api_bind($cmp.handleFoo),
}),
on:
_m0 ||
($ctx._m0 = {
foo: api_bind($cmp.handleFoo),
}),
}),
]),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_element("div", stc0, [
api_element("button", {
key: 1,
on: ($ctx._m0 ||= {
click: api_bind($cmp.handleClick),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind($cmp.handleClick),
}),
}),
]),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
1,
{
on: ($ctx._m0 ||= {
click: api_bind($cmp.handleClick),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind($cmp.handleClick),
}),
},
null
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
1,
{
on: ($ctx._m0 ||= {
click: api_bind($cmp.handleClick),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind($cmp.handleClick),
}),
},
null
),
api_static_part(
3,
{
on: ($ctx._m1 ||= {
press: api_bind($cmp.handlePress),
}),
on:
_m1 ||
($ctx._m1 = {
press: api_bind($cmp.handlePress),
}),
},
null
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
0,
{
on: ($ctx._m1 ||= {
a123: api_bind($cmp.handleClick),
}),
on:
_m1 ||
($ctx._m1 = {
a123: api_bind($cmp.handleClick),
}),
},
null
),
Expand All @@ -24,9 +26,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
0,
{
on: ($ctx._m3 ||= {
foo_bar: api_bind($cmp.handleClick),
}),
on:
_m3 ||
($ctx._m3 = {
foo_bar: api_bind($cmp.handleClick),
}),
},
null
),
Expand All @@ -35,9 +39,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
0,
{
on: ($ctx._m5 ||= {
foo_: api_bind($cmp.handleClick),
}),
on:
_m5 ||
($ctx._m5 = {
foo_: api_bind($cmp.handleClick),
}),
},
null
),
Expand All @@ -46,9 +52,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
0,
{
on: ($ctx._m7 ||= {
a123: api_bind($cmp.handleClick),
}),
on:
_m7 ||
($ctx._m7 = {
a123: api_bind($cmp.handleClick),
}),
},
null
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
1,
{
on: ($ctx._m0 ||= {
click: api_bind(() => ($cmp.myField = "foo")),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind(() => ($cmp.myField = "foo")),
}),
},
null
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
0,
{
on: ($ctx._m1 ||= {
click: api_bind($cmp.bar.arr[$cmp.baz]),
}),
on:
_m1 ||
($ctx._m1 = {
click: api_bind($cmp.bar.arr[$cmp.baz]),
}),
},
null
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
1,
{
on: ($ctx._m0 ||= {
click: api_bind(() => $cmp.taberu(okazu)),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind(() => $cmp.taberu(okazu)),
}),
},
null
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
1,
{
on: ($ctx._m0 ||= {
click: api_bind(() => $cmp.foo++),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind(() => $cmp.foo++),
}),
},
null
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
0,
{
on: ($ctx._m1 ||= {
click: api_bind($cmp.create),
}),
on:
_m1 ||
($ctx._m1 = {
click: api_bind($cmp.create),
}),
},
null
),
Expand All @@ -38,9 +40,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
2,
{
on: ($ctx._m2 ||= {
click: api_bind(task.delete),
}),
on:
_m2 ||
($ctx._m2 = {
click: api_bind(task.delete),
}),
},
null
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
4,
{
on: ($ctx._m0 ||= {
click: api_bind($cmp.onClickBaz),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind($cmp.onClickBaz),
}),
ref: "foo",
style: $cmp.fooStyle,
attrs: {
Expand All @@ -30,9 +32,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
6,
{
on: ($ctx._m1 ||= {
click: api_bind($cmp.onClickQuux),
}),
on:
_m1 ||
($ctx._m1 = {
click: api_bind($cmp.onClickQuux),
}),
ref: "bar",
style: $cmp.barStyle,
attrs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
5,
{
on: ($ctx._m0 ||= {
click: api_bind($cmp.onClickBaz),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind($cmp.onClickBaz),
}),
},
null
),
Expand Down Expand Up @@ -55,9 +57,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
10,
{
on: ($ctx._m1 ||= {
click: api_bind($cmp.onClickQuux),
}),
on:
_m1 ||
($ctx._m1 = {
click: api_bind($cmp.onClickQuux),
}),
},
null
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
1,
{
on: ($ctx._m0 ||= {
click: api_bind($cmp.onClickFoo),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind($cmp.onClickFoo),
}),
ref: "foo",
style: $cmp.fooStyle,
className: api_normalize_class_name($cmp.fooClass),
Expand All @@ -30,9 +32,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
3,
{
on: ($ctx._m1 ||= {
click: api_bind($cmp.onClickBar),
}),
on:
_m1 ||
($ctx._m1 = {
click: api_bind($cmp.onClickBar),
}),
ref: "bar",
style: $cmp.barStyle,
className: api_normalize_class_name($cmp.barClass),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
2,
{
on: ($ctx._m0 ||= {
click: api_bind($cmp.onClickFoo),
}),
on:
_m0 ||
($ctx._m0 = {
click: api_bind($cmp.onClickFoo),
}),
ref: "foo",
style: $cmp.fooStyle,
attrs: {
Expand All @@ -24,9 +26,11 @@ function tmpl($api, $cmp, $slotset, $ctx) {
api_static_part(
5,
{
on: ($ctx._m1 ||= {
click: api_bind($cmp.onClickBar),
}),
on:
_m1 ||
($ctx._m1 = {
click: api_bind($cmp.onClickBar),
}),
ref: "bar",
style: $cmp.barStyle,
attrs: {
Expand Down
Loading

0 comments on commit c11f811

Please sign in to comment.