@qwik.dev/core 2.0.0-beta.7 → 2.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/bindings/qwik.darwin-arm64.node +0 -0
  2. package/bindings/qwik.darwin-x64.node +0 -0
  3. package/bindings/qwik.linux-x64-gnu.node +0 -0
  4. package/bindings/qwik.win32-x64-msvc.node +0 -0
  5. package/bindings/qwik_wasm_bg.wasm +0 -0
  6. package/dist/build/package.json +1 -1
  7. package/dist/cli.cjs +17 -17
  8. package/dist/core-internal.d.ts +8 -2
  9. package/dist/core.cjs +48 -15
  10. package/dist/core.cjs.map +1 -1
  11. package/dist/core.min.mjs +1 -1
  12. package/dist/core.mjs +47 -16
  13. package/dist/core.mjs.map +1 -1
  14. package/dist/core.prod.cjs +20 -14
  15. package/dist/core.prod.mjs +23 -14
  16. package/dist/loader/index.cjs +2 -2
  17. package/dist/loader/index.mjs +2 -2
  18. package/dist/loader/package.json +1 -1
  19. package/dist/optimizer.cjs +5 -5
  20. package/dist/optimizer.mjs +5 -5
  21. package/dist/qwikloader.debug.js +0 -13
  22. package/dist/qwikloader.js +1 -1
  23. package/dist/server.cjs +76 -23
  24. package/dist/server.mjs +75 -23
  25. package/dist/starters/features/auth/package.json +1 -1
  26. package/dist/starters/features/localize/package.json +3 -3
  27. package/dist/starters/features/pandacss/package.json +1 -1
  28. package/dist/starters/features/playwright/playwright-report/index.html +943 -903
  29. package/dist/starters/features/postcss/postcss.config.js +1 -1
  30. package/dist/starters/features/tailwind/package.json +2 -2
  31. package/dist/starters/features/tailwind/prettier.config.js +10 -0
  32. package/dist/starters/features/tailwind-v3/package.json +1 -1
  33. package/dist/starters/features/tailwind-v3/prettier.config.js +10 -0
  34. package/dist/testing/index.cjs +81 -29
  35. package/dist/testing/index.mjs +80 -29
  36. package/dist/testing/package.json +1 -1
  37. package/package.json +6 -6
  38. package/dist/starters/features/tailwind/.prettierrc.js +0 -3
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/build",
3
- "version": "2.0.0-beta.7-dev+2dd89a6",
3
+ "version": "2.0.0-beta.8-dev+434cd18",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
package/dist/cli.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/cli 2.0.0-beta.7-dev+2dd89a6
3
+ * @qwik.dev/core/cli 2.0.0-beta.8-dev+434cd18
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -983,9 +983,9 @@ var require_path_key = __commonJS({
983
983
  }
984
984
  });
985
985
 
