no qrl creation in CSR #317
wmertens
started this conversation in
Proposals For Qwik
Replies: 1 comment 4 replies
-
|
Would we still be able to handle preload reprioritizations at QRL creation time? Currently we handle reprioritizations when the QRLs run. But with some changes in the optimizer it should be possible to eliminate waterfalls by handling them at QRL creation time. This will need to happen both on first page load and also after SPA route navigations. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What is it about?
QRLs are for serialization and code splitting only
What's the motivation for this proposal?
on the client, it's extra work to create qrls. It's way faster for the JS engine to create functions that capture the scope than for userspace to create QRL objects that do basically the same thing.
example:
Right now, this creates a qrl for the arrow function every render, and it is similar to the server version:
and incrementer.ts is:
Instead, we should allow regular functions on the client, because we don't need to know what the qrl is, we won't serialize it, we just need to call it.
and then incrementer.ts is:
We can also memoize the importer:
Proposed Solution / Feature
and core could export a helper to create these memoized qrls
Which makes the final code:
Links / References
No response
Beta Was this translation helpful? Give feedback.
All reactions