|
| 1 | +--- |
| 2 | +source: packages/qwik/src/optimizer/core/src/test.rs |
| 3 | +assertion_line: 420 |
| 4 | +expression: output |
| 5 | +--- |
| 6 | +==INPUT 1 (test.tsx)== |
| 7 | + |
| 8 | + |
| 9 | +import { component$, useTask$ } from '@qwik.dev/core'; |
| 10 | +import { helper } from './test-logger'; |
| 11 | + |
| 12 | +export const TestComponent = component$(() => { |
| 13 | + helper(); |
| 14 | + |
| 15 | + useTask$(() => { |
| 16 | + console.log("log 1:",helper()); |
| 17 | + }); |
| 18 | + |
| 19 | + useTask$(() => { |
| 20 | + console.log("log 2:",helper()); |
| 21 | + }); |
| 22 | + |
| 23 | + return <button onClick$={() => helper()}>Click me</button>; |
| 24 | +}); |
| 25 | + |
| 26 | + |
| 27 | +==INPUT 2 (test-logger.ts)== |
| 28 | + |
| 29 | + |
| 30 | +export const helper = () => { |
| 31 | + console.log("helper"); |
| 32 | +}; |
| 33 | + |
| 34 | +============================= test.tsx_TestComponent_component_useTask_O98HB2chigg.js (ENTRY POINT)== |
| 35 | + |
| 36 | +import { helper } from "./test-logger"; |
| 37 | +export const TestComponent_component_useTask_O98HB2chigg = ()=>{ |
| 38 | + console.log("log 1:", helper()); |
| 39 | +}; |
| 40 | + |
| 41 | + |
| 42 | +Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";2DAOU;IACR,QAAQ,GAAG,CAAC,UAAS;AACtB\"}") |
| 43 | +/* |
| 44 | +{ |
| 45 | + "origin": "test.tsx", |
| 46 | + "name": "TestComponent_component_useTask_O98HB2chigg", |
| 47 | + "entry": null, |
| 48 | + "displayName": "test.tsx_TestComponent_component_useTask", |
| 49 | + "hash": "O98HB2chigg", |
| 50 | + "canonicalFilename": "test.tsx_TestComponent_component_useTask_O98HB2chigg", |
| 51 | + "path": "", |
| 52 | + "extension": "js", |
| 53 | + "parent": "TestComponent_component_JeI1MikkbKs", |
| 54 | + "ctxKind": "function", |
| 55 | + "ctxName": "useTask$", |
| 56 | + "captures": false, |
| 57 | + "loc": [ |
| 58 | + 169, |
| 59 | + 213 |
| 60 | + ] |
| 61 | +} |
| 62 | +*/ |
| 63 | +============================= test.js == |
| 64 | + |
| 65 | +import { componentQrl } from "@qwik.dev/core"; |
| 66 | +import { qrl } from "@qwik.dev/core"; |
| 67 | +const i_JeI1MikkbKs = ()=>import("./test.tsx_TestComponent_component_JeI1MikkbKs"); |
| 68 | +export const TestComponent = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(i_JeI1MikkbKs, "TestComponent_component_JeI1MikkbKs")); |
| 69 | + |
| 70 | + |
| 71 | +Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";;;AAIA,OAAO,MAAM,8BAAgB,sFAY1B\"}") |
| 72 | +============================= test-logger.js == |
| 73 | + |
| 74 | +export const helper = ()=>{ |
| 75 | + console.log("helper"); |
| 76 | +}; |
| 77 | + |
| 78 | + |
| 79 | +Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test-logger.ts\"],\"names\":[],\"mappings\":\"AACA,OAAO,MAAM,SAAS;IACpB,QAAQ,GAAG,CAAC;AACd,EAAE\"}") |
| 80 | +============================= test.tsx_TestComponent_component_useTask_1_0N0OYUl6cY8.js (ENTRY POINT)== |
| 81 | + |
| 82 | +import { helper } from "./test-logger"; |
| 83 | +export const TestComponent_component_useTask_1_0N0OYUl6cY8 = ()=>{ |
| 84 | + console.log("log 2:", helper()); |
| 85 | +}; |
| 86 | + |
| 87 | + |
| 88 | +Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";6DAWU;IACR,QAAQ,GAAG,CAAC,UAAS;AACtB\"}") |
| 89 | +/* |
| 90 | +{ |
| 91 | + "origin": "test.tsx", |
| 92 | + "name": "TestComponent_component_useTask_1_0N0OYUl6cY8", |
| 93 | + "entry": null, |
| 94 | + "displayName": "test.tsx_TestComponent_component_useTask_1", |
| 95 | + "hash": "0N0OYUl6cY8", |
| 96 | + "canonicalFilename": "test.tsx_TestComponent_component_useTask_1_0N0OYUl6cY8", |
| 97 | + "path": "", |
| 98 | + "extension": "js", |
| 99 | + "parent": "TestComponent_component_JeI1MikkbKs", |
| 100 | + "ctxKind": "function", |
| 101 | + "ctxName": "useTask$", |
| 102 | + "captures": false, |
| 103 | + "loc": [ |
| 104 | + 227, |
| 105 | + 271 |
| 106 | + ] |
| 107 | +} |
| 108 | +*/ |
| 109 | +============================= test.tsx_TestComponent_component_JeI1MikkbKs.js (ENTRY POINT)== |
| 110 | + |
| 111 | +import { _jsxSorted } from "@qwik.dev/core"; |
| 112 | +import { helper } from "./test-logger"; |
| 113 | +import { qrl } from "@qwik.dev/core"; |
| 114 | +import { useTaskQrl } from "@qwik.dev/core"; |
| 115 | +const i_0N0OYUl6cY8 = ()=>import("./test.tsx_TestComponent_component_useTask_1_0N0OYUl6cY8"); |
| 116 | +const i_O98HB2chigg = ()=>import("./test.tsx_TestComponent_component_useTask_O98HB2chigg"); |
| 117 | +const i_yEs3QuJxKa8 = ()=>import("./test.tsx_TestComponent_component_button_on_click_yEs3QuJxKa8"); |
| 118 | +export const TestComponent_component_JeI1MikkbKs = ()=>{ |
| 119 | + helper(); |
| 120 | + useTaskQrl(/*#__PURE__*/ qrl(i_O98HB2chigg, "TestComponent_component_useTask_O98HB2chigg")); |
| 121 | + useTaskQrl(/*#__PURE__*/ qrl(i_0N0OYUl6cY8, "TestComponent_component_useTask_1_0N0OYUl6cY8")); |
| 122 | + return /*#__PURE__*/ _jsxSorted("button", null, { |
| 123 | + "on:click": /*#__PURE__*/ qrl(i_yEs3QuJxKa8, "TestComponent_component_button_on_click_yEs3QuJxKa8") |
| 124 | + }, "Click me", 3, "u6_0"); |
| 125 | +}; |
| 126 | + |
| 127 | + |
| 128 | +Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";;;;;;;mDAIwC;IACtC;IAED;IAIA;IAIE,qBAAO,WAAC;QAAO,UAAQ;OAAkB;AAC5C\"}") |
| 129 | +/* |
| 130 | +{ |
| 131 | + "origin": "test.tsx", |
| 132 | + "name": "TestComponent_component_JeI1MikkbKs", |
| 133 | + "entry": null, |
| 134 | + "displayName": "test.tsx_TestComponent_component", |
| 135 | + "hash": "JeI1MikkbKs", |
| 136 | + "canonicalFilename": "test.tsx_TestComponent_component_JeI1MikkbKs", |
| 137 | + "path": "", |
| 138 | + "extension": "js", |
| 139 | + "parent": null, |
| 140 | + "ctxKind": "function", |
| 141 | + "ctxName": "component$", |
| 142 | + "captures": false, |
| 143 | + "loc": [ |
| 144 | + 138, |
| 145 | + 339 |
| 146 | + ] |
| 147 | +} |
| 148 | +*/ |
| 149 | +============================= test.tsx_TestComponent_component_button_on_click_yEs3QuJxKa8.js (ENTRY POINT)== |
| 150 | + |
| 151 | +import { helper } from "./test-logger"; |
| 152 | +export const TestComponent_component_button_on_click_yEs3QuJxKa8 = ()=>helper(); |
| 153 | + |
| 154 | + |
| 155 | +Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";mEAe4B,IAAM\"}") |
| 156 | +/* |
| 157 | +{ |
| 158 | + "origin": "test.tsx", |
| 159 | + "name": "TestComponent_component_button_on_click_yEs3QuJxKa8", |
| 160 | + "entry": null, |
| 161 | + "displayName": "test.tsx_TestComponent_component_button_on_click", |
| 162 | + "hash": "yEs3QuJxKa8", |
| 163 | + "canonicalFilename": "test.tsx_TestComponent_component_button_on_click_yEs3QuJxKa8", |
| 164 | + "path": "", |
| 165 | + "extension": "js", |
| 166 | + "parent": "TestComponent_component_JeI1MikkbKs", |
| 167 | + "ctxKind": "eventHandler", |
| 168 | + "ctxName": "onClick$", |
| 169 | + "captures": false, |
| 170 | + "loc": [ |
| 171 | + 303, |
| 172 | + 317 |
| 173 | + ] |
| 174 | +} |
| 175 | +*/ |
| 176 | +== DIAGNOSTICS == |
| 177 | + |
| 178 | +[] |
0 commit comments