Title: LWS Protocol Mode Support (Draft/Future) · Issue #87 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: LWS Protocol Mode Support (Draft/Future) · Issue #87 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: LWS Protocol Mode Support (Draft/Future) · Issue #87 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Summary Add optional --lws-mode flag to support W3C Linked Web Storage (LWS) protocol semantics alongside the current Solid Protocol/LDP implementation. Status: 📋 Draft/Exploratory - LWS spec is in early stages (PR #37 just merged Jan 20...
Open Graph Description: Summary Add optional --lws-mode flag to support W3C Linked Web Storage (LWS) protocol semantics alongside the current Solid Protocol/LDP implementation. Status: 📋 Draft/Exploratory - LWS spec is in...
X Description: Summary Add optional --lws-mode flag to support W3C Linked Web Storage (LWS) protocol semantics alongside the current Solid Protocol/LDP implementation. Status: 📋 Draft/Exploratory - LWS spec is in...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/87
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"LWS Protocol Mode Support (Draft/Future)","articleBody":"## Summary\n\nAdd optional `--lws-mode` flag to support W3C Linked Web Storage (LWS) protocol semantics alongside the current Solid Protocol/LDP implementation.\n\n**Status:** 📋 Draft/Exploratory - LWS spec is in early stages (PR #37 just merged Jan 2026)\n**Priority:** Low (monitor ecosystem first)\n**Related:** https://github.com/w3c/lws-protocol/pull/37\n\n## Background\n\n### What is LWS?\n\nThe W3C Linked Web Storage protocol suite defines CRUD operations with different conventions than Solid/LDP:\n\n- **POST for creation** (server-assigned URIs with Slug hints)\n- **PUT for updates only** (not creation)\n- **Link headers for metadata** (removes slash semantics for containers)\n- **Mandatory ETag concurrency control**\n- **JSON Merge Patch for metadata updates** (via separate linkset resources)\n\n### Current State: LDP/Solid\n\nJSS implements Solid Protocol conventions based on LDP:\n\n- ✅ PUT creates **or** updates resources\n- ✅ Trailing slash indicates containers\n- ✅ POST to containers with Slug support\n- ✅ ETag-based If-Match/If-None-Match\n- ✅ N3 Patch and SPARQL Update for RDF modifications\n\n## Key Differences\n\n| Aspect | Solid/LDP (Current) | LWS Protocol (Proposed) |\n|--------|---------------------|-------------------------|\n| **Resource Creation** | PUT or POST | POST only |\n| **PUT Semantics** | Create or update | Update only (404 if not exists) |\n| **Container Detection** | Trailing slash (`/alice/`) | Link header: `rel=\"type\"` |\n| **Metadata Updates** | N3 Patch, SPARQL Update | JSON Merge Patch on linkset |\n| **Concurrency Control** | Optional ETag | Mandatory ETag |\n| **Slash Semantics** | Standard (containers end with `/`) | Removed (header-based only) |\n\n## Proposed Implementation\n\n### Configuration Flag\n\n```bash\n# LWS mode\njss start --lws-mode\n\n# Solid/LDP mode (default, current behavior)\njss start\n```\n\n### Code Changes Required\n\n#### 1. PUT Handler Split (src/handlers/resource.js)\n**Effort:** 3 hours\n\n```javascript\nexport async function handlePut(request, reply) {\n const lwsMode = request.lwsMode || false;\n \n if (lwsMode) {\n // LWS: PUT only for updates\n const stats = await storage.stat(storagePath);\n if (\\!stats) {\n return reply.code(404).send({\n error: 'Use POST to create resources in LWS mode'\n });\n }\n } else {\n // LDP: PUT creates or updates (current)\n const existed = stats \\!== null;\n }\n}\n```\n\n#### 2. Container Detection Toggle (src/utils/url.js)\n**Effort:** 4 hours\n\n```javascript\nexport function isContainer(urlPath, request) {\n if (request?.lwsMode) {\n // LWS: Check Link header for Container type\n const linkHeader = request?.headers?.link || '';\n return linkHeader.includes('ldp#Container');\n } else {\n // LDP: Trailing slash\n return urlPath.endsWith('/');\n }\n}\n```\n\n**Files affected:** src/utils/url.js, src/handlers/resource.js, src/handlers/container.js, src/ldp/headers.js\n\n#### 3. Linkset Metadata Endpoints (new)\n**Effort:** 8 hours\n\nNew file: `src/handlers/linkset.js`\n\n- `GET /resource;linkset` - Return metadata as JSON\n- `PATCH /resource;linkset` - JSON Merge Patch for user-managed metadata\n\n#### 4. Config Infrastructure\n**Effort:** 2 hours\n\nAdd `--lws-mode` flag to CLI and config system.\n\n#### 5. Testing Matrix\n**Effort:** 12 hours\n\nDuplicate all CRUD tests for LWS mode (223 tests × 2 modes = 446 tests total).\n\n## Complexity Assessment\n\n| Component | Effort | Files | Risk |\n|-----------|--------|-------|------|\n| Config flag | 2h | 3 | Low |\n| PUT behavior | 3h | 1 | Medium |\n| Container detection | 4h | 4 | High |\n| Linkset endpoints | 8h | 1 new | Medium |\n| Testing | 12h | All | High |\n| Documentation | 2h | 2 | Low |\n| **Total** | **~31 hours** | **~15** | **High** |\n\n## Trade-offs\n\n### Pros ✅\n\n- **Future-proof** if LWS gains adoption\n- **Universal server** supporting both protocols\n- **Research value** for evaluating LWS concepts\n- **Subdomain isolation** - run Solid + LWS pods on same server\n\n### Cons ❌\n\n- **Test burden** - doubles maintenance (446 tests)\n- **Code complexity** - branching logic throughout\n- **Premature** - LWS ecosystem is tiny (no known apps)\n- **Bug risk** - less-used mode more error-prone\n- **Documentation split** - user confusion\n\n## Decision Criteria\n\n**Do NOT implement until:**\n\n- ✅ At least **3 other servers** implement LWS\n- ✅ At least **5 client apps** request LWS support\n- ✅ W3C Solid CG shows **interest in LWS alignment**\n- ✅ LWS spec reaches **Candidate Recommendation** status\n\n## Monitor These Signals\n\n- [ ] Number of servers implementing LWS\n- [ ] Client apps using LWS endpoints\n- [ ] W3C Solid CG discussions about LWS\n- [ ] LWS spec maturity (currently early draft)\n\n## Alternative: Plugin Architecture\n\nInstead of core branching, design protocol adapters:\n\n```bash\njss start --protocol=lws # LWS semantics\njss start --protocol=solid # LDP semantics (default)\njss start --protocol=s3 # Future: S3-compatible\n```\n\nBenefits:\n- Clean core implementation\n- Community experimentation\n- No test matrix explosion\n\n## Current LWS Ecosystem (Jan 2026)\n\n- **Servers:** Unknown\n- **Clients:** Likely zero\n- **Spec status:** Early draft (PR #37 just merged)\n- **Community:** Small W3C working group\n\n## Recommendation\n\n**Priority: Low - Monitor but don't implement**\n\n**Timeline:**\n- **Now:** Capture this analysis\n- **Q2 2026:** Survey LWS ecosystem adoption\n- **Q4 2026:** Reassess if signals show traction\n- **2027+:** Implement if ecosystem warrants\n\n**Keep focus on:**\n- ✅ did:key authentication (#86) - adds capability without breaking changes\n- ✅ Solid Protocol improvements - serve existing ecosystem\n- ✅ Performance and stability - core value\n\n## References\n\n- [W3C LWS Protocol PR #37](https://github.com/w3c/lws-protocol/pull/37)\n- [W3C LWS Protocol Repo](https://github.com/w3c/lws-protocol)\n- [LDP Specification](https://www.w3.org/TR/ldp/)\n- [Solid Protocol](https://solidproject.org/TR/protocol)","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-01-14T14:41:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/87/JavaScriptSolidServer/issues/87"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5d97f6bf-ec89-b2b1-9e8a-25de7dd4c7f6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C2A6:1B8E26:B58C72D:EBC37C0:69768DB1 |
| html-safe-nonce | 00b3861b4094452f1f8c898173593e76c4c4dcbc772a4b7497edb6a503440932 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkE2OjFCOEUyNjpCNThDNzJEOkVCQzM3QzA6Njk3NjhEQjEiLCJ2aXNpdG9yX2lkIjoiMjU3NDcxNjczODMzMDg1Njg4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f1a8b1f70b0c65b93742ae7c2309f117ba8390c3af866362855c4ea1f76b1919 |
| hovercard-subject-tag | issue:3813503606 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/87/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d5a81b02381e96d01bb999b5f156c7d38d72b37be287963ce23d0de33467eaf8/JavaScriptSolidServer/JavaScriptSolidServer/issues/87 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d5a81b02381e96d01bb999b5f156c7d38d72b37be287963ce23d0de33467eaf8/JavaScriptSolidServer/JavaScriptSolidServer/issues/87 |
| og:image:alt | Summary Add optional --lws-mode flag to support W3C Linked Web Storage (LWS) protocol semantics alongside the current Solid Protocol/LDP implementation. Status: 📋 Draft/Exploratory - LWS spec is in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5b577f6be6482e336e3c30e8daefa30144947b17 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width