@nitronjs/framework 0.2.6 → 0.2.7
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/HMR/Server.js +5 -2
- package/lib/View/View.js +1 -1
- package/package.json +1 -1
package/lib/HMR/Server.js
CHANGED
|
@@ -34,13 +34,16 @@ class HMRServer {
|
|
|
34
34
|
registerRoutes(fastify) {
|
|
35
35
|
this.#clientScript = this.#findSocketIoClient();
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
const handler = (req, reply) => {
|
|
38
38
|
if (!this.#clientScript) {
|
|
39
39
|
return reply.code(503).send("// HMR disabled: socket.io client not found");
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
reply.type("application/javascript").send(fs.readFileSync(this.#clientScript, "utf-8"));
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// Support both paths for cache compatibility
|
|
46
|
+
fastify.get("/__nitron_client/socket.io.js", handler);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
/**
|
package/lib/View/View.js
CHANGED
|
@@ -689,7 +689,7 @@ class View {
|
|
|
689
689
|
: "";
|
|
690
690
|
|
|
691
691
|
const hmrScript = this.#isDev
|
|
692
|
-
? `<script src="/
|
|
692
|
+
? `<script src="/__nitron_client/socket.io.js"${nonceAttr}></script><script src="/storage/js/hmr.js"${nonceAttr}></script>`
|
|
693
693
|
: "";
|
|
694
694
|
|
|
695
695
|
const hydrateScript = hasHydration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitronjs/framework",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "NitronJS is a modern and extensible Node.js MVC framework built on Fastify. It focuses on clean architecture, modular structure, and developer productivity, offering built-in routing, middleware, configuration management, CLI tooling, and native React integration for scalable full-stack applications.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"njs": "./cli/njs.js"
|