-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: destructured props for inline components
- Loading branch information
Showing
9 changed files
with
381 additions
and
20 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
'@qwik.dev/core': patch | ||
--- | ||
|
||
fix: destructured props for inline components |
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
71 changes: 71 additions & 0 deletions
71
...optimizer/core/src/snapshots/qwik_core__test__destructure_args_inline_cmp_block_stmt.snap
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,71 @@ | ||
--- | ||
source: packages/qwik/src/optimizer/core/src/test.rs | ||
assertion_line: 3651 | ||
expression: output | ||
snapshot_kind: text | ||
--- | ||
==INPUT== | ||
|
||
|
||
export default ({ data }: { data: any }) => { | ||
return ( | ||
<div | ||
data-is-active={data.selectedOutputDetail === 'options'} | ||
onClick$={() => { | ||
data.selectedOutputDetail = 'options'; | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
============================= test.js == | ||
|
||
import { _fnSignal } from "@qwik.dev/core"; | ||
import { qrl } from "@qwik.dev/core"; | ||
import { _jsxSorted } from "@qwik.dev/core"; | ||
export default ((props)=>{ | ||
return /*#__PURE__*/ _jsxSorted("div", null, { | ||
"data-is-active": _fnSignal((p0)=>p0.data.selectedOutputDetail === 'options', [ | ||
props | ||
], 'p0.data.selectedOutputDetail==="options"'), | ||
onClick$: /*#__PURE__*/ qrl(()=>import("./test.tsx_test_div_onClick_GbMO6TGQv9M"), "test_div_onClick_GbMO6TGQv9M", [ | ||
props | ||
]) | ||
}, null, 3, "u6_0"); | ||
}); | ||
|
||
|
||
Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";;;AACE,eAAe,CAAA;IACP,qBACE,WAAC;QACC,gBAAc,kBAAE,GAHV,KAGe,oBAAoB,KAAK;;;QAC9C,QAAQ;;;;AAKpB,CAAA,EAAE\"}") | ||
============================= test.tsx_test_div_onClick_GbMO6TGQv9M.js (ENTRY POINT)== | ||
|
||
import { useLexicalScope } from "@qwik.dev/core"; | ||
export const test_div_onClick_GbMO6TGQv9M = ()=>{ | ||
const [props] = useLexicalScope(); | ||
props.data.selectedOutputDetail = 'options'; | ||
}; | ||
|
||
|
||
Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";4CAKwB;;IACR,MALI,KAKC,oBAAoB,GAAG\"}") | ||
/* | ||
{ | ||
"origin": "test.tsx", | ||
"name": "test_div_onClick_GbMO6TGQv9M", | ||
"entry": null, | ||
"displayName": "test.tsx_test_div_onClick", | ||
"hash": "GbMO6TGQv9M", | ||
"canonicalFilename": "test.tsx_test_div_onClick_GbMO6TGQv9M", | ||
"path": "", | ||
"extension": "js", | ||
"parent": null, | ||
"ctxKind": "eventHandler", | ||
"ctxName": "onClick$", | ||
"captures": true, | ||
"loc": [ | ||
181, | ||
259 | ||
] | ||
} | ||
*/ | ||
== DIAGNOSTICS == | ||
|
||
[] |
72 changes: 72 additions & 0 deletions
72
...ptimizer/core/src/snapshots/qwik_core__test__destructure_args_inline_cmp_block_stmt2.snap
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,72 @@ | ||
--- | ||
source: packages/qwik/src/optimizer/core/src/test.rs | ||
assertion_line: 3673 | ||
expression: output | ||
snapshot_kind: text | ||
--- | ||
==INPUT== | ||
|
||
|
||
export default (props: { data: any }) => { | ||
const { data } = props; | ||
return ( | ||
<div | ||
data-is-active={data.selectedOutputDetail === 'options'} | ||
onClick$={() => { | ||
data.selectedOutputDetail = 'options'; | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
============================= test.js == | ||
|
||
import { _fnSignal } from "@qwik.dev/core"; | ||
import { qrl } from "@qwik.dev/core"; | ||
import { _jsxSorted } from "@qwik.dev/core"; | ||
export default ((props)=>{ | ||
return /*#__PURE__*/ _jsxSorted("div", null, { | ||
"data-is-active": _fnSignal((p0)=>p0.data.selectedOutputDetail === 'options', [ | ||
props | ||
], 'p0.data.selectedOutputDetail==="options"'), | ||
onClick$: /*#__PURE__*/ qrl(()=>import("./test.tsx_test_div_onClick_GbMO6TGQv9M"), "test_div_onClick_GbMO6TGQv9M", [ | ||
props | ||
]) | ||
}, null, 3, "u6_0"); | ||
}); | ||
|
||
|
||
Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";;;AACE,eAAe,CAAA,CAAC;IAER,qBACE,WAAC;QACC,gBAAc,kBAAE,GAHlB,KAGuB,oBAAoB,KAAK;;;QAC9C,QAAQ;;;;AAKpB,CAAA,EAAE\"}") | ||
============================= test.tsx_test_div_onClick_GbMO6TGQv9M.js (ENTRY POINT)== | ||
|
||
import { useLexicalScope } from "@qwik.dev/core"; | ||
export const test_div_onClick_GbMO6TGQv9M = ()=>{ | ||
const [props] = useLexicalScope(); | ||
props.data.selectedOutputDetail = 'options'; | ||
}; | ||
|
||
|
||
Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";4CAMwB;;IAJH,MAAT,KAKS,oBAAoB,GAAG\"}") | ||
/* | ||
{ | ||
"origin": "test.tsx", | ||
"name": "test_div_onClick_GbMO6TGQv9M", | ||
"entry": null, | ||
"displayName": "test.tsx_test_div_onClick", | ||
"hash": "GbMO6TGQv9M", | ||
"canonicalFilename": "test.tsx_test_div_onClick_GbMO6TGQv9M", | ||
"path": "", | ||
"extension": "js", | ||
"parent": null, | ||
"ctxKind": "eventHandler", | ||
"ctxName": "onClick$", | ||
"captures": true, | ||
"loc": [ | ||
206, | ||
284 | ||
] | ||
} | ||
*/ | ||
== DIAGNOSTICS == | ||
|
||
[] |
66 changes: 66 additions & 0 deletions
66
.../optimizer/core/src/snapshots/qwik_core__test__destructure_args_inline_cmp_expr_stmt.snap
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,66 @@ | ||
--- | ||
source: packages/qwik/src/optimizer/core/src/test.rs | ||
assertion_line: 3673 | ||
expression: output | ||
snapshot_kind: text | ||
--- | ||
==INPUT== | ||
|
||
|
||
export default ({ data }: { data: any }) => | ||
<div | ||
data-is-active={data.selectedOutputDetail === 'options'} | ||
onClick$={() => { | ||
data.selectedOutputDetail = 'options'; | ||
}} | ||
/>; | ||
|
||
============================= test.js == | ||
|
||
import { _fnSignal } from "@qwik.dev/core"; | ||
import { qrl } from "@qwik.dev/core"; | ||
import { _jsxSorted } from "@qwik.dev/core"; | ||
export default ((props)=>/*#__PURE__*/ _jsxSorted("div", null, { | ||
"data-is-active": _fnSignal((p0)=>p0.data.selectedOutputDetail === 'options', [ | ||
props | ||
], 'p0.data.selectedOutputDetail==="options"'), | ||
onClick$: /*#__PURE__*/ qrl(()=>import("./test.tsx_test_div_onClick_GbMO6TGQv9M"), "test_div_onClick_GbMO6TGQv9M", [ | ||
props | ||
]) | ||
}, null, 3, "u6_0")); | ||
|
||
|
||
Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";;;AACE,eAAe,CAAA,uBACL,WAAC;QACC,gBAAc,kBAAE,GAFV,KAEe,oBAAoB,KAAK;;;QAC9C,QAAQ;;;uBAGT,EAAE\"}") | ||
============================= test.tsx_test_div_onClick_GbMO6TGQv9M.js (ENTRY POINT)== | ||
|
||
import { useLexicalScope } from "@qwik.dev/core"; | ||
export const test_div_onClick_GbMO6TGQv9M = ()=>{ | ||
const [props] = useLexicalScope(); | ||
props.data.selectedOutputDetail = 'options'; | ||
}; | ||
|
||
|
||
Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";4CAIwB;;IACR,MAJI,KAIC,oBAAoB,GAAG\"}") | ||
/* | ||
{ | ||
"origin": "test.tsx", | ||
"name": "test_div_onClick_GbMO6TGQv9M", | ||
"entry": null, | ||
"displayName": "test.tsx_test_div_onClick", | ||
"hash": "GbMO6TGQv9M", | ||
"canonicalFilename": "test.tsx_test_div_onClick_GbMO6TGQv9M", | ||
"path": "", | ||
"extension": "js", | ||
"parent": null, | ||
"ctxKind": "eventHandler", | ||
"ctxName": "onClick$", | ||
"captures": true, | ||
"loc": [ | ||
161, | ||
239 | ||
] | ||
} | ||
*/ | ||
== DIAGNOSTICS == | ||
|
||
[] |
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.