Skip to content

Commit

Permalink
96ae4c6 fix(qrl): correct qrl loading in vite dev mode (#6579)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmertens committed Jun 20, 2024
1 parent ed02be9 commit 596ff1c
Show file tree
Hide file tree
Showing 26 changed files with 46 additions and 42 deletions.
Binary file modified bindings/qwik.win32-x64-msvc.node
Binary file not shown.
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/qwik/build",
"version": "1.5.7-dev20240619180045",
"version": "1.5.7-dev20240620004924",
"main": "index.mjs",
"types": "index.d.ts",
"private": true,
Expand Down
4 changes: 2 additions & 2 deletions cli.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* @builder.io/qwik/cli 1.5.7-dev20240619180045
* @builder.io/qwik/cli 1.5.7-dev20240620004924
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
Expand Down Expand Up @@ -4889,7 +4889,7 @@ async function printHelp(app) {
await runCommand2(Object.assign(app, { task: args[0], args }));
}
function printVersion() {
console.log("1.5.7-dev20240619180045");
console.log("1.5.7-dev20240620004924");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Expand Down
6 changes: 3 additions & 3 deletions core.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* @builder.io/qwik 1.5.7-dev20240619180045
* @builder.io/qwik 1.5.7-dev20240620004924
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
Expand Down Expand Up @@ -1560,7 +1560,7 @@
*
* @public
*/
const version = "1.5.7-dev20240619180045";
const version = "1.5.7-dev20240620004924";

const hashCode = (text, hash = 0) => {
for (let i = 0; i < text.length; i++) {
Expand Down Expand Up @@ -7307,7 +7307,7 @@ Task Symbol: ${task.$qrl$.$symbol$}
throwErrorAndStop('Sync QRL without containerState');
}
}
let output = `${encodeURI(chunk)}#${symbol}`;
let output = `${chunk}#${symbol}`;
const capture = qrl.$capture$;
const captureRef = qrl.$captureRef$;
if (captureRef && captureRef.length) {
Expand Down
2 changes: 1 addition & 1 deletion core.cjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3835,7 +3835,7 @@ export declare type ValueOrPromise<T> = T | Promise<T>;
export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;

/**
* 1.5.7-dev20240619180045
* 1.5.7-dev20240620004924
*
* @public
*/
Expand Down
2 changes: 1 addition & 1 deletion core.min.mjs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions core.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* @builder.io/qwik 1.5.7-dev20240619180045
* @builder.io/qwik 1.5.7-dev20240620004924
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
Expand Down Expand Up @@ -1556,7 +1556,7 @@ const dangerouslySetInnerHTML = 'dangerouslySetInnerHTML';
*
* @public
*/
const version = "1.5.7-dev20240619180045";
const version = "1.5.7-dev20240620004924";

const hashCode = (text, hash = 0) => {
for (let i = 0; i < text.length; i++) {
Expand Down Expand Up @@ -7303,7 +7303,7 @@ const serializeQRL = (qrl, opts = {}) => {
throwErrorAndStop('Sync QRL without containerState');
}
}
let output = `${encodeURI(chunk)}#${symbol}`;
let output = `${chunk}#${symbol}`;
const capture = qrl.$capture$;
const captureRef = qrl.$captureRef$;
if (captureRef && captureRef.length) {
Expand Down
2 changes: 1 addition & 1 deletion core.mjs.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions core.prod.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* @builder.io/qwik 1.5.7-dev20240619180045
* @builder.io/qwik 1.5.7-dev20240620004924
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
Expand Down Expand Up @@ -540,7 +540,7 @@
}
const shouldWrapFunctional = (res, node) => !!node.key && (!isJSXNode(res) || !isFunction(res.type) && res.key != node.key);
const dangerouslySetInnerHTML = "dangerouslySetInnerHTML";
const version = "1.5.7-dev20240619180045";
const version = "1.5.7-dev20240620004924";
const hashCode = (text, hash = 0) => {
for (let i = 0; i < text.length; i++) {
hash = (hash << 5) - hash + text.charCodeAt(i), hash |= 0;
Expand Down Expand Up @@ -3595,7 +3595,7 @@
throwErrorAndStop("Sync QRL without containerState");
}
}
let output = `${encodeURI(chunk)}#${symbol}`;
let output = `${chunk}#${symbol}`;
const capture = qrl.$capture$;
const captureRef = qrl.$captureRef$;
return captureRef && captureRef.length ? opts.$getObjId$ ? output += `[${mapJoin(captureRef, opts.$getObjId$, " ")}]` : opts.$addRefMap$ && (output += `[${mapJoin(captureRef, opts.$addRefMap$, " ")}]`) : capture && capture.length > 0 && (output += `[${capture.join(" ")}]`),
Expand Down
6 changes: 3 additions & 3 deletions core.prod.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* @builder.io/qwik 1.5.7-dev20240619180045
* @builder.io/qwik 1.5.7-dev20240620004924
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
Expand Down Expand Up @@ -829,7 +829,7 @@ const static_subtree = 2;

const dangerouslySetInnerHTML = "dangerouslySetInnerHTML";

const version = "1.5.7-dev20240619180045";
const version = "1.5.7-dev20240620004924";

const hashCode = (text, hash = 0) => {
for (let i = 0; i < text.length; i++) {
Expand Down Expand Up @@ -4579,7 +4579,7 @@ const serializeQRL = (qrl, opts = {}) => {
throwErrorAndStop("Sync QRL without containerState");
}
}
let output = `${encodeURI(chunk)}#${symbol}`;
let output = `${chunk}#${symbol}`;
const capture = qrl.$capture$;
const captureRef = qrl.$captureRef$;
return captureRef && captureRef.length ? opts.$getObjId$ ? output += `[${mapJoin(captureRef, opts.$getObjId$, " ")}]` : opts.$addRefMap$ && (output += `[${mapJoin(captureRef, opts.$addRefMap$, " ")}]`) : capture && capture.length > 0 && (output += `[${capture.join(" ")}]`),
Expand Down
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/qwik/core",
"version": "1.5.7-dev20240619180045",
"version": "1.5.7-dev20240620004924",
"main": "../core.mjs",
"module": "../core.mjs",
"types": "../core.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion jsx-dev-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/qwik/jsx-dev-runtime",
"version": "1.5.7-dev20240619180045",
"version": "1.5.7-dev20240620004924",
"main": "../core.mjs",
"module": "../core.mjs",
"types": "../jsx-runtime.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion jsx-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/qwik/jsx-runtime",
"version": "1.5.7-dev20240619180045",
"version": "1.5.7-dev20240620004924",
"main": "../core.mjs",
"module": "../core.mjs",
"types": "../jsx-runtime.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/qwik/loader",
"version": "1.5.7-dev20240619180045",
"version": "1.5.7-dev20240620004924",
"main": "index.mjs",
"types": "index.d.ts",
"private": true,
Expand Down
10 changes: 6 additions & 4 deletions optimizer.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* @builder.io/qwik/optimizer 1.5.7-dev20240619180045
* @builder.io/qwik/optimizer 1.5.7-dev20240620004924
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
Expand Down Expand Up @@ -1256,7 +1256,7 @@ globalThis.qwikOptimizer = function(module) {
}
};
var versions = {
qwik: "1.5.7-dev20240619180045"
qwik: "1.5.7-dev20240620004924"
};
async function getSystem() {
const sysEnv = getEnv();
Expand Down Expand Up @@ -2059,6 +2059,7 @@ globalThis.qwikOptimizer = function(module) {
const match = /^([^?]*)\?_qrl_parent=(.*)/.exec(id2);
if (match) {
let [, qrlId, parentId] = match;
parentId = decodeURIComponent(parentId);
parentId.startsWith(opts.rootDir) && (qrlId = `${opts.rootDir}${qrlId}`);
if (!transformedOutputs.has(qrlId)) {
return null;
Expand Down Expand Up @@ -2996,6 +2997,7 @@ globalThis.qwikOptimizer = function(module) {
}
}));
}));
const encode = url2 => encodeURIComponent(url2).replaceAll("%2F", "/");
const renderOpts = {
debug: true,
locale: serverData.locale,
Expand All @@ -3008,7 +3010,7 @@ globalThis.qwikOptimizer = function(module) {
}
const chunk = mapper && mapper[getSymbolHash(symbolName)];
if (chunk) {
return chunk;
return [ chunk[0], encode(chunk[1]) ];
}
parent ||= foundQrls.get(symbolName);
if (!parent) {
Expand All @@ -3017,7 +3019,7 @@ globalThis.qwikOptimizer = function(module) {
}
const parentPath = path.dirname(parent);
const qrlPath = parentPath.startsWith(opts.rootDir) ? path.relative(opts.rootDir, parentPath) : parentPath;
const qrlFile = `${qrlPath}/${symbolName.toLowerCase()}.js?_qrl_parent=${parent}`;
const qrlFile = `${encode(qrlPath)}/${symbolName.toLowerCase()}.js?_qrl_parent=${encode(parent)}`;
return [ symbolName, `${base}${qrlFile}` ];
},
prefetchStrategy: null,
Expand Down
10 changes: 6 additions & 4 deletions optimizer.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* @builder.io/qwik/optimizer 1.5.7-dev20240619180045
* @builder.io/qwik/optimizer 1.5.7-dev20240620004924
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
Expand Down Expand Up @@ -1282,7 +1282,7 @@ var QWIK_BINDING_MAP = {
};

var versions = {
qwik: "1.5.7-dev20240619180045"
qwik: "1.5.7-dev20240620004924"
};

async function getSystem() {
Expand Down Expand Up @@ -2070,6 +2070,7 @@ function createPlugin(optimizerOptions = {}) {
const match = /^([^?]*)\?_qrl_parent=(.*)/.exec(id2);
if (match) {
let [, qrlId, parentId] = match;
parentId = decodeURIComponent(parentId);
parentId.startsWith(opts.rootDir) && (qrlId = `${opts.rootDir}${qrlId}`);
if (!transformedOutputs.has(qrlId)) {
return null;
Expand Down Expand Up @@ -3102,6 +3103,7 @@ async function configureDevServer(base, server, opts, sys, path, isClientDevOnly
}
}));
}));
const encode = url2 => encodeURIComponent(url2).replaceAll("%2F", "/");
const renderOpts = {
debug: true,
locale: serverData.locale,
Expand All @@ -3114,7 +3116,7 @@ async function configureDevServer(base, server, opts, sys, path, isClientDevOnly
}
const chunk = mapper && mapper[getSymbolHash(symbolName)];
if (chunk) {
return chunk;
return [ chunk[0], encode(chunk[1]) ];
}
parent || (parent = foundQrls.get(symbolName));
if (!parent) {
Expand All @@ -3123,7 +3125,7 @@ async function configureDevServer(base, server, opts, sys, path, isClientDevOnly
}
const parentPath = path.dirname(parent);
const qrlPath = parentPath.startsWith(opts.rootDir) ? path.relative(opts.rootDir, parentPath) : parentPath;
const qrlFile = `${qrlPath}/${symbolName.toLowerCase()}.js?_qrl_parent=${parent}`;
const qrlFile = `${encode(qrlPath)}/${symbolName.toLowerCase()}.js?_qrl_parent=${encode(parent)}`;
return [ symbolName, `${base}${qrlFile}` ];
},
prefetchStrategy: null,
Expand Down
2 changes: 1 addition & 1 deletion optimizer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/qwik/optimizer",
"version": "1.5.7-dev20240619180045",
"version": "1.5.7-dev20240620004924",
"main": "../optimizer.mjs",
"module": "../optimizer.mjs",
"types": "../optimizer.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/qwik",
"version": "1.5.7-dev20240619180045",
"version": "1.5.7-dev20240620004924",
"description": "An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.",
"license": "MIT",
"main": "./core.mjs",
Expand Down
2 changes: 1 addition & 1 deletion prefetch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/qwik/prefetch",
"version": "1.5.7-dev20240619180045",
"version": "1.5.7-dev20240620004924",
"main": "index.mjs",
"types": "index.d.ts",
"private": true,
Expand Down
4 changes: 2 additions & 2 deletions server.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* @builder.io/qwik/server 1.5.7-dev20240619180045
* @builder.io/qwik/server 1.5.7-dev20240620004924
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
Expand Down Expand Up @@ -159,7 +159,7 @@ function getBuildBase(opts) {
return `${import_meta.env.BASE_URL}build/`;
}
var versions = {
qwik: "1.5.7-dev20240619180045",
qwik: "1.5.7-dev20240620004924",
qwikDom: "2.1.19"
};

Expand Down
4 changes: 2 additions & 2 deletions server.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* @builder.io/qwik/server 1.5.7-dev20240619180045
* @builder.io/qwik/server 1.5.7-dev20240620004924
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
Expand Down Expand Up @@ -114,7 +114,7 @@ function getBuildBase(opts) {
return `${import.meta.env.BASE_URL}build/`;
}
var versions = {
qwik: "1.5.7-dev20240619180045",
qwik: "1.5.7-dev20240620004924",
qwikDom: "2.1.19"
};

Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/qwik/server",
"version": "1.5.7-dev20240619180045",
"version": "1.5.7-dev20240620004924",
"main": "../server.mjs",
"module": "../server.mjs",
"types": "../server.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion testing/index.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* @builder.io/qwik/testing 1.5.7-dev20240619180045
* @builder.io/qwik/testing 1.5.7-dev20240620004924
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion testing/index.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* @builder.io/qwik/testing 1.5.7-dev20240619180045
* @builder.io/qwik/testing 1.5.7-dev20240620004924
* Copyright Builder.io, Inc. All Rights Reserved.
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/qwik/testing",
"version": "1.5.7-dev20240619180045",
"version": "1.5.7-dev20240620004924",
"main": "index.mjs",
"types": "index.d.ts",
"private": true,
Expand Down

0 comments on commit 596ff1c

Please sign in to comment.