Skip to content

Commit cc61d99

Browse files
committed
chore: update README
1 parent c1d1f23 commit cc61d99

File tree

1 file changed

+22
-47
lines changed

1 file changed

+22
-47
lines changed

README.md

+22-47
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
# Qwik qwik-preact ⚡️
1+
# qwik-preact ⚡️
2+
3+
QwikPreact allows adding Preact components into existing Qwik application
24

35
## How to Integrate into a Qwik app
46

57
Integration is pretty much the same as <https://qwik.builder.io/docs/integrations/react/>.
6-
Instead of `react` and `react-dom`, you will need to install `preact` and `preact-render-to-string`. And don't forgot `/** @jsxImportSource preact */`
8+
9+
First, install `@qwikdev/qwik-preact` with npm, pnpm or yarn. Instead of `react` and `react-dom`, you will need to install `preact` and `preact-render-to-string`. And don't forgot `/** @jsxImportSource preact */`
710

811
preact.tsx
912

@@ -41,53 +44,25 @@ export default component$(() => {
4144
});
4245
```
4346

44-
Please keep in mind that this is an experimental implementation based on `qwik-react` implementation. So, there might be bugs and unwanted behaviours.
45-
46-
## Development Builds
47-
48-
- Create a component library
49-
- Vite.js tooling.
50-
- Prettier code formatter.
51-
52-
### Client only
53-
54-
During development, the index.html is not a result of server-side rendering, but rather the Qwik app is built using client-side JavaScript only. This is ideal for development with Vite and its ability to reload modules quickly and on-demand. However, this mode is only for development and does not showcase "how" Qwik works since JavaScript is required to execute, and Vite imports many development modules for the app to work.
55-
56-
```
57-
npm run dev
58-
```
59-
60-
### Server-side Rendering (SSR) and Client
61-
62-
Server-side rendered index.html, with client-side modules prefetched and loaded by the browser. This can be used to test out server-side rendered content during development, but will be slower than the client-only development builds.
63-
64-
```
65-
npm run dev.ssr
66-
```
67-
68-
## Production Builds
69-
70-
A production build should generate the client and server modules by running both client and server build commands.
71-
72-
```
73-
npm run build
74-
```
75-
76-
### Client Modules
77-
78-
Production build that creates only the client-side modules that are dynamically imported by the browser.
79-
80-
```
81-
npm run build.client
47+
vite.config.ts
48+
49+
```ts
50+
// vite.config.ts
51+
import { qwikPreact } from '@qwikdev/qwik-preact/vite';
52+
53+
export default defineConfig(() => {
54+
return {
55+
...,
56+
plugins: [
57+
...,
58+
// The important part
59+
qwikPreact()
60+
],
61+
};
62+
});
8263
```
8364

84-
### Server Modules
85-
86-
Production build that creates the server-side render (SSR) module that is used by the server to render the HTML.
87-
88-
```
89-
npm run build.server
90-
```
65+
Please keep in mind that this is an experimental implementation based on `qwik-react` implementation. So, there might be bugs and unwanted behaviours.
9166

9267
---
9368

0 commit comments

Comments
 (0)