Skip to content

Commit bc40234

Browse files
authored
Merge branch 'build/v2' into no-cjs
2 parents 6eda0a4 + cb19ff7 commit bc40234

File tree

70 files changed

+1232
-480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1232
-480
lines changed

.changeset/afraid-wolves-heal.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@qwik.dev/core': patch
3+
---
4+
5+
fix: checking if object is serializable in dev mode

.changeset/heavy-clouds-walk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@qwik.dev/core': minor
3+
---
4+
5+
feat: support promises in attributes

.changeset/large-turtles-write.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@qwik.dev/core': patch
3+
---
4+
5+
fix: don't emit script before qwik style element

.changeset/pre.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"changesets": [
1818
"afraid-bags-jam",
1919
"afraid-garlics-greet",
20+
"afraid-wolves-heal",
2021
"all-cloths-hammer",
2122
"angry-boats-lose",
2223
"angry-grapes-itch",
@@ -59,6 +60,7 @@
5960
"friendly-gorillas-walk",
6061
"friendly-sloths-return",
6162
"funny-apricots-learn",
63+
"funny-feet-wish",
6264
"fuzzy-files-kiss",
6365
"fuzzy-jobs-compare",
6466
"fuzzy-worlds-kneel",
@@ -78,6 +80,7 @@
7880
"itchy-comics-develop",
7981
"kind-toes-glow",
8082
"large-houses-watch",
83+
"large-turtles-write",
8184
"lazy-tigers-dig",
8285
"lemon-dingos-dance",
8386
"lemon-tools-bathe",
@@ -91,6 +94,7 @@
9194
"mean-tires-cover",
9295
"mean-webs-try",
9396
"nervous-terms-explode",
97+
"nice-teams-grow",
9498
"nine-otters-repeat",
9599
"ninety-crabs-lay",
96100
"ninety-pets-win",
@@ -102,6 +106,7 @@
102106
"open-beds-grab",
103107
"orange-otters-attend",
104108
"plain-eggs-clean",
109+
"polite-parents-win",
105110
"polite-sloths-visit",
106111
"pretty-glasses-mate",
107112
"pretty-parents-draw",
@@ -126,6 +131,7 @@
126131
"sharp-apples-relate",
127132
"shiny-readers-double",
128133
"short-suits-bet",
134+
"shy-carpets-switch",
129135
"shy-shirts-glow",
130136
"shy-walls-shake",
131137
"silly-pans-wear",

packages/create-qwik/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# create-qwik
22

3+
## 2.0.0-beta.13
4+
35
## 2.0.0-beta.12
46

57
## 2.0.0-beta.11

packages/create-qwik/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "create-qwik",
33
"description": "Interactive CLI for create Qwik projects and adding features.",
4-
"version": "2.0.0-beta.12",
4+
"version": "2.0.0-beta.13",
55
"author": "Qwik Team",
66
"bin": "./create-qwik.mjs",
77
"bugs": "https://github.com/QwikDev/qwik/issues",

packages/docs/src/components/router-head/router-head.tsx

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import { component$ } from '@qwik.dev/core';
2-
import { useDocumentHead, useLocation } from '@qwik.dev/router';
1+
import { component$, untrack } from '@qwik.dev/core';
2+
import { DocumentHeadTags, useDocumentHead, useLocation } from '@qwik.dev/router';
33
import { Social } from './social';
4-
import { InjectThemeScript } from '../theme-toggle';
54
import { Vendor } from './vendor';
65

6+
/** The dynamic head content */
77
export const RouterHead = component$(() => {
8-
const { url } = useLocation();
98
const head = useDocumentHead();
9+
const { url } = useLocation();
10+
const href = head.frontmatter?.canonical || untrack(() => url.href);
11+
1012
const title = head.title
1113
? `${head.title} 📚 Qwik Documentation`
1214
: `Qwik - Framework reimagined for the edge`;
@@ -47,45 +49,23 @@ export const RouterHead = component$(() => {
4749
}
4850
},
4951
};
50-
5152
return (
5253
<>
53-
<title>{title}</title>
5454
<meta name="description" content={description} />
55-
<link rel="canonical" href={head.frontmatter?.canonical || url.href} />
56-
<meta name="viewport" content="width=device-width, initial-scale=1" />
57-
<meta name="apple-mobile-web-app-title" content="Qwik" />
58-
<meta name="application-name" content="Qwik" />
59-
<meta name="apple-mobile-web-app-title" content="Qwik" />
60-
<meta name="theme-color" content="#006ce9" />
61-
<meta name="color-scheme" content="dark light" />
62-
63-
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png" />
64-
<link rel="icon" href="/favicons/favicon.svg" type="image/svg+xml" />
55+
<link rel="canonical" href={href} />
6556

6657
{import.meta.env.PROD && (
6758
<>
68-
<Social title={title} description={description} href={url.href} ogImage={OGImage.URL} />
59+
<Social title={title} description={description} href={href} ogImage={OGImage.URL} />
6960
<Vendor />
7061
</>
7162
)}
7263

73-
{head.meta
64+
<DocumentHeadTags
65+
title={title}
7466
// Skip description because that was already added at the top
75-
.filter((s) => s.name !== 'description')
76-
.map((m, key) => (
77-
<meta key={key} {...m} />
78-
))}
79-
80-
{head.links.map((l, key) => (
81-
<link key={key} {...l} />
82-
))}
83-
84-
{head.styles.map((s, key) => (
85-
<style key={key} {...s.props} dangerouslySetInnerHTML={s.style} />
86-
))}
87-
88-
<InjectThemeScript />
67+
meta={head.meta.filter((s) => s.name !== 'description')}
68+
/>
8969
</>
9070
);
9171
});