986
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js
986
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
987
987
  var require_resolveCommand = __commonJS({
988
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
988
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
989
989
  "use strict";
990
990
  var path3 = require("path");
991
991
  var which = require_which();
@@ -1025,9 +1025,9 @@ var require_resolveCommand = __commonJS({
1025
1025
  }
1026
1026
  });
1027
1027
 
1028
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js
1028
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
1029
1029
  var require_escape = __commonJS({
1030
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
1030
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
1031
1031
  "use strict";
1032
1032
  var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
1033
1033
  function escapeCommand(arg) {
@@ -1036,8 +1036,8 @@ var require_escape = __commonJS({
1036
1036
  }
1037
1037
  function escapeArgument(arg, doubleEscapeMetaChars) {
1038
1038
  arg = `${arg}`;
1039
- arg = arg.replace(/(\\*)"/g, '$1$1\\"');
1040
- arg = arg.replace(/(\\*)$/, "$1$1");
1039
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
1040
+ arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
1041
1041
  arg = `"${arg}"`;
1042
1042
  arg = arg.replace(metaCharsRegExp, "^$1");
1043
1043
  if (doubleEscapeMetaChars) {
@@ -1078,9 +1078,9 @@ var require_shebang_command = __commonJS({
1078
1078
  }
1079
1079
  });
1080
1080
 
1081
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js
1081
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
1082
1082
  var require_readShebang = __commonJS({
1083
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
1083
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
1084
1084
  "use strict";
1085
1085
  var fs8 = require("fs");
1086
1086
  var shebangCommand = require_shebang_command();
@@ -1100,9 +1100,9 @@ var require_readShebang = __commonJS({
1100
1100
  }
1101
1101
  });
1102
1102
 
1103
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js
1103
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
1104
1104
  var require_parse = __commonJS({
1105
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
1105
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
1106
1106
  "use strict";
1107
1107
  var path3 = require("path");
1108
1108
  var resolveCommand = require_resolveCommand();
@@ -1162,9 +1162,9 @@ var require_parse = __commonJS({
1162
1162
  }
1163
1163
  });
1164
1164
 
1165
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js
1165
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
1166
1166
  var require_enoent = __commonJS({
1167
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
1167
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
1168
1168
  "use strict";
1169
1169
  var isWin = process.platform === "win32";
1170
1170
  function notFoundError(original, syscall) {
@@ -1183,7 +1183,7 @@ var require_enoent = __commonJS({
1183
1183
  const originalEmit = cp.emit;
1184
1184
  cp.emit = function(name, arg1) {
1185
1185
  if (name === "exit") {
1186
- const err = verifyENOENT(arg1, parsed, "spawn");
1186
+ const err = verifyENOENT(arg1, parsed);
1187
1187
  if (err) {
1188
1188
  return originalEmit.call(cp, "error", err);
1189
1189
  }
@@ -1212,9 +1212,9 @@ var require_enoent = __commonJS({
1212
1212
  }
1213
1213
  });
1214
1214
 
1215
- // node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js
1215
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
1216
1216
  var require_cross_spawn = __commonJS({
1217
- "node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js"(exports2, module2) {
1217
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module2) {
1218
1218
  "use strict";
1219
1219
  var cp = require("child_process");
1220
1220
  var parse = require_parse();
@@ -5536,7 +5536,7 @@ async function printHelp(app) {
5536
5536
  await runCommand2(Object.assign(app, { task: args[0], args }));
5537
5537
  }
5538
5538
  function printVersion() {
5539
- console.log("2.0.0-beta.7-dev+2dd89a6");
5539
+ console.log("2.0.0-beta.8-dev+434cd18");
5540
5540
  }
5541
5541
  // Annotate the CommonJS export names for ESM import in node:
5542
5542
  0 && (module.exports = {
@@ -1226,6 +1226,9 @@ export declare type FunctionComponent<P = unknown> = {
1226
1226
  renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
1227
1227
  }['renderFn'];
1228
1228
 
1229
+ /** @internal */
1230
+ export declare const _getConstProps: <T, JSX>(props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
1231
+
1229
1232
  /** @internal */
1230
1233
  export declare const _getContextContainer: () => ClientContainer | undefined;
1231
1234
 
@@ -1267,6 +1270,9 @@ export declare const getPlatform: () => CorePlatform;
1267
1270
  /** @internal */
1268
1271
  export declare function _getQContainerElement(element: Element | _VNode): Element | null;
1269
1272
 
1273
+ /** @internal */
1274
+ export declare const _getVarProps: <T, JSX>(props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
1275
+
1270
1276
  /** @public */
1271
1277
  declare interface GlobalInjections {
1272
1278
  tag: string;
@@ -1679,7 +1685,7 @@ export declare const _mapApp_findIndx: <T>(array: (T | null)[], key: string, sta
1679
1685
  export declare const _mapArray_get: <T>(array: (T | null)[], key: string, start: number) => T | null;
1680
1686
 
1681
1687
  /** @internal */
1682
- export declare const _mapArray_set: <T>(array: (T | null)[], key: string, value: T | null, start: number) => void;
1688
+ export declare const _mapArray_set: <T>(array: (T | null)[], key: string, value: T | null, start: number, allowNullValue?: boolean) => void;
1683
1689
 
1684
1690
  declare type MediaSpecialAttrs = {
1685
1691
  crossOrigin?: HTMLCrossOriginAttribute;
@@ -4346,7 +4352,7 @@ export declare const _VAR_PROPS: unique symbol;
4346
4352
  export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
4347
4353
 
4348
4354
  /**
4349
- * 2.0.0-beta.7-dev+2dd89a6
4355
+ * 2.0.0-beta.8-dev+434cd18
4350
4356
  *
4351
4357
  * @public
4352
4358
  */
package/dist/core.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core 2.0.0-beta.7-dev+2dd89a6
3
+ * @qwik.dev/core 2.0.0-beta.8-dev+434cd18
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -1252,7 +1252,7 @@
1252
1252
  *
1253
1253
  * @public
1254
1254
  */
1255
- const version = "2.0.0-beta.7-dev+2dd89a6";
1255
+ const version = "2.0.0-beta.8-dev+434cd18";
1256
1256
 
1257
1257
  /** @internal */
1258
1258
  const EMPTY_ARRAY = [];
@@ -1432,17 +1432,17 @@
1432
1432
  return (bottom << 1) ^ -1;
1433
1433
  };
1434
1434
  /** @internal */
1435
- const mapArray_set = (array, key, value, start) => {
1435
+ const mapArray_set = (array, key, value, start, allowNullValue = false) => {
1436
1436
  const indx = mapApp_findIndx(array, key, start);
1437
1437
  if (indx >= 0) {
1438
- if (value == null) {
1438
+ if (value == null && !allowNullValue) {
1439
1439
  array.splice(indx, 2);
1440
1440
  }
1441
1441
  else {
1442
1442
  array[indx + 1] = value;
1443
1443
  }
1444
1444
  }
1445
- else if (value != null) {
1445
+ else if (value != null || allowNullValue) {
1446
1446
  array.splice(indx ^ -1, 0, key, value);
1447
1447
  }
1448
1448
  };
@@ -1456,6 +1456,9 @@
1456
1456
  return null;
1457
1457
  }
1458
1458
  };
1459
+ const mapArray_has = (array, key, start) => {
1460
+ return mapApp_findIndx(array, key, start) >= 0;
1461
+ };
1459
1462
 
1460
1463
  /** @internal */
1461
1464
  const _CONST_PROPS = Symbol('CONST');
@@ -3520,6 +3523,24 @@
3520
3523
  const directGetPropsProxyProp = (jsx, prop) => {
3521
3524
  return (jsx.constProps && prop in jsx.constProps ? jsx.constProps[prop] : jsx.varProps[prop]);
3522
3525
  };
3526
+ /** @internal */
3527
+ const _getVarProps = (props) => {
3528
+ if (!props) {
3529
+ return null;
3530
+ }
3531
+ return _VAR_PROPS in props
3532
+ ? 'children' in props
3533
+ ? { ...props[_VAR_PROPS], children: props.children }
3534
+ : props[_VAR_PROPS]
3535
+ : props;
3536
+ };
3537
+ /** @internal */
3538
+ const _getConstProps = (props) => {
3539
+ if (!props) {
3540
+ return null;
3541
+ }
3542
+ return _CONST_PROPS in props ? props[_CONST_PROPS] : null;
3543
+ };
3523
3544
 
3524
3545
  const isForeignObjectElement = (elementName) => {
3525
3546
  return build.isDev ? elementName.toLowerCase() === 'foreignobject' : elementName === 'foreignObject';
@@ -4268,8 +4289,10 @@
4268
4289
  value = trackSignalAndAssignHost(value, vNewNode, key, container, signalData);
4269
4290
  }
4270
4291
  if (key === dangerouslySetInnerHTML) {
4271
- element.innerHTML = value;
4272
- element.setAttribute(QContainerAttr, "html" /* QContainerValue.HTML */);
4292
+ if (value) {
4293
+ element.innerHTML = String(value);
4294
+ element.setAttribute(QContainerAttr, "html" /* QContainerValue.HTML */);
4295
+ }
4273
4296
  continue;
4274
4297
  }
4275
4298
  if (elementName === 'textarea' && key === 'value') {
@@ -6346,19 +6369,16 @@
6346
6369
  }
6347
6370
  setContext(host, context, value) {
6348
6371
  let ctx = this.getHostProp(host, QCtxAttr);
6349
- if (!ctx) {
6372
+ if (ctx == null) {
6350
6373
  this.setHostProp(host, QCtxAttr, (ctx = []));
6351
6374
  }
6352
- mapArray_set(ctx, context.id, value, 0);
6375
+ mapArray_set(ctx, context.id, value, 0, true);
6353
6376
  }
6354
6377
  resolveContext(host, contextId) {
6355
6378
  while (host) {
6356
6379
  const ctx = this.getHostProp(host, QCtxAttr);
6357
- if (ctx) {
6358
- const value = mapArray_get(ctx, contextId.id, 0);
6359
- if (value) {
6360
- return value;
6361
- }
6380
+ if (ctx != null && mapArray_has(ctx, contextId.id, 0)) {
6381
+ return mapArray_get(ctx, contextId.id, 0);
6362
6382
  }
6363
6383
  host = this.getParentHost(host);
6364
6384
  }
@@ -11816,7 +11836,7 @@
11816
11836
  // the file 'qwik-prefetch-service-worker.js' is not located in /build/
11817
11837
  resolvedOpts.path = baseUrl + resolvedOpts.path;
11818
11838
  }
11819
- let code = PREFETCH_CODE.replace("'_URL_'", JSON.stringify(resolvedOpts.path));
11839
+ let code = PREFETCH_CODE.replace('"_URL_"', JSON.stringify(resolvedOpts.path.split('/').pop()));
11820
11840
  if (!build.isDev) {
11821
11841
  // consecutive spaces are indentation
11822
11842
  code = code.replaceAll(/\s\s+/gm, '');
@@ -11846,6 +11866,17 @@
11846
11866
  });
11847
11867
  });
11848
11868
  }
11869
+ if ('caches' in window) {
11870
+ caches
11871
+ .keys()
11872
+ .then((names) => {
11873
+ const cacheName = names.find((name) => name.startsWith('QwikBundles'));
11874
+ if (cacheName) {
11875
+ caches.delete(cacheName).catch(console.error);
11876
+ }
11877
+ })
11878
+ .catch(console.error);
11879
+ }
11849
11880
  }).toString();
11850
11881
  /**
11851
11882
  * @deprecated This is no longer needed as the preloading happens automatically in qrl-class. You
@@ -11892,11 +11923,13 @@
11892
11923
  exports._deserialize = _deserialize;
11893
11924
  exports._dumpState = dumpState;
11894
11925
  exports._fnSignal = _fnSignal;
11926
+ exports._getConstProps = _getConstProps;
11895
11927
  exports._getContextContainer = _getContextContainer;
11896
11928
  exports._getContextElement = _getContextElement;
11897
11929
  exports._getContextEvent = _getContextEvent;
11898
11930
  exports._getDomContainer = getDomContainer;
11899
11931
  exports._getQContainerElement = _getQContainerElement;
11932
+ exports._getVarProps = _getVarProps;
11900
11933
  exports._isJSXNode = isJSXNode;
11901
11934
  exports._isStore = isStore;
11902
11935
  exports._isStringifiable = isStringifiable;