Skip to content

Commit

Permalink
Merge pull request #7352 from QwikDev/v2-merge-main
Browse files Browse the repository at this point in the history
chore: merge main into v2
  • Loading branch information
wmertens authored Feb 20, 2025
2 parents 630d35d + c3ba77d commit f9a5268
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ jobs:
path: |
packages/insights/dist
packages/insights/.netlify
key: ${{ hashfiles('others-key.txt', 'packages/qwik-insights/**/*') }}
key: ${{ hashfiles('others-key.txt', 'packages/insights/**/*') }}
- name: 'check cache: unit tests'
id: cache-unit
uses: actions/cache/restore@v4
Expand Down
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,19 @@
"prod",
"peer"
]
}
],
"semverGroups": [
},
{
"label": "Playwright should have the same version as in flake.nix",
"dependencies": [
"@playwright/test"
],
"pinVersion": "1.47.0"
},
"dependencyTypes": [
"dev"
],
"pinVersion": "1.48.1"
}
],
"semverGroups": [
{
"label": "use exact version numbers for devDependencies",
"dependencyTypes": [
Expand Down Expand Up @@ -95,7 +98,7 @@
"@napi-rs/triples": "1.2.0",
"@node-rs/helper": "1.6.0",
"@octokit/action": "6.1.0",
"@playwright/test": "1.47.0",
"@playwright/test": "1.48.1",
"@qwik.dev/core": "workspace:*",
"@qwik.dev/router": "workspace:*",
"@types/brotli": "1.3.4",
Expand Down
3 changes: 1 addition & 2 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"react-dom": "18.3.1",
"rehype-pretty-code": "0.11.0",
"shiki": "0.14.7",
"shikiji": "0.9.19",
"snarkdown": "2.0.0",
"tailwindcss": "3.4.6",
"terser": "5.37.0",
Expand Down Expand Up @@ -77,7 +76,7 @@
"codesandbox.sync": "tsx codesandbox.sync.ts",
"contributors": "tsx contributors.ts",
"deploy": "wrangler pages publish ./dist",
"dev": "tsx check-qwik-build.ts && vite --mode ssr --open",
"dev": "concurrently \"tsx check-qwik-build.ts\" \"vite --mode ssr --open\"",
"dev.debug": "node --inspect-brk ../../node_modules/vite/bin/vite.js --mode ssr --force",
"prebuild.core": "tsx check-qwik-build.ts",
"preview": "qwik build preview && vite preview --open",
Expand Down
Binary file removed packages/docs/public/showcases/promptle_art_.webp
Binary file not shown.
Binary file removed packages/docs/public/showcases/reduced_to.webp
Binary file not shown.
8 changes: 0 additions & 8 deletions packages/docs/scripts/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@
"href": "https://jbnado.dev/",
"tags": "portfolio"
},
{
"href": "https://reduced.to",
"tags": "app"
},
{
"href": "https://sanyamjainqwik.vercel.app/",
"tags": "portfolio"
Expand All @@ -129,10 +125,6 @@
"href": "https://pulsestax.com/",
"tags": "saas"
},
{
"href": "https://promptle.art/",
"tags": "game"
},
{
"href": "https://abdhashem.com",
"tags": "portfolio"
Expand Down
32 changes: 0 additions & 32 deletions packages/docs/src/routes/(ecosystem)/showcase/generated-pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -424,22 +424,6 @@
"href": "https://jbnado.dev/",
"tags": "portfolio"
},
{
"title": "The FREE Open-Source URL Shortener | Reduced.to",
"imgSrc": "/showcases/reduced_to.webp",
"perf": {
"score": 0.9,
"fcpDisplay": "2.6 s",
"fcpScore": 0.63,
"lcpDisplay": "3.1 s",
"lcpScore": 0.75,
"ttiDisplay": "3.2 s",
"ttiScore": 0.94,
"ttiTime": 3244
},
"href": "https://reduced.to",
"tags": "app"
},
{
"title": "Sanyam Jain",
"imgSrc": "/showcases/sanyamjainqwik_vercel_app_.webp",
Expand Down Expand Up @@ -489,22 +473,6 @@
"href": "https://pulsestax.com/",
"tags": "saas"
},
{
"title": "Promptle - Can you Guess the AI prompt?",
"imgSrc": "/showcases/promptle_art_.webp",
"perf": {
"score": 1,
"fcpDisplay": "1.0 s",
"fcpScore": 1,
"lcpDisplay": "1.0 s",
"lcpScore": 1,
"ttiDisplay": "1.0 s",
"ttiScore": 1,
"ttiTime": 977
},
"href": "https://promptle.art/",
"tags": "game"
},
{
"title": "Abdulrahman Hashem | Full Stack & Front End Enthusiast",
"imgSrc": "/showcases/abdhashem_com.webp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ export default component$(() => {

In Qwik, a [task](/docs/components/tasks/#usetask) is work that needs to happen when a state changes. (This is similar to an "effect" in other frameworks.) In this example, we use the task to invoke code on the server.

1. Import `useTask$` from `qwik` and `$server` from `qwik-router`.
```tsx /useTask\$/ /\$server/
1. Import `useTask$` from `qwik` and `server$` from `qwik-router`.
```tsx /useTask\$/ /server\$/
import { component$, useSignal, useTask$ } from "@qwik.dev/core";
import {
routeLoader$,
Expand Down
7 changes: 6 additions & 1 deletion packages/insights/src/entry.netlify-edge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ declare global {
interface QwikRouterPlatform extends PlatformNetlify {}
}

export default createQwikRouter({ render, qwikRouterConfig });
export default createQwikRouter({
render,
qwikRouterConfig,
// disable CSRF protection because we get called from everywhere
checkOrigin: false,
});
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,20 @@ export function createRequestEvent(
} else {
status = statusOrResponse.status;
statusOrResponse.headers.forEach((value, key) => {
if (key.toLowerCase() === 'set-cookie') {
return;
}
headers.append(key, value);
});
statusOrResponse.headers.getSetCookie().forEach((ck) => {
const index = ck.indexOf('=');
if (index === -1) {
return;
}
const key = ck.slice(0, index).trim();
const value = ck.slice(index + 1).trim();
cookie.set(key, value);
});
if (statusOrResponse.body) {
const writableStream = requestEv.getWritableStream();
statusOrResponse.body.pipeTo(writableStream);
Expand Down
3 changes: 3 additions & 0 deletions packages/qwik/src/cli/migrate-v2/run-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ export async function runV2Migration(app: AppCommand) {
[['qwikCityPlan', 'qwikRouterConfig']],
'@qwik-city-plan' // using old name, package name will be updated in the next step
);
replaceImportInFiles([['jsxs', 'jsx']], '@builder.io/qwik/jsx-runtime');

replacePackage('@qwik-city-plan', '@qwik-router-config', true);
replacePackage('@builder.io/qwik-city', '@qwik.dev/router');
replacePackage('@builder.io/qwik-react', '@qwik.dev/react');
// jsx-runtime contains re-exports from "core"
replacePackage('@builder.io/qwik/jsx-runtime', '@qwik.dev/core');
// "@builder.io/qwik" should be the last one because it's name is a substring of the package names above
replacePackage('@builder.io/qwik', '@qwik.dev/core');

Expand Down
17 changes: 12 additions & 5 deletions packages/qwik/src/cli/migrate-v2/update-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,22 @@ import { log, spinner } from '@clack/prompts';
export async function updateDependencies() {
// TODO(migrate-v2): rely on workspaceRoot instead?
const packageJson = await readPackageJson(process.cwd());
const devDependencies = (packageJson.devDependencies ??= {});
const dependencies = (packageJson.dependencies ??= {});

const version = getPackageTag();

const dependencyNames = [
'dependencies',
'devDependencies',
'peerDependencies',
'optionalDependencies',
] as const;

for (const name of packageNames) {
if (dependencies[name] || devDependencies[name]) {
delete dependencies[name];
devDependencies[name] = version;
for (const propName of dependencyNames) {
const prop = packageJson[propName];
if (prop && prop[name]) {
prop[name] = version;
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/qwik/src/cli/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export interface IntegrationPackageJson {
scripts?: { [k: string]: string };
dependencies?: { [k: string]: string };
devDependencies?: { [k: string]: string };
peerDependencies?: { [k: string]: string };
optionalDependencies?: { [k: string]: string };
engines?: { node: string };
private?: boolean;
files?: string[];
Expand Down
44 changes: 13 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions scripts/binding-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export async function copyPlatformBindingWasm(config: BuildConfig) {
// now check if we already have this package in the cache
const cachedPath = join(cacheDir, realPackageName);
if (!existsSync(cachedPath)) {
ensureDir(cacheDir);
// download the package
console.log(`🦉 downloading CI build from ${url}`);
const pkgRsp = await fetch(url);
Expand Down
2 changes: 2 additions & 0 deletions starters/adapters/fastify/src/plugins/fastify-qwik.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const qwikPlugin: FastifyPluginAsync<FastifyQwikOptions> = async (
decorateReply: false,
});

fastify.removeAllContentTypeParsers();

fastify.setNotFoundHandler(async (request, response) => {
await router(request.raw, response.raw, (err) => fastify.log.error(err));
await notFound(request.raw, response.raw, (err) => fastify.log.error(err));
Expand Down

0 comments on commit f9a5268

Please sign in to comment.