@gracile/engine 0.8.0-next.2 → 0.8.1-next.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/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +2 -0
- package/dist/vite/hmr.d.ts +3 -0
- package/dist/vite/hmr.d.ts.map +1 -0
- package/dist/vite/hmr.js +29 -0
- package/package.json +4 -4
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQtD;;;;;;;;;;;;;;;;GAgBG;AAIH,eAAO,MAAM,OAAO,YAAa,aAAa,KAAG,GAAG,EA6TnD,CAAC;AAEF,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -11,6 +11,7 @@ import { nodeAdapter } from './server/adapters/node.js';
|
|
|
11
11
|
import { buildRoutes } from './vite/build-routes.js';
|
|
12
12
|
import { htmlRoutesLoader } from './vite/html-routes.js';
|
|
13
13
|
import { virtualRoutes, virtualRoutesClient } from './vite/virtual-routes.js';
|
|
14
|
+
import { hmrSsrReload } from './vite/hmr.js';
|
|
14
15
|
let isClientBuilt = false;
|
|
15
16
|
/**
|
|
16
17
|
* The main Vite plugin for loading the Gracile framework.
|
|
@@ -81,6 +82,7 @@ export const gracile = (config) => {
|
|
|
81
82
|
// return null;
|
|
82
83
|
// },
|
|
83
84
|
// },
|
|
85
|
+
hmrSsrReload(),
|
|
84
86
|
{
|
|
85
87
|
name: 'vite-plugin-gracile-serve-middleware',
|
|
86
88
|
apply: 'serve',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../../src/vite/hmr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAyB,MAAM,MAAM,CAAC;AAG1D,wBAAgB,YAAY,IAAI,MAAM,CAoCrC"}
|
package/dist/vite/hmr.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// NOTE: From https://vite.dev/guide/migration#advanced (Vite 5>6 migration).
|
|
2
|
+
export function hmrSsrReload() {
|
|
3
|
+
return {
|
|
4
|
+
name: 'vite-plugin-gracile-hmr-ssr-reload',
|
|
5
|
+
enforce: 'post',
|
|
6
|
+
hotUpdate: {
|
|
7
|
+
order: 'post',
|
|
8
|
+
handler({ modules, server, timestamp }) {
|
|
9
|
+
if (this.environment.name !== 'ssr')
|
|
10
|
+
return;
|
|
11
|
+
let hasSsrOnlyModules = false;
|
|
12
|
+
const invalidatedModules = new Set();
|
|
13
|
+
for (const module_ of modules) {
|
|
14
|
+
if (module_.id == null)
|
|
15
|
+
continue;
|
|
16
|
+
const clientModule = server.environments.client.moduleGraph.getModuleById(module_.id);
|
|
17
|
+
if (clientModule != null)
|
|
18
|
+
continue;
|
|
19
|
+
this.environment.moduleGraph.invalidateModule(module_, invalidatedModules, timestamp, true);
|
|
20
|
+
hasSsrOnlyModules = true;
|
|
21
|
+
}
|
|
22
|
+
if (hasSsrOnlyModules) {
|
|
23
|
+
server.ws.send({ type: 'full-reload' });
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gracile/engine",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1-next.0",
|
|
4
4
|
"description": "A thin, full-stack, web framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"custom-elements",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"!/dist/typedoc-entrypoint.*"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@gracile-labs/better-errors": "^0.1.2
|
|
47
|
-
"@gracile/internal-utils": "^0.5.0
|
|
46
|
+
"@gracile-labs/better-errors": "^0.1.2",
|
|
47
|
+
"@gracile/internal-utils": "^0.5.0",
|
|
48
48
|
"@whatwg-node/server": "^0.9.50",
|
|
49
49
|
"fdir": "^6.4.2",
|
|
50
50
|
"picocolors": "^1.1.1",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"access": "public",
|
|
61
61
|
"provenance": true
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "57ac5aff44bc294ed2da38ca22c151194b6cdc8c"
|
|
64
64
|
}
|