@nitronjs/framework 0.2.10 → 0.2.11
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.
|
@@ -1,14 +1,38 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as ReactDOM from 'react-dom';
|
|
3
3
|
import * as ReactDOMClient from 'react-dom/client';
|
|
4
|
-
import * as
|
|
4
|
+
import * as OriginalJsx from 'react/jsx-runtime';
|
|
5
5
|
import RefreshRuntime from 'react-refresh/runtime';
|
|
6
6
|
|
|
7
|
+
function extractKey(props: any, key: any): [any, any] {
|
|
8
|
+
if (props == null || !('key' in props)) {
|
|
9
|
+
return [props, key];
|
|
10
|
+
}
|
|
11
|
+
const { key: propKey, ...rest } = props;
|
|
12
|
+
return [rest, key ?? propKey];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function jsx(type: any, props: any, key?: any) {
|
|
16
|
+
const [cleanProps, finalKey] = extractKey(props, key);
|
|
17
|
+
return OriginalJsx.jsx(type, cleanProps, finalKey);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function jsxs(type: any, props: any, key?: any) {
|
|
21
|
+
const [cleanProps, finalKey] = extractKey(props, key);
|
|
22
|
+
return OriginalJsx.jsxs(type, cleanProps, finalKey);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const NitronJSXRuntime = {
|
|
26
|
+
jsx,
|
|
27
|
+
jsxs,
|
|
28
|
+
Fragment: OriginalJsx.Fragment
|
|
29
|
+
};
|
|
30
|
+
|
|
7
31
|
Object.assign(window, {
|
|
8
32
|
__NITRON_REACT__: React,
|
|
9
33
|
__NITRON_REACT_DOM__: ReactDOM,
|
|
10
34
|
__NITRON_REACT_DOM_CLIENT__: ReactDOMClient,
|
|
11
|
-
__NITRON_JSX_RUNTIME__:
|
|
35
|
+
__NITRON_JSX_RUNTIME__: NitronJSXRuntime
|
|
12
36
|
});
|
|
13
37
|
|
|
14
38
|
RefreshRuntime.injectIntoGlobalHook(window);
|
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as ReactDOM from 'react-dom';
|
|
3
3
|
import * as ReactDOMClient from 'react-dom/client';
|
|
4
|
-
import * as
|
|
4
|
+
import * as OriginalJsx from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function extractKey(props: any, key: any): [any, any] {
|
|
7
|
+
if (props == null || !('key' in props)) {
|
|
8
|
+
return [props, key];
|
|
9
|
+
}
|
|
10
|
+
const { key: propKey, ...rest } = props;
|
|
11
|
+
return [rest, key ?? propKey];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function jsx(type: any, props: any, key?: any) {
|
|
15
|
+
const [cleanProps, finalKey] = extractKey(props, key);
|
|
16
|
+
return OriginalJsx.jsx(type, cleanProps, finalKey);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function jsxs(type: any, props: any, key?: any) {
|
|
20
|
+
const [cleanProps, finalKey] = extractKey(props, key);
|
|
21
|
+
return OriginalJsx.jsxs(type, cleanProps, finalKey);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const NitronJSXRuntime = {
|
|
25
|
+
jsx,
|
|
26
|
+
jsxs,
|
|
27
|
+
Fragment: OriginalJsx.Fragment
|
|
28
|
+
};
|
|
5
29
|
|
|
6
30
|
Object.assign(window, {
|
|
7
31
|
__NITRON_REACT__: React,
|
|
8
32
|
__NITRON_REACT_DOM__: ReactDOM,
|
|
9
33
|
__NITRON_REACT_DOM_CLIENT__: ReactDOMClient,
|
|
10
|
-
__NITRON_JSX_RUNTIME__:
|
|
34
|
+
__NITRON_JSX_RUNTIME__: NitronJSXRuntime
|
|
11
35
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitronjs/framework",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
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"
|