bromium 1.0.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/LICENSE +21 -0
- package/README.md +76 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-runtime.d.ts +2 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +3 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/vite-plugin.d.ts +4 -0
- package/dist/vite-plugin.d.ts.map +1 -0
- package/dist/vite-plugin.js +5 -0
- package/dist/vite-plugin.js.map +1 -0
- package/package.json +71 -0
- package/src/index.ts +109 -0
- package/src/jsx-runtime.ts +2 -0
- package/src/vite-plugin.ts +4 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 bromscandium
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# BromiumJS
|
|
2
|
+
|
|
3
|
+
A modern JavaScript/TypeScript UI framework combining the best of Vue, React, and Next.js.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Proxy-based Reactivity** - Vue 3-inspired reactive system with `ref`, `reactive`, `computed`, and `watch`
|
|
8
|
+
- **JSX Support** - React-like JSX with virtual DOM and efficient diffing
|
|
9
|
+
- **Dual Hook Systems** - Both React-style hooks (`useState`, `useRef`) and Vue-style lifecycle hooks (`onMounted`, `onUnmounted`)
|
|
10
|
+
- **File-based Routing** - Next.js-style automatic route generation
|
|
11
|
+
- **Vite Integration** - First-class Vite plugin with HMR support
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install bromium
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { createApp, ref } from 'bromium';
|
|
23
|
+
|
|
24
|
+
function Counter() {
|
|
25
|
+
const count = ref(0);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div>
|
|
29
|
+
<p>Count: {count.value}</p>
|
|
30
|
+
<button onClick={() => count.value++}>Increment</button>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
createApp(Counter).mount('#app');
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Vite Configuration
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
// vite.config.ts
|
|
42
|
+
import { defineConfig } from 'vite';
|
|
43
|
+
import bromium from 'bromium/vite-plugin';
|
|
44
|
+
|
|
45
|
+
export default defineConfig({
|
|
46
|
+
plugins: [bromium()],
|
|
47
|
+
esbuild: {
|
|
48
|
+
jsx: 'automatic',
|
|
49
|
+
jsxImportSource: 'bromium'
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Documentation
|
|
55
|
+
|
|
56
|
+
See the [full documentation](https://github.com/bromscandium/bromiumjs#readme) for:
|
|
57
|
+
|
|
58
|
+
- Reactivity system (`ref`, `reactive`, `computed`, `watch`)
|
|
59
|
+
- Components and JSX
|
|
60
|
+
- Hooks (React-style and Vue-style)
|
|
61
|
+
- Router and file-based routing
|
|
62
|
+
- Vite plugin configuration
|
|
63
|
+
|
|
64
|
+
## Packages
|
|
65
|
+
|
|
66
|
+
| Package | Description |
|
|
67
|
+
|---------|-------------|
|
|
68
|
+
| `bromium` | Main package (this) |
|
|
69
|
+
| `@bromium/core` | Reactivity system |
|
|
70
|
+
| `@bromium/runtime` | JSX runtime and renderer |
|
|
71
|
+
| `@bromium/router` | Client-side router |
|
|
72
|
+
| `@bromium/vite-plugin` | Vite integration |
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ref, reactive, computed, effect, watch, watchEffect, isRef, isReactive, unref, toRef, toRefs, toRaw, shallowRef, triggerRef, markRaw, queueJob, type Ref, type ComputedRef, type ShallowRef, type EffectFn, type EffectOptions, } from '@bromium/core';
|
|
2
|
+
export { jsx, jsxs, jsxDEV, createElement, h, Fragment, render, createApp, onMounted, onUnmounted, onUpdated, getCurrentInstance, useState, useRef, useMemo, useCallback, createVNode, createTextVNode, isVNode, Text, type VNode, type VNodeChild, type VNodeChildren, type VNodeType, type ComponentFunction, type ComponentInstance, type JSXElement, type AppConfig, } from '@bromium/runtime';
|
|
3
|
+
export { createRouter, useRouter, useRoute, useParams, useQuery, useRouteMeta, useNavigate, useRouteMatch, Link, RouterView, Redirect, Navigate, type Router, type Route, type RouteLocation, type MatchedRoute, type NavigationTarget, type NavigationGuard, type NavigationHook, } from '@bromium/router';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,GAAG,EACH,QAAQ,EACR,QAAQ,EAGR,MAAM,EACN,KAAK,EACL,WAAW,EAGX,KAAK,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,MAAM,EACN,KAAK,EACL,UAAU,EACV,UAAU,EACV,OAAO,EAGP,QAAQ,EAGR,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,aAAa,GACnB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAEL,GAAG,EACH,IAAI,EACJ,MAAM,EACN,aAAa,EACb,CAAC,EACD,QAAQ,EAGR,MAAM,EACN,SAAS,EAGT,SAAS,EACT,WAAW,EACX,SAAS,EACT,kBAAkB,EAGlB,QAAQ,EACR,MAAM,EACN,OAAO,EACP,WAAW,EAGX,WAAW,EACX,eAAe,EACf,OAAO,EACP,IAAI,EAGJ,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,SAAS,GACf,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAEL,YAAY,EAGZ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,aAAa,EAGb,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,QAAQ,EAGR,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// BromiumJS - Main Package
|
|
2
|
+
// Re-exports all subpackages for convenience
|
|
3
|
+
// Core reactivity
|
|
4
|
+
export {
|
|
5
|
+
// Reactive primitives
|
|
6
|
+
ref, reactive, computed,
|
|
7
|
+
// Effects
|
|
8
|
+
effect, watch, watchEffect,
|
|
9
|
+
// Utilities
|
|
10
|
+
isRef, isReactive, unref, toRef, toRefs, toRaw, shallowRef, triggerRef, markRaw,
|
|
11
|
+
// Batching
|
|
12
|
+
queueJob, } from '@bromium/core';
|
|
13
|
+
// Runtime - JSX and rendering
|
|
14
|
+
export {
|
|
15
|
+
// JSX
|
|
16
|
+
jsx, jsxs, jsxDEV, createElement, h, Fragment,
|
|
17
|
+
// Rendering
|
|
18
|
+
render, createApp,
|
|
19
|
+
// Lifecycle
|
|
20
|
+
onMounted, onUnmounted, onUpdated, getCurrentInstance,
|
|
21
|
+
// Hooks (React-style state persistence)
|
|
22
|
+
useState, useRef, useMemo, useCallback,
|
|
23
|
+
// VNode utilities
|
|
24
|
+
createVNode, createTextVNode, isVNode, Text, } from '@bromium/runtime';
|
|
25
|
+
// Router
|
|
26
|
+
export {
|
|
27
|
+
// Router creation
|
|
28
|
+
createRouter,
|
|
29
|
+
// Hooks
|
|
30
|
+
useRouter, useRoute, useParams, useQuery, useRouteMeta, useNavigate, useRouteMatch,
|
|
31
|
+
// Components
|
|
32
|
+
Link, RouterView, Redirect, Navigate, } from '@bromium/router';
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,6CAA6C;AAE7C,kBAAkB;AAClB,OAAO;AACL,sBAAsB;AACtB,GAAG,EACH,QAAQ,EACR,QAAQ;AAER,UAAU;AACV,MAAM,EACN,KAAK,EACL,WAAW;AAEX,YAAY;AACZ,KAAK,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,MAAM,EACN,KAAK,EACL,UAAU,EACV,UAAU,EACV,OAAO;AAEP,WAAW;AACX,QAAQ,GAQT,MAAM,eAAe,CAAC;AAEvB,8BAA8B;AAC9B,OAAO;AACL,MAAM;AACN,GAAG,EACH,IAAI,EACJ,MAAM,EACN,aAAa,EACb,CAAC,EACD,QAAQ;AAER,YAAY;AACZ,MAAM,EACN,SAAS;AAET,YAAY;AACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,kBAAkB;AAElB,wCAAwC;AACxC,QAAQ,EACR,MAAM,EACN,OAAO,EACP,WAAW;AAEX,kBAAkB;AAClB,WAAW,EACX,eAAe,EACf,OAAO,EACP,IAAI,GAWL,MAAM,kBAAkB,CAAC;AAE1B,SAAS;AACT,OAAO;AACL,kBAAkB;AAClB,YAAY;AAEZ,QAAQ;AACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,aAAa;AAEb,aAAa;AACb,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,QAAQ,GAUT,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAChF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-plugin.js","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAA6B,MAAM,sBAAsB,CAAC;AAChF,eAAe,aAAa,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bromium",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "BromiumJS - A modern JavaScript framework with proxy-based reactivity, JSX, and file-based routing",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./jsx-runtime": {
|
|
15
|
+
"import": "./dist/jsx-runtime.js",
|
|
16
|
+
"types": "./dist/jsx-runtime.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./jsx-dev-runtime": {
|
|
19
|
+
"import": "./dist/jsx-runtime.js",
|
|
20
|
+
"types": "./dist/jsx-runtime.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./vite-plugin": {
|
|
23
|
+
"import": "./dist/vite-plugin.js",
|
|
24
|
+
"types": "./dist/vite-plugin.d.ts"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"src"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc",
|
|
33
|
+
"dev": "tsc --watch"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@bromium/core": "^1.0.0",
|
|
37
|
+
"@bromium/runtime": "^1.0.0",
|
|
38
|
+
"@bromium/router": "^1.0.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"vite": "^5.0.0 || ^6.0.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependenciesMeta": {
|
|
44
|
+
"vite": {
|
|
45
|
+
"optional": true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@bromium/vite-plugin": "^1.0.0",
|
|
50
|
+
"typescript": "^5.3.0"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"bromium",
|
|
54
|
+
"bromiumjs",
|
|
55
|
+
"framework",
|
|
56
|
+
"reactive",
|
|
57
|
+
"jsx",
|
|
58
|
+
"frontend"
|
|
59
|
+
],
|
|
60
|
+
"author": "bromscandium",
|
|
61
|
+
"license": "MIT",
|
|
62
|
+
"repository": {
|
|
63
|
+
"type": "git",
|
|
64
|
+
"url": "git+https://github.com/bromscandium/bromiumjs.git",
|
|
65
|
+
"directory": "bromium"
|
|
66
|
+
},
|
|
67
|
+
"homepage": "https://github.com/bromscandium/bromiumjs#readme",
|
|
68
|
+
"bugs": {
|
|
69
|
+
"url": "https://github.com/bromscandium/bromiumjs/issues"
|
|
70
|
+
}
|
|
71
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// BromiumJS - Main Package
|
|
2
|
+
// Re-exports all subpackages for convenience
|
|
3
|
+
|
|
4
|
+
// Core reactivity
|
|
5
|
+
export {
|
|
6
|
+
// Reactive primitives
|
|
7
|
+
ref,
|
|
8
|
+
reactive,
|
|
9
|
+
computed,
|
|
10
|
+
|
|
11
|
+
// Effects
|
|
12
|
+
effect,
|
|
13
|
+
watch,
|
|
14
|
+
watchEffect,
|
|
15
|
+
|
|
16
|
+
// Utilities
|
|
17
|
+
isRef,
|
|
18
|
+
isReactive,
|
|
19
|
+
unref,
|
|
20
|
+
toRef,
|
|
21
|
+
toRefs,
|
|
22
|
+
toRaw,
|
|
23
|
+
shallowRef,
|
|
24
|
+
triggerRef,
|
|
25
|
+
markRaw,
|
|
26
|
+
|
|
27
|
+
// Batching
|
|
28
|
+
queueJob,
|
|
29
|
+
|
|
30
|
+
// Types
|
|
31
|
+
type Ref,
|
|
32
|
+
type ComputedRef,
|
|
33
|
+
type ShallowRef,
|
|
34
|
+
type EffectFn,
|
|
35
|
+
type EffectOptions,
|
|
36
|
+
} from '@bromium/core';
|
|
37
|
+
|
|
38
|
+
// Runtime - JSX and rendering
|
|
39
|
+
export {
|
|
40
|
+
// JSX
|
|
41
|
+
jsx,
|
|
42
|
+
jsxs,
|
|
43
|
+
jsxDEV,
|
|
44
|
+
createElement,
|
|
45
|
+
h,
|
|
46
|
+
Fragment,
|
|
47
|
+
|
|
48
|
+
// Rendering
|
|
49
|
+
render,
|
|
50
|
+
createApp,
|
|
51
|
+
|
|
52
|
+
// Lifecycle
|
|
53
|
+
onMounted,
|
|
54
|
+
onUnmounted,
|
|
55
|
+
onUpdated,
|
|
56
|
+
getCurrentInstance,
|
|
57
|
+
|
|
58
|
+
// Hooks (React-style state persistence)
|
|
59
|
+
useState,
|
|
60
|
+
useRef,
|
|
61
|
+
useMemo,
|
|
62
|
+
useCallback,
|
|
63
|
+
|
|
64
|
+
// VNode utilities
|
|
65
|
+
createVNode,
|
|
66
|
+
createTextVNode,
|
|
67
|
+
isVNode,
|
|
68
|
+
Text,
|
|
69
|
+
|
|
70
|
+
// Types
|
|
71
|
+
type VNode,
|
|
72
|
+
type VNodeChild,
|
|
73
|
+
type VNodeChildren,
|
|
74
|
+
type VNodeType,
|
|
75
|
+
type ComponentFunction,
|
|
76
|
+
type ComponentInstance,
|
|
77
|
+
type JSXElement,
|
|
78
|
+
type AppConfig,
|
|
79
|
+
} from '@bromium/runtime';
|
|
80
|
+
|
|
81
|
+
// Router
|
|
82
|
+
export {
|
|
83
|
+
// Router creation
|
|
84
|
+
createRouter,
|
|
85
|
+
|
|
86
|
+
// Hooks
|
|
87
|
+
useRouter,
|
|
88
|
+
useRoute,
|
|
89
|
+
useParams,
|
|
90
|
+
useQuery,
|
|
91
|
+
useRouteMeta,
|
|
92
|
+
useNavigate,
|
|
93
|
+
useRouteMatch,
|
|
94
|
+
|
|
95
|
+
// Components
|
|
96
|
+
Link,
|
|
97
|
+
RouterView,
|
|
98
|
+
Redirect,
|
|
99
|
+
Navigate,
|
|
100
|
+
|
|
101
|
+
// Types
|
|
102
|
+
type Router,
|
|
103
|
+
type Route,
|
|
104
|
+
type RouteLocation,
|
|
105
|
+
type MatchedRoute,
|
|
106
|
+
type NavigationTarget,
|
|
107
|
+
type NavigationGuard,
|
|
108
|
+
type NavigationHook,
|
|
109
|
+
} from '@bromium/router';
|