Skip to content

Commit

Permalink
Merge branch 'QwikDev:main' into cache-control-headers-on-redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonprsousa authored Nov 5, 2024
2 parents 5de0cdf + f72fda5 commit 4ede2d0
Show file tree
Hide file tree
Showing 139 changed files with 1,772 additions and 1,015 deletions.
9 changes: 3 additions & 6 deletions .changeset/changelog-github-custom.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,9 @@ var changelogFunctions = {
.concat(links.pull || links.commit, ')');
}
emojiFirstline = firstLine
.replace('FEAT:', '✨ ')
.replace('feat:', '✨ ')
.replace('fix:', '🐞🩹')
.replace('FIX:', '🐞🩹')
.replace('DOCS:', '📃')
.replace('docs:', '📃');
.replace(/feat:/i, '✨ ')
.replace(/fix:/i, '🐞🩹')
.replace(/docs:/i, '📃');
return [
2 /*return*/,
'\n\n- '
Expand Down
9 changes: 3 additions & 6 deletions .changeset/changelog-github-custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,9 @@ const changelogFunctions: ChangelogFunctions = {
}

const emojiFirstline = firstLine
.replace('FEAT:', '✨ ')
.replace('feat:', '✨ ')
.replace('fix:', '🐞🩹')
.replace('FIX:', '🐞🩹')
.replace('DOCS:', '📃')
.replace('docs:', '📃');
.replace(/feat:/i, '✨ ')
.replace(/fix:/i, '🐞🩹')
.replace(/docs:/i, '📃');

return `\n\n- ${emojiFirstline} ${suffix}\n${futureLines.map((l) => ` ${l}`).join('\n')}`;
},
Expand Down
36 changes: 36 additions & 0 deletions .changeset/eleven-rabbits-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
'@builder.io/qwik': minor
---

Async functions in `useComputed` are deprecated.

**Why?**

- Qwik can't track used signals after the first await, which leads to subtle bugs.
- When calculating the first time, it will see it's a promise and it will restart the render function.
- Both `useTask` and `useResource` are available, without these problems.

In v2, async functions won't work.

Again, to get the same functionality use `useTask` or `useResource` instead, or this function:

```tsx
export const useAsyncComputed$ = (qrlFn: QRL<() => Promise<any>>) => {
const sig = useSignal();
useTask(({ track }) => {
const result = track(qrlFn);
if (result && 'then' in result) {
result.then(
(val) => (sig.value = val),
(err) => {
console.error('async computed function threw!', err);
throw error;
}
);
} else {
sig.value = result;
}
});
return sig;
};
```
5 changes: 5 additions & 0 deletions .changeset/friendly-flowers-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik': patch
---

docs: fix useResource docs example & remove unused demo
5 changes: 5 additions & 0 deletions .changeset/funny-wasps-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik': patch
---

FIX: QRL segment filenames are no longer lowercased. This was giving trouble with parent lookups in dev mode and there was no good reason for it.
5 changes: 5 additions & 0 deletions .changeset/gentle-adults-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik': patch
---

FIX: the type for `<textarea>` now accepts text children, as per spec.
5 changes: 5 additions & 0 deletions .changeset/late-bugs-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik': patch
---

FIX: dev-mode QRL paths are now handled by Vite so they are the same as the parent paths. You can see this in the Sources section of the browser devtools, where the segments are now always next to their parents (when the parent is loaded).
2 changes: 1 addition & 1 deletion .changeset/lazy-worms-attack.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@builder.io/qwik-city': patch
---

