@simpleapps-com/augur-config 2.3.0 → 2.4.0
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/bin/augur-doctor.mjs +41 -1
- package/package.json +1 -1
package/bin/augur-doctor.mjs
CHANGED
|
@@ -790,6 +790,40 @@ if (usesServerProxy) {
|
|
|
790
790
|
);
|
|
791
791
|
}
|
|
792
792
|
|
|
793
|
+
// 21b. QueryClient memory safety on the server (#481)
|
|
794
|
+
// A module-scope QueryClient is shared across every request on the server.
|
|
795
|
+
// A finite gcTime in a provider's defaultOptions starts a GC timer during SSR
|
|
796
|
+
// that pins the whole request cache until it fires. Both leak memory.
|
|
797
|
+
const moduleScopeClientRegex = /^(?:export\s+)?(?:const|let|var)\s+\w+\s*=\s*new QueryClient\(/m;
|
|
798
|
+
// Allowed: Infinity, resolveGcTime(...), 0 (fires next tick). Anything else is finite.
|
|
799
|
+
const finiteGcTimeRegex = /gcTime\s*:\s*(?!Infinity\b|resolveGcTime\(|0\b)\S/;
|
|
800
|
+
|
|
801
|
+
const moduleScopeClientFiles = proxyDetectionFiles.filter(
|
|
802
|
+
(f) => fileExists(f) && fileContains(f, moduleScopeClientRegex)
|
|
803
|
+
);
|
|
804
|
+
if (moduleScopeClientFiles.length > 0) {
|
|
805
|
+
fail(
|
|
806
|
+
"query-client-scope",
|
|
807
|
+
"QueryClient created at module scope (shared across server requests)",
|
|
808
|
+
`${moduleScopeClientFiles.join(", ")}: create it per request (see wiki guide-getting-started#provider-setup)`
|
|
809
|
+
);
|
|
810
|
+
} else {
|
|
811
|
+
pass("query-client-scope", "No module-scope QueryClient", "");
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
const finiteGcTimeFiles = proxyDetectionFiles.filter(
|
|
815
|
+
(f) => fileExists(f) && fileContains(f, finiteGcTimeRegex)
|
|
816
|
+
);
|
|
817
|
+
if (finiteGcTimeFiles.length > 0) {
|
|
818
|
+
fail(
|
|
819
|
+
"query-gc-time",
|
|
820
|
+
"Finite gcTime in provider/query setup (leaks memory during SSR)",
|
|
821
|
+
`${finiteGcTimeFiles.join(", ")}: remove it, or wrap with resolveGcTime() from augur-core`
|
|
822
|
+
);
|
|
823
|
+
} else {
|
|
824
|
+
pass("query-gc-time", "No finite gcTime in provider/query setup", "");
|
|
825
|
+
}
|
|
826
|
+
|
|
793
827
|
// 22. augur-api version
|
|
794
828
|
if (pkg) {
|
|
795
829
|
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
@@ -952,7 +986,13 @@ const groups = {
|
|
|
952
986
|
"next-strict",
|
|
953
987
|
],
|
|
954
988
|
"Testing & Quality": ["contract-tests", "quality-script", "pre-commit"],
|
|
955
|
-
"Proxy Adoption": [
|
|
989
|
+
"Proxy Adoption": [
|
|
990
|
+
"proxy-local-hooks",
|
|
991
|
+
"proxy-server-query",
|
|
992
|
+
"query-client-scope",
|
|
993
|
+
"query-gc-time",
|
|
994
|
+
"api-version",
|
|
995
|
+
],
|
|
956
996
|
"Package Versions": ["augur-version-sync", "augur-version-latest"],
|
|
957
997
|
"Patterns": ["no-wrapper", "auth", "image-loader"],
|
|
958
998
|
};
|