packages/docs/src/repl/ui/repl-commands.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { createPlaygroundShareUrl } from './repl-share-url';
22
import type { ReplAppInput } from '../types';
33

4-
export const ReplCommands = ({
5-
input,
6-
enableCopyToPlayground,
7-
enableDownload,
8-
}: ReplCommandProps) => {
4+
export const ReplCommands = ({ input, enableCopyToPlayground }: ReplCommandProps) => {
95
return (
106
<div class="repl-commands">
117
{enableCopyToPlayground ? (

packages/docs/src/root.tsx

Lines changed: 4 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
import { component$, useContextProvider, useStore } from '@qwik.dev/core';
22
import { Insights } from '@qwik.dev/core/insights';
3-
import {
4-
RouterOutlet,
5-
ServiceWorkerRegister,
6-
useDocumentHead,
7-
useLocation,
8-
useQwikRouter,
9-
} from '@qwik.dev/router';
10-
import RealMetricsOptimization from './components/real-metrics-optimization/real-metrics-optimization';
11-
import { Social } from './components/router-head/social';
12-
import { Vendor } from './components/router-head/vendor';
3+
import { RouterOutlet, useQwikRouter } from '@qwik.dev/router';
4+
import { RouterHead } from './components/router-head/router-head';
135
import { InjectThemeScript } from './components/theme-toggle';
14-
import { BUILDER_PUBLIC_API_KEY } from './constants';
156
import { GlobalStore, type SiteStore } from './context';
7+
168
import './global.css';
179

1810
export const uwu = /*javascript*/ `
@@ -50,8 +42,6 @@ export const uwu = /*javascript*/ `
5042

5143
export default component$(() => {
5244
useQwikRouter();
53-
const head = useDocumentHead();
54-
const { url } = useLocation();
5545

5646
const store = useStore<SiteStore>({
5747
headerMenuOpen: false,
@@ -62,55 +52,11 @@ export default component$(() => {
6252

6353
useContextProvider(GlobalStore, store);
6454

65-
const title = head.title
66-
? `${head.title} 📚 Qwik Documentation`
67-
: `Qwik - Framework reimagined for the edge`;
68-
const description =
69-
head.meta.find((m) => m.name === 'description')?.content ||
70-
`No hydration, auto lazy-loading, edge-optimized, and fun 🎉!`;
71-
72-
const OGImage = {
73-
imageURL: '',
74-
ogImgTitle: '',
75-
ogImgSubTitle: '' as string | undefined,
76-
77-
get URL() {
78-
//turn the title into array with [0] -> Title [1] -> subTitle
79-
const arrayedTitle = title.split(' | ');
80-
const ogImageUrl = new URL('https://opengraphqwik.vercel.app/api/og?level=1');
81-
82-
// biggerTitle
83-
this.ogImgTitle = arrayedTitle[0];
84-
//smallerTitle
85-
this.ogImgSubTitle = arrayedTitle[1]
86-
? arrayedTitle[1].replace(' 📚 Qwik Documentation', '')
87-
: undefined;
88-
89-
//decide whether or not to show dynamic OGimage or use docs default social card
90-
if (this.ogImgSubTitle == undefined || this.ogImgTitle == undefined) {
91-
this.imageURL = new URL(`/logos/social-card.jpg`, url).href;
92-
93-
return this.imageURL;
94-
} else {
95-
ogImageUrl.searchParams.set('title', this.ogImgTitle);
96-
ogImageUrl.searchParams.set('subtitle', this.ogImgSubTitle);
97-
// ogImageUrl.searchParams.set('level', this.routeLevel.toString());
98-
99-
this.imageURL = ogImageUrl.toString();
100-
101-
return this.imageURL;
102-
}
103-
},
104-
};
105-
10655
return (
10756
<>
10857
<head>
10958
<meta charset="utf-8" />
11059

111-
<title>{title}</title>
112-
<meta name="description" content={description} />
113-
<link rel="canonical" href={head.frontmatter?.canonical || url.href} />
11460
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
11561
<meta name="apple-mobile-web-app-title" content="Qwik" />
11662
<meta name="application-name" content="Qwik" />
@@ -121,38 +67,11 @@ export default component$(() => {
12167
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png" />
12268
<link rel="icon" href="/favicons/favicon.svg" type="image/svg+xml" />
12369

124-
{import.meta.env.PROD && (
125-
<>
126-
<Social title={title} description={description} href={url.href} ogImage={OGImage.URL} />
127-
<Vendor />
128-
</>
129-
)}
130-
131-
{/* The below are tags that were collected from all the `head` exports in the current route. */}
132-
{head.meta
133-
// Skip description because that was already added at the top
134-
.filter((s) => s.name !== 'description')
135-
.map((m, key) => (
136-
<meta key={key} {...m} />
137-
))}
138-
139-
{head.links.map((l, key) => (
140-
<link key={key} {...l} />
141-
))}
142-
143-
{head.styles.map((s, key) => (
144-
<style key={key} {...s.props} dangerouslySetInnerHTML={s.style} />
145-
))}
146-
147-
{head.scripts.map((s, key) => (
148-
<script key={key} {...s.props} dangerouslySetInnerHTML={s.script} />
149-
))}
70+
<RouterHead />
15071

15172
<InjectThemeScript />
15273
<script dangerouslySetInnerHTML={uwu} />
15374

154-
<ServiceWorkerRegister />
155-
15675
<script dangerouslySetInnerHTML={`(${collectSymbols})()`} />
15776
<Insights />
15877
</head>
@@ -164,7 +83,6 @@ export default component$(() => {
16483
>
16584
{/* This renders the current route, including all Layout components. */}
16685
<RouterOutlet />
167-
<RealMetricsOptimization builderApiKey={BUILDER_PUBLIC_API_KEY} />
16886
</body>
16987
</>
17088
);

packages/docs/src/routes/api/qwik-router/api.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@
726726
}
727727
],
728728
"kind": "Variable",
729-
"content": "This is a wrapper around the `useQwikRouter()` hook. We recommend using the hook instead of this component.\n\n\n```typescript\nQwikRouterProvider: import(\"@qwik.dev/core\").Component<QwikRouterProps>\n```",
729+
"content": "This is a wrapper around the `useQwikRouter()` hook. We recommend using the hook instead of this component, unless you have a good reason to make your root component reactive.\n\n\n```typescript\nQwikRouterProvider: import(\"@qwik.dev/core\").Component<QwikRouterProps>\n```",
730730
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/runtime/src/qwik-router-component.tsx",
731731
"mdFile": "router.qwikrouterprovider.md"
732732
},

0 commit comments

Comments
 (0)