MDX content no longer ignores Layout components. See [the MDX docs](https://mdxjs.com/docs/using-mdx/#layout) for more information.
FIX: MDX content no longer ignores Layout components. See [the MDX docs](https://mdxjs.com/docs/using-mdx/#layout) for more information.
5 changes: 5 additions & 0 deletions .changeset/lemon-gorillas-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik-city': patch
---

FIX: SSG errors now show the path that failed
5 changes: 5 additions & 0 deletions .changeset/loud-deers-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-qwik': patch
---

INFRA: migration from tsm to tsx
2 changes: 1 addition & 1 deletion .changeset/many-turtles-cough.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@builder.io/qwik-city': patch
---

Fix action redirect regression where searchParams were appended
FIX: Fixed action redirect regression where searchParams were appended
2 changes: 1 addition & 1 deletion .changeset/ninety-planets-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
'@builder.io/qwik': patch
---

FIX: `vite` is now a peer dependency of `qwik` and `qwik-city`, so that there can be no duplicate imports. This should not have consequences, since all apps also directly depend on `vite`.
FIX: `vite` is now a peer dependency of `qwik`, `qwik-city`, `qwik-react` and `qwik-labs`, so that there can be no duplicate imports. This should not have consequences, since all apps also directly depend on `vite`.
2 changes: 1 addition & 1 deletion .changeset/real-garlics-argue.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@builder.io/qwik-city': patch
---

Fixed MDX layout default export being ignored by transformer.
FIX: Fixed MDX layout default export being ignored by transformer.
5 changes: 5 additions & 0 deletions .changeset/rude-camels-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'eslint-plugin-qwik': patch
---

FIX: the @typescript-eslint/utils dependency is upgraded and made explicit in the package
2 changes: 1 addition & 1 deletion .changeset/shaggy-apes-kneel.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@builder.io/qwik': patch
---

sync$ QRLs will now be serialized into the HTML in a shorter form
FEAT: sync$ QRLs will now be serialized into the HTML in a shorter form
7 changes: 7 additions & 0 deletions .changeset/short-cycles-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@builder.io/qwik': minor
---

FEAT: Expose `unwrapStore` as a low level AP

This enables developers to clone the content of a `useStore()` using `structureClone` or IndexedDB
2 changes: 1 addition & 1 deletion .changeset/silver-countries-kiss.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@builder.io/qwik-city': patch
---

Prevent unexpected caching for q-data.json
FIX: Prevent unexpected caching for q-data.json
5 changes: 5 additions & 0 deletions .changeset/twenty-radios-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik-city': patch
---

fix: Multiple rewrite routes pointing to the same route is no longer an error.
2 changes: 1 addition & 1 deletion .changeset/unlucky-experts-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@builder.io/qwik': patch
---

Allow setting `linkFetchPriority` for modulepreload links in the prefetch strategy. Also fix the links in dev mode
FEAT: Allow setting `linkFetchPriority` for modulepreload links in the prefetch strategy. Also fix the links in dev mode
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -880,11 +880,14 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Fixup package.json files
run: pnpm run release.fixup-package-json

- name: Commit Build Artifacts
if: github.event_name == 'push'
env:
QWIK_API_TOKEN_GITHUB: ${{ secrets.QWIK_API_TOKEN_GITHUB }}
run: pnpm run qwik-save-artifacts
run: pnpm run qwik-push-build-repos

- name: Publish packages for testing
if: github.event_name != 'workflow_dispatch'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ bun create qwik@latest

- Ping us at [@QwikDev](https://twitter.com/QwikDev)
- Join our [Discord](https://qwik.dev/chat) community
- Join all the [other community groups](https://qwikcommunity.com)
- Join all the [other community groups](https://qwik.dev/ecosystem/#community)

## Development

Expand Down
58 changes: 30 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
"label": "Be lenient in vite versions for prod. v4 is broken, v5 is good",
"dependencyTypes": [
"prod"
"prod",
"peer"
],
"dependencies": [
"vite"
Expand Down Expand Up @@ -155,10 +156,10 @@
"terser": "5.31.3",
"tmp": "0.2.3",
"tree-kill": "1.2.2",
"tsm": "2.3.0",
"tsx": "4.19.1",
"typescript": "5.4.5",
"undici": "*",
"vfile": "6.0.1",
"vfile": "6.0.2",
"vite": "5.3.5",
"vite-imagetools": "7.0.4",
"vite-plugin-dts": "3.9.1",
Expand All @@ -178,7 +179,7 @@
"pnpm": {
"overrides": {
"typescript": "5.4.5",
"vfile": "6.0.1",
"vfile": "6.0.2",
"@supabase/realtime-js": "2.8.4"
},
"patchedDependencies": {
Expand All @@ -187,35 +188,35 @@
},
"private": true,
"scripts": {
"api.update": "tsm scripts/index.ts --tsc --api --dev",
"build": "tsm scripts/index.ts",
"api.update": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --api --dev",
"build": "tsx --require ./scripts/runBefore.ts scripts/index.ts",
"build.changelog-formatter": "tsc .changeset/changelog-github-custom.ts && mv .changeset/changelog-github-custom.js .changeset/changelog-github-custom.cjs",
"build.clean": "rm -rf packages/qwik/dist/ && rm -rf packages/qwik-city/lib/ && rm -rf packages/docs/dist/ && rm -rf packages/insights/dist/ && rm -rf packages/qwik-labs/lib/ && rm -rf packages/qwik-labs/vite/",
"build.cli": "tsm scripts/index.ts --cli --dev",
"build.cli.prod": "tsm scripts/index.ts --cli",
"build.core": "tsm scripts/index.ts --tsc --build --qwikcity --api --platform-binding",
"build.eslint": "tsm scripts/index.ts --eslint",
"build.full": "tsm scripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikcity --qwikworker --qwiklabs --qwikreact --qwikauth --cli --platform-binding --wasm",
"build.local": "tsm scripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikcity --qwikworker --qwiklabs --qwikreact --qwikauth --cli --platform-binding-wasm-copy",
"build.only_javascript": "tsm scripts/index.ts --tsc --build --api",
"build.cli": "tsx --require ./scripts/runBefore.ts scripts/index.ts --cli --dev",
"build.cli.prod": "tsx --require ./scripts/runBefore.ts scripts/index.ts --cli",
"build.core": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --qwikcity --api --platform-binding",
"build.eslint": "tsx --require ./scripts/runBefore.ts scripts/index.ts --eslint",
"build.full": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikcity --qwikworker --qwiklabs --qwikreact --qwikauth --cli --platform-binding --wasm",
"build.local": "tsx --require ./scripts/runBefore.tsscripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikcity --qwikworker --qwiklabs --qwikreact --qwikauth --cli --platform-binding-wasm-copy",
"build.only_javascript": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --api",
"build.packages.docs": "pnpm -C ./packages/docs/ run build",
"build.packages.insights": "pnpm -C ./packages/insights/ run build",
"build.platform": "tsm scripts/index.ts --platform-binding",
"build.platform.copy": "tsm scripts/index.ts --platform-binding-wasm-copy",
"build.qwik-city": "tsm scripts/index.ts --tsc --qwikcity",
"build.validate": "tsm scripts/index.ts --tsc --build --api --eslint --qwikcity --platform-binding --wasm --validate",
"build.vite": "tsm scripts/index.ts --tsc --build --api --qwikcity --eslint --platform-binding-wasm-copy",
"build.wasm": "tsm scripts/index.ts --wasm",
"build.watch": "tsm scripts/index.ts --build --qwikcity --watch --dev --platform-binding",
"build.platform": "tsx --require ./scripts/runBefore.ts scripts/index.ts --platform-binding",
"build.platform.copy": "tsx --require ./scripts/runBefore.ts scripts/index.ts --platform-binding-wasm-copy",
"build.qwik-city": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwikcity",
"build.validate": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --api --eslint --qwikcity --platform-binding --wasm --validate",
"build.vite": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --api --qwikcity --eslint --platform-binding-wasm-copy",
"build.wasm": "tsx --require ./scripts/runBefore.ts scripts/index.ts --wasm",
"build.watch": "tsx --require ./scripts/runBefore.ts scripts/index.ts --build --qwikcity --watch --dev --platform-binding",
"change": "changeset",
"cli": "pnpm build.cli && node packages/create-qwik/dist/create-qwik.cjs && tsm scripts/validate-cli.ts --copy-local-qwik-dist",
"cli": "pnpm build.cli && node packages/create-qwik/dist/create-qwik.cjs && tsx --require ./scripts/runBefore.ts scripts/validate-cli.ts --copy-local-qwik-dist",
"cli.qwik": "pnpm build.cli && node packages/qwik/dist/qwik-cli.cjs",
"cli.validate": "tsm scripts/validate-cli.ts",
"cli.validate": "tsx --require ./scripts/runBefore.ts scripts/validate-cli.ts",
"deps": "corepack pnpm upgrade -i -r --latest && syncpack fix-mismatches && corepack pnpm dedupe",
"docs.dev": "cd packages/docs && pnpm build.repl-sw && pnpm dev",
"docs.preview": "cd packages/docs && pnpm preview",
"docs.sync": "tsm scripts/docs_sync/index.ts && pnpm fmt",
"eslint.update": "tsm scripts/eslint-docs.ts",
"docs.sync": "tsx --require ./scripts/runBefore.ts scripts/docs_sync/index.ts && pnpm fmt",
"eslint.update": "tsx --require ./scripts/runBefore.ts scripts/eslint-docs.ts",
"fmt": "pnpm prettier.fix && pnpm syncpack format",
"fmt.staged": "pretty-quick --staged",
"link.dist": "cd packages/qwik && pnpm link --global && cd ../qwik-city && pnpm link --global && cd ../eslint-plugin-qwik && pnpm link --global && cd ../qwik-react && pnpm link --global",
Expand All @@ -230,12 +231,13 @@
"preinstall": "npx only-allow pnpm",
"prepare": "simple-git-hooks",
"prettier.fix": "prettier --cache --write .",
"qwik-save-artifacts": "tsm ./scripts/qwik-save-artifacts.ts",
"qwik-push-build-repos": "tsx --require ./scripts/runBefore.ts ./scripts/qwik-push-build-repos.ts",
"release": "changeset publish",
"release.fixup-package-json": "syncpack fix-mismatches --config syncpack-release-conf.json",
"release.pkg-pr-new": "pnpm dlx pkg-pr-new@^0.0.9 publish --compact --pnpm ./packages/qwik ./packages/qwik-city ./packages/eslint-plugin-qwik ./packages/create-qwik",
"release.prepare": "pnpm build --prepare-release",
"serve": "tsm --inspect --conditions=development starters/dev-server.ts 3300",
"serve.debug": "tsm --inspect-brk --conditions=development starters/dev-server.ts 3300",
"serve": "tsx --require ./scripts/runBefore.ts --inspect --conditions=development starters/dev-server.ts 3300",
"serve.debug": "tsx --require ./scripts/runBefore.ts --inspect-brk --conditions=development starters/dev-server.ts 3300",
"start": "concurrently \"npm:build.watch\" \"npm:tsc.watch\" -n build,tsc -c green,cyan",
"test": "pnpm build.full && pnpm test.unit && pnpm test.e2e",
"test.e2e": "pnpm test.e2e.chromium && pnpm test.e2e.webkit",
Expand All @@ -253,7 +255,7 @@
"tsc.check": "tsc --noEmit",
"tsc.trace": "tsc -p tsconfig.json --traceResolution > tsc.log",
"tsc.watch": "tsc --noEmit --watch --preserveWatchOutput",
"update.qwik.builds": "tsm scripts/update-qwik-builds.ts packages/docs && tsm scripts/update-qwik-builds.ts packages/insights; pnpm install",
"update.qwik.builds": "tsx --require ./scripts/runBefore.ts scripts/update-qwik-builds.ts packages/docs && tsx scripts/update-qwik-builds.ts packages/insights; pnpm install",
"vitest": "vitest"
},
"simple-git-hooks": {
Expand Down
8 changes: 4 additions & 4 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@
"build.repl-sw": "vite --config vite.config-repl-sw.mts build",
"build.server": "NODE_OPTIONS=--max-old-space-size=8192 vite build -c adapters/cloudflare-pages/vite.config.mts",
"build.showcase": "pnpm node scripts/showcase.js",
"codesandbox.sync": "tsm codesandbox.sync.ts",
"contributors": "tsm contributors.ts",
"codesandbox.sync": "tsx codesandbox.sync.ts",
"contributors": "tsx contributors.ts",
"deploy": "wrangler pages publish ./dist",
"dev": "tsm check-qwik-build.ts && vite --mode ssr --open",
"dev": "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": "tsm check-qwik-build.ts",
"prebuild.core": "tsx check-qwik-build.ts",
"preview": "qwik build preview && vite preview --open",
"preview.only": "NODE_DEBUG=net,http node --inspect-brk ../../node_modules/vite/bin/vite.js preview",
"preview.wrangler": "wrangler pages dev ./dist --compatibility-flags=nodejs_als",
Expand Down
Loading

0 comments on commit 4ede2d0

Please sign in to comment.