vatts 2.3.0-canary → 2.3.0-canary.1
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/LICENSE +12 -12
- package/README.md +65 -65
- package/dist/builder.js +27 -27
- package/dist/frameworks/FrontCore.js +7 -7
- package/dist/frameworks/react/react-elements.d.ts +9 -9
- package/dist/frameworks/renderers/renderer-react.js +20 -20
- package/dist/frameworks/renderers/renderer.vue.js +16 -16
- package/dist/frameworks/themes/BuildingPage.js +270 -270
- package/dist/frameworks/themes/DefaultNotFound.js +309 -309
- package/dist/frameworks/themes/ErrorModal.js +217 -217
- package/dist/frameworks/themes/ServerError.js +345 -345
- package/dist/frameworks/themes/VattsDevBadge.js +140 -140
- package/dist/frameworks/vue/App.vue +148 -148
- package/dist/frameworks/vue/components/Link.vue +38 -38
- package/dist/frameworks/vue/components/image/Image.vue +128 -128
- package/dist/global/global.d.ts +179 -179
- package/dist/hotReload.js +77 -77
- package/dist/loaders.js +15 -15
- package/dist/renderers/common.js +3 -3
- package/dist/utils/core-go.js +2 -2
- package/dist/utils/utils.js +5 -5
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
Copyright 2026 mfraz
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
See the License for the specific language governing permissions and
|
|
1
|
+
Copyright 2026 mfraz
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
13
|
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/murillo-frazao-cunha/vatts-docs/master/public/logo.png">
|
|
4
|
-
<img alt="Vatts.js logo" src="https://raw.githubusercontent.com/murillo-frazao-cunha/vatts-docs/master/public/logo.png" width="128">
|
|
5
|
-
</picture>
|
|
6
|
-
<h1>Vatts.js</h1>
|
|
7
|
-
|
|
8
|
-
[](https://www.npmjs.com/package/vatts)
|
|
9
|
-
[](./LICENSE)
|
|
10
|
-
[](https://github.com/murillo-frazao-cunha/vatts.js)
|
|
11
|
-
|
|
12
|
-
[](#)
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## Getting Started
|
|
21
|
-
|
|
22
|
-
**Vatts.js** is a modern, full-featured web framework for **Node.js** with first-class support for **React and Vue**.
|
|
23
|
-
|
|
24
|
-
It is the first framework to offer native HTTP/3 support out of the box, powered by a Go-based HTTP server with built-in SSL termination. Applications run directly on the latest web transport protocol, without proxies or external layers.
|
|
25
|
-
|
|
26
|
-
Vatts.js is a **multi-framework platform**, allowing you to build applications using **either React or Vue per project** — not both at the same time.
|
|
27
|
-
This keeps the ecosystem clean, predictable, and optimized for performance and tooling.
|
|
28
|
-
|
|
29
|
-
Vatts removes unnecessary configuration and complex abstractions, allowing you to focus on what truly matters: **building fast, secure, and scalable applications**.
|
|
30
|
-
|
|
31
|
-
### Why choose Vatts.js?
|
|
32
|
-
- **Native HTTP** — modern, secure, and high-performance networking with **HTTP/3 support**
|
|
33
|
-
- Extremely fast — architecture optimized for low overhead
|
|
34
|
-
- Intuitive API — easy to learn and pleasant to use
|
|
35
|
-
- Productivity from the first minute — zero unnecessary boilerplate
|
|
36
|
-
- Multi-framework — choose **React or Vue per project**
|
|
37
|
-
- Full integration between backend and frontend
|
|
38
|
-
- Built for modern projects — TypeScript-friendly, modular, and extensible
|
|
39
|
-
|
|
40
|
-
___
|
|
41
|
-
|
|
42
|
-
## Documentation
|
|
43
|
-
|
|
44
|
-
Visit [https://vatts.mfraz.ovh](https://vatts.mfraz.ovh) to view the full documentation.
|
|
45
|
-
|
|
46
|
-
___
|
|
47
|
-
|
|
48
|
-
## Community
|
|
49
|
-
|
|
50
|
-
The Vatts.js community can be found on [GitHub Discussions](https://github.com/mfraz/vatts.js), where you can ask questions, share ideas, and showcase your projects with others.
|
|
51
|
-
|
|
52
|
-
___
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
## Security
|
|
56
|
-
|
|
57
|
-
Vatts.js uses a security-first hybrid architecture in which Node.js coordinates the application layer and a high-performance Go networking engine manages HTTP connections and transport protocols.
|
|
58
|
-
By delegating network handling to Go, the platform achieves strong isolation, predictable request processing, and native support for modern transports like HTTP/3 under SSL — all while maintaining consistent security enforcement across environments, including local and non-TLS setups.
|
|
59
|
-
|
|
60
|
-
If you believe you have found a security vulnerability in Vatts.js, we encourage you to **responsibly disclose it and NOT open a public issue**.
|
|
61
|
-
|
|
62
|
-
To participate in our vulnerability disclosure program, please email [contact@mfraz.ovh](mailto:contact@mfraz.ovh). We will add you to the program and provide further instructions for submitting your report.
|
|
63
|
-
|
|
64
|
-
___
|
|
65
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/murillo-frazao-cunha/vatts-docs/master/public/logo.png">
|
|
4
|
+
<img alt="Vatts.js logo" src="https://raw.githubusercontent.com/murillo-frazao-cunha/vatts-docs/master/public/logo.png" width="128">
|
|
5
|
+
</picture>
|
|
6
|
+
<h1>Vatts.js</h1>
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/vatts)
|
|
9
|
+
[](./LICENSE)
|
|
10
|
+
[](https://github.com/murillo-frazao-cunha/vatts.js)
|
|
11
|
+
|
|
12
|
+
[](#)
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Getting Started
|
|
21
|
+
|
|
22
|
+
**Vatts.js** is a modern, full-featured web framework for **Node.js** with first-class support for **React and Vue**.
|
|
23
|
+
|
|
24
|
+
It is the first framework to offer native HTTP/3 support out of the box, powered by a Go-based HTTP server with built-in SSL termination. Applications run directly on the latest web transport protocol, without proxies or external layers.
|
|
25
|
+
|
|
26
|
+
Vatts.js is a **multi-framework platform**, allowing you to build applications using **either React or Vue per project** — not both at the same time.
|
|
27
|
+
This keeps the ecosystem clean, predictable, and optimized for performance and tooling.
|
|
28
|
+
|
|
29
|
+
Vatts removes unnecessary configuration and complex abstractions, allowing you to focus on what truly matters: **building fast, secure, and scalable applications**.
|
|
30
|
+
|
|
31
|
+
### Why choose Vatts.js?
|
|
32
|
+
- **Native HTTP** — modern, secure, and high-performance networking with **HTTP/3 support**
|
|
33
|
+
- Extremely fast — architecture optimized for low overhead
|
|
34
|
+
- Intuitive API — easy to learn and pleasant to use
|
|
35
|
+
- Productivity from the first minute — zero unnecessary boilerplate
|
|
36
|
+
- Multi-framework — choose **React or Vue per project**
|
|
37
|
+
- Full integration between backend and frontend
|
|
38
|
+
- Built for modern projects — TypeScript-friendly, modular, and extensible
|
|
39
|
+
|
|
40
|
+
___
|
|
41
|
+
|
|
42
|
+
## Documentation
|
|
43
|
+
|
|
44
|
+
Visit [https://vatts.mfraz.ovh](https://vatts.mfraz.ovh) to view the full documentation.
|
|
45
|
+
|
|
46
|
+
___
|
|
47
|
+
|
|
48
|
+
## Community
|
|
49
|
+
|
|
50
|
+
The Vatts.js community can be found on [GitHub Discussions](https://github.com/mfraz/vatts.js), where you can ask questions, share ideas, and showcase your projects with others.
|
|
51
|
+
|
|
52
|
+
___
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## Security
|
|
56
|
+
|
|
57
|
+
Vatts.js uses a security-first hybrid architecture in which Node.js coordinates the application layer and a high-performance Go networking engine manages HTTP connections and transport protocols.
|
|
58
|
+
By delegating network handling to Go, the platform achieves strong isolation, predictable request processing, and native support for modern transports like HTTP/3 under SSL — all while maintaining consistent security enforcement across environments, including local and non-TLS setups.
|
|
59
|
+
|
|
60
|
+
If you believe you have found a security vulnerability in Vatts.js, we encourage you to **responsibly disclose it and NOT open a public issue**.
|
|
61
|
+
|
|
62
|
+
To participate in our vulnerability disclosure program, please email [contact@mfraz.ovh](mailto:contact@mfraz.ovh). We will add you to the program and provide further instructions for submitting your report.
|
|
63
|
+
|
|
64
|
+
___
|
|
65
|
+
|
package/dist/builder.js
CHANGED
|
@@ -159,23 +159,23 @@ const virtualEntryPlugin = (options) => ({
|
|
|
159
159
|
metadata: r.metadata || {}
|
|
160
160
|
}));
|
|
161
161
|
const entryClientPath = path.join(__dirname, 'frameworks', framework, 'entry.client.js').replace(/\\/g, '/');
|
|
162
|
-
const code = `
|
|
163
|
-
${imports}
|
|
164
|
-
${layoutImport}
|
|
165
|
-
${notFoundImport}
|
|
166
|
-
import DefaultNotFound from '${defaultNotFoundPath}';
|
|
167
|
-
|
|
168
|
-
window.__VATTS_COMPONENTS__ = {
|
|
169
|
-
${componentRegistration}
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
window.__VATTS_ROUTES__ = ${JSON.stringify(clientRoutes)};
|
|
173
|
-
|
|
174
|
-
${layoutRegistration}
|
|
175
|
-
${notFoundRegistration}
|
|
176
|
-
window.__VATTS_DEFAULT_NOT_FOUND__ = DefaultNotFound;
|
|
177
|
-
|
|
178
|
-
import '${entryClientPath}';
|
|
162
|
+
const code = `
|
|
163
|
+
${imports}
|
|
164
|
+
${layoutImport}
|
|
165
|
+
${notFoundImport}
|
|
166
|
+
import DefaultNotFound from '${defaultNotFoundPath}';
|
|
167
|
+
|
|
168
|
+
window.__VATTS_COMPONENTS__ = {
|
|
169
|
+
${componentRegistration}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
window.__VATTS_ROUTES__ = ${JSON.stringify(clientRoutes)};
|
|
173
|
+
|
|
174
|
+
${layoutRegistration}
|
|
175
|
+
${notFoundRegistration}
|
|
176
|
+
window.__VATTS_DEFAULT_NOT_FOUND__ = DefaultNotFound;
|
|
177
|
+
|
|
178
|
+
import '${entryClientPath}';
|
|
179
179
|
`;
|
|
180
180
|
return { contents: code, loader: 'js', resolveDir: projectDir };
|
|
181
181
|
});
|
|
@@ -195,13 +195,13 @@ const nodeBuiltinStubPlugin = () => ({
|
|
|
195
195
|
return { path: args.path, namespace: 'node-stub' };
|
|
196
196
|
});
|
|
197
197
|
build.onLoad({ filter: /.*/, namespace: 'node-stub' }, () => ({
|
|
198
|
-
contents: `
|
|
199
|
-
function noop() {}
|
|
200
|
-
export const resolve = noop; export const join = noop; export const parse = () => ({});
|
|
201
|
-
export const createHash = () => ({ update: () => ({ digest: () => '' }) });
|
|
202
|
-
export class EventEmitter { on(){} emit(){} off(){} once(){} }
|
|
203
|
-
export class Readable extends EventEmitter {} export class Writable extends EventEmitter {}
|
|
204
|
-
export default Object.assign(noop, { resolve, join, parse, createHash, EventEmitter, Readable, Writable });
|
|
198
|
+
contents: `
|
|
199
|
+
function noop() {}
|
|
200
|
+
export const resolve = noop; export const join = noop; export const parse = () => ({});
|
|
201
|
+
export const createHash = () => ({ update: () => ({ digest: () => '' }) });
|
|
202
|
+
export class EventEmitter { on(){} emit(){} off(){} once(){} }
|
|
203
|
+
export class Readable extends EventEmitter {} export class Writable extends EventEmitter {}
|
|
204
|
+
export default Object.assign(noop, { resolve, join, parse, createHash, EventEmitter, Readable, Writable });
|
|
205
205
|
`,
|
|
206
206
|
loader: 'js'
|
|
207
207
|
}));
|
|
@@ -215,9 +215,9 @@ const smartSvgPlugin = () => ({
|
|
|
215
215
|
const base64 = buffer.toString('base64');
|
|
216
216
|
const content = buffer.toString('utf8');
|
|
217
217
|
return {
|
|
218
|
-
contents: `
|
|
219
|
-
export default "data:image/svg+xml;base64,${base64}";
|
|
220
|
-
export const svgContent = ${JSON.stringify(content)};
|
|
218
|
+
contents: `
|
|
219
|
+
export default "data:image/svg+xml;base64,${base64}";
|
|
220
|
+
export const svgContent = ${JSON.stringify(content)};
|
|
221
221
|
`,
|
|
222
222
|
loader: 'js'
|
|
223
223
|
};
|
|
@@ -18,13 +18,13 @@ exports.dispatchHmrReady = dispatchHmrReady;
|
|
|
18
18
|
function renderCriticalError(error, framework) {
|
|
19
19
|
console.error(`[Vatts Core] ❌ Critical Error rendering application (${framework}):`, error);
|
|
20
20
|
if (typeof document !== 'undefined') {
|
|
21
|
-
document.body.innerHTML = `
|
|
22
|
-
<div style="font-family: monospace; padding: 20px; color: #ff4444; background: #000000; min-height: 100vh;">
|
|
23
|
-
<h1>Vatts Client Error (${framework})</h1>
|
|
24
|
-
<p>A critical error occurred while initializing the application.</p>
|
|
25
|
-
<pre style="background: #0a0a0a; padding: 15px; border-radius: 5px; overflow: auto;">${error?.message || error}</pre>
|
|
26
|
-
<pre style="color: #666; font-size: 12px; margin-top: 10px;">${error?.stack || ''}</pre>
|
|
27
|
-
</div>
|
|
21
|
+
document.body.innerHTML = `
|
|
22
|
+
<div style="font-family: monospace; padding: 20px; color: #ff4444; background: #000000; min-height: 100vh;">
|
|
23
|
+
<h1>Vatts Client Error (${framework})</h1>
|
|
24
|
+
<p>A critical error occurred while initializing the application.</p>
|
|
25
|
+
<pre style="background: #0a0a0a; padding: 15px; border-radius: 5px; overflow: auto;">${error?.message || error}</pre>
|
|
26
|
+
<pre style="color: #666; font-size: 12px; margin-top: 10px;">${error?.stack || ''}</pre>
|
|
27
|
+
</div>
|
|
28
28
|
`;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
declare module 'react' {
|
|
4
|
-
namespace JSX {
|
|
5
|
-
interface IntrinsicElements {
|
|
6
|
-
'vatts-dev-badge': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> | any;
|
|
7
|
-
'vatts-error-modal': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> | any;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare module 'react' {
|
|
4
|
+
namespace JSX {
|
|
5
|
+
interface IntrinsicElements {
|
|
6
|
+
'vatts-dev-badge': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> | any;
|
|
7
|
+
'vatts-error-modal': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> | any;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
10
|
}
|
|
@@ -30,20 +30,20 @@ const BuildingPage_1 = require("../themes/BuildingPage");
|
|
|
30
30
|
const ServerError_1 = require("../themes/ServerError");
|
|
31
31
|
function buildShellHtml(options) {
|
|
32
32
|
const { lang, title, metaTagsHtml, stylesHtml, hotReloadScript, scriptsHtml } = options;
|
|
33
|
-
return `<!DOCTYPE html>
|
|
34
|
-
<html lang="${lang}">
|
|
35
|
-
<head>
|
|
36
|
-
<meta charset="utf-8" />
|
|
37
|
-
<title>${title}</title>
|
|
38
|
-
${metaTagsHtml || ''}
|
|
39
|
-
${stylesHtml || ''}
|
|
40
|
-
</head>
|
|
41
|
-
<body>
|
|
42
|
-
|
|
43
|
-
<div id="root"></div>
|
|
44
|
-
${scriptsHtml || ''}
|
|
45
|
-
${hotReloadScript ? `<div style="display:none">${hotReloadScript}</div>` : ''}
|
|
46
|
-
</body>
|
|
33
|
+
return `<!DOCTYPE html>
|
|
34
|
+
<html lang="${lang}">
|
|
35
|
+
<head>
|
|
36
|
+
<meta charset="utf-8" />
|
|
37
|
+
<title>${title}</title>
|
|
38
|
+
${metaTagsHtml || ''}
|
|
39
|
+
${stylesHtml || ''}
|
|
40
|
+
</head>
|
|
41
|
+
<body>
|
|
42
|
+
|
|
43
|
+
<div id="root"></div>
|
|
44
|
+
${scriptsHtml || ''}
|
|
45
|
+
${hotReloadScript ? `<div style="display:none">${hotReloadScript}</div>` : ''}
|
|
46
|
+
</body>
|
|
47
47
|
</html>`;
|
|
48
48
|
}
|
|
49
49
|
async function sendReactSsrFallback(options) {
|
|
@@ -89,12 +89,12 @@ async function sendReactSsrFallback(options) {
|
|
|
89
89
|
return Promise.resolve();
|
|
90
90
|
}
|
|
91
91
|
function ServerRoot({ lang, title, metaTagsHtml, stylesHtml, initialDataScript, hotReloadScript, children }) {
|
|
92
|
-
const headContent = `
|
|
93
|
-
<meta charset="utf-8" />
|
|
94
|
-
<title>${title}</title>
|
|
95
|
-
${initialDataScript ? `<script>${initialDataScript}</script>` : ''}
|
|
96
|
-
${metaTagsHtml || ''}
|
|
97
|
-
${stylesHtml || ''}
|
|
92
|
+
const headContent = `
|
|
93
|
+
<meta charset="utf-8" />
|
|
94
|
+
<title>${title}</title>
|
|
95
|
+
${initialDataScript ? `<script>${initialDataScript}</script>` : ''}
|
|
96
|
+
${metaTagsHtml || ''}
|
|
97
|
+
${stylesHtml || ''}
|
|
98
98
|
`;
|
|
99
99
|
return (react_1.default.createElement("html", { lang: lang },
|
|
100
100
|
react_1.default.createElement("head", { dangerouslySetInnerHTML: { __html: headContent } }),
|
|
@@ -48,22 +48,22 @@ const BuildingPage_1 = require("../themes/BuildingPage");
|
|
|
48
48
|
const ServerError_1 = require("../themes/ServerError");
|
|
49
49
|
function buildVueShellDocument(options) {
|
|
50
50
|
const { lang, title, metaTagsHtml, scriptPreloadsHtml, componentPreloadsHtml, stylesHtml, obfuscatedData, scriptsHtml, hotReloadScript, bodyInnerHtml, } = options;
|
|
51
|
-
return `<!DOCTYPE html>
|
|
52
|
-
<html lang="${lang}">
|
|
53
|
-
<head>
|
|
54
|
-
<meta charset="utf-8" />
|
|
55
|
-
<title>${title}</title>
|
|
56
|
-
${metaTagsHtml}
|
|
57
|
-
${scriptPreloadsHtml}
|
|
58
|
-
${componentPreloadsHtml}
|
|
59
|
-
${stylesHtml}
|
|
60
|
-
</head>
|
|
61
|
-
<body>
|
|
62
|
-
<script id="__vatts_data__" type="text/plain" data-h="${obfuscatedData}"></script>
|
|
63
|
-
<div id="root">${bodyInnerHtml || ''}</div>
|
|
64
|
-
${scriptsHtml}
|
|
65
|
-
${hotReloadScript ? `<div style="display:none">${hotReloadScript}</div>` : ''}
|
|
66
|
-
</body>
|
|
51
|
+
return `<!DOCTYPE html>
|
|
52
|
+
<html lang="${lang}">
|
|
53
|
+
<head>
|
|
54
|
+
<meta charset="utf-8" />
|
|
55
|
+
<title>${title}</title>
|
|
56
|
+
${metaTagsHtml}
|
|
57
|
+
${scriptPreloadsHtml}
|
|
58
|
+
${componentPreloadsHtml}
|
|
59
|
+
${stylesHtml}
|
|
60
|
+
</head>
|
|
61
|
+
<body>
|
|
62
|
+
<script id="__vatts_data__" type="text/plain" data-h="${obfuscatedData}"></script>
|
|
63
|
+
<div id="root">${bodyInnerHtml || ''}</div>
|
|
64
|
+
${scriptsHtml}
|
|
65
|
+
${hotReloadScript ? `<div style="display:none">${hotReloadScript}</div>` : ''}
|
|
66
|
+
</body>
|
|
67
67
|
</html>`;
|
|
68
68
|
}
|
|
69
69
|
function ensureVueComponent(existingComponent, componentPath) {
|