Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/smart-event-qrl-references.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@qwik.dev/core': patch
---

fix: keep event-only QRL dependencies outside component render chunks
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { $, component$, useSignal } from '@qwik.dev/core';
import { openFeature } from './heavy-feature';

function invoke(callback) {
return callback();
}
function useCustomHook(callback) {
return invoke(callback);
}
function Consumer(props) {
return props.onClick$();
}

export const App = component$(() => {
const count = useSignal(0);
const click = $(() => openFeature(count.value));
const wrapped = $(() => openFeature(count.value));
const render = $(() => count.value);
const hookRead = $(() => count.value);
const mixed = $(() => count.value);
const custom = $(() => count.value);
render();
useCustomHook(hookRead);
mixed();
return (
<>
<button onClick$={click}>direct</button>
<button onClick$={wrapped}>wrapped</button>
<button onClick$={mixed}>mixed</button>
<Consumer onClick$={custom} />
</>
);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { $, component$, useSignal, _jsxSorted } from '@qwik.dev/core';

export const App = component$(() => {
const count = useSignal(0);
const View = $(() => <span>{count.value}</span>);
const getter = $(() => count.value);
const click = $(() => count.value++);
return (
<>
<button onClick$={click}>event only</button>
<button onClick$={View}>also a tag</button>
<View />
{_jsxSorted(
'button',
null,
{
get 'q-e:click'() {
getter();
return getter;
},
},
'getter',
3,
null
)}
</>
);
});
Loading
Loading