baraqex 1.0.40 → 1.0.43

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baraqex",
3
- "version": "1.0.40",
3
+ "version": "1.0.43",
4
4
  "description": "A powerful full-stack framework built on top of frontend-hamroun",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -25,8 +25,25 @@ await build({
25
25
  'fs',
26
26
  'path',
27
27
  'http',
28
- 'https'
29
- ]
28
+ 'https',
29
+ // Add Node.js built-ins that should be excluded from browser
30
+ 'url',
31
+ 'util',
32
+ 'stream',
33
+ 'buffer',
34
+ 'events',
35
+ 'querystring',
36
+ 'os',
37
+ 'child_process',
38
+ 'cluster',
39
+ 'net',
40
+ 'tls',
41
+ 'dns'
42
+ ],
43
+ alias: {
44
+ // Map baraqex to the browser version
45
+ 'baraqex': 'baraqex/browser'
46
+ }
30
47
  });
31
48
 
32
49
  // Build server - use full baraqex with server capabilities
@@ -8,7 +8,7 @@
8
8
  "name": "ssr-version",
9
9
  "version": "0.0.0",
10
10
  "dependencies": {
11
- "baraqex": "^1.0.39",
11
+ "baraqex": "^1.0.42",
12
12
  "express": "^4.18.2",
13
13
  "frontend-hamroun": "latest"
14
14
  },
@@ -661,12 +661,12 @@
661
661
  }
662
662
  },
663
663
  "node_modules/baraqex": {
664
- "version": "1.0.39",
665
- "resolved": "https://registry.npmjs.org/baraqex/-/baraqex-1.0.39.tgz",
666
- "integrity": "sha512-UIOcuPgpYrcdcN44lU77HmS/kS+KlCc2a0WeMLF8FA8OALu6IUNxHLtjkkl+OyL485ix1JGFfrRxz+FcSjddEQ==",
664
+ "version": "1.0.42",
665
+ "resolved": "https://registry.npmjs.org/baraqex/-/baraqex-1.0.42.tgz",
666
+ "integrity": "sha512-jLvarvccQS0kKN9b8PFiwFWnUMuHVDsjhm2ejlVtlKD1v0ZMS0sPj8psvtwK4T+PwjH7z6NrkoXqp4Wk1DCTDQ==",
667
667
  "license": "MIT",
668
668
  "dependencies": {
669
- "frontend-hamroun": "^1.2.89"
669
+ "frontend-hamroun": "^1.2.90"
670
670
  },
671
671
  "bin": {
672
672
  "baraqex": "bin/baraqex.js"
@@ -1267,9 +1267,9 @@
1267
1267
  }
1268
1268
  },
1269
1269
  "node_modules/frontend-hamroun": {
1270
- "version": "1.2.89",
1271
- "resolved": "https://registry.npmjs.org/frontend-hamroun/-/frontend-hamroun-1.2.89.tgz",
1272
- "integrity": "sha512-/XvADZLlMYMos+pnF0r43A5TAOGa3sAPgjnyTdkziiRvlQXa8X3uh3ScEyKDDnp8qHYpeioOCMpemWwEMF5EtQ==",
1270
+ "version": "1.2.90",
1271
+ "resolved": "https://registry.npmjs.org/frontend-hamroun/-/frontend-hamroun-1.2.90.tgz",
1272
+ "integrity": "sha512-qlnvlCv/pF3hSCwqf2o7TpyHkE8raAetFsr7jq4UuLvtHDhS8Rpf3qD8o6SClzU5aoqASfkYvU0f7y1oPRpVJA==",
1273
1273
  "license": "MIT",
1274
1274
  "dependencies": {
1275
1275
  "boxen": "^7.0.0",
@@ -10,7 +10,7 @@
10
10
  "start": "node dist/server.js"
11
11
  },
12
12
  "dependencies": {
13
- "baraqex": "^1.0.39",
13
+ "baraqex": "^1.0.42",
14
14
  "express": "^4.18.2",
15
15
  "frontend-hamroun": "latest"
16
16
  },
@@ -1,5 +1,12 @@
1
- import { hydrate, jsx, render } from 'frontend-hamroun';
1
+ import { hydrate, jsx, render } from 'baraqex/browser';
2
2
  import { App } from './App.js';
3
3
 
4
- await hydrate(jsx(App, {}), document.getElementById('root')!);
5
- await render(jsx(App, {}), document.getElementById('root')!);
4
+ // Wait for DOM to be ready
5
+ document.addEventListener('DOMContentLoaded', async () => {
6
+ const rootElement = document.getElementById('app-root');
7
+ if (rootElement) {
8
+ await hydrate(<App /> as any, rootElement);
9
+ } else {
10
+ console.error('Root element not found');
11
+ }
12
+ });
@@ -1,7 +1,7 @@
1
1
  import express from 'express';
2
2
  import path from 'path';
3
3
  import { fileURLToPath } from 'url';
4
- import { renderToString, jsx } from 'frontend-hamroun';
4
+ import { renderToString, jsx } from 'baraqex';
5
5
  import { App } from './App.js';
6
6
 
7
7
  const __filename = fileURLToPath(import.meta.url);