File tree Expand file tree Collapse file tree 7 files changed +58
-46
lines changed Expand file tree Collapse file tree 7 files changed +58
-46
lines changed Original file line number Diff line number Diff line change 1- import { component$ , PropsOf , useSignal } from "@qwik.dev/core" ;
1+ import { component$ , useSignal } from "@qwik.dev/core" ;
22
3- export const Counter = component$ < PropsOf < "div" > > ( ( ) => {
3+ export const Counter = component$ ( ( ) => {
44 const count = useSignal ( 0 ) ;
55
66 return (
Original file line number Diff line number Diff line change 1- import { component$ , PropsOf } from "@qwik.dev/core" ;
1+ import { component$ } from "@qwik.dev/core" ;
22
3- export const Logo = component$ < PropsOf < "div" > > ( ( ) => {
3+ export const Logo = component$ ( ( ) => {
44 return (
55 < div >
66 < a href = "https://qwik.dev/" >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11/**
22 * WHAT IS THIS FILE?
33 *
4- * SSR entry point, in all cases the application is rendered outside the browser, this
5- * entry point will be the common one.
6- *
7- * - Server (express, cloudflare...)
8- * - npm run start
9- * - npm run preview
10- * - npm run build
4+ * SSR renderer function, used by Qwik Router.
115 *
6+ * Note that this is the only place the Qwik renderer is called.
7+ * On the client, containers resume and do not call render.
128 */
13- import {
14- renderToStream ,
15- type RenderToStreamOptions ,
16- } from "@qwik.dev/core/server" ;
9+ import { createRenderer } from "@qwik.dev/router" ;
1710import Root from "./root" ;
1811
19- export default function ( opts : RenderToStreamOptions ) {
20- return renderToStream ( < Root /> , opts ) ;
21- }
12+ export default createRenderer ( ( opts ) => {
13+ return {
14+ jsx : < Root /> ,
15+ options : {
16+ ...opts ,
17+ // Use container attributes to set attributes on the html tag.
18+ containerAttributes : {
19+ lang : "en-us" ,
20+ ...opts . containerAttributes ,
21+ } ,
22+ serverData : {
23+ ...opts . serverData ,
24+ // These are the default values for the document head and are overridden by the `head` exports
25+ // documentHead: {
26+ // title: "My App",
27+ // },
28+ } ,
29+ } ,
30+ } ;
31+ } ) ;
Original file line number Diff line number Diff line change 1- import { QwikRouterProvider , RouterOutlet } from "@qwik.dev/router" ;
1+ import { component$ } from "@qwik.dev/core" ;
2+ import {
3+ DocumentHeadTags ,
4+ RouterOutlet ,
5+ useLocation ,
6+ useQwikRouter ,
7+ } from "@qwik.dev/router" ;
8+
9+ import "./global.css" ;
10+
11+ export default component$ ( ( ) => {
12+ useQwikRouter ( ) ;
13+ const { url } = useLocation ( ) ;
14+
15+ /**
16+ * This is the root of a QwikRouter site. It contains the document's `<head>` and `<body>`. You can adjust them as you see fit.
17+ */
218
3- export default ( ) => {
419 return (
5- < QwikRouterProvider >
20+ < >
621 < head >
722 < meta charset = "utf-8" />
8- < title > Qwik Blank App</ title >
23+ < meta name = "viewport" content = "width=device-width, initial-scale=1.0" />
24+ < link rel = "icon" type = "image/svg+xml" href = "/favicon.svg" />
25+
26+ < DocumentHeadTags />
27+
28+ < link rel = "canonical" href = { url . href } />
929 </ head >
1030 < body >
1131 < RouterOutlet />
1232 </ body >
13- </ QwikRouterProvider >
33+ </ >
1434 ) ;
15- } ;
35+ } ) ;
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ export default component$(() => {
77 < >
88 < h1 > Qwik Library Starter</ h1 >
99 < p >
10- This is a Qwik library starter. Make your components and export them
11- from `src/index.ts`. This playground app will not be bundled with your
12- library. You can use the Router like a normal Qwik app with the Qwik
13- Router.
10+ This is a playground meant for testing your library. Make your
11+ components and export them from `src/index.ts`. This playground app will
12+ not be bundled with your library. You can use the Router like a normal
13+ Qwik app with the Qwik Router.
1414 </ p >
1515 < Logo />
1616 < Counter />
Original file line number Diff line number Diff line change 99 "strict" : true ,
1010 "declaration" : true ,
1111 "declarationDir" : " lib" ,
12- "rootDir" : " src" ,
1312 "resolveJsonModule" : true ,
1413 "moduleResolution" : " Bundler" ,
1514 "esModuleInterop" : true ,
You can’t perform that action at this time.
0 commit comments