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/dist/browser.d.ts +16 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +51 -169
- package/dist/browser.js.map +4 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -15
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/templates/ssr-template/esbuild.config.js +19 -2
- package/templates/ssr-template/package-lock.json +8 -8
- package/templates/ssr-template/package.json +1 -1
- package/templates/ssr-template/src/client.tsx +10 -3
- package/templates/ssr-template/src/server.ts +1 -1
package/package.json
CHANGED
|
@@ -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.
|
|
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.
|
|
665
|
-
"resolved": "https://registry.npmjs.org/baraqex/-/baraqex-1.0.
|
|
666
|
-
"integrity": "sha512-
|
|
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.
|
|
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.
|
|
1271
|
-
"resolved": "https://registry.npmjs.org/frontend-hamroun/-/frontend-hamroun-1.2.
|
|
1272
|
-
"integrity": "sha512
|
|
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",
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { hydrate, jsx, render } from '
|
|
1
|
+
import { hydrate, jsx, render } from 'baraqex/browser';
|
|
2
2
|
import { App } from './App.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
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 '
|
|
4
|
+
import { renderToString, jsx } from 'baraqex';
|
|
5
5
|
import { App } from './App.js';
|
|
6
6
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|