@qwik.dev/core 2.0.0-alpha.8 → 2.0.0-alpha.9
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.
- package/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.darwin-x64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/build/package.json +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/core-internal.d.ts +234 -22
- package/dist/core.cjs +7305 -7418
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +7299 -7418
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +1546 -1662
- package/dist/core.prod.mjs +2713 -2852
- package/dist/insights/index.qwik.cjs +1815 -1933
- package/dist/insights/index.qwik.mjs +1815 -1933
- package/dist/insights/insights.d.ts +1 -1
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +47 -17
- package/dist/optimizer.d.ts +1 -1
- package/dist/optimizer.mjs +45 -17
- package/dist/prefetch/package.json +1 -1
- package/dist/server.cjs +12 -11
- package/dist/server.mjs +12 -11
- package/dist/starters/features/auth/package.json +1 -1
- package/dist/starters/features/tailwind/package.json +2 -2
- package/dist/starters/features/tailwind-v3/.vscode/settings.json +3 -0
- package/dist/starters/features/tailwind-v3/package.json +21 -0
- package/dist/starters/features/tailwind-v3/postcss.config.cjs +6 -0
- package/dist/starters/features/tailwind-v3/src/global.css +7 -0
- package/dist/starters/features/tailwind-v3/tailwind.config.js +8 -0
- package/dist/testing/index.cjs +5461 -5373
- package/dist/testing/index.d.ts +2 -1
- package/dist/testing/index.mjs +5475 -5389
- package/dist/testing/package.json +1 -1
- package/package.json +3 -3
- package/public.d.ts +6 -0
package/dist/loader/package.json
CHANGED
package/dist/optimizer.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/optimizer 2.0.0-alpha.
|
|
3
|
+
* @qwik.dev/core/optimizer 2.0.0-alpha.9-dev+56ed5bd
|
|
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
|
|
@@ -1235,7 +1235,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
1235
1235
|
}
|
|
1236
1236
|
};
|
|
1237
1237
|
var versions = {
|
|
1238
|
-
qwik: "2.0.0-alpha.
|
|
1238
|
+
qwik: "2.0.0-alpha.9-dev+56ed5bd"
|
|
1239
1239
|
};
|
|
1240
1240
|
async function getSystem() {
|
|
1241
1241
|
const sysEnv = getEnv();
|
|
@@ -1814,7 +1814,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
1814
1814
|
ExperimentalFeatures2.insights = "insights";
|
|
1815
1815
|
return ExperimentalFeatures2;
|
|
1816
1816
|
})(ExperimentalFeatures || {});
|
|
1817
|
-
function
|
|
1817
|
+
function createQwikPlugin(optimizerOptions = {}) {
|
|
1818
1818
|
const id = `${Math.round(899 * Math.random()) + 100}`;
|
|
1819
1819
|
const clientResults = new Map;
|
|
1820
1820
|
const clientTransformedOutputs = new Map;
|
|
@@ -1832,7 +1832,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
1832
1832
|
rootDir: null,
|
|
1833
1833
|
tsconfigFileNames: [ "./tsconfig.json" ],
|
|
1834
1834
|
input: null,
|
|
1835
|
-
outDir:
|
|
1835
|
+
outDir: "",
|
|
1836
1836
|
assetsDir: null,
|
|
1837
1837
|
resolveQwikBuild: true,
|
|
1838
1838
|
entryStrategy: null,
|
|
@@ -2452,7 +2452,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
2452
2452
|
var LIB_OUT_DIR = "lib";
|
|
2453
2453
|
var Q_MANIFEST_FILENAME = "q-manifest.json";
|
|
2454
2454
|
function qwikRollup(qwikRollupOpts = {}) {
|
|
2455
|
-
const qwikPlugin =
|
|
2455
|
+
const qwikPlugin = createQwikPlugin(qwikRollupOpts.optimizerOptions);
|
|
2456
2456
|
const rollupPlugin = {
|
|
2457
2457
|
name: "rollup-plugin-qwik",
|
|
2458
2458
|
api: {
|
|
@@ -2491,7 +2491,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
2491
2491
|
inputOpts.input || (inputOpts.input = opts.input);
|
|
2492
2492
|
return inputOpts;
|
|
2493
2493
|
},
|
|
2494
|
-
outputOptions: rollupOutputOpts => normalizeRollupOutputOptionsObject(qwikPlugin
|
|
2494
|
+
outputOptions: rollupOutputOpts => normalizeRollupOutputOptionsObject(qwikPlugin, rollupOutputOpts, false),
|
|
2495
2495
|
async buildStart() {
|
|
2496
2496
|
qwikPlugin.onDiagnostics(((diagnostics, optimizer, srcDir) => {
|
|
2497
2497
|
diagnostics.forEach((d => {
|
|
@@ -2545,29 +2545,45 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
2545
2545
|
};
|
|
2546
2546
|
return rollupPlugin;
|
|
2547
2547
|
}
|
|
2548
|
-
function normalizeRollupOutputOptions(
|
|
2548
|
+
function normalizeRollupOutputOptions(qwikPlugin, rollupOutputOpts, useAssetsDir, outDir) {
|
|
2549
2549
|
if (Array.isArray(rollupOutputOpts)) {
|
|
2550
2550
|
rollupOutputOpts.length || rollupOutputOpts.push({});
|
|
2551
2551
|
return rollupOutputOpts.map((outputOptsObj => ({
|
|
2552
|
-
...normalizeRollupOutputOptionsObject(
|
|
2552
|
+
...normalizeRollupOutputOptionsObject(qwikPlugin, outputOptsObj, useAssetsDir),
|
|
2553
2553
|
dir: outDir || outputOptsObj.dir
|
|
2554
2554
|
})));
|
|
2555
2555
|
}
|
|
2556
2556
|
return {
|
|
2557
|
-
...normalizeRollupOutputOptionsObject(
|
|
2557
|
+
...normalizeRollupOutputOptionsObject(qwikPlugin, rollupOutputOpts, useAssetsDir),
|
|
2558
2558
|
dir: outDir || (null == rollupOutputOpts ? void 0 : rollupOutputOpts.dir)
|
|
2559
2559
|
};
|
|
2560
2560
|
}
|
|
2561
|
-
function normalizeRollupOutputOptionsObject(
|
|
2561
|
+
function normalizeRollupOutputOptionsObject(qwikPlugin, rollupOutputOptsObj, useAssetsDir) {
|
|
2562
2562
|
const outputOpts = {
|
|
2563
2563
|
...rollupOutputOptsObj
|
|
2564
2564
|
};
|
|
2565
|
+
const opts = qwikPlugin.getOptions();
|
|
2566
|
+
const optimizer = qwikPlugin.getOptimizer();
|
|
2567
|
+
const manualChunks = qwikPlugin.manualChunks;
|
|
2565
2568
|
if ("client" === opts.target) {
|
|
2566
2569
|
if (!outputOpts.assetFileNames) {
|
|
2567
2570
|
const assetFileNames = "assets/[hash]-[name].[ext]";
|
|
2568
2571
|
outputOpts.assetFileNames = useAssetsDir ? `${opts.assetsDir}/${assetFileNames}` : assetFileNames;
|
|
2569
2572
|
}
|
|
2570
|
-
|
|
2573
|
+
let fileName;
|
|
2574
|
+
fileName = "production" !== opts.buildMode || opts.debug ? chunkInfo => {
|
|
2575
|
+
var _a, _b;
|
|
2576
|
+
if (null == (_a = chunkInfo.moduleIds) ? void 0 : _a.some((id => id.endsWith("core.prod.mjs")))) {
|
|
2577
|
+
return "build/core.js";
|
|
2578
|
+
}
|
|
2579
|
+
if (null == (_b = chunkInfo.moduleIds) ? void 0 : _b.some((id => id.endsWith("qwik-router/lib/index.qwik.mjs")))) {
|
|
2580
|
+
return "build/qwik-router.js";
|
|
2581
|
+
}
|
|
2582
|
+
const path = optimizer.sys.path;
|
|
2583
|
+
const relativePath = path.relative(optimizer.sys.cwd(), chunkInfo.name);
|
|
2584
|
+
const sanitized = relativePath.replace(/^(\.\.\/)+/, "").replace(/^\/+/, "").replace(/\//g, "-");
|
|
2585
|
+
return `build/${sanitized}.js`;
|
|
2586
|
+
} : "build/q-[hash].js";
|
|
2571
2587
|
outputOpts.entryFileNames || (outputOpts.entryFileNames = useAssetsDir ? `${opts.assetsDir}/${fileName}` : fileName);
|
|
2572
2588
|
outputOpts.chunkFileNames || (outputOpts.chunkFileNames = useAssetsDir ? `${opts.assetsDir}/${fileName}` : fileName);
|
|
2573
2589
|
} else {
|
|
@@ -2587,11 +2603,12 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
2587
2603
|
return outputOpts;
|
|
2588
2604
|
}
|
|
2589
2605
|
function createRollupError2(id, diagnostic) {
|
|
2590
|
-
|
|
2606
|
+
var _a;
|
|
2607
|
+
const loc = null == (_a = diagnostic.highlights) ? void 0 : _a[0];
|
|
2591
2608
|
const err = Object.assign(new Error(diagnostic.message), {
|
|
2592
2609
|
id: id,
|
|
2593
2610
|
plugin: "qwik",
|
|
2594
|
-
loc: {
|
|
2611
|
+
loc: loc && {
|
|
2595
2612
|
column: loc.startCol,
|
|
2596
2613
|
line: loc.startLine
|
|
2597
2614
|
},
|
|
@@ -2913,6 +2930,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
2913
2930
|
return;
|
|
2914
2931
|
}
|
|
2915
2932
|
const hasQwikRouter = null == (_a = server.config.plugins) ? void 0 : _a.some((plugin => "vite-plugin-qwik-router" === plugin.name));
|
|
2933
|
+
const cssImportedByCSS = new Set;
|
|
2916
2934
|
server.middlewares.use((async (req, res, next) => {
|
|
2917
2935
|
try {
|
|
2918
2936
|
const {ORIGIN: ORIGIN} = process.env;
|
|
@@ -2971,11 +2989,17 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
2971
2989
|
const {pathId: pathId, query: query} = parseId(v.url);
|
|
2972
2990
|
if ("" === query && CSS_EXTENSIONS.some((ext => pathId.endsWith(ext)))) {
|
|
2973
2991
|
const isEntryCSS = 0 === v.importers.size;
|
|
2992
|
+
const hasCSSImporter = Array.from(v.importers).some((importer => {
|
|
2993
|
+
const importerPath = importer.url || importer.file;
|
|
2994
|
+
const isCSS = importerPath && CSS_EXTENSIONS.some((ext => importerPath.endsWith(ext)));
|
|
2995
|
+
isCSS && v.url && cssImportedByCSS.add(v.url);
|
|
2996
|
+
return isCSS;
|
|
2997
|
+
}));
|
|
2974
2998
|
const hasJSImporter = Array.from(v.importers).some((importer => {
|
|
2975
2999
|
const importerPath = importer.url || importer.file;
|
|
2976
3000
|
return importerPath && JS_EXTENSIONS.test(importerPath);
|
|
2977
3001
|
}));
|
|
2978
|
-
if ((isEntryCSS || hasJSImporter) && !added.has(v.url)) {
|
|
3002
|
+
if ((isEntryCSS || hasJSImporter) && !hasCSSImporter && !cssImportedByCSS.has(v.url) && !added.has(v.url)) {
|
|
2979
3003
|
added.add(v.url);
|
|
2980
3004
|
manifest.injections.push({
|
|
2981
3005
|
tag: "link",
|
|
@@ -3014,11 +3038,17 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3014
3038
|
const {pathId: pathId, query: query} = parseId(v.url);
|
|
3015
3039
|
if (!added.has(v.url) && "" === query && CSS_EXTENSIONS.some((ext => pathId.endsWith(ext)))) {
|
|
3016
3040
|
const isEntryCSS = 0 === v.importers.size;
|
|
3041
|
+
const hasCSSImporter = Array.from(v.importers).some((importer => {
|
|
3042
|
+
const importerPath = importer.url || importer.file;
|
|
3043
|
+
const isCSS = importerPath && CSS_EXTENSIONS.some((ext => importerPath.endsWith(ext)));
|
|
3044
|
+
isCSS && v.url && cssImportedByCSS.add(v.url);
|
|
3045
|
+
return isCSS;
|
|
3046
|
+
}));
|
|
3017
3047
|
const hasJSImporter = Array.from(v.importers).some((importer => {
|
|
3018
3048
|
const importerPath = importer.url || importer.file;
|
|
3019
3049
|
return importerPath && JS_EXTENSIONS.test(importerPath);
|
|
3020
3050
|
}));
|
|
3021
|
-
if (isEntryCSS || hasJSImporter) {
|
|
3051
|
+
if ((isEntryCSS || hasJSImporter) && !hasCSSImporter && !cssImportedByCSS.has(v.url)) {
|
|
3022
3052
|
res.write(`<link rel="stylesheet" href="${base}${v.url.slice(1)}">`);
|
|
3023
3053
|
added.add(v.url);
|
|
3024
3054
|
}
|
|
@@ -3166,7 +3196,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3166
3196
|
let ssrOutDir = null;
|
|
3167
3197
|
const fileFilter = qwikViteOpts.fileFilter ? (id, type) => TRANSFORM_REGEX.test(id) || qwikViteOpts.fileFilter(id, type) : () => true;
|
|
3168
3198
|
const injections = [];
|
|
3169
|
-
const qwikPlugin =
|
|
3199
|
+
const qwikPlugin = createQwikPlugin(qwikViteOpts.optimizerOptions);
|
|
3170
3200
|
async function loadQwikInsights(clientOutDir2 = "") {
|
|
3171
3201
|
const sys = qwikPlugin.getSys();
|
|
3172
3202
|
const cwdRelativePath = absolutePathAwareJoin(sys.path, rootDir || ".", clientOutDir2, "q-insights.json");
|
|
@@ -3341,7 +3371,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3341
3371
|
const origOnwarn = null == (_t = updatedViteConfig.build.rollupOptions) ? void 0 : _t.onwarn;
|
|
3342
3372
|
updatedViteConfig.build.rollupOptions = {
|
|
3343
3373
|
input: opts.input,
|
|
3344
|
-
output: normalizeRollupOutputOptions(
|
|
3374
|
+
output: normalizeRollupOutputOptions(qwikPlugin, null == (_v = null == (_u = viteConfig.build) ? void 0 : _u.rollupOptions) ? void 0 : _v.output, useAssetsDir, buildOutputDir),
|
|
3345
3375
|
preserveEntrySignatures: "exports-only",
|
|
3346
3376
|
onwarn: (warning, warn) => {
|
|
3347
3377
|
if ("typescript" === warning.plugin && warning.message.includes("outputToFilesystem")) {
|
package/dist/optimizer.d.ts
CHANGED
package/dist/optimizer.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/optimizer 2.0.0-alpha.
|
|
3
|
+
* @qwik.dev/core/optimizer 2.0.0-alpha.9-dev+56ed5bd
|
|
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
|
|
@@ -1260,7 +1260,7 @@ var QWIK_BINDING_MAP = {
|
|
|
1260
1260
|
};
|
|
1261
1261
|
|
|
1262
1262
|
var versions = {
|
|
1263
|
-
qwik: "2.0.0-alpha.
|
|
1263
|
+
qwik: "2.0.0-alpha.9-dev+56ed5bd"
|
|
1264
1264
|
};
|
|
1265
1265
|
|
|
1266
1266
|
async function getSystem() {
|
|
@@ -1830,7 +1830,7 @@ var ExperimentalFeatures = (ExperimentalFeatures2 => {
|
|
|
1830
1830
|
return ExperimentalFeatures2;
|
|
1831
1831
|
})(ExperimentalFeatures || {});
|
|
1832
1832
|
|
|
1833
|
-
function
|
|
1833
|
+
function createQwikPlugin(optimizerOptions = {}) {
|
|
1834
1834
|
const id = `${Math.round(899 * Math.random()) + 100}`;
|
|
1835
1835
|
const clientResults = new Map;
|
|
1836
1836
|
const clientTransformedOutputs = new Map;
|
|
@@ -1848,7 +1848,7 @@ function createPlugin(optimizerOptions = {}) {
|
|
|
1848
1848
|
rootDir: null,
|
|
1849
1849
|
tsconfigFileNames: [ "./tsconfig.json" ],
|
|
1850
1850
|
input: null,
|
|
1851
|
-
outDir:
|
|
1851
|
+
outDir: "",
|
|
1852
1852
|
assetsDir: null,
|
|
1853
1853
|
resolveQwikBuild: true,
|
|
1854
1854
|
entryStrategy: null,
|
|
@@ -2483,7 +2483,7 @@ var LIB_OUT_DIR = "lib";
|
|
|
2483
2483
|
var Q_MANIFEST_FILENAME = "q-manifest.json";
|
|
2484
2484
|
|
|
2485
2485
|
function qwikRollup(qwikRollupOpts = {}) {
|
|
2486
|
-
const qwikPlugin =
|
|
2486
|
+
const qwikPlugin = createQwikPlugin(qwikRollupOpts.optimizerOptions);
|
|
2487
2487
|
const rollupPlugin = {
|
|
2488
2488
|
name: "rollup-plugin-qwik",
|
|
2489
2489
|
api: {
|
|
@@ -2521,7 +2521,7 @@ function qwikRollup(qwikRollupOpts = {}) {
|
|
|
2521
2521
|
inputOpts.input || (inputOpts.input = opts.input);
|
|
2522
2522
|
return inputOpts;
|
|
2523
2523
|
},
|
|
2524
|
-
outputOptions: rollupOutputOpts => normalizeRollupOutputOptionsObject(qwikPlugin
|
|
2524
|
+
outputOptions: rollupOutputOpts => normalizeRollupOutputOptionsObject(qwikPlugin, rollupOutputOpts, false),
|
|
2525
2525
|
async buildStart() {
|
|
2526
2526
|
qwikPlugin.onDiagnostics(((diagnostics, optimizer, srcDir) => {
|
|
2527
2527
|
diagnostics.forEach((d => {
|
|
@@ -2575,30 +2575,45 @@ function qwikRollup(qwikRollupOpts = {}) {
|
|
|
2575
2575
|
return rollupPlugin;
|
|
2576
2576
|
}
|
|
2577
2577
|
|
|
2578
|
-
function normalizeRollupOutputOptions(
|
|
2578
|
+
function normalizeRollupOutputOptions(qwikPlugin, rollupOutputOpts, useAssetsDir, outDir) {
|
|
2579
2579
|
if (Array.isArray(rollupOutputOpts)) {
|
|
2580
2580
|
rollupOutputOpts.length || rollupOutputOpts.push({});
|
|
2581
2581
|
return rollupOutputOpts.map((outputOptsObj => ({
|
|
2582
|
-
...normalizeRollupOutputOptionsObject(
|
|
2582
|
+
...normalizeRollupOutputOptionsObject(qwikPlugin, outputOptsObj, useAssetsDir),
|
|
2583
2583
|
dir: outDir || outputOptsObj.dir
|
|
2584
2584
|
})));
|
|
2585
2585
|
}
|
|
2586
2586
|
return {
|
|
2587
|
-
...normalizeRollupOutputOptionsObject(
|
|
2587
|
+
...normalizeRollupOutputOptionsObject(qwikPlugin, rollupOutputOpts, useAssetsDir),
|
|
2588
2588
|
dir: outDir || rollupOutputOpts?.dir
|
|
2589
2589
|
};
|
|
2590
2590
|
}
|
|
2591
2591
|
|
|
2592
|
-
function normalizeRollupOutputOptionsObject(
|
|
2592
|
+
function normalizeRollupOutputOptionsObject(qwikPlugin, rollupOutputOptsObj, useAssetsDir) {
|
|
2593
2593
|
const outputOpts = {
|
|
2594
2594
|
...rollupOutputOptsObj
|
|
2595
2595
|
};
|
|
2596
|
+
const opts = qwikPlugin.getOptions();
|
|
2597
|
+
const optimizer = qwikPlugin.getOptimizer();
|
|
2598
|
+
const manualChunks = qwikPlugin.manualChunks;
|
|
2596
2599
|
if ("client" === opts.target) {
|
|
2597
2600
|
if (!outputOpts.assetFileNames) {
|
|
2598
2601
|
const assetFileNames = "assets/[hash]-[name].[ext]";
|
|
2599
2602
|
outputOpts.assetFileNames = useAssetsDir ? `${opts.assetsDir}/${assetFileNames}` : assetFileNames;
|
|
2600
2603
|
}
|
|
2601
|
-
|
|
2604
|
+
let fileName;
|
|
2605
|
+
fileName = "production" !== opts.buildMode || opts.debug ? chunkInfo => {
|
|
2606
|
+
if (chunkInfo.moduleIds?.some((id => id.endsWith("core.prod.mjs")))) {
|
|
2607
|
+
return "build/core.js";
|
|
2608
|
+
}
|
|
2609
|
+
if (chunkInfo.moduleIds?.some((id => id.endsWith("qwik-router/lib/index.qwik.mjs")))) {
|
|
2610
|
+
return "build/qwik-router.js";
|
|
2611
|
+
}
|
|
2612
|
+
const path = optimizer.sys.path;
|
|
2613
|
+
const relativePath = path.relative(optimizer.sys.cwd(), chunkInfo.name);
|
|
2614
|
+
const sanitized = relativePath.replace(/^(\.\.\/)+/, "").replace(/^\/+/, "").replace(/\//g, "-");
|
|
2615
|
+
return `build/${sanitized}.js`;
|
|
2616
|
+
} : "build/q-[hash].js";
|
|
2602
2617
|
outputOpts.entryFileNames || (outputOpts.entryFileNames = useAssetsDir ? `${opts.assetsDir}/${fileName}` : fileName);
|
|
2603
2618
|
outputOpts.chunkFileNames || (outputOpts.chunkFileNames = useAssetsDir ? `${opts.assetsDir}/${fileName}` : fileName);
|
|
2604
2619
|
} else {
|
|
@@ -2619,11 +2634,11 @@ function normalizeRollupOutputOptionsObject(opts, rollupOutputOptsObj, useAssets
|
|
|
2619
2634
|
}
|
|
2620
2635
|
|
|
2621
2636
|
function createRollupError2(id, diagnostic) {
|
|
2622
|
-
const loc = diagnostic.highlights[0]
|
|
2637
|
+
const loc = diagnostic.highlights?.[0];
|
|
2623
2638
|
const err = Object.assign(new Error(diagnostic.message), {
|
|
2624
2639
|
id: id,
|
|
2625
2640
|
plugin: "qwik",
|
|
2626
|
-
loc: {
|
|
2641
|
+
loc: loc && {
|
|
2627
2642
|
column: loc.startCol,
|
|
2628
2643
|
line: loc.startLine
|
|
2629
2644
|
},
|
|
@@ -3065,6 +3080,7 @@ async function configureDevServer(base, server, opts, sys, path, isClientDevOnly
|
|
|
3065
3080
|
return;
|
|
3066
3081
|
}
|
|
3067
3082
|
const hasQwikRouter = server.config.plugins?.some((plugin => "vite-plugin-qwik-router" === plugin.name));
|
|
3083
|
+
const cssImportedByCSS = new Set;
|
|
3068
3084
|
server.middlewares.use((async (req, res, next) => {
|
|
3069
3085
|
try {
|
|
3070
3086
|
const {ORIGIN: ORIGIN} = process.env;
|
|
@@ -3122,11 +3138,17 @@ async function configureDevServer(base, server, opts, sys, path, isClientDevOnly
|
|
|
3122
3138
|
const {pathId: pathId, query: query} = parseId(v.url);
|
|
3123
3139
|
if ("" === query && CSS_EXTENSIONS.some((ext => pathId.endsWith(ext)))) {
|
|
3124
3140
|
const isEntryCSS = 0 === v.importers.size;
|
|
3141
|
+
const hasCSSImporter = Array.from(v.importers).some((importer => {
|
|
3142
|
+
const importerPath = importer.url || importer.file;
|
|
3143
|
+
const isCSS = importerPath && CSS_EXTENSIONS.some((ext => importerPath.endsWith(ext)));
|
|
3144
|
+
isCSS && v.url && cssImportedByCSS.add(v.url);
|
|
3145
|
+
return isCSS;
|
|
3146
|
+
}));
|
|
3125
3147
|
const hasJSImporter = Array.from(v.importers).some((importer => {
|
|
3126
3148
|
const importerPath = importer.url || importer.file;
|
|
3127
3149
|
return importerPath && JS_EXTENSIONS.test(importerPath);
|
|
3128
3150
|
}));
|
|
3129
|
-
if ((isEntryCSS || hasJSImporter) && !added.has(v.url)) {
|
|
3151
|
+
if ((isEntryCSS || hasJSImporter) && !hasCSSImporter && !cssImportedByCSS.has(v.url) && !added.has(v.url)) {
|
|
3130
3152
|
added.add(v.url);
|
|
3131
3153
|
manifest.injections.push({
|
|
3132
3154
|
tag: "link",
|
|
@@ -3165,11 +3187,17 @@ async function configureDevServer(base, server, opts, sys, path, isClientDevOnly
|
|
|
3165
3187
|
const {pathId: pathId, query: query} = parseId(v.url);
|
|
3166
3188
|
if (!added.has(v.url) && "" === query && CSS_EXTENSIONS.some((ext => pathId.endsWith(ext)))) {
|
|
3167
3189
|
const isEntryCSS = 0 === v.importers.size;
|
|
3190
|
+
const hasCSSImporter = Array.from(v.importers).some((importer => {
|
|
3191
|
+
const importerPath = importer.url || importer.file;
|
|
3192
|
+
const isCSS = importerPath && CSS_EXTENSIONS.some((ext => importerPath.endsWith(ext)));
|
|
3193
|
+
isCSS && v.url && cssImportedByCSS.add(v.url);
|
|
3194
|
+
return isCSS;
|
|
3195
|
+
}));
|
|
3168
3196
|
const hasJSImporter = Array.from(v.importers).some((importer => {
|
|
3169
3197
|
const importerPath = importer.url || importer.file;
|
|
3170
3198
|
return importerPath && JS_EXTENSIONS.test(importerPath);
|
|
3171
3199
|
}));
|
|
3172
|
-
if (isEntryCSS || hasJSImporter) {
|
|
3200
|
+
if ((isEntryCSS || hasJSImporter) && !hasCSSImporter && !cssImportedByCSS.has(v.url)) {
|
|
3173
3201
|
res.write(`<link rel="stylesheet" href="${base}${v.url.slice(1)}">`);
|
|
3174
3202
|
added.add(v.url);
|
|
3175
3203
|
}
|
|
@@ -3335,7 +3363,7 @@ function qwikVite(qwikViteOpts = {}) {
|
|
|
3335
3363
|
let ssrOutDir = null;
|
|
3336
3364
|
const fileFilter = qwikViteOpts.fileFilter ? (id, type) => TRANSFORM_REGEX.test(id) || qwikViteOpts.fileFilter(id, type) : () => true;
|
|
3337
3365
|
const injections = [];
|
|
3338
|
-
const qwikPlugin =
|
|
3366
|
+
const qwikPlugin = createQwikPlugin(qwikViteOpts.optimizerOptions);
|
|
3339
3367
|
async function loadQwikInsights(clientOutDir2 = "") {
|
|
3340
3368
|
const sys = qwikPlugin.getSys();
|
|
3341
3369
|
const cwdRelativePath = absolutePathAwareJoin(sys.path, rootDir || ".", clientOutDir2, "q-insights.json");
|
|
@@ -3509,7 +3537,7 @@ function qwikVite(qwikViteOpts = {}) {
|
|
|
3509
3537
|
const origOnwarn = updatedViteConfig.build.rollupOptions?.onwarn;
|
|
3510
3538
|
updatedViteConfig.build.rollupOptions = {
|
|
3511
3539
|
input: opts.input,
|
|
3512
|
-
output: normalizeRollupOutputOptions(
|
|
3540
|
+
output: normalizeRollupOutputOptions(qwikPlugin, viteConfig.build?.rollupOptions?.output, useAssetsDir, buildOutputDir),
|
|
3513
3541
|
preserveEntrySignatures: "exports-only",
|
|
3514
3542
|
onwarn: (warning, warn) => {
|
|
3515
3543
|
if ("typescript" === warning.plugin && warning.message.includes("outputToFilesystem")) {
|
package/dist/server.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/server 2.0.0-alpha.
|
|
3
|
+
* @qwik.dev/core/server 2.0.0-alpha.9-dev+56ed5bd
|
|
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
|
|
@@ -53,7 +53,7 @@ __export(server_exports, {
|
|
|
53
53
|
renderToString: () => renderToString,
|
|
54
54
|
resolveManifest: () => resolveManifest,
|
|
55
55
|
setServerPlatform: () => setServerPlatform2,
|
|
56
|
-
versions: () =>
|
|
56
|
+
versions: () => versions
|
|
57
57
|
});
|
|
58
58
|
module.exports = __toCommonJS(server_exports);
|
|
59
59
|
var import_core5 = require("@qwik.dev/core");
|
|
@@ -257,8 +257,10 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
|
|
|
257
257
|
// 47
|
|
258
258
|
"WrappedSignal is read-only",
|
|
259
259
|
// 48
|
|
260
|
-
"Attribute value is unsafe for SSR"
|
|
260
|
+
"Attribute value is unsafe for SSR",
|
|
261
261
|
// 49
|
|
262
|
+
"SerializerSymbol function returned rejected promise"
|
|
263
|
+
// 50
|
|
262
264
|
];
|
|
263
265
|
let text = MAP[code] ?? "";
|
|
264
266
|
if (parts.length) {
|
|
@@ -962,8 +964,8 @@ function getBuildBase(opts) {
|
|
|
962
964
|
}
|
|
963
965
|
return `${import_meta.env.BASE_URL}build/`;
|
|
964
966
|
}
|
|
965
|
-
var
|
|
966
|
-
qwik: "2.0.0-alpha.
|
|
967
|
+
var versions = {
|
|
968
|
+
qwik: "2.0.0-alpha.9-dev+56ed5bd",
|
|
967
969
|
qwikDom: "2.1.19"
|
|
968
970
|
};
|
|
969
971
|
|
|
@@ -973,8 +975,8 @@ var import_build4 = require("@qwik.dev/core/build");
|
|
|
973
975
|
|
|
974
976
|
// packages/qwik/src/server/prefetch-utils.ts
|
|
975
977
|
function workerFetchScript() {
|
|
976
|
-
const
|
|
977
|
-
const workerBody = `onmessage=(e)=>{${
|
|
978
|
+
const fetch = `Promise.all(e.data.map(u=>fetch(u))).finally(()=>{setTimeout(postMessage({}),9999)})`;
|
|
979
|
+
const workerBody = `onmessage=(e)=>{${fetch}}`;
|
|
978
980
|
const blob = `new Blob(['${workerBody}'],{type:"text/javascript"})`;
|
|
979
981
|
const url = `URL.createObjectURL(${blob})`;
|
|
980
982
|
let s = `const w=new Worker(${url});`;
|
|
@@ -1062,7 +1064,7 @@ function prefetchUrlsEvent2(container, prefetchResources, nonce) {
|
|
|
1062
1064
|
scriptAttrs.push("nonce", nonce);
|
|
1063
1065
|
}
|
|
1064
1066
|
container.openElement("script", null, scriptAttrs);
|
|
1065
|
-
container.writer.write(prefetchUrlsEventScript(container
|
|
1067
|
+
container.writer.write(prefetchUrlsEventScript(container.$buildBase$ || "", prefetchResources));
|
|
1066
1068
|
container.writer.write(
|
|
1067
1069
|
`;document.dispatchEvent(new CustomEvent('qprefetch', {detail:{links: [location.pathname]}}))`
|
|
1068
1070
|
);
|
|
@@ -1779,7 +1781,6 @@ var SSRContainer = class extends import_core4._SharedContainer {
|
|
|
1779
1781
|
tag;
|
|
1780
1782
|
writer;
|
|
1781
1783
|
timing;
|
|
1782
|
-
buildBase;
|
|
1783
1784
|
resolvedManifest;
|
|
1784
1785
|
symbolToChunkResolver;
|
|
1785
1786
|
renderOptions;
|
|
@@ -1847,7 +1848,7 @@ var SSRContainer = class extends import_core4._SharedContainer {
|
|
|
1847
1848
|
this.tag = opts.tagName;
|
|
1848
1849
|
this.writer = opts.writer;
|
|
1849
1850
|
this.timing = opts.timing;
|
|
1850
|
-
this
|
|
1851
|
+
this.$buildBase$ = opts.buildBase;
|
|
1851
1852
|
this.resolvedManifest = opts.resolvedManifest;
|
|
1852
1853
|
this.renderOptions = opts.renderOptions;
|
|
1853
1854
|
this.$processInjectionsFromManifest$();
|
|
@@ -1914,7 +1915,7 @@ var SSRContainer = class extends import_core4._SharedContainer {
|
|
|
1914
1915
|
containerAttributes[QRuntimeAttr] = "2";
|
|
1915
1916
|
containerAttributes[QVersionAttr] = this.$version$ ?? "dev";
|
|
1916
1917
|
containerAttributes[QRenderAttr] = (qRender ? qRender + "-" : "") + (import_build4.isDev ? "ssr-dev" : "ssr");
|
|
1917
|
-
containerAttributes[QBaseAttr] = this
|
|
1918
|
+
containerAttributes[QBaseAttr] = this.$buildBase$ || "";
|
|
1918
1919
|
containerAttributes[QLocaleAttr] = this.$locale$;
|
|
1919
1920
|
containerAttributes[QManifestHashAttr] = this.resolvedManifest.manifest.manifestHash;
|
|
1920
1921
|
containerAttributes[QInstanceAttr] = this.$instanceHash$;
|
package/dist/server.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/server 2.0.0-alpha.
|
|
3
|
+
* @qwik.dev/core/server 2.0.0-alpha.9-dev+56ed5bd
|
|
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
|
|
@@ -217,8 +217,10 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
|
|
|
217
217
|
// 47
|
|
218
218
|
"WrappedSignal is read-only",
|
|
219
219
|
// 48
|
|
220
|
-
"Attribute value is unsafe for SSR"
|
|
220
|
+
"Attribute value is unsafe for SSR",
|
|
221
221
|
// 49
|
|
222
|
+
"SerializerSymbol function returned rejected promise"
|
|
223
|
+
// 50
|
|
222
224
|
];
|
|
223
225
|
let text = MAP[code] ?? "";
|
|
224
226
|
if (parts.length) {
|
|
@@ -919,8 +921,8 @@ function getBuildBase(opts) {
|
|
|
919
921
|
}
|
|
920
922
|
return `${import.meta.env.BASE_URL}build/`;
|
|
921
923
|
}
|
|
922
|
-
var
|
|
923
|
-
qwik: "2.0.0-alpha.
|
|
924
|
+
var versions = {
|
|
925
|
+
qwik: "2.0.0-alpha.9-dev+56ed5bd",
|
|
924
926
|
qwikDom: "2.1.19"
|
|
925
927
|
};
|
|
926
928
|
|
|
@@ -937,8 +939,8 @@ import { isDev as isDev4 } from "@qwik.dev/core/build";
|
|
|
937
939
|
|
|
938
940
|
// packages/qwik/src/server/prefetch-utils.ts
|
|
939
941
|
function workerFetchScript() {
|
|
940
|
-
const
|
|
941
|
-
const workerBody = `onmessage=(e)=>{${
|
|
942
|
+
const fetch = `Promise.all(e.data.map(u=>fetch(u))).finally(()=>{setTimeout(postMessage({}),9999)})`;
|
|
943
|
+
const workerBody = `onmessage=(e)=>{${fetch}}`;
|
|
942
944
|
const blob = `new Blob(['${workerBody}'],{type:"text/javascript"})`;
|
|
943
945
|
const url = `URL.createObjectURL(${blob})`;
|
|
944
946
|
let s = `const w=new Worker(${url});`;
|
|
@@ -1026,7 +1028,7 @@ function prefetchUrlsEvent2(container, prefetchResources, nonce) {
|
|
|
1026
1028
|
scriptAttrs.push("nonce", nonce);
|
|
1027
1029
|
}
|
|
1028
1030
|
container.openElement("script", null, scriptAttrs);
|
|
1029
|
-
container.writer.write(prefetchUrlsEventScript(container
|
|
1031
|
+
container.writer.write(prefetchUrlsEventScript(container.$buildBase$ || "", prefetchResources));
|
|
1030
1032
|
container.writer.write(
|
|
1031
1033
|
`;document.dispatchEvent(new CustomEvent('qprefetch', {detail:{links: [location.pathname]}}))`
|
|
1032
1034
|
);
|
|
@@ -1761,7 +1763,6 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
1761
1763
|
__publicField(this, "tag");
|
|
1762
1764
|
__publicField(this, "writer");
|
|
1763
1765
|
__publicField(this, "timing");
|
|
1764
|
-
__publicField(this, "buildBase");
|
|
1765
1766
|
__publicField(this, "resolvedManifest");
|
|
1766
1767
|
__publicField(this, "symbolToChunkResolver");
|
|
1767
1768
|
__publicField(this, "renderOptions");
|
|
@@ -1816,7 +1817,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
1816
1817
|
this.tag = opts.tagName;
|
|
1817
1818
|
this.writer = opts.writer;
|
|
1818
1819
|
this.timing = opts.timing;
|
|
1819
|
-
this
|
|
1820
|
+
this.$buildBase$ = opts.buildBase;
|
|
1820
1821
|
this.resolvedManifest = opts.resolvedManifest;
|
|
1821
1822
|
this.renderOptions = opts.renderOptions;
|
|
1822
1823
|
this.$processInjectionsFromManifest$();
|
|
@@ -1883,7 +1884,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
1883
1884
|
containerAttributes[QRuntimeAttr] = "2";
|
|
1884
1885
|
containerAttributes[QVersionAttr] = this.$version$ ?? "dev";
|
|
1885
1886
|
containerAttributes[QRenderAttr] = (qRender ? qRender + "-" : "") + (isDev4 ? "ssr-dev" : "ssr");
|
|
1886
|
-
containerAttributes[QBaseAttr] = this
|
|
1887
|
+
containerAttributes[QBaseAttr] = this.$buildBase$ || "";
|
|
1887
1888
|
containerAttributes[QLocaleAttr] = this.$locale$;
|
|
1888
1889
|
containerAttributes[QManifestHashAttr] = this.resolvedManifest.manifest.manifestHash;
|
|
1889
1890
|
containerAttributes[QInstanceAttr] = this.$instanceHash$;
|
|
@@ -2866,5 +2867,5 @@ export {
|
|
|
2866
2867
|
renderToString,
|
|
2867
2868
|
resolveManifest,
|
|
2868
2869
|
setServerPlatform2 as setServerPlatform,
|
|
2869
|
-
|
|
2870
|
+
versions
|
|
2870
2871
|
};
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"nextSteps": {
|
|
11
11
|
"lines": [
|
|
12
|
-
" Please add `optimizeDeps: { include: ['@auth/
|
|
12
|
+
" Please add `optimizeDeps: { include: ['@auth/qwik'] }`",
|
|
13
13
|
" to your vite.config.ts file.",
|
|
14
14
|
" Have a look at the docs for more info: ",
|
|
15
15
|
" https://qwik.dev/docs/integrations/authjs/"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"description": "Use Tailwind in your Qwik app",
|
|
2
|
+
"description": "Use Tailwind v4 in your Qwik app",
|
|
3
3
|
"__qwik__": {
|
|
4
|
-
"displayName": "Integration: Tailwind (styling)",
|
|
4
|
+
"displayName": "Integration: Tailwind v4 (styling)",
|
|
5
5
|
"priority": -10,
|
|
6
6
|
"viteConfig": {
|
|
7
7
|
"imports": [
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Use Tailwind v3 in your Qwik app",
|
|
3
|
+
"__qwik__": {
|
|
4
|
+
"displayName": "Integration: Tailwind v3 (styling)",
|
|
5
|
+
"priority": -10,
|
|
6
|
+
"viteConfig": {},
|
|
7
|
+
"docs": [
|
|
8
|
+
"https://qwik.dev/integrations/integration/tailwind/",
|
|
9
|
+
"https://tailwindcss.com/docs/utility-first"
|
|
10
|
+
],
|
|
11
|
+
"alwaysInRoot": [
|
|
12
|
+
".vscode"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"autoprefixer": "^10.4.19",
|
|
17
|
+
"postcss": "^8.4.39",
|
|
18
|
+
"prettier-plugin-tailwindcss": "^0.5.4",
|
|
19
|
+
"tailwindcss": "^3.4.17"
|
|
20
|
+
}
|
|
21
|
+
}
|