@ossy/app 1.13.0 → 1.13.2

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/cli/build.js CHANGED
@@ -319,6 +319,7 @@ export function writePageSsrStubs (pageFiles, srcDir, ossyDir) {
319
319
  for (const f of pageFiles) {
320
320
  const pageId = clientHydrateIdForPage(f, srcDir)
321
321
  const stubPath = path.join(entriesDir, `${pageId}.mjs`)
322
+ fs.mkdirSync(path.dirname(stubPath), { recursive: true })
322
323
  fs.writeFileSync(stubPath, generatePageSsrModule({ pageAbsPath: f, stubAbsPath: stubPath }))
323
324
  }
324
325
  }
@@ -42,6 +42,22 @@ async function bundleOneHydratePage ({
42
42
  }
43
43
  }
44
44
 
45
+ async function bundleWithConcurrency (entries, concurrency, processFn) {
46
+ const results = new Array(entries.length)
47
+ let nextIdx = 0
48
+ async function worker () {
49
+ while (nextIdx < entries.length) {
50
+ const idx = nextIdx++
51
+ results[idx] = await processFn(entries[idx]).then(
52
+ (value) => ({ status: 'fulfilled', value }),
53
+ (reason) => ({ status: 'rejected', reason }),
54
+ )
55
+ }
56
+ }
57
+ await Promise.all(Array.from({ length: concurrency }, worker))
58
+ return results
59
+ }
60
+
45
61
  async function bundleHydratePagesParallel ({
46
62
  clientHydrateInput,
47
63
  buildPath,
@@ -57,8 +73,12 @@ async function bundleHydratePagesParallel ({
57
73
 
58
74
  const entries = Object.entries(clientHydrateInput)
59
75
 
60
- const results = await Promise.allSettled(
61
- entries.map(async ([entryName, stubPath]) => {
76
+ const BUNDLE_CONCURRENCY = 4
77
+
78
+ const results = await bundleWithConcurrency(
79
+ entries,
80
+ BUNDLE_CONCURRENCY,
81
+ async ([entryName, stubPath]) => {
62
82
  const pageId = pageIdFromHydrateEntryName(entryName)
63
83
  const t0 = Date.now()
64
84
  reporter?.startBundle?.(pageId)
@@ -85,7 +105,7 @@ async function bundleHydratePagesParallel ({
85
105
  console.error(`[@ossy/app][client-bundle] ${entryName} failed:`, error)
86
106
  throw error
87
107
  }
88
- })
108
+ },
89
109
  )
90
110
 
91
111
  const failures = results.filter((r) => r.status === 'rejected').length
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ossy/app",
3
- "version": "1.13.0",
3
+ "version": "1.13.2",
4
4
  "description": "",
5
5
  "source": "./src/index.js",
6
6
  "main": "./src/index.js",
@@ -27,14 +27,14 @@
27
27
  "@babel/eslint-parser": "^7.15.8",
28
28
  "@babel/preset-react": "^7.26.3",
29
29
  "@babel/register": "^7.25.9",
30
- "@ossy/connected-components": "^1.13.0",
31
- "@ossy/design-system": "^1.13.0",
32
- "@ossy/pages": "^1.13.0",
33
- "@ossy/router": "^1.13.0",
34
- "@ossy/router-react": "^1.13.0",
35
- "@ossy/sdk": "^1.13.0",
36
- "@ossy/sdk-react": "^1.13.0",
37
- "@ossy/themes": "^1.13.0",
30
+ "@ossy/connected-components": "^1.13.2",
31
+ "@ossy/design-system": "^1.13.2",
32
+ "@ossy/pages": "^1.13.2",
33
+ "@ossy/router": "^1.13.2",
34
+ "@ossy/router-react": "^1.13.2",
35
+ "@ossy/sdk": "^1.13.2",
36
+ "@ossy/sdk-react": "^1.13.2",
37
+ "@ossy/themes": "^1.13.2",
38
38
  "@rollup/plugin-alias": "^6.0.0",
39
39
  "@rollup/plugin-babel": "6.1.0",
40
40
  "@rollup/plugin-commonjs": "^29.0.0",
@@ -67,5 +67,5 @@
67
67
  "README.md",
68
68
  "tsconfig.json"
69
69
  ],
70
- "gitHead": "a687fe27dffd3dd2bf152355bbbfd1661b698178"
70
+ "gitHead": "261f99aae788324c696edaeaa13a67380780e3fc"
71
71
  }