@lowdefy/server-dev 0.0.0-experimental-20260220095000 → 0.0.0-experimental-20260220143146
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/lib/server/pageCache.mjs
CHANGED
|
@@ -86,19 +86,6 @@ class PageCache {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
invalidateByFiles(changedFiles, fileDependencyMap) {
|
|
90
|
-
const affectedPages = new Set();
|
|
91
|
-
for (const filePath of changedFiles) {
|
|
92
|
-
const pageIds = fileDependencyMap.get(filePath);
|
|
93
|
-
if (pageIds) {
|
|
94
|
-
for (const pageId of pageIds) {
|
|
95
|
-
affectedPages.add(pageId);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
this.invalidatePages(affectedPages);
|
|
100
|
-
return affectedPages;
|
|
101
|
-
}
|
|
102
89
|
}
|
|
103
90
|
|
|
104
91
|
export default PageCache;
|
|
@@ -47,45 +47,6 @@ test('invalidatePages removes specific pages', () => {
|
|
|
47
47
|
expect(cache.isCompiled('settings')).toBe(false);
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
test('invalidateByFiles returns affected pages and invalidates them', () => {
|
|
51
|
-
const cache = new PageCache();
|
|
52
|
-
cache.markCompiled('home');
|
|
53
|
-
cache.markCompiled('dashboard');
|
|
54
|
-
|
|
55
|
-
const fileDependencyMap = new Map([
|
|
56
|
-
['pages/home/blocks.yaml', new Set(['home'])],
|
|
57
|
-
['shared/layout.yaml', new Set(['home', 'dashboard'])],
|
|
58
|
-
]);
|
|
59
|
-
|
|
60
|
-
const affected = cache.invalidateByFiles(['pages/home/blocks.yaml'], fileDependencyMap);
|
|
61
|
-
expect(affected).toEqual(new Set(['home']));
|
|
62
|
-
expect(cache.isCompiled('home')).toBe(false);
|
|
63
|
-
expect(cache.isCompiled('dashboard')).toBe(true);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
test('invalidateByFiles handles shared files affecting multiple pages', () => {
|
|
67
|
-
const cache = new PageCache();
|
|
68
|
-
cache.markCompiled('home');
|
|
69
|
-
cache.markCompiled('dashboard');
|
|
70
|
-
|
|
71
|
-
const fileDependencyMap = new Map([['shared/layout.yaml', new Set(['home', 'dashboard'])]]);
|
|
72
|
-
|
|
73
|
-
const affected = cache.invalidateByFiles(['shared/layout.yaml'], fileDependencyMap);
|
|
74
|
-
expect(affected).toEqual(new Set(['home', 'dashboard']));
|
|
75
|
-
expect(cache.isCompiled('home')).toBe(false);
|
|
76
|
-
expect(cache.isCompiled('dashboard')).toBe(false);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
test('invalidateByFiles returns empty set for unknown files', () => {
|
|
80
|
-
const cache = new PageCache();
|
|
81
|
-
cache.markCompiled('home');
|
|
82
|
-
|
|
83
|
-
const fileDependencyMap = new Map();
|
|
84
|
-
const affected = cache.invalidateByFiles(['unknown.yaml'], fileDependencyMap);
|
|
85
|
-
expect(affected).toEqual(new Set());
|
|
86
|
-
expect(cache.isCompiled('home')).toBe(true);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
50
|
test('acquireBuildLock returns true for first request', async () => {
|
|
90
51
|
const cache = new PageCache();
|
|
91
52
|
const shouldBuild = await cache.acquireBuildLock('home');
|
package/manager/getContext.mjs
CHANGED
|
@@ -70,7 +70,6 @@ async function getContext() {
|
|
|
70
70
|
// JIT build state
|
|
71
71
|
pageCache: new PageCache(),
|
|
72
72
|
pageRegistry: null,
|
|
73
|
-
fileDependencyMap: null,
|
|
74
73
|
buildContext: null,
|
|
75
74
|
};
|
|
76
75
|
|
|
@@ -85,7 +84,6 @@ async function getContext() {
|
|
|
85
84
|
const result = await buildFn();
|
|
86
85
|
if (result) {
|
|
87
86
|
context.pageRegistry = result.pageRegistry;
|
|
88
|
-
context.fileDependencyMap = result.fileDependencyMap;
|
|
89
87
|
context.buildContext = result.context;
|
|
90
88
|
}
|
|
91
89
|
};
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import fs from 'fs';
|
|
18
17
|
import path from 'path';
|
|
19
18
|
import getLowdefyVersion from '../utils/getLowdefyVersion.mjs';
|
|
20
19
|
import setupWatcher from '../utils/setupWatcher.mjs';
|
|
@@ -41,35 +40,16 @@ function lowdefyBuildWatcher(context) {
|
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
try {
|
|
44
|
-
// Check if only page-level files changed (targeted invalidation)
|
|
45
43
|
const isSkeletonChange =
|
|
46
44
|
lowdefyYamlModified ||
|
|
47
|
-
changedFiles.some(
|
|
48
|
-
(f) =>
|
|
49
|
-
!context.fileDependencyMap?.has(f) && !f.startsWith('pages/') && !f.startsWith('./')
|
|
50
|
-
);
|
|
45
|
+
changedFiles.some((f) => !f.startsWith('pages/') && !f.startsWith('./'));
|
|
51
46
|
|
|
52
47
|
if (isSkeletonChange || !context.pageCache) {
|
|
53
|
-
// Full skeleton rebuild
|
|
54
48
|
await context.lowdefyBuild();
|
|
55
49
|
} else {
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
context.fileDependencyMap
|
|
60
|
-
);
|
|
61
|
-
if (affectedPages.size > 0) {
|
|
62
|
-
// Write invalidated page IDs to a file so the Next.js server process
|
|
63
|
-
// (which has its own PageCache) knows which pages to rebuild.
|
|
64
|
-
const invalidationPath = path.join(context.directories.build, 'invalidatePages.json');
|
|
65
|
-
fs.writeFileSync(invalidationPath, JSON.stringify([...affectedPages]));
|
|
66
|
-
context.logger.info(
|
|
67
|
-
`Invalidated ${affectedPages.size} page(s): ${[...affectedPages].join(', ')}`
|
|
68
|
-
);
|
|
69
|
-
} else {
|
|
70
|
-
// Unknown file changed - do full rebuild to be safe
|
|
71
|
-
await context.lowdefyBuild();
|
|
72
|
-
}
|
|
50
|
+
// Page-only changes: invalidate all pages, no skeleton rebuild needed
|
|
51
|
+
context.pageCache.invalidateAll();
|
|
52
|
+
context.logger.info('Page files changed, invalidated all pages.');
|
|
73
53
|
}
|
|
74
54
|
context.reloadClients();
|
|
75
55
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20260220143146",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -36,35 +36,35 @@
|
|
|
36
36
|
".npmrc"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@lowdefy/actions-core": "0.0.0-experimental-
|
|
40
|
-
"@lowdefy/api": "0.0.0-experimental-
|
|
41
|
-
"@lowdefy/block-utils": "0.0.0-experimental-
|
|
42
|
-
"@lowdefy/blocks-aggrid": "0.0.0-experimental-
|
|
43
|
-
"@lowdefy/blocks-antd": "0.0.0-experimental-
|
|
44
|
-
"@lowdefy/blocks-basic": "0.0.0-experimental-
|
|
45
|
-
"@lowdefy/blocks-color-selectors": "0.0.0-experimental-
|
|
46
|
-
"@lowdefy/blocks-echarts": "0.0.0-experimental-
|
|
47
|
-
"@lowdefy/blocks-loaders": "0.0.0-experimental-
|
|
48
|
-
"@lowdefy/blocks-markdown": "0.0.0-experimental-
|
|
49
|
-
"@lowdefy/blocks-qr": "0.0.0-experimental-
|
|
50
|
-
"@lowdefy/build": "0.0.0-experimental-
|
|
51
|
-
"@lowdefy/client": "0.0.0-experimental-
|
|
52
|
-
"@lowdefy/engine": "0.0.0-experimental-
|
|
53
|
-
"@lowdefy/errors": "0.0.0-experimental-
|
|
54
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
55
|
-
"@lowdefy/layout": "0.0.0-experimental-
|
|
56
|
-
"@lowdefy/logger": "0.0.0-experimental-
|
|
57
|
-
"@lowdefy/node-utils": "0.0.0-experimental-
|
|
58
|
-
"@lowdefy/operators-change-case": "0.0.0-experimental-
|
|
59
|
-
"@lowdefy/operators-diff": "0.0.0-experimental-
|
|
60
|
-
"@lowdefy/operators-js": "0.0.0-experimental-
|
|
61
|
-
"@lowdefy/operators-moment": "0.0.0-experimental-
|
|
62
|
-
"@lowdefy/operators-mql": "0.0.0-experimental-
|
|
63
|
-
"@lowdefy/operators-nunjucks": "0.0.0-experimental-
|
|
64
|
-
"@lowdefy/operators-uuid": "0.0.0-experimental-
|
|
65
|
-
"@lowdefy/operators-yaml": "0.0.0-experimental-
|
|
66
|
-
"@lowdefy/plugin-aws": "0.0.0-experimental-
|
|
67
|
-
"@lowdefy/plugin-next-auth": "0.0.0-experimental-
|
|
39
|
+
"@lowdefy/actions-core": "0.0.0-experimental-20260220143146",
|
|
40
|
+
"@lowdefy/api": "0.0.0-experimental-20260220143146",
|
|
41
|
+
"@lowdefy/block-utils": "0.0.0-experimental-20260220143146",
|
|
42
|
+
"@lowdefy/blocks-aggrid": "0.0.0-experimental-20260220143146",
|
|
43
|
+
"@lowdefy/blocks-antd": "0.0.0-experimental-20260220143146",
|
|
44
|
+
"@lowdefy/blocks-basic": "0.0.0-experimental-20260220143146",
|
|
45
|
+
"@lowdefy/blocks-color-selectors": "0.0.0-experimental-20260220143146",
|
|
46
|
+
"@lowdefy/blocks-echarts": "0.0.0-experimental-20260220143146",
|
|
47
|
+
"@lowdefy/blocks-loaders": "0.0.0-experimental-20260220143146",
|
|
48
|
+
"@lowdefy/blocks-markdown": "0.0.0-experimental-20260220143146",
|
|
49
|
+
"@lowdefy/blocks-qr": "0.0.0-experimental-20260220143146",
|
|
50
|
+
"@lowdefy/build": "0.0.0-experimental-20260220143146",
|
|
51
|
+
"@lowdefy/client": "0.0.0-experimental-20260220143146",
|
|
52
|
+
"@lowdefy/engine": "0.0.0-experimental-20260220143146",
|
|
53
|
+
"@lowdefy/errors": "0.0.0-experimental-20260220143146",
|
|
54
|
+
"@lowdefy/helpers": "0.0.0-experimental-20260220143146",
|
|
55
|
+
"@lowdefy/layout": "0.0.0-experimental-20260220143146",
|
|
56
|
+
"@lowdefy/logger": "0.0.0-experimental-20260220143146",
|
|
57
|
+
"@lowdefy/node-utils": "0.0.0-experimental-20260220143146",
|
|
58
|
+
"@lowdefy/operators-change-case": "0.0.0-experimental-20260220143146",
|
|
59
|
+
"@lowdefy/operators-diff": "0.0.0-experimental-20260220143146",
|
|
60
|
+
"@lowdefy/operators-js": "0.0.0-experimental-20260220143146",
|
|
61
|
+
"@lowdefy/operators-moment": "0.0.0-experimental-20260220143146",
|
|
62
|
+
"@lowdefy/operators-mql": "0.0.0-experimental-20260220143146",
|
|
63
|
+
"@lowdefy/operators-nunjucks": "0.0.0-experimental-20260220143146",
|
|
64
|
+
"@lowdefy/operators-uuid": "0.0.0-experimental-20260220143146",
|
|
65
|
+
"@lowdefy/operators-yaml": "0.0.0-experimental-20260220143146",
|
|
66
|
+
"@lowdefy/plugin-aws": "0.0.0-experimental-20260220143146",
|
|
67
|
+
"@lowdefy/plugin-next-auth": "0.0.0-experimental-20260220143146",
|
|
68
68
|
"chokidar": "3.5.3",
|
|
69
69
|
"dotenv": "16.3.1",
|
|
70
70
|
"next": "13.5.4",
|
package/package.original.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20260220143146",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -43,35 +43,35 @@
|
|
|
43
43
|
"prepublishOnly": "pnpm build"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@lowdefy/actions-core": "0.0.0-experimental-
|
|
47
|
-
"@lowdefy/api": "0.0.0-experimental-
|
|
48
|
-
"@lowdefy/block-utils": "0.0.0-experimental-
|
|
49
|
-
"@lowdefy/blocks-aggrid": "0.0.0-experimental-
|
|
50
|
-
"@lowdefy/blocks-antd": "0.0.0-experimental-
|
|
51
|
-
"@lowdefy/blocks-basic": "0.0.0-experimental-
|
|
52
|
-
"@lowdefy/blocks-color-selectors": "0.0.0-experimental-
|
|
53
|
-
"@lowdefy/blocks-echarts": "0.0.0-experimental-
|
|
54
|
-
"@lowdefy/blocks-loaders": "0.0.0-experimental-
|
|
55
|
-
"@lowdefy/blocks-markdown": "0.0.0-experimental-
|
|
56
|
-
"@lowdefy/blocks-qr": "0.0.0-experimental-
|
|
57
|
-
"@lowdefy/build": "0.0.0-experimental-
|
|
58
|
-
"@lowdefy/client": "0.0.0-experimental-
|
|
59
|
-
"@lowdefy/engine": "0.0.0-experimental-
|
|
60
|
-
"@lowdefy/errors": "0.0.0-experimental-
|
|
61
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
62
|
-
"@lowdefy/layout": "0.0.0-experimental-
|
|
63
|
-
"@lowdefy/logger": "0.0.0-experimental-
|
|
64
|
-
"@lowdefy/node-utils": "0.0.0-experimental-
|
|
65
|
-
"@lowdefy/operators-change-case": "0.0.0-experimental-
|
|
66
|
-
"@lowdefy/operators-diff": "0.0.0-experimental-
|
|
67
|
-
"@lowdefy/operators-js": "0.0.0-experimental-
|
|
68
|
-
"@lowdefy/operators-moment": "0.0.0-experimental-
|
|
69
|
-
"@lowdefy/operators-mql": "0.0.0-experimental-
|
|
70
|
-
"@lowdefy/operators-nunjucks": "0.0.0-experimental-
|
|
71
|
-
"@lowdefy/operators-uuid": "0.0.0-experimental-
|
|
72
|
-
"@lowdefy/operators-yaml": "0.0.0-experimental-
|
|
73
|
-
"@lowdefy/plugin-aws": "0.0.0-experimental-
|
|
74
|
-
"@lowdefy/plugin-next-auth": "0.0.0-experimental-
|
|
46
|
+
"@lowdefy/actions-core": "0.0.0-experimental-20260220143146",
|
|
47
|
+
"@lowdefy/api": "0.0.0-experimental-20260220143146",
|
|
48
|
+
"@lowdefy/block-utils": "0.0.0-experimental-20260220143146",
|
|
49
|
+
"@lowdefy/blocks-aggrid": "0.0.0-experimental-20260220143146",
|
|
50
|
+
"@lowdefy/blocks-antd": "0.0.0-experimental-20260220143146",
|
|
51
|
+
"@lowdefy/blocks-basic": "0.0.0-experimental-20260220143146",
|
|
52
|
+
"@lowdefy/blocks-color-selectors": "0.0.0-experimental-20260220143146",
|
|
53
|
+
"@lowdefy/blocks-echarts": "0.0.0-experimental-20260220143146",
|
|
54
|
+
"@lowdefy/blocks-loaders": "0.0.0-experimental-20260220143146",
|
|
55
|
+
"@lowdefy/blocks-markdown": "0.0.0-experimental-20260220143146",
|
|
56
|
+
"@lowdefy/blocks-qr": "0.0.0-experimental-20260220143146",
|
|
57
|
+
"@lowdefy/build": "0.0.0-experimental-20260220143146",
|
|
58
|
+
"@lowdefy/client": "0.0.0-experimental-20260220143146",
|
|
59
|
+
"@lowdefy/engine": "0.0.0-experimental-20260220143146",
|
|
60
|
+
"@lowdefy/errors": "0.0.0-experimental-20260220143146",
|
|
61
|
+
"@lowdefy/helpers": "0.0.0-experimental-20260220143146",
|
|
62
|
+
"@lowdefy/layout": "0.0.0-experimental-20260220143146",
|
|
63
|
+
"@lowdefy/logger": "0.0.0-experimental-20260220143146",
|
|
64
|
+
"@lowdefy/node-utils": "0.0.0-experimental-20260220143146",
|
|
65
|
+
"@lowdefy/operators-change-case": "0.0.0-experimental-20260220143146",
|
|
66
|
+
"@lowdefy/operators-diff": "0.0.0-experimental-20260220143146",
|
|
67
|
+
"@lowdefy/operators-js": "0.0.0-experimental-20260220143146",
|
|
68
|
+
"@lowdefy/operators-moment": "0.0.0-experimental-20260220143146",
|
|
69
|
+
"@lowdefy/operators-mql": "0.0.0-experimental-20260220143146",
|
|
70
|
+
"@lowdefy/operators-nunjucks": "0.0.0-experimental-20260220143146",
|
|
71
|
+
"@lowdefy/operators-uuid": "0.0.0-experimental-20260220143146",
|
|
72
|
+
"@lowdefy/operators-yaml": "0.0.0-experimental-20260220143146",
|
|
73
|
+
"@lowdefy/plugin-aws": "0.0.0-experimental-20260220143146",
|
|
74
|
+
"@lowdefy/plugin-next-auth": "0.0.0-experimental-20260220143146",
|
|
75
75
|
"chokidar": "3.5.3",
|
|
76
76
|
"dotenv": "16.3.1",
|
|
77
77
|
"next": "13.5.4",
|