houdini 2.0.0-next.7 → 2.0.0-next.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.
- package/build/cmd-cjs/index.js +2 -2
- package/build/cmd-esm/index.js +2 -2
- package/build/vite/hmr.d.ts +0 -2
- package/build/vite-cjs/index.js +6 -18
- package/build/vite-esm/index.js +6 -18
- package/package.json +1 -1
package/build/cmd-cjs/index.js
CHANGED
|
@@ -89211,12 +89211,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
89211
89211
|
}
|
|
89212
89212
|
packageJSON2.devDependencies = {
|
|
89213
89213
|
...packageJSON2.devDependencies,
|
|
89214
|
-
houdini: "^2.0.0-next.
|
|
89214
|
+
houdini: "^2.0.0-next.8"
|
|
89215
89215
|
};
|
|
89216
89216
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
89217
89217
|
packageJSON2.devDependencies = {
|
|
89218
89218
|
...packageJSON2.devDependencies,
|
|
89219
|
-
"houdini-svelte": "^3.0.0-next.
|
|
89219
|
+
"houdini-svelte": "^3.0.0-next.11"
|
|
89220
89220
|
};
|
|
89221
89221
|
} else {
|
|
89222
89222
|
throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
|
package/build/cmd-esm/index.js
CHANGED
|
@@ -89215,12 +89215,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
89215
89215
|
}
|
|
89216
89216
|
packageJSON2.devDependencies = {
|
|
89217
89217
|
...packageJSON2.devDependencies,
|
|
89218
|
-
houdini: "^2.0.0-next.
|
|
89218
|
+
houdini: "^2.0.0-next.8"
|
|
89219
89219
|
};
|
|
89220
89220
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
89221
89221
|
packageJSON2.devDependencies = {
|
|
89222
89222
|
...packageJSON2.devDependencies,
|
|
89223
|
-
"houdini-svelte": "^3.0.0-next.
|
|
89223
|
+
"houdini-svelte": "^3.0.0-next.11"
|
|
89224
89224
|
};
|
|
89225
89225
|
} else {
|
|
89226
89226
|
throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
|
package/build/vite/hmr.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { EnvironmentModuleNode } from 'vite';
|
|
2
1
|
import { type Config } from '../lib';
|
|
3
2
|
export declare function isGraphQLFile(filepath: string): boolean;
|
|
4
3
|
export declare function shouldReactToFileChange(filepath: string, config: Config): Promise<boolean>;
|
|
5
|
-
export declare function fileDependsOnHoudini(modules: EnvironmentModuleNode[], houdiniPath: string): Boolean;
|
package/build/vite-cjs/index.js
CHANGED
|
@@ -85754,17 +85754,6 @@ async function shouldReactToFileChange(filepath, config2) {
|
|
|
85754
85754
|
}
|
|
85755
85755
|
return config2.includeFile(filepath, { root: process.cwd() });
|
|
85756
85756
|
}
|
|
85757
|
-
function fileDependsOnHoudini(modules, houdiniPath) {
|
|
85758
|
-
const fileDependencies = modules.reduce((acc, module2) => {
|
|
85759
|
-
module2.importedModules.forEach((importedModule) => {
|
|
85760
|
-
if (importedModule?.id) acc.push(importedModule.id);
|
|
85761
|
-
});
|
|
85762
|
-
return acc;
|
|
85763
|
-
}, []);
|
|
85764
|
-
return fileDependencies.some((file) => {
|
|
85765
|
-
return file.startsWith(houdiniPath);
|
|
85766
|
-
});
|
|
85767
|
-
}
|
|
85768
85757
|
|
|
85769
85758
|
// src/vite/houdini.ts
|
|
85770
85759
|
var config;
|
|
@@ -85778,12 +85767,13 @@ function Plugin(opts = {}) {
|
|
|
85778
85767
|
// houdini will always act as a "meta framework" and process the user's code before it
|
|
85779
85768
|
// is processed by the user's library-specific plugins.
|
|
85780
85769
|
enforce: "pre",
|
|
85781
|
-
async hotUpdate({ file, server, modules, timestamp }) {
|
|
85770
|
+
async hotUpdate({ file, server, modules, timestamp, read }) {
|
|
85782
85771
|
const config2 = await getConfig(opts);
|
|
85783
85772
|
const shouldReact = await shouldReactToFileChange(file, config2);
|
|
85784
85773
|
const runtimeDir = path_exports.join(config2.projectRoot, config2.runtimeDir ?? ".houdini");
|
|
85774
|
+
const dependsOn = (await read()).includes("$houdini");
|
|
85785
85775
|
const isGqlFile = isGraphQLFile(file);
|
|
85786
|
-
if (!(shouldReact && (
|
|
85776
|
+
if (!(shouldReact && (dependsOn || isGqlFile))) {
|
|
85787
85777
|
return modules;
|
|
85788
85778
|
}
|
|
85789
85779
|
if (config2.localSchema) {
|
|
@@ -85793,20 +85783,18 @@ function Plugin(opts = {}) {
|
|
|
85793
85783
|
config2.pluginMode = true;
|
|
85794
85784
|
let artifactStats = void 0;
|
|
85795
85785
|
if (!lastHotUpdateEvent || timestamp !== lastHotUpdateEvent.timestamp) {
|
|
85796
|
-
console.log("\u{1F3A9} \u{1F504} bundle HMR rebuild...");
|
|
85797
85786
|
try {
|
|
85798
85787
|
artifactStats = await compile(config2);
|
|
85799
85788
|
} catch (e2) {
|
|
85800
85789
|
formatErrors(e2);
|
|
85801
85790
|
}
|
|
85791
|
+
lastHotUpdateEvent = {
|
|
85792
|
+
timestamp
|
|
85793
|
+
};
|
|
85802
85794
|
}
|
|
85803
|
-
lastHotUpdateEvent = {
|
|
85804
|
-
timestamp
|
|
85805
|
-
};
|
|
85806
85795
|
if (!artifactStats) {
|
|
85807
85796
|
return modules;
|
|
85808
85797
|
}
|
|
85809
|
-
console.log("\u{1F3A9} \u2B06\uFE0F bundle changed, triggering HMR update");
|
|
85810
85798
|
const taintedModules = [];
|
|
85811
85799
|
for await (const file2 of fs_exports.walk(runtimeDir)) {
|
|
85812
85800
|
const module2 = environment.moduleGraph.getModuleById(file2);
|
package/build/vite-esm/index.js
CHANGED
|
@@ -85746,17 +85746,6 @@ async function shouldReactToFileChange(filepath, config2) {
|
|
|
85746
85746
|
}
|
|
85747
85747
|
return config2.includeFile(filepath, { root: process.cwd() });
|
|
85748
85748
|
}
|
|
85749
|
-
function fileDependsOnHoudini(modules, houdiniPath) {
|
|
85750
|
-
const fileDependencies = modules.reduce((acc, module) => {
|
|
85751
|
-
module.importedModules.forEach((importedModule) => {
|
|
85752
|
-
if (importedModule?.id) acc.push(importedModule.id);
|
|
85753
|
-
});
|
|
85754
|
-
return acc;
|
|
85755
|
-
}, []);
|
|
85756
|
-
return fileDependencies.some((file) => {
|
|
85757
|
-
return file.startsWith(houdiniPath);
|
|
85758
|
-
});
|
|
85759
|
-
}
|
|
85760
85749
|
|
|
85761
85750
|
// src/vite/houdini.ts
|
|
85762
85751
|
var config;
|
|
@@ -85770,12 +85759,13 @@ function Plugin(opts = {}) {
|
|
|
85770
85759
|
// houdini will always act as a "meta framework" and process the user's code before it
|
|
85771
85760
|
// is processed by the user's library-specific plugins.
|
|
85772
85761
|
enforce: "pre",
|
|
85773
|
-
async hotUpdate({ file, server, modules, timestamp }) {
|
|
85762
|
+
async hotUpdate({ file, server, modules, timestamp, read }) {
|
|
85774
85763
|
const config2 = await getConfig(opts);
|
|
85775
85764
|
const shouldReact = await shouldReactToFileChange(file, config2);
|
|
85776
85765
|
const runtimeDir = path_exports.join(config2.projectRoot, config2.runtimeDir ?? ".houdini");
|
|
85766
|
+
const dependsOn = (await read()).includes("$houdini");
|
|
85777
85767
|
const isGqlFile = isGraphQLFile(file);
|
|
85778
|
-
if (!(shouldReact && (
|
|
85768
|
+
if (!(shouldReact && (dependsOn || isGqlFile))) {
|
|
85779
85769
|
return modules;
|
|
85780
85770
|
}
|
|
85781
85771
|
if (config2.localSchema) {
|
|
@@ -85785,20 +85775,18 @@ function Plugin(opts = {}) {
|
|
|
85785
85775
|
config2.pluginMode = true;
|
|
85786
85776
|
let artifactStats = void 0;
|
|
85787
85777
|
if (!lastHotUpdateEvent || timestamp !== lastHotUpdateEvent.timestamp) {
|
|
85788
|
-
console.log("\u{1F3A9} \u{1F504} bundle HMR rebuild...");
|
|
85789
85778
|
try {
|
|
85790
85779
|
artifactStats = await compile(config2);
|
|
85791
85780
|
} catch (e2) {
|
|
85792
85781
|
formatErrors(e2);
|
|
85793
85782
|
}
|
|
85783
|
+
lastHotUpdateEvent = {
|
|
85784
|
+
timestamp
|
|
85785
|
+
};
|
|
85794
85786
|
}
|
|
85795
|
-
lastHotUpdateEvent = {
|
|
85796
|
-
timestamp
|
|
85797
|
-
};
|
|
85798
85787
|
if (!artifactStats) {
|
|
85799
85788
|
return modules;
|
|
85800
85789
|
}
|
|
85801
|
-
console.log("\u{1F3A9} \u2B06\uFE0F bundle changed, triggering HMR update");
|
|
85802
85790
|
const taintedModules = [];
|
|
85803
85791
|
for await (const file2 of fs_exports.walk(runtimeDir)) {
|
|
85804
85792
|
const module = environment.moduleGraph.getModuleById(file2);
|