Skip to content

Become a thin Electron shell over jspod#2

Merged
melvincarvalho merged 2 commits into
mainfrom
issue-1-jspod-shell
May 23, 2026
Merged

Become a thin Electron shell over jspod#2
melvincarvalho merged 2 commits into
mainfrom
issue-1-jspod-shell

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Closes #1

Summary

  • Drop javascript-solid-server@^0.0.81 (current upstream is 0.0.201) and mashlib-jss@^0.1.1. Add jspod@^0.0.42 as the single server dep.
  • Rewrite main.js to spawn jspod as a child process (--no-open, --port, --root) instead of calling createServer in-process. Probe http://localhost:<port>/ until ready, then loadURL in the BrowserWindow. Kill the child on before-quit.
  • jspod is resolved via createRequire(import.meta.url).resolve('jspod') and run with process.execPath + ELECTRON_RUN_AS_NODE=1, so we don't rely on PATH or .bin symlinks.
  • Address bar overlay now defaults to window.location.href (your own pod) instead of hardcoding timbl.solidcommunity.net.
  • README rewritten to describe the new architecture.

Why

solid-desktop was ~120 JSS versions behind and reinvented bootstrap logic that jspod now handles: free-port discovery, persisted JWT token-secret, auto-install of the default app bundle on first run, seeded welcome / signin / account / docs pages, rung-1 me/me credentials with off-loopback warning. Delegating to jspod keeps solid-desktop minimal and inherits jspod releases automatically.

Smoke test

Confirmed manually: npm install && npm start launches the Electron window, jspod boots on port 3011 against ./data, the BrowserWindow lands on the seeded welcome page, the purple address bar overlay shows the current URL, and before-quit terminates the child cleanly.

Known follow-ups

  • The address bar overlay overlaps welcome-page content rather than pushing it down (welcome.html positions content independently of <body> flow). Will need a CSS adjustment in a follow-up — out of scope here.
  • jspod is CLI-only today. If a start(options) JS export lands upstream, solid-desktop can import it in-process and skip the child-process layer.
  • On fresh Linux installs, Electron's chrome-sandbox is shipped without the SUID bit (npm can't set it). Users hit FATAL:setuid_sandbox_host.cc until they sudo chown root:root && sudo chmod 4755 node_modules/electron/dist/chrome-sandbox or pass --no-sandbox. Not caused by this PR but worth documenting separately.

Test plan

  • rm -rf node_modules && npm install && npm start on a clean checkout
  • First-run install of the default bundle completes (apps appear under data/public/apps/)
  • Welcome page loads in the Electron window
  • Address-bar Go navigates to an external Solid URI
  • Quitting the app via menu kills the jspod child (no orphan listening on port 3011)

Drop direct deps on javascript-solid-server (pinned 120 versions behind)
and mashlib-jss. Add jspod as the single server dep and spawn it as a
child process (--no-open, --port, --root) instead of calling createServer
in-process. Probe readiness, then load the local pod URL in the
BrowserWindow.

Address bar overlay now defaults to your own pod instead of an external
WebID. First launch triggers jspod's bootstrap of the default app bundle.
The nav was inside the page's body, so pages with a constrained body
(like jspod's welcome.html with max-width:680px + margin:2em auto) made
the nav render as a half-width chip floating mid-page.

Make the nav position:fixed so it spans the viewport regardless of
body layout, and pad html (not body) by the nav height so the page
content sits below the nav rather than under it. Padding html targets
the initial containing block, which works even when body has its own
auto margins for centering.
@melvincarvalho
melvincarvalho merged commit eb74f8f into main May 23, 2026
@melvincarvalho
melvincarvalho deleted the issue-1-jspod-shell branch May 23, 2026 16:30
This was referenced May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: become a thin Electron shell over jspod

1 participant