Skip to content

Commit ca6f7cb

Browse files
committed
Merge remote-tracking branch 'origin/main' into upcoming
2 parents c2fda4a + 71e3136 commit ca6f7cb

File tree

27 files changed

+112
-82
lines changed

27 files changed

+112
-82
lines changed

.changeset/spicy-seas-check.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@builder.io/qwik-city': patch
3+
---
4+
5+
fix: SPA routing is broken unless origin matches value in in vite.config #8093
6+
7+
If the SSG origin was set to `localhost:3000` and a user visited from `127.0.0.1:3000`, SPA routing would be broken.
8+
9+
Internally, useNavigate's context provider `goto` checks the new destination with the last route location. If the
10+
origin is different, it just does a normal browser navigation. This makes sense; links to other origins cannot use
11+
SPA routing. However, the initial route it compares was using an origin that came from the server environment.
12+
13+
Now, the first navigation will set that initial route to the browser's actual href, eliminating the erroneous
14+
origin mismatch for SPA navigations.

.changeset/tiny-tires-wait.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@builder.io/qwik-city': patch
3+
---
4+
5+
FIX: `this` in various Qwik-City handlers is now `RequestEvent` again.

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,8 @@ jobs:
684684
# browser: firefox
685685
- host: macos-latest
686686
browser: webkit
687-
# - host: windows-latest
688-
# browser: chromium
687+
- host: windows-latest
688+
browser: chromium
689689

690690
runs-on: ${{ matrix.settings.host }}
691691

@@ -834,7 +834,8 @@ jobs:
834834
always() &&
835835
github.repository == 'QwikDev/qwik' && (
836836
github.ref == 'refs/heads/upcoming' ||
837-
needs.test-unit.result == 'success'
837+
needs.test-unit.result == 'success' ||
838+
needs.test-unit.result == 'skipped'
838839
)
839840
840841
steps:

e2e/adapters-e2e/playwright.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default defineConfig({
2020
},
2121

2222
// Increase global timeout for service worker tests
23-
timeout: 30000,
23+
timeout: process.env.CI ? 120000 : 30000,
2424

2525
projects: [
2626
{
@@ -44,5 +44,6 @@ export default defineConfig({
4444
port: 3000,
4545
stdout: 'pipe',
4646
reuseExistingServer: !process.env.CI,
47+
timeout: process.env.CI ? 120000 : 30000,
4748
},
4849
});

e2e/qwik-cli-e2e/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,4 @@ export function log(text: string) {
205205
console.log(yellow('E2E: ' + text));
206206
}
207207

208-
export const DEFAULT_TIMEOUT = 30000;
208+
export const DEFAULT_TIMEOUT = process.env.CI ? 120000 : 30000;

e2e/qwik-react-e2e/playwright.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default defineConfig({
2020
},
2121

2222
// Increase global timeout for service worker tests
23-
timeout: 30000,
23+
timeout: process.env.CI ? 120000 : 30000,
2424

2525
projects: [
2626
{
@@ -44,5 +44,6 @@ export default defineConfig({
4444
port: 3000,
4545
stdout: 'pipe',
4646
reuseExistingServer: !process.env.CI,
47+
timeout: process.env.CI ? 120000 : 30000,
4748
},
4849
});

eslint.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,26 @@ const ignores = [
3030
'packages/docs/src/routes/examples/apps',
3131
'packages/docs/src/routes/playground/app',
3232
'packages/docs/src/routes/tutorial',
33+
'packages/qwik/src/optimizer/core/src/fixtures',
34+
'packages/qwik/bindings',
3335
'packages/qwik-labs/lib',
3436
'packages/qwik-labs/lib-types',
3537
'packages/qwik-labs/vite',
3638
'packages/insights/drizzle.config.ts',
3739
'packages/insights/panda.config.ts',
40+
'packages/qwik/src/napi',
3841
'starters/apps/base',
3942
'starters/apps/library',
4043
'starters/templates',
4144
'**/vite.config.ts',
4245
// packages with eslint.config.mjs
4346
'packages/qwik-labs',
4447
'packages/insights',
45-
'starters',
4648
// eslint.config.*
4749
'**/eslint.config.mjs',
4850
'**/eslint.config.js',
51+
'.changeset',
52+
'packages/docs/public/builder',
4953
];
5054

5155
export default tseslint.config(

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/qwik-city/src/middleware/request-handler/request-event.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ export function createRequestEvent(
7777

7878
while (routeModuleIndex < requestHandlers.length) {
7979
const moduleRequestHandler = requestHandlers[routeModuleIndex];
80-
const result = moduleRequestHandler(requestEv);
80+
const asyncStore = globalThis.qcAsyncRequestStore;
81+
const result = asyncStore?.run
82+
? asyncStore.run(requestEv, moduleRequestHandler, requestEv)
83+
: moduleRequestHandler(requestEv);
8184
if (isPromise(result)) {
8285
await result;
8386
}

packages/qwik-city/src/runtime/src/contexts.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type {
77
RouteLocation,
88
RouteNavigate,
99
RoutePreventNavigate,
10-
RouteStateInternal,
1110
} from './types';
1211

1312
export const RouteStateContext = /*#__PURE__*/ createContextId<Record<string, any>>('qc-s');
@@ -24,8 +23,5 @@ export const RouteNavigateContext = /*#__PURE__*/ createContextId<RouteNavigate>
2423

2524
export const RouteActionContext = /*#__PURE__*/ createContextId<RouteAction>('qc-a');
2625

27-
export const RouteInternalContext =
28-
/*#__PURE__*/ createContextId<Signal<RouteStateInternal>>('qc-ir');
29-
3026
export const RoutePreventNavigateContext =
3127
/*#__PURE__*/ createContextId<RoutePreventNavigate>('qc-p');

0 commit comments

Comments
 (0)