spoint 0.1.675 → 0.1.677

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.
@@ -20,9 +20,13 @@ export function createAppModuleSystem(client, uiRoot) {
20
20
  return engineCtx
21
21
  }
22
22
 
23
- // Rewrites relative imports in app code to blob URLs since app code has no base URL to resolve against.
23
+ // Rewrites relative AND root-absolute imports in app code to blob URLs since app code has no base
24
+ // URL to resolve against. Root-absolute ('/spoint/src/...') specifiers show up here because the
25
+ // gh-pages deploy's path-patch step absolutizes deep relative '../../src/...' imports in apps/**/*.js
26
+ // at build time (see .github/workflows/gh-pages.yml "Patch paths for gh-pages") -- a shipped app's
27
+ // source can carry either form depending on how many directories deep it lives.
24
28
  async function _resolveDepsToBlobs(source, baseUrl, revokes, seen = new Map()) {
25
- const re = /((?:from|import)\s*)(['"])(\.[^'"]+)\2/g
29
+ const re = /((?:from|import)\s*)(['"])(\.[^'"]+|\/[^'"]+)\2/g
26
30
  const specs = new Set()
27
31
  let m
28
32
  while ((m = re.exec(source)) !== null) specs.add(m[3])
package/client/app.js CHANGED
@@ -382,8 +382,7 @@ async function _finishLoading() {
382
382
  const SCENERY_BUILD_TIMEOUT_MS = 30000
383
383
  if (_terrainCfg && !terrainBackdrop) {
384
384
  loadingMgr.setLabel('Building world (first load can take up to 30s)...')
385
- let _sceneryTimedOut = false
386
- try { await Promise.race([_buildWorldScenery(), new Promise(r => setTimeout(() => { _sceneryTimedOut = true; r() }, SCENERY_BUILD_TIMEOUT_MS))]) }
385
+ try { await Promise.race([_buildWorldScenery(), new Promise(r => setTimeout(r, SCENERY_BUILD_TIMEOUT_MS))]) }
387
386
  catch (e) { console.error('[terrain] scenery build failed:', e?.message || e) }
388
387
  // Cold-load retry: a transient GL_INVALID_OPERATION storm (ModelPool cluster draw races the index upload) can poison planet init once; drain errors + rebuild once if __terrain never got set.
389
388
  if (typeof window !== 'undefined' && !window.__terrain && _terrainCfg) {
@@ -393,8 +392,7 @@ async function _finishLoading() {
393
392
  try { terrainBackdrop && terrainBackdrop.dispose && terrainBackdrop.dispose() } catch (_) {}
394
393
  terrainBackdrop = null
395
394
  await new Promise(r => setTimeout(r, 500))
396
- _sceneryTimedOut = false
397
- try { await Promise.race([_buildWorldScenery(), new Promise(r => setTimeout(() => { _sceneryTimedOut = true; r() }, SCENERY_BUILD_TIMEOUT_MS))]) }
395
+ try { await Promise.race([_buildWorldScenery(), new Promise(r => setTimeout(r, SCENERY_BUILD_TIMEOUT_MS))]) }
398
396
  catch (e) { console.error('[terrain] scenery rebuild failed:', e?.message || e) }
399
397
  }
400
398
  // The scenery build did not finish before the timeout raced it (or planet is still absent) --
@@ -402,7 +400,13 @@ async function _finishLoading() {
402
400
  // forever, but silently shipping a bare/incomplete scene with no way to recover is its own bug.
403
401
  // Surface it with a Retry action that re-invokes _buildWorldScenery() in place once the terrain
404
402
  // config + scene are already set up, without reloading the page.
405
- if ((_sceneryTimedOut || (typeof window !== 'undefined' && !window.__terrain)) && _terrainCfg) {
403
+ // Only surface the retry toast when the terrain is GENUINELY still absent after the race settles --
404
+ // _sceneryTimedOut alone means the setTimeout won the race, not that the build actually failed: a
405
+ // cold build that finishes a moment after the clock (real terrain now present, window.__terrain set)
406
+ // is a benign timing win, not a defect, and showing a scary "did not finish loading" toast over a
407
+ // fully-working world trains users to distrust a working load. window.__terrain absence is the real
408
+ // failure signal either way.
409
+ if (typeof window !== 'undefined' && !window.__terrain && _terrainCfg) {
406
410
  console.warn('[terrain] scenery build did not complete before timeout -> showing retry toast')
407
411
  showToast('World scenery did not finish loading', 'warn', 8000, {
408
412
  action: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoint",
3
- "version": "0.1.675",
3
+ "version": "0.1.677",
4
4
  "description": "Physics and netcode SDK for multiplayer game servers",
5
5
  "type": "module",
6
6
  "workspaces": [