[ HackMD | #2767 ]
Goal
Have an ergonomic way of styling components where the styles are:
lazy-loadable: Load the styles on as needed basis.
type-safe: Developer should not worry that they have miss placed a style, or should feel that refactoring / renaming styles is hard.
tree-shakable: System should be able to remove unneeded styles.
Scalable: It should work on small as well as large projects. Should work with MFE composition.
Miško Hevery changed 2 years agoView mode Like Bookmark
https://github.com/BuilderIO/qwik/issues/1460
Overview
The goal is to implement two things:
An Image REST API which would be part of the Qwik-City which would allow
<Image> component which will take a URL and optimize it for the current window size.
General overview:
Principles
Should path-params and search-params be merged?
PROS merged: simplified mental model
It is not possible to augment the JSX, this will have to rely on the route function. Question is where does the route function come from?
single global route function generated by the Qwik-City:
Miško Hevery changed 3 years agoView mode Like Bookmark
Use cases
Third party CustomClass implements something important and requires methods to work with the data.
Simplest possible usage
PROBLEM
export default component$(() => {
const url = new URL(); // works!
const value = new CustomClass(3434); // breaks serialization
return (
Wout Mertens changed 3 years agoView mode Like Bookmark
Moved to PR#2266
Or Habits which people bring to Resumable frameworks from Hydration mindset.
Or "Dehydrate Your Habits for Faster Apps with Less Work" <- trying to surface the benefit / why they should care
Don't register events eagerly with useClientEffect$()
⚠ Use useClientEffect$() with caution ⚠
Instead => useOn() methods
Miško Hevery changed 3 years agoView mode Like Bookmark
State is part of the tree
In SSR the same app runs for multiple users, globally declared state works great in the browser but have several problems specially in SSR:
Difficult to test (it can not be easily replaced and mocked)
Global is hard to serialize, Qwik is HTML-centric
Qwik Render in async, meaning that several apps can run at the same time, a global state would just not work.
Even without async, having state declared outside the tree can be a security vulnerability in SSR, since some data might leaks between runs.
The reactive primitive is the store
For Qwik is critically important to serialize, so applications can resume.
Manu MA changed 3 years agoView mode Like Bookmark
Overview
The purpose of this demo is to showcase Qwik and Cloudflare capabilities building a new class of applications and personalization. The demo shows how easy it can be to build that which is considered hard currently in the industry. It is also to showcase a new server paradigm of multiple workers cooperating on a single response, bringing parallelism to the server.
Demo's Goals
Showcase:
Micro-frontend in the browser
Resumability => instant on applications
Advance caching strategies where sub-parts of the applications can be cached at CDN.
Miško Hevery changed 3 years agoView mode Like Bookmark
I have some prior writing about this topic you can steal from as much as you like:
The weirdly obscure art of Streamed HTML
Handling mid-stream errors
reduxjs/redux-tookit: How to incrementally hydrate Redux across page fragments during initial load?
My comment on sveltejs/kit: Supporting streaming SSR in the future
Authors: Misko Hevery, Taylor Hunt, Ryan Corniato
Streaming is transmitting data as it’s created. Most pertinently on the Web, you can stream HTML to a browser as your server generates it.
Miško Hevery changed 3 years agoView mode Like Bookmark
Overview
Let's assume you have a slow service that retrieves a Book. How can we stream the content of the page before the Book is retrieved?
Code
interface Book {
title: string;
author: string;
}
export const onGet = () => {
David Zearing changed 3 years agoView mode Like Bookmark
Folder based
I want a route the matches:
/examples
/examples/
/examples/something
/examples/something/else
/examples/something/else/thing
/src/routes/examples/[[...slug]]/index.tsx
Adam Bradley changed 3 years agoView mode Like Bookmark