Skip to content

Commit a9b2004

Browse files
authored
fix: server url property (#112)
1 parent 2b571ad commit a9b2004

File tree

16 files changed

+16
-18
lines changed

16 files changed

+16
-18
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@builder.io/qwik",
3-
"version": "0.0.16-0",
3+
"version": "0.0.16-1",
44
"description": "An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.",
55
"scripts": {
66
"build": "node scripts --tsc --build --api --platform-binding --wasm",

src/server/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface DocumentOptions {
2727
// (undocumented)
2828
debug?: boolean;
2929
// (undocumented)
30-
url?: string;
30+
url?: URL;
3131
}
3232

3333
// @alpha

src/server/document.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function createGlobal(opts?: GlobalOptions): QwikGlobal {
2222
opts = opts || {};
2323

2424
const doc: QwikDocument = domino.createDocument() as any;
25-
const baseURI = typeof opts.url !== 'string' ? BASE_URI : opts.url;
25+
const baseURI = opts.url === undefined ? BASE_URI : opts.url.href;
2626
const loc = new URL(baseURI, BASE_URI);
2727

2828
Object.defineProperty(doc, 'baseURI', {

src/server/platform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function createPlatform(document: any, opts?: DocumentOptions) {
1414
const doc: Document = document;
1515

1616
if (opts?.url) {
17-
doc.location.href = new URL(opts.url, 'http://qwik.local').href;
17+
doc.location.href = opts.url.href;
1818
}
1919
const symbolCache = new Map<string, { [symbol: string]: any }>();
2020
const serverPlatform: CorePlatform = {

src/server/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface QwikDocument extends Document {}
2727
* @public
2828
*/
2929
export interface DocumentOptions {
30-
url?: string;
30+
url?: URL;
3131
debug?: boolean;
3232
}
3333

src/testing/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface DocumentOptions {
2727
// (undocumented)
2828
debug?: boolean;
2929
// (undocumented)
30-
url?: string;
30+
url?: URL;
3131
}
3232

3333
// @alpha

src/testing/document.unit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { pathToFileURL } from 'url';
1212
describe('global', () => {
1313
it('should create document', () => {
1414
const global = createGlobal({
15-
url: pathToFileURL(__filename).href,
15+
url: pathToFileURL(__filename),
1616
});
1717
expect(global.document.baseURI).toContain('file://');
1818
expect(global.document.baseURI).toContain('document.unit.ts');

starters/apps/starter-builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"start": "npm run clean && concurrently -c blue,green \"rollup -c --configDev --watch\" \"wait-on public/build && npm run serve\""
1010
},
1111
"devDependencies": {
12-
"@builder.io/qwik": "~0.0.15",
12+
"@builder.io/qwik": "0.0.16-1",
1313
"@rollup/plugin-node-resolve": "^13.0.6",
1414
"concurrently": "^6.4.0",
1515
"rimraf": "^3.0.2",

starters/apps/starter-builder/src/index.server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function renderApp(opts: RenderToStringOptions) {
2121
<head>
2222
<title>Qwik Blank App</title>
2323
</head>
24-
<body>
24+
<body q:base="/build/">
2525
<Header />
2626
<div id="my-content"></div>
2727
<Footer />

starters/apps/starter-partytown/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"serve": "echo \"server not setup\""
1010
},
1111
"devDependencies": {
12-
"@builder.io/qwik": "~0.0.15",
12+
"@builder.io/qwik": "0.0.16-1",
1313
"@rollup/plugin-node-resolve": "^13.0.6",
1414
"concurrently": "^6.4.0",
1515
"rimraf": "^3.0.2",

0 commit comments

Comments
 (